summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Ziegler <austin@halostatue.ca>2011-07-30 19:39:58 -0400
committerAustin Ziegler <austin@halostatue.ca>2011-07-30 19:39:58 -0400
commitca444f81819ee49d3a174271dbca75061a4067f5 (patch)
treeb364285304247316339fbbcb900921bd076808c9
parent79f7205cc94023191c47d9e48e33e87aae499fef (diff)
downloaddiff-lcs-ca444f81819ee49d3a174271dbca75061a4067f5.tar.gz
Removing minitar and ruwiki from the new diff-lcs repo.
-rw-r--r--minitar/tags/release-0.5.042
-rw-r--r--minitar/tags/release-0.5.142
-rw-r--r--minitar/trunk/ChangeLog14
-rw-r--r--minitar/trunk/Install6
-rw-r--r--minitar/trunk/README66
-rw-r--r--minitar/trunk/Rakefile113
-rw-r--r--minitar/trunk/archive-tar-minitar.gemspec41
-rw-r--r--minitar/trunk/bin/minitar27
-rw-r--r--minitar/trunk/install.rb262
-rw-r--r--minitar/trunk/lib/archive/tar/minitar.rb979
-rw-r--r--minitar/trunk/lib/archive/tar/minitar/command.rb814
-rw-r--r--minitar/trunk/tests/tc_tar.rb614
-rw-r--r--minitar/trunk/tests/testall.rb10
-rw-r--r--ruwiki/tags/experimental-0.7/Default/ProjectIndex27
-rw-r--r--ruwiki/tags/experimental-0.7/README46
-rw-r--r--ruwiki/tags/experimental-0.7/Ruwiki/BugTracking28
-rw-r--r--ruwiki/tags/experimental-0.7/Ruwiki/ChangeLog53
-rw-r--r--ruwiki/tags/experimental-0.7/Ruwiki/Configuring_Ruwiki188
-rw-r--r--ruwiki/tags/experimental-0.7/Ruwiki/Extending_Ruwiki226
-rw-r--r--ruwiki/tags/experimental-0.7/Ruwiki/LicenseAndAuthorInfo30
-rw-r--r--ruwiki/tags/experimental-0.7/Ruwiki/ProjectIndex33
-rw-r--r--ruwiki/tags/experimental-0.7/Ruwiki/RuwikiTemplatingLibrary74
-rw-r--r--ruwiki/tags/experimental-0.7/Ruwiki/SandBox8
-rw-r--r--ruwiki/tags/experimental-0.7/Ruwiki/To_Do61
-rw-r--r--ruwiki/tags/experimental-0.7/Ruwiki/WikiFeatures16
-rw-r--r--ruwiki/tags/experimental-0.7/Ruwiki/WikiMarkup214
-rw-r--r--ruwiki/tags/experimental-0.7/lib/algorithm/diff.rb220
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki.rb401
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/backend.rb219
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/backend/flatfiles.rb215
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/config.rb134
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/handler.rb207
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/lang/de.rb64
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/lang/en.rb62
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/lang/es.rb63
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/page.rb137
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/servlet.rb34
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/template.rb223
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/wiki.rb90
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens.rb132
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/00default.rb188
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/01wikilinks.rb168
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/abbreviations.rb42
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/calendar.rb147
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/headings.rb43
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/lists.rb129
-rw-r--r--ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/rubylists.rb47
-rw-r--r--ruwiki/tags/experimental-0.7/ruwiki.cgi39
-rw-r--r--ruwiki/tags/experimental-0.7/ruwiki_servlet253
-rw-r--r--ruwiki/tags/experimental-0.7/ruwiki_servlet.bat16
-rw-r--r--ruwiki/tags/experimental-0.7/templates/de/body.tmpl12
-rw-r--r--ruwiki/tags/experimental-0.7/templates/de/content.tmpl4
-rw-r--r--ruwiki/tags/experimental-0.7/templates/de/controls.tmpl14
-rw-r--r--ruwiki/tags/experimental-0.7/templates/de/edit.tmpl15
-rw-r--r--ruwiki/tags/experimental-0.7/templates/de/error.tmpl4
-rw-r--r--ruwiki/tags/experimental-0.7/templates/de/ruwiki.css32
-rw-r--r--ruwiki/tags/experimental-0.7/templates/de/save.tmpl5
-rw-r--r--ruwiki/tags/experimental-0.7/templates/default/body.tmpl12
-rw-r--r--ruwiki/tags/experimental-0.7/templates/default/content.tmpl4
-rw-r--r--ruwiki/tags/experimental-0.7/templates/default/controls.tmpl14
-rw-r--r--ruwiki/tags/experimental-0.7/templates/default/edit.tmpl15
-rw-r--r--ruwiki/tags/experimental-0.7/templates/default/error.tmpl4
-rw-r--r--ruwiki/tags/experimental-0.7/templates/default/ruwiki.css41
-rw-r--r--ruwiki/tags/experimental-0.7/templates/default/save.tmpl5
-rw-r--r--ruwiki/tags/experimental-0.7/templates/es/body.tmpl14
-rw-r--r--ruwiki/tags/experimental-0.7/templates/es/content.tmpl4
-rw-r--r--ruwiki/tags/experimental-0.7/templates/es/controls.tmpl14
-rw-r--r--ruwiki/tags/experimental-0.7/templates/es/edit.tmpl15
-rw-r--r--ruwiki/tags/experimental-0.7/templates/es/error.tmpl5
-rw-r--r--ruwiki/tags/experimental-0.7/templates/es/ruwiki.css32
-rw-r--r--ruwiki/tags/experimental-0.7/templates/es/save.tmpl5
-rw-r--r--ruwiki/tags/experimental-0.7/tests/harness-cgi.rb28
-rw-r--r--ruwiki/tags/experimental-0.7/tests/harness.rb29
-rw-r--r--ruwiki/tags/experimental-0.7/tests/tc_backend.rb88
-rw-r--r--ruwiki/tags/experimental-0.7/tests/tc_bugs.rb66
-rw-r--r--ruwiki/tags/experimental-0.7/tests/tc_tokens.rb266
-rwxr-xr-xruwiki/tags/experimental-0.7/tests/testall.rb8
-rw-r--r--ruwiki/tags/release-0.6.1/Default/ProjectIndex19
-rw-r--r--ruwiki/tags/release-0.6.1/README48
-rw-r--r--ruwiki/tags/release-0.6.1/Ruwiki/BugTracking19
-rw-r--r--ruwiki/tags/release-0.6.1/Ruwiki/ChangeLog36
-rw-r--r--ruwiki/tags/release-0.6.1/Ruwiki/Configuring_Ruwiki178
-rw-r--r--ruwiki/tags/release-0.6.1/Ruwiki/Extending_Ruwiki173
-rw-r--r--ruwiki/tags/release-0.6.1/Ruwiki/LicenseAndAuthorInfo21
-rw-r--r--ruwiki/tags/release-0.6.1/Ruwiki/ProjectIndex28
-rw-r--r--ruwiki/tags/release-0.6.1/Ruwiki/RuwikiTemplatingLibrary82
-rw-r--r--ruwiki/tags/release-0.6.1/Ruwiki/SandBox5
-rw-r--r--ruwiki/tags/release-0.6.1/Ruwiki/To_Do42
-rw-r--r--ruwiki/tags/release-0.6.1/Ruwiki/WikiFeatures13
-rw-r--r--ruwiki/tags/release-0.6.1/Ruwiki/WikiMarkup173
-rw-r--r--ruwiki/tags/release-0.6.1/lib/algorithm/diff.rb220
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki.rb312
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/backend.rb124
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/backend/flatfiles.rb190
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/config.rb132
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/handler.rb207
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/lang/en.rb52
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/page.rb127
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/servlet.rb34
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/template.rb223
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/wiki.rb86
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens.rb126
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/00default.rb174
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/01wikilinks.rb161
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/abbreviations.rb42
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/headings.rb41
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/lists.rb114
-rw-r--r--ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/rubylists.rb47
-rw-r--r--ruwiki/tags/release-0.6.1/ruwiki.cgi39
-rw-r--r--ruwiki/tags/release-0.6.1/ruwiki_servlet.rb47
-rw-r--r--ruwiki/tags/release-0.6.1/templates/default/body.tmpl9
-rw-r--r--ruwiki/tags/release-0.6.1/templates/default/content.tmpl4
-rw-r--r--ruwiki/tags/release-0.6.1/templates/default/controls.tmpl5
-rw-r--r--ruwiki/tags/release-0.6.1/templates/default/edit.tmpl14
-rw-r--r--ruwiki/tags/release-0.6.1/templates/default/error.tmpl4
-rw-r--r--ruwiki/tags/release-0.6.1/templates/default/ruwiki.css31
-rw-r--r--ruwiki/tags/release-0.6.1/templates/default/save.tmpl5
-rw-r--r--ruwiki/tags/release-0.6.1/tests/harness.rb29
-rw-r--r--ruwiki/tags/release-0.6.1/tests/tc_tokens.rb259
-rw-r--r--ruwiki/tags/release-0.6.2/Default/ProjectIndex21
-rw-r--r--ruwiki/tags/release-0.6.2/README56
-rw-r--r--ruwiki/tags/release-0.6.2/Ruwiki/BugTracking19
-rw-r--r--ruwiki/tags/release-0.6.2/Ruwiki/ChangeLog41
-rw-r--r--ruwiki/tags/release-0.6.2/Ruwiki/Configuring_Ruwiki178
-rw-r--r--ruwiki/tags/release-0.6.2/Ruwiki/Extending_Ruwiki226
-rw-r--r--ruwiki/tags/release-0.6.2/Ruwiki/LicenseAndAuthorInfo28
-rw-r--r--ruwiki/tags/release-0.6.2/Ruwiki/ProjectIndex28
-rw-r--r--ruwiki/tags/release-0.6.2/Ruwiki/RuwikiTemplatingLibrary82
-rw-r--r--ruwiki/tags/release-0.6.2/Ruwiki/SandBox5
-rw-r--r--ruwiki/tags/release-0.6.2/Ruwiki/To_Do42
-rw-r--r--ruwiki/tags/release-0.6.2/Ruwiki/WikiFeatures13
-rw-r--r--ruwiki/tags/release-0.6.2/Ruwiki/WikiMarkup173
-rw-r--r--ruwiki/tags/release-0.6.2/lib/algorithm/diff.rb220
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki.rb326
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/backend.rb161
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/backend/flatfiles.rb156
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/config.rb134
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/handler.rb207
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/lang/de.rb60
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/lang/en.rb58
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/lang/es.rb59
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/page.rb131
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/servlet.rb34
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/template.rb223
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/wiki.rb91
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens.rb131
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/00default.rb174
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/01wikilinks.rb161
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/abbreviations.rb42
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/headings.rb41
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/lists.rb114
-rw-r--r--ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/rubylists.rb47
-rw-r--r--ruwiki/tags/release-0.6.2/ruwiki.cgi39
-rw-r--r--ruwiki/tags/release-0.6.2/ruwiki_servlet.rb47
-rw-r--r--ruwiki/tags/release-0.6.2/templates/de/body.tmpl12
-rw-r--r--ruwiki/tags/release-0.6.2/templates/de/content.tmpl4
-rw-r--r--ruwiki/tags/release-0.6.2/templates/de/controls.tmpl5
-rw-r--r--ruwiki/tags/release-0.6.2/templates/de/edit.tmpl14
-rw-r--r--ruwiki/tags/release-0.6.2/templates/de/error.tmpl4
-rw-r--r--ruwiki/tags/release-0.6.2/templates/de/ruwiki.css31
-rw-r--r--ruwiki/tags/release-0.6.2/templates/de/save.tmpl5
-rw-r--r--ruwiki/tags/release-0.6.2/templates/default/body.tmpl12
-rw-r--r--ruwiki/tags/release-0.6.2/templates/default/content.tmpl4
-rw-r--r--ruwiki/tags/release-0.6.2/templates/default/controls.tmpl5
-rw-r--r--ruwiki/tags/release-0.6.2/templates/default/edit.tmpl14
-rw-r--r--ruwiki/tags/release-0.6.2/templates/default/error.tmpl4
-rw-r--r--ruwiki/tags/release-0.6.2/templates/default/ruwiki.css31
-rw-r--r--ruwiki/tags/release-0.6.2/templates/default/save.tmpl5
-rw-r--r--ruwiki/tags/release-0.6.2/templates/es/body.tmpl12
-rw-r--r--ruwiki/tags/release-0.6.2/templates/es/content.tmpl4
-rw-r--r--ruwiki/tags/release-0.6.2/templates/es/controls.tmpl5
-rw-r--r--ruwiki/tags/release-0.6.2/templates/es/edit.tmpl14
-rw-r--r--ruwiki/tags/release-0.6.2/templates/es/error.tmpl4
-rw-r--r--ruwiki/tags/release-0.6.2/templates/es/ruwiki.css31
-rw-r--r--ruwiki/tags/release-0.6.2/templates/es/save.tmpl5
-rw-r--r--ruwiki/tags/release-0.6.2/tests/harness.rb29
-rw-r--r--ruwiki/tags/release-0.6.2/tests/tc_tokens.rb259
-rw-r--r--ruwiki/tags/release-0.6/Default/ProjectIndex17
-rw-r--r--ruwiki/tags/release-0.6/README48
-rw-r--r--ruwiki/tags/release-0.6/Ruwiki/BugTracking17
-rw-r--r--ruwiki/tags/release-0.6/Ruwiki/ChangeLog23
-rw-r--r--ruwiki/tags/release-0.6/Ruwiki/Configuring_Ruwiki161
-rw-r--r--ruwiki/tags/release-0.6/Ruwiki/Extending_Ruwiki171
-rw-r--r--ruwiki/tags/release-0.6/Ruwiki/LicenseAndAuthorInfo21
-rw-r--r--ruwiki/tags/release-0.6/Ruwiki/ProjectIndex28
-rw-r--r--ruwiki/tags/release-0.6/Ruwiki/RuwikiTemplatingLibrary5
-rw-r--r--ruwiki/tags/release-0.6/Ruwiki/SandBox5
-rw-r--r--ruwiki/tags/release-0.6/Ruwiki/To_Do37
-rw-r--r--ruwiki/tags/release-0.6/Ruwiki/WikiFeatures13
-rw-r--r--ruwiki/tags/release-0.6/Ruwiki/WikiMarkup179
-rw-r--r--ruwiki/tags/release-0.6/lib/algorithm/diff.rb220
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki.rb263
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/abbreviations.rb16
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/backend.rb126
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/backend/flatfiles.rb175
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/config.rb81
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/handler.rb207
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/markup.rb35
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/markup/meta.rb37
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/page.rb144
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/servlet.rb34
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/template.rb223
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/wiki.rb84
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens.rb128
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/00default.rb239
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/abbreviations.rb38
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/headings.rb41
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/lists.rb114
-rw-r--r--ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/rubylists.rb47
-rw-r--r--ruwiki/tags/release-0.6/ruwiki.cgi38
-rw-r--r--ruwiki/tags/release-0.6/ruwiki_servlet.rb48
-rw-r--r--ruwiki/tags/release-0.6/templates/default/body.tmpl9
-rw-r--r--ruwiki/tags/release-0.6/templates/default/content.tmpl4
-rw-r--r--ruwiki/tags/release-0.6/templates/default/controls.tmpl3
-rw-r--r--ruwiki/tags/release-0.6/templates/default/edit.tmpl14
-rw-r--r--ruwiki/tags/release-0.6/templates/default/error.tmpl4
-rw-r--r--ruwiki/tags/release-0.6/templates/default/ruwiki.css31
-rw-r--r--ruwiki/tags/release-0.6/templates/default/save.tmpl5
-rw-r--r--ruwiki/tags/release-0.6/tests/debugger.rb41
-rw-r--r--ruwiki/tags/release-0.6/tests/tc_backend.rb112
-rw-r--r--ruwiki/tags/release-0.6/tests/tc_markup.rb84
-rw-r--r--ruwiki/tags/release-0.6/tests/tc_page.rb67
-rw-r--r--ruwiki/tags/release-0.6/tests/tc_ruwiki.rb59
-rw-r--r--ruwiki/tags/release-0.6/tests/test_utils.rb39
-rw-r--r--ruwiki/tags/release-0.7/Default/ProjectIndex27
-rw-r--r--ruwiki/tags/release-0.7/README46
-rw-r--r--ruwiki/tags/release-0.7/Ruwiki/BugTracking28
-rw-r--r--ruwiki/tags/release-0.7/Ruwiki/ChangeLog49
-rw-r--r--ruwiki/tags/release-0.7/Ruwiki/Configuring_Ruwiki188
-rw-r--r--ruwiki/tags/release-0.7/Ruwiki/Extending_Ruwiki226
-rw-r--r--ruwiki/tags/release-0.7/Ruwiki/LicenseAndAuthorInfo30
-rw-r--r--ruwiki/tags/release-0.7/Ruwiki/ProjectIndex33
-rw-r--r--ruwiki/tags/release-0.7/Ruwiki/RuwikiTemplatingLibrary74
-rw-r--r--ruwiki/tags/release-0.7/Ruwiki/SandBox8
-rw-r--r--ruwiki/tags/release-0.7/Ruwiki/To_Do61
-rw-r--r--ruwiki/tags/release-0.7/Ruwiki/WikiFeatures16
-rw-r--r--ruwiki/tags/release-0.7/Ruwiki/WikiMarkup214
-rw-r--r--ruwiki/tags/release-0.7/lib/algorithm/diff.rb220
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki.rb319
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/backend.rb165
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/backend/flatfiles.rb155
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/config.rb134
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/handler.rb207
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/lang/de.rb60
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/lang/en.rb58
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/lang/es.rb59
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/page.rb131
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/servlet.rb34
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/template.rb223
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/wiki.rb90
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens.rb132
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/00default.rb188
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/01wikilinks.rb168
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/abbreviations.rb42
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/calendar.rb147
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/headings.rb43
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/lists.rb129
-rw-r--r--ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/rubylists.rb47
-rw-r--r--ruwiki/tags/release-0.7/ruwiki.cgi39
-rw-r--r--ruwiki/tags/release-0.7/ruwiki_servlet253
-rw-r--r--ruwiki/tags/release-0.7/ruwiki_servlet.bat16
-rw-r--r--ruwiki/tags/release-0.7/templates/de/body.tmpl12
-rw-r--r--ruwiki/tags/release-0.7/templates/de/content.tmpl4
-rw-r--r--ruwiki/tags/release-0.7/templates/de/controls.tmpl5
-rw-r--r--ruwiki/tags/release-0.7/templates/de/edit.tmpl14
-rw-r--r--ruwiki/tags/release-0.7/templates/de/error.tmpl4
-rw-r--r--ruwiki/tags/release-0.7/templates/de/ruwiki.css32
-rw-r--r--ruwiki/tags/release-0.7/templates/de/save.tmpl5
-rw-r--r--ruwiki/tags/release-0.7/templates/default/body.tmpl12
-rw-r--r--ruwiki/tags/release-0.7/templates/default/content.tmpl4
-rw-r--r--ruwiki/tags/release-0.7/templates/default/controls.tmpl5
-rw-r--r--ruwiki/tags/release-0.7/templates/default/edit.tmpl14
-rw-r--r--ruwiki/tags/release-0.7/templates/default/error.tmpl4
-rw-r--r--ruwiki/tags/release-0.7/templates/default/ruwiki.css38
-rw-r--r--ruwiki/tags/release-0.7/templates/default/save.tmpl5
-rw-r--r--ruwiki/tags/release-0.7/templates/es/body.tmpl14
-rw-r--r--ruwiki/tags/release-0.7/templates/es/content.tmpl4
-rw-r--r--ruwiki/tags/release-0.7/templates/es/controls.tmpl5
-rw-r--r--ruwiki/tags/release-0.7/templates/es/edit.tmpl14
-rw-r--r--ruwiki/tags/release-0.7/templates/es/error.tmpl5
-rw-r--r--ruwiki/tags/release-0.7/templates/es/ruwiki.css32
-rw-r--r--ruwiki/tags/release-0.7/templates/es/save.tmpl5
-rw-r--r--ruwiki/tags/release-0.7/tests/harness-cgi.rb28
-rw-r--r--ruwiki/tags/release-0.7/tests/harness.rb29
-rw-r--r--ruwiki/tags/release-0.7/tests/tc_bugs.rb66
-rw-r--r--ruwiki/tags/release-0.7/tests/tc_tokens.rb266
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/README65
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/contrib/enscript-token.rb43
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/contrib/rublog_integrator.rb66
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/convert279
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/convert.bat16
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Default/ProjectIndex.ruwiki48
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/BugTracking.ruwiki34
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ChangeLog.ruwiki72
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Configuring_Ruwiki.ruwiki114
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Extending_Ruwiki.ruwiki310
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/LicenseAndAuthorInfo.ruwiki33
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ProjectIndex.ruwiki51
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Roadmap.ruwiki223
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki157
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/SandBox.ruwiki11
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/To_Do.ruwiki61
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/TroubleShooting.ruwiki27
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Upgrading+and+Converting.ruwiki37
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiFeatures.ruwiki20
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiMarkup.ruwiki264
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingPages.ruwiki17
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingProjects.ruwiki17
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Tutorial/ProjectIndex.ruwiki12
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Tutorial/SandBox.ruwiki10
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki.rb452
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend.rb306
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/_corefiles.rb193
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/flatfiles.rb152
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/marshal.rb109
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/yaml.rb110
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/config.rb151
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/exportable.rb105
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/handler.rb207
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/de.rb91
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/en.rb99
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/es.rb90
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/page.rb259
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/servlet.rb35
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/template.rb331
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki.rb92
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens.rb136
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/00default.rb206
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/01wikilinks.rb166
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/02actions.rb63
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/abbreviations.rb40
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/calendar.rb147
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/headings.rb43
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/lists.rb112
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/rubylists.rb47
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/tar.rb684
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/ruwiki.cgi49
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet245
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet.bat17
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/content.tmpl5
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/controls.tmpl23
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/edit.tmpl26
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/error.tmpl14
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/footer.tmpl23
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/ruwiki.css285
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/content.tmpl6
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/edit.tmpl26
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/error.tmpl13
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/footer.tmpl22
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/ruwiki.css336
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/save.tmpl10
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/body.tmpl13
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/content.tmpl5
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/edit.tmpl24
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/error.tmpl10
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/footer.tmpl10
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/ruwiki.css181
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/harness-cgi.rb40
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/harness.rb41
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/tc_backend_flatfile.rb98
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/tc_bugs.rb64
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/tc_exportable.rb66
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/tc_template.rb142
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/tc_tokens.rb327
-rwxr-xr-xruwiki/tags/release-0.8.0-fixes/tests/testall.rb18
-rw-r--r--ruwiki/tags/release-0.8.0/README65
-rw-r--r--ruwiki/tags/release-0.8.0/contrib/enscript-token.rb43
-rw-r--r--ruwiki/tags/release-0.8.0/convert279
-rw-r--r--ruwiki/tags/release-0.8.0/convert.bat16
-rw-r--r--ruwiki/tags/release-0.8.0/data/Default/ProjectIndex.ruwiki48
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/BugTracking.ruwiki34
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/ChangeLog.ruwiki72
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/Configuring_Ruwiki.ruwiki114
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/Extending_Ruwiki.ruwiki310
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/LicenseAndAuthorInfo.ruwiki33
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/ProjectIndex.ruwiki51
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/Roadmap.ruwiki223
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki157
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/SandBox.ruwiki11
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/To_Do.ruwiki61
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/TroubleShooting.ruwiki27
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/Upgrading+and+Converting.ruwiki37
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/WikiFeatures.ruwiki20
-rw-r--r--ruwiki/tags/release-0.8.0/data/Ruwiki/WikiMarkup.ruwiki264
-rw-r--r--ruwiki/tags/release-0.8.0/data/Tutorial/AddingPages.ruwiki17
-rw-r--r--ruwiki/tags/release-0.8.0/data/Tutorial/AddingProjects.ruwiki17
-rw-r--r--ruwiki/tags/release-0.8.0/data/Tutorial/ProjectIndex.ruwiki12
-rw-r--r--ruwiki/tags/release-0.8.0/data/Tutorial/SandBox.ruwiki10
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki.rb449
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/backend.rb306
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/backend/_corefiles.rb193
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/backend/flatfiles.rb185
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/backend/marshal.rb109
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/backend/yaml.rb110
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/config.rb151
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/handler.rb207
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/lang/de.rb91
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/lang/en.rb99
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/lang/es.rb90
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/page.rb235
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/servlet.rb35
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/template.rb331
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/wiki.rb92
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens.rb136
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/00default.rb206
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/01wikilinks.rb166
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/02actions.rb63
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/abbreviations.rb40
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/calendar.rb147
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/headings.rb43
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/lists.rb112
-rw-r--r--ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/rubylists.rb47
-rw-r--r--ruwiki/tags/release-0.8.0/ruwiki.cgi48
-rw-r--r--ruwiki/tags/release-0.8.0/ruwiki_servlet245
-rw-r--r--ruwiki/tags/release-0.8.0/ruwiki_servlet.bat17
-rw-r--r--ruwiki/tags/release-0.8.0/templates/default/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.8.0/templates/default/content.tmpl5
-rw-r--r--ruwiki/tags/release-0.8.0/templates/default/controls.tmpl23
-rw-r--r--ruwiki/tags/release-0.8.0/templates/default/edit.tmpl26
-rw-r--r--ruwiki/tags/release-0.8.0/templates/default/error.tmpl14
-rw-r--r--ruwiki/tags/release-0.8.0/templates/default/footer.tmpl23
-rw-r--r--ruwiki/tags/release-0.8.0/templates/default/ruwiki.css285
-rw-r--r--ruwiki/tags/release-0.8.0/templates/default/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.8.0/templates/sidebar/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.8.0/templates/sidebar/content.tmpl6
-rw-r--r--ruwiki/tags/release-0.8.0/templates/sidebar/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.8.0/templates/sidebar/edit.tmpl26
-rw-r--r--ruwiki/tags/release-0.8.0/templates/sidebar/error.tmpl13
-rw-r--r--ruwiki/tags/release-0.8.0/templates/sidebar/footer.tmpl22
-rw-r--r--ruwiki/tags/release-0.8.0/templates/sidebar/ruwiki.css336
-rw-r--r--ruwiki/tags/release-0.8.0/templates/sidebar/save.tmpl10
-rw-r--r--ruwiki/tags/release-0.8.0/templates/simple/body.tmpl13
-rw-r--r--ruwiki/tags/release-0.8.0/templates/simple/content.tmpl5
-rw-r--r--ruwiki/tags/release-0.8.0/templates/simple/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.8.0/templates/simple/edit.tmpl24
-rw-r--r--ruwiki/tags/release-0.8.0/templates/simple/error.tmpl10
-rw-r--r--ruwiki/tags/release-0.8.0/templates/simple/footer.tmpl10
-rw-r--r--ruwiki/tags/release-0.8.0/templates/simple/ruwiki.css181
-rw-r--r--ruwiki/tags/release-0.8.0/templates/simple/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.8.0/tests/harness-cgi.rb40
-rw-r--r--ruwiki/tags/release-0.8.0/tests/harness.rb41
-rw-r--r--ruwiki/tags/release-0.8.0/tests/tc_backend_flatfile.rb98
-rw-r--r--ruwiki/tags/release-0.8.0/tests/tc_bugs.rb64
-rw-r--r--ruwiki/tags/release-0.8.0/tests/tc_template.rb142
-rw-r--r--ruwiki/tags/release-0.8.0/tests/tc_tokens.rb327
-rwxr-xr-xruwiki/tags/release-0.8.0/tests/testall.rb18
-rw-r--r--ruwiki/tags/release-0.9.0/Rakefile207
-rw-r--r--ruwiki/tags/release-0.9.0/Readme.rubygems86
-rw-r--r--ruwiki/tags/release-0.9.0/Readme.tarfile65
-rw-r--r--ruwiki/tags/release-0.9.0/contrib/enscript-token.rb55
-rw-r--r--ruwiki/tags/release-0.9.0/contrib/rublog_integrator.rb68
-rw-r--r--ruwiki/tags/release-0.9.0/data/Default/ProjectIndex.ruwiki48
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/Antispam.ruwiki64
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/BugTracking.ruwiki32
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/ChangeLog.ruwiki101
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/Configuring_Ruwiki.ruwiki150
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/Extending_Ruwiki.ruwiki316
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/LicenseAndAuthorInfo.ruwiki29
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/ProjectIndex.ruwiki83
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/Roadmap.ruwiki224
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki155
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/RuwikiUtilities.ruwiki156
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/SandBox.ruwiki8
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/To_Do.ruwiki50
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/TroubleShooting.ruwiki32
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/WikiFeatures.ruwiki16
-rw-r--r--ruwiki/tags/release-0.9.0/data/Ruwiki/WikiMarkup.ruwiki260
-rw-r--r--ruwiki/tags/release-0.9.0/data/Tutorial/AddingPages.ruwiki15
-rw-r--r--ruwiki/tags/release-0.9.0/data/Tutorial/AddingProjects.ruwiki15
-rw-r--r--ruwiki/tags/release-0.9.0/data/Tutorial/ProjectIndex.ruwiki10
-rw-r--r--ruwiki/tags/release-0.9.0/data/Tutorial/SandBox.ruwiki8
-rw-r--r--ruwiki/tags/release-0.9.0/data/agents.banned60
-rw-r--r--ruwiki/tags/release-0.9.0/data/agents.readonly321
-rw-r--r--ruwiki/tags/release-0.9.0/data/hostip.banned30
-rw-r--r--ruwiki/tags/release-0.9.0/data/hostip.readonly28
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki.rb622
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/auth.rb56
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/auth/gforge.rb73
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/backend.rb318
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/backend/flatfiles.rb217
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/config.rb244
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/exportable.rb192
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/handler.rb342
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/lang/de.rb339
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/lang/en.rb334
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/lang/es.rb339
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/page.rb262
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/servlet.rb38
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/template.rb553
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/utils.rb24
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/utils/command.rb102
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/utils/converter.rb297
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/utils/manager.rb639
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/utils/servletrunner.rb295
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/wiki.rb147
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens.rb136
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/00default.rb211
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/01wikilinks.rb166
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/02actions.rb63
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/abbreviations.rb40
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/calendar.rb147
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/headings.rb43
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/lists.rb112
-rw-r--r--ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/rubylists.rb48
-rw-r--r--ruwiki/tags/release-0.9.0/ruwiki58
-rw-r--r--ruwiki/tags/release-0.9.0/ruwiki.cgi87
-rw-r--r--ruwiki/tags/release-0.9.0/ruwiki.conf22
-rw-r--r--ruwiki/tags/release-0.9.0/ruwiki_convert56
-rw-r--r--ruwiki/tags/release-0.9.0/ruwiki_service.rb82
-rw-r--r--ruwiki/tags/release-0.9.0/ruwiki_servlet53
-rw-r--r--ruwiki/tags/release-0.9.0/templates/default/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.9.0/templates/default/content.tmpl7
-rw-r--r--ruwiki/tags/release-0.9.0/templates/default/controls.tmpl23
-rw-r--r--ruwiki/tags/release-0.9.0/templates/default/edit.tmpl27
-rw-r--r--ruwiki/tags/release-0.9.0/templates/default/error.tmpl14
-rw-r--r--ruwiki/tags/release-0.9.0/templates/default/footer.tmpl23
-rw-r--r--ruwiki/tags/release-0.9.0/templates/default/ruwiki.css297
-rw-r--r--ruwiki/tags/release-0.9.0/templates/default/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.0/templates/sidebar/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.9.0/templates/sidebar/content.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.0/templates/sidebar/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.0/templates/sidebar/edit.tmpl27
-rw-r--r--ruwiki/tags/release-0.9.0/templates/sidebar/error.tmpl13
-rw-r--r--ruwiki/tags/release-0.9.0/templates/sidebar/footer.tmpl22
-rw-r--r--ruwiki/tags/release-0.9.0/templates/sidebar/ruwiki.css347
-rw-r--r--ruwiki/tags/release-0.9.0/templates/sidebar/save.tmpl10
-rw-r--r--ruwiki/tags/release-0.9.0/templates/simple/body.tmpl13
-rw-r--r--ruwiki/tags/release-0.9.0/templates/simple/content.tmpl7
-rw-r--r--ruwiki/tags/release-0.9.0/templates/simple/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.0/templates/simple/edit.tmpl25
-rw-r--r--ruwiki/tags/release-0.9.0/templates/simple/error.tmpl10
-rw-r--r--ruwiki/tags/release-0.9.0/templates/simple/footer.tmpl10
-rw-r--r--ruwiki/tags/release-0.9.0/templates/simple/ruwiki.css192
-rw-r--r--ruwiki/tags/release-0.9.0/templates/simple/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.0/tests/harness.rb52
-rw-r--r--ruwiki/tags/release-0.9.0/tests/tc_backend_flatfile.rb103
-rw-r--r--ruwiki/tags/release-0.9.0/tests/tc_bugs.rb74
-rw-r--r--ruwiki/tags/release-0.9.0/tests/tc_exportable.rb64
-rw-r--r--ruwiki/tags/release-0.9.0/tests/tc_template.rb145
-rw-r--r--ruwiki/tags/release-0.9.0/tests/tc_tokens.rb335
-rwxr-xr-xruwiki/tags/release-0.9.0/tests/testall.rb20
-rw-r--r--ruwiki/tags/release-0.9.1/Rakefile207
-rw-r--r--ruwiki/tags/release-0.9.1/Readme.rubygems86
-rw-r--r--ruwiki/tags/release-0.9.1/Readme.tarfile65
-rw-r--r--ruwiki/tags/release-0.9.1/contrib/enscript-token.rb55
-rw-r--r--ruwiki/tags/release-0.9.1/contrib/rublog_integrator.rb68
-rw-r--r--ruwiki/tags/release-0.9.1/data/Default/ProjectIndex.ruwiki48
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/Antispam.ruwiki83
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/BugTracking.ruwiki32
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/ChangeLog.ruwiki110
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/Configuring_Ruwiki.ruwiki150
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/Extending_Ruwiki.ruwiki316
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/LicenseAndAuthorInfo.ruwiki29
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/ProjectIndex.ruwiki83
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/Roadmap.ruwiki224
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki155
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/RuwikiUtilities.ruwiki156
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/SandBox.ruwiki8
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/To_Do.ruwiki50
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/TroubleShooting.ruwiki32
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/WikiFeatures.ruwiki16
-rw-r--r--ruwiki/tags/release-0.9.1/data/Ruwiki/WikiMarkup.ruwiki260
-rw-r--r--ruwiki/tags/release-0.9.1/data/Tutorial/AddingPages.ruwiki15
-rw-r--r--ruwiki/tags/release-0.9.1/data/Tutorial/AddingProjects.ruwiki15
-rw-r--r--ruwiki/tags/release-0.9.1/data/Tutorial/ProjectIndex.ruwiki10
-rw-r--r--ruwiki/tags/release-0.9.1/data/Tutorial/SandBox.ruwiki8
-rw-r--r--ruwiki/tags/release-0.9.1/data/agents.banned60
-rw-r--r--ruwiki/tags/release-0.9.1/data/agents.readonly321
-rw-r--r--ruwiki/tags/release-0.9.1/data/clean.uri37
-rw-r--r--ruwiki/tags/release-0.9.1/data/hostip.banned30
-rw-r--r--ruwiki/tags/release-0.9.1/data/hostip.readonly28
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki.rb626
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/auth.rb56
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/auth/gforge.rb73
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/backend.rb318
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/backend/flatfiles.rb216
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/config.rb244
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/exportable.rb192
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/handler.rb342
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/lang/de.rb339
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/lang/en.rb334
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/lang/es.rb339
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/page.rb262
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/servlet.rb38
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/template.rb553
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/utils.rb22
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/utils/command.rb102
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/utils/converter.rb297
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/utils/manager.rb648
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/utils/servletrunner.rb296
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/wiki.rb164
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens.rb131
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/00default.rb209
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/01wikilinks.rb166
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/02actions.rb63
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/abbreviations.rb40
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/calendar.rb147
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/headings.rb43
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/lists.rb112
-rw-r--r--ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/rubylists.rb48
-rw-r--r--ruwiki/tags/release-0.9.1/ruwiki58
-rw-r--r--ruwiki/tags/release-0.9.1/ruwiki.cgi87
-rw-r--r--ruwiki/tags/release-0.9.1/ruwiki.conf22
-rw-r--r--ruwiki/tags/release-0.9.1/ruwiki_convert54
-rw-r--r--ruwiki/tags/release-0.9.1/ruwiki_service.rb80
-rw-r--r--ruwiki/tags/release-0.9.1/ruwiki_servlet51
-rw-r--r--ruwiki/tags/release-0.9.1/templates/default/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.9.1/templates/default/content.tmpl7
-rw-r--r--ruwiki/tags/release-0.9.1/templates/default/controls.tmpl23
-rw-r--r--ruwiki/tags/release-0.9.1/templates/default/edit.tmpl27
-rw-r--r--ruwiki/tags/release-0.9.1/templates/default/error.tmpl14
-rw-r--r--ruwiki/tags/release-0.9.1/templates/default/footer.tmpl23
-rw-r--r--ruwiki/tags/release-0.9.1/templates/default/ruwiki.css297
-rw-r--r--ruwiki/tags/release-0.9.1/templates/default/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.1/templates/sidebar/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.9.1/templates/sidebar/content.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.1/templates/sidebar/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.1/templates/sidebar/edit.tmpl27
-rw-r--r--ruwiki/tags/release-0.9.1/templates/sidebar/error.tmpl13
-rw-r--r--ruwiki/tags/release-0.9.1/templates/sidebar/footer.tmpl22
-rw-r--r--ruwiki/tags/release-0.9.1/templates/sidebar/ruwiki.css347
-rw-r--r--ruwiki/tags/release-0.9.1/templates/sidebar/save.tmpl10
-rw-r--r--ruwiki/tags/release-0.9.1/templates/simple/body.tmpl13
-rw-r--r--ruwiki/tags/release-0.9.1/templates/simple/content.tmpl7
-rw-r--r--ruwiki/tags/release-0.9.1/templates/simple/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.1/templates/simple/edit.tmpl25
-rw-r--r--ruwiki/tags/release-0.9.1/templates/simple/error.tmpl10
-rw-r--r--ruwiki/tags/release-0.9.1/templates/simple/footer.tmpl10
-rw-r--r--ruwiki/tags/release-0.9.1/templates/simple/ruwiki.css192
-rw-r--r--ruwiki/tags/release-0.9.1/templates/simple/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.1/tests/harness.rb52
-rw-r--r--ruwiki/tags/release-0.9.1/tests/tc_backend_flatfile.rb103
-rw-r--r--ruwiki/tags/release-0.9.1/tests/tc_bugs.rb74
-rw-r--r--ruwiki/tags/release-0.9.1/tests/tc_exportable.rb64
-rw-r--r--ruwiki/tags/release-0.9.1/tests/tc_template.rb145
-rw-r--r--ruwiki/tags/release-0.9.1/tests/tc_tokens.rb335
-rwxr-xr-xruwiki/tags/release-0.9.1/tests/testall.rb20
-rw-r--r--ruwiki/tags/release-0.9.2/Rakefile207
-rw-r--r--ruwiki/tags/release-0.9.2/Readme.rubygems86
-rw-r--r--ruwiki/tags/release-0.9.2/Readme.tarfile65
-rw-r--r--ruwiki/tags/release-0.9.2/contrib/enscript-token.rb55
-rw-r--r--ruwiki/tags/release-0.9.2/contrib/rublog_integrator.rb68
-rw-r--r--ruwiki/tags/release-0.9.2/data/Default/ProjectIndex.ruwiki48
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/Antispam.ruwiki83
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/BugTracking.ruwiki32
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/ChangeLog.ruwiki113
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/Configuring_Ruwiki.ruwiki150
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/Extending_Ruwiki.ruwiki316
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/LicenseAndAuthorInfo.ruwiki29
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/ProjectIndex.ruwiki83
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/Roadmap.ruwiki224
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki155
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/RuwikiUtilities.ruwiki156
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/SandBox.ruwiki8
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/To_Do.ruwiki50
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/TroubleShooting.ruwiki32
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/WikiFeatures.ruwiki16
-rw-r--r--ruwiki/tags/release-0.9.2/data/Ruwiki/WikiMarkup.ruwiki260
-rw-r--r--ruwiki/tags/release-0.9.2/data/Tutorial/AddingPages.ruwiki15
-rw-r--r--ruwiki/tags/release-0.9.2/data/Tutorial/AddingProjects.ruwiki15
-rw-r--r--ruwiki/tags/release-0.9.2/data/Tutorial/ProjectIndex.ruwiki10
-rw-r--r--ruwiki/tags/release-0.9.2/data/Tutorial/SandBox.ruwiki8
-rw-r--r--ruwiki/tags/release-0.9.2/data/agents.banned60
-rw-r--r--ruwiki/tags/release-0.9.2/data/agents.readonly321
-rw-r--r--ruwiki/tags/release-0.9.2/data/clean.uri37
-rw-r--r--ruwiki/tags/release-0.9.2/data/hostip.banned30
-rw-r--r--ruwiki/tags/release-0.9.2/data/hostip.readonly28
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki.rb626
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/auth.rb56
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/auth/gforge.rb73
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/backend.rb318
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/backend/flatfiles.rb216
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/config.rb244
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/exportable.rb192
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/handler.rb342
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/lang/de.rb339
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/lang/en.rb334
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/lang/es.rb339
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/page.rb262
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/servlet.rb38
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/template.rb553
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/utils.rb22
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/utils/command.rb102
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/utils/converter.rb297
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/utils/manager.rb648
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/utils/servletrunner.rb296
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/wiki.rb164
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens.rb127
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/00default.rb209
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/01wikilinks.rb166
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/02actions.rb63
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/abbreviations.rb40
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/calendar.rb147
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/headings.rb43
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/lists.rb112
-rw-r--r--ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/rubylists.rb48
-rw-r--r--ruwiki/tags/release-0.9.2/ruwiki58
-rw-r--r--ruwiki/tags/release-0.9.2/ruwiki.cgi87
-rw-r--r--ruwiki/tags/release-0.9.2/ruwiki.conf22
-rw-r--r--ruwiki/tags/release-0.9.2/ruwiki_convert54
-rw-r--r--ruwiki/tags/release-0.9.2/ruwiki_service.rb80
-rw-r--r--ruwiki/tags/release-0.9.2/ruwiki_servlet51
-rw-r--r--ruwiki/tags/release-0.9.2/templates/default/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.9.2/templates/default/content.tmpl7
-rw-r--r--ruwiki/tags/release-0.9.2/templates/default/controls.tmpl23
-rw-r--r--ruwiki/tags/release-0.9.2/templates/default/edit.tmpl27
-rw-r--r--ruwiki/tags/release-0.9.2/templates/default/error.tmpl14
-rw-r--r--ruwiki/tags/release-0.9.2/templates/default/footer.tmpl23
-rw-r--r--ruwiki/tags/release-0.9.2/templates/default/ruwiki.css297
-rw-r--r--ruwiki/tags/release-0.9.2/templates/default/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.2/templates/sidebar/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.9.2/templates/sidebar/content.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.2/templates/sidebar/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.2/templates/sidebar/edit.tmpl27
-rw-r--r--ruwiki/tags/release-0.9.2/templates/sidebar/error.tmpl13
-rw-r--r--ruwiki/tags/release-0.9.2/templates/sidebar/footer.tmpl22
-rw-r--r--ruwiki/tags/release-0.9.2/templates/sidebar/ruwiki.css347
-rw-r--r--ruwiki/tags/release-0.9.2/templates/sidebar/save.tmpl10
-rw-r--r--ruwiki/tags/release-0.9.2/templates/simple/body.tmpl13
-rw-r--r--ruwiki/tags/release-0.9.2/templates/simple/content.tmpl7
-rw-r--r--ruwiki/tags/release-0.9.2/templates/simple/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.2/templates/simple/edit.tmpl25
-rw-r--r--ruwiki/tags/release-0.9.2/templates/simple/error.tmpl10
-rw-r--r--ruwiki/tags/release-0.9.2/templates/simple/footer.tmpl10
-rw-r--r--ruwiki/tags/release-0.9.2/templates/simple/ruwiki.css192
-rw-r--r--ruwiki/tags/release-0.9.2/templates/simple/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.2/tests/harness.rb52
-rw-r--r--ruwiki/tags/release-0.9.2/tests/tc_backend_flatfile.rb103
-rw-r--r--ruwiki/tags/release-0.9.2/tests/tc_bugs.rb74
-rw-r--r--ruwiki/tags/release-0.9.2/tests/tc_exportable.rb64
-rw-r--r--ruwiki/tags/release-0.9.2/tests/tc_template.rb145
-rw-r--r--ruwiki/tags/release-0.9.2/tests/tc_tokens.rb335
-rwxr-xr-xruwiki/tags/release-0.9.2/tests/testall.rb20
-rw-r--r--ruwiki/tags/release-0.9.3/Rakefile207
-rw-r--r--ruwiki/tags/release-0.9.3/Readme.rubygems86
-rw-r--r--ruwiki/tags/release-0.9.3/Readme.tarfile65
-rw-r--r--ruwiki/tags/release-0.9.3/contrib/enscript-token.rb55
-rw-r--r--ruwiki/tags/release-0.9.3/contrib/rublog_integrator.rb68
-rw-r--r--ruwiki/tags/release-0.9.3/data/Default/ProjectIndex.ruwiki48
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/Antispam.ruwiki83
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/BugTracking.ruwiki32
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/ChangeLog.ruwiki116
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/Configuring_Ruwiki.ruwiki150
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/Extending_Ruwiki.ruwiki316
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/LicenseAndAuthorInfo.ruwiki29
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/ProjectIndex.ruwiki83
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/Roadmap.ruwiki224
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki155
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/RuwikiUtilities.ruwiki156
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/SandBox.ruwiki8
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/To_Do.ruwiki50
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/TroubleShooting.ruwiki32
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/WikiFeatures.ruwiki16
-rw-r--r--ruwiki/tags/release-0.9.3/data/Ruwiki/WikiMarkup.ruwiki260
-rw-r--r--ruwiki/tags/release-0.9.3/data/Tutorial/AddingPages.ruwiki15
-rw-r--r--ruwiki/tags/release-0.9.3/data/Tutorial/AddingProjects.ruwiki15
-rw-r--r--ruwiki/tags/release-0.9.3/data/Tutorial/ProjectIndex.ruwiki10
-rw-r--r--ruwiki/tags/release-0.9.3/data/Tutorial/SandBox.ruwiki8
-rw-r--r--ruwiki/tags/release-0.9.3/data/agents.banned60
-rw-r--r--ruwiki/tags/release-0.9.3/data/agents.readonly321
-rw-r--r--ruwiki/tags/release-0.9.3/data/clean.uri37
-rw-r--r--ruwiki/tags/release-0.9.3/data/hostip.banned30
-rw-r--r--ruwiki/tags/release-0.9.3/data/hostip.readonly28
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki.rb626
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/auth.rb56
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/auth/gforge.rb73
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/backend.rb318
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/backend/flatfiles.rb216
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/config.rb244
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/exportable.rb192
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/handler.rb342
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/lang/de.rb339
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/lang/en.rb334
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/lang/es.rb339
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/page.rb262
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/servlet.rb38
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/template.rb553
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/utils.rb22
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/utils/command.rb102
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/utils/converter.rb297
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/utils/manager.rb648
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/utils/servletrunner.rb296
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/wiki.rb164
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens.rb127
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/00default.rb209
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/01wikilinks.rb166
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/02actions.rb63
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/abbreviations.rb40
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/calendar.rb147
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/headings.rb43
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/lists.rb112
-rw-r--r--ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/rubylists.rb48
-rw-r--r--ruwiki/tags/release-0.9.3/ruwiki58
-rw-r--r--ruwiki/tags/release-0.9.3/ruwiki.cgi87
-rw-r--r--ruwiki/tags/release-0.9.3/ruwiki.conf22
-rw-r--r--ruwiki/tags/release-0.9.3/ruwiki_convert54
-rw-r--r--ruwiki/tags/release-0.9.3/ruwiki_service.rb80
-rw-r--r--ruwiki/tags/release-0.9.3/ruwiki_servlet51
-rw-r--r--ruwiki/tags/release-0.9.3/templates/default/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.9.3/templates/default/content.tmpl7
-rw-r--r--ruwiki/tags/release-0.9.3/templates/default/controls.tmpl23
-rw-r--r--ruwiki/tags/release-0.9.3/templates/default/edit.tmpl27
-rw-r--r--ruwiki/tags/release-0.9.3/templates/default/error.tmpl14
-rw-r--r--ruwiki/tags/release-0.9.3/templates/default/footer.tmpl23
-rw-r--r--ruwiki/tags/release-0.9.3/templates/default/ruwiki.css297
-rw-r--r--ruwiki/tags/release-0.9.3/templates/default/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.3/templates/sidebar/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.9.3/templates/sidebar/content.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.3/templates/sidebar/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.3/templates/sidebar/edit.tmpl27
-rw-r--r--ruwiki/tags/release-0.9.3/templates/sidebar/error.tmpl13
-rw-r--r--ruwiki/tags/release-0.9.3/templates/sidebar/footer.tmpl22
-rw-r--r--ruwiki/tags/release-0.9.3/templates/sidebar/ruwiki.css347
-rw-r--r--ruwiki/tags/release-0.9.3/templates/sidebar/save.tmpl10
-rw-r--r--ruwiki/tags/release-0.9.3/templates/simple/body.tmpl13
-rw-r--r--ruwiki/tags/release-0.9.3/templates/simple/content.tmpl7
-rw-r--r--ruwiki/tags/release-0.9.3/templates/simple/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.3/templates/simple/edit.tmpl25
-rw-r--r--ruwiki/tags/release-0.9.3/templates/simple/error.tmpl10
-rw-r--r--ruwiki/tags/release-0.9.3/templates/simple/footer.tmpl10
-rw-r--r--ruwiki/tags/release-0.9.3/templates/simple/ruwiki.css192
-rw-r--r--ruwiki/tags/release-0.9.3/templates/simple/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.9.3/tests/harness.rb52
-rw-r--r--ruwiki/tags/release-0.9.3/tests/tc_backend_flatfile.rb103
-rw-r--r--ruwiki/tags/release-0.9.3/tests/tc_bugs.rb74
-rw-r--r--ruwiki/tags/release-0.9.3/tests/tc_exportable.rb64
-rw-r--r--ruwiki/tags/release-0.9.3/tests/tc_template.rb145
-rw-r--r--ruwiki/tags/release-0.9.3/tests/tc_tokens.rb335
-rwxr-xr-xruwiki/tags/release-0.9.3/tests/testall.rb20
-rw-r--r--ruwiki/trunk/Rakefile207
-rw-r--r--ruwiki/trunk/Readme.rubygems86
-rw-r--r--ruwiki/trunk/Readme.tarfile65
-rw-r--r--ruwiki/trunk/bin/ruwiki58
-rw-r--r--ruwiki/trunk/bin/ruwiki.cgi87
-rw-r--r--ruwiki/trunk/bin/ruwiki_convert54
-rw-r--r--ruwiki/trunk/bin/ruwiki_service.rb80
-rw-r--r--ruwiki/trunk/bin/ruwiki_servlet51
-rw-r--r--ruwiki/trunk/contrib/enscript-token.rb55
-rw-r--r--ruwiki/trunk/contrib/rublog_integrator.rb68
-rw-r--r--ruwiki/trunk/data/Default/ProjectIndex.ruwiki48
-rw-r--r--ruwiki/trunk/data/Ruwiki/Antispam.ruwiki83
-rw-r--r--ruwiki/trunk/data/Ruwiki/BugTracking.ruwiki32
-rw-r--r--ruwiki/trunk/data/Ruwiki/ChangeLog.ruwiki120
-rw-r--r--ruwiki/trunk/data/Ruwiki/Configuring_Ruwiki.ruwiki150
-rw-r--r--ruwiki/trunk/data/Ruwiki/Extending_Ruwiki.ruwiki316
-rw-r--r--ruwiki/trunk/data/Ruwiki/LicenseAndAuthorInfo.ruwiki29
-rw-r--r--ruwiki/trunk/data/Ruwiki/ProjectIndex.ruwiki83
-rw-r--r--ruwiki/trunk/data/Ruwiki/Roadmap.ruwiki224
-rw-r--r--ruwiki/trunk/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki155
-rw-r--r--ruwiki/trunk/data/Ruwiki/RuwikiUtilities.ruwiki156
-rw-r--r--ruwiki/trunk/data/Ruwiki/SandBox.ruwiki8
-rw-r--r--ruwiki/trunk/data/Ruwiki/To_Do.ruwiki50
-rw-r--r--ruwiki/trunk/data/Ruwiki/TroubleShooting.ruwiki32
-rw-r--r--ruwiki/trunk/data/Ruwiki/WikiFeatures.ruwiki16
-rw-r--r--ruwiki/trunk/data/Ruwiki/WikiMarkup.ruwiki260
-rw-r--r--ruwiki/trunk/data/Tutorial/AddingPages.ruwiki15
-rw-r--r--ruwiki/trunk/data/Tutorial/AddingProjects.ruwiki15
-rw-r--r--ruwiki/trunk/data/Tutorial/ProjectIndex.ruwiki10
-rw-r--r--ruwiki/trunk/data/Tutorial/SandBox.ruwiki8
-rw-r--r--ruwiki/trunk/data/agents.banned60
-rw-r--r--ruwiki/trunk/data/agents.readonly321
-rw-r--r--ruwiki/trunk/data/clean.uri37
-rw-r--r--ruwiki/trunk/data/hostip.banned30
-rw-r--r--ruwiki/trunk/data/hostip.readonly28
-rw-r--r--ruwiki/trunk/lib/ruwiki.rb626
-rw-r--r--ruwiki/trunk/lib/ruwiki/auth.rb56
-rw-r--r--ruwiki/trunk/lib/ruwiki/auth/gforge.rb73
-rw-r--r--ruwiki/trunk/lib/ruwiki/backend.rb318
-rw-r--r--ruwiki/trunk/lib/ruwiki/backend/flatfiles.rb216
-rw-r--r--ruwiki/trunk/lib/ruwiki/config.rb244
-rw-r--r--ruwiki/trunk/lib/ruwiki/exportable.rb192
-rw-r--r--ruwiki/trunk/lib/ruwiki/handler.rb342
-rw-r--r--ruwiki/trunk/lib/ruwiki/lang/de.rb339
-rw-r--r--ruwiki/trunk/lib/ruwiki/lang/en.rb334
-rw-r--r--ruwiki/trunk/lib/ruwiki/lang/es.rb339
-rw-r--r--ruwiki/trunk/lib/ruwiki/page.rb262
-rw-r--r--ruwiki/trunk/lib/ruwiki/servlet.rb38
-rw-r--r--ruwiki/trunk/lib/ruwiki/template.rb553
-rw-r--r--ruwiki/trunk/lib/ruwiki/utils.rb22
-rw-r--r--ruwiki/trunk/lib/ruwiki/utils/command.rb102
-rw-r--r--ruwiki/trunk/lib/ruwiki/utils/converter.rb297
-rw-r--r--ruwiki/trunk/lib/ruwiki/utils/manager.rb648
-rw-r--r--ruwiki/trunk/lib/ruwiki/utils/servletrunner.rb296
-rw-r--r--ruwiki/trunk/lib/ruwiki/wiki.rb171
-rw-r--r--ruwiki/trunk/lib/ruwiki/wiki/tokens.rb127
-rw-r--r--ruwiki/trunk/lib/ruwiki/wiki/tokens/00default.rb208
-rw-r--r--ruwiki/trunk/lib/ruwiki/wiki/tokens/01wikilinks.rb166
-rw-r--r--ruwiki/trunk/lib/ruwiki/wiki/tokens/02actions.rb63
-rw-r--r--ruwiki/trunk/lib/ruwiki/wiki/tokens/abbreviations.rb40
-rw-r--r--ruwiki/trunk/lib/ruwiki/wiki/tokens/calendar.rb147
-rw-r--r--ruwiki/trunk/lib/ruwiki/wiki/tokens/headings.rb43
-rw-r--r--ruwiki/trunk/lib/ruwiki/wiki/tokens/lists.rb112
-rw-r--r--ruwiki/trunk/lib/ruwiki/wiki/tokens/rubylists.rb48
-rw-r--r--ruwiki/trunk/ruwiki.conf22
-rw-r--r--ruwiki/trunk/templates/default/body.tmpl19
-rw-r--r--ruwiki/trunk/templates/default/content.tmpl7
-rw-r--r--ruwiki/trunk/templates/default/controls.tmpl23
-rw-r--r--ruwiki/trunk/templates/default/edit.tmpl27
-rw-r--r--ruwiki/trunk/templates/default/error.tmpl14
-rw-r--r--ruwiki/trunk/templates/default/footer.tmpl23
-rw-r--r--ruwiki/trunk/templates/default/ruwiki.css297
-rw-r--r--ruwiki/trunk/templates/default/save.tmpl8
-rw-r--r--ruwiki/trunk/templates/sidebar/body.tmpl19
-rw-r--r--ruwiki/trunk/templates/sidebar/content.tmpl8
-rw-r--r--ruwiki/trunk/templates/sidebar/controls.tmpl8
-rw-r--r--ruwiki/trunk/templates/sidebar/edit.tmpl27
-rw-r--r--ruwiki/trunk/templates/sidebar/error.tmpl13
-rw-r--r--ruwiki/trunk/templates/sidebar/footer.tmpl22
-rw-r--r--ruwiki/trunk/templates/sidebar/ruwiki.css347
-rw-r--r--ruwiki/trunk/templates/sidebar/save.tmpl10
-rw-r--r--ruwiki/trunk/templates/simple/body.tmpl13
-rw-r--r--ruwiki/trunk/templates/simple/content.tmpl7
-rw-r--r--ruwiki/trunk/templates/simple/controls.tmpl8
-rw-r--r--ruwiki/trunk/templates/simple/edit.tmpl25
-rw-r--r--ruwiki/trunk/templates/simple/error.tmpl10
-rw-r--r--ruwiki/trunk/templates/simple/footer.tmpl10
-rw-r--r--ruwiki/trunk/templates/simple/ruwiki.css192
-rw-r--r--ruwiki/trunk/templates/simple/save.tmpl8
-rw-r--r--ruwiki/trunk/tests/harness.rb52
-rw-r--r--ruwiki/trunk/tests/tc_backend_flatfile.rb103
-rw-r--r--ruwiki/trunk/tests/tc_bugs.rb74
-rw-r--r--ruwiki/trunk/tests/tc_exportable.rb64
-rw-r--r--ruwiki/trunk/tests/tc_template.rb145
-rw-r--r--ruwiki/trunk/tests/tc_tokens.rb335
-rwxr-xr-xruwiki/trunk/tests/testall.rb20
931 files changed, 0 insertions, 97654 deletions
diff --git a/minitar/tags/release-0.5.0 b/minitar/tags/release-0.5.0
deleted file mode 100644
index bea88ab..0000000
--- a/minitar/tags/release-0.5.0
+++ /dev/null
@@ -1,42 +0,0 @@
-Gem::Specification.new do |s|
- s.name = %{archive-tar-minitar}
- s.version = %{0.5.0}
- s.author = %{Austin Ziegler, Mauricio Fernandez}
- s.email = %{minitar@halostatue.ca}
- s.homepage = %{http://rubyforge.org/projects/ruwiki/}
- s.rubyforge_project = %{ruwiki}
-
- s.files = Dir.glob("**/*").delete_if do |item|
- item.include?("CVS") or item.include?(".svn") or
- item == "install.rb" or item =~ /~$/ or
- item =~ /gem(?:spec)?$/
- end
-
- s.summary = %{Provides POSIX tarchive management from Ruby programs.}
- s.platform = Gem::Platform::RUBY
-
- s.required_ruby_version = %(>=1.8.1)
-
- s.executables = %w(minitar)
- s.bindir = %(bin)
- s.default_executable = %(minitar)
-
- s.test_suite_file = %w{tests/testall.rb}
-
- s.autorequire = %{archive/tar/minitar}
- s.require_paths = %w{lib}
-
- description = []
- File.open("README") do |file|
- file.each do |line|
- line.chomp!
- break if line.empty?
- description << "#{line.gsub(/\[\d\]/, '')}"
- end
- end
- s.description = description[2..-1].join(" ")
-
- s.has_rdoc = true
- s.rdoc_options = ["--title", "Archive::Tar::MiniTar -- A POSIX tarchive library", "--main", "README", "--line-numbers"]
- s.extra_rdoc_files = %w(README ChangeLog Install)
-end
diff --git a/minitar/tags/release-0.5.1 b/minitar/tags/release-0.5.1
deleted file mode 100644
index 8819b85..0000000
--- a/minitar/tags/release-0.5.1
+++ /dev/null
@@ -1,42 +0,0 @@
-Gem::Specification.new do |s|
- s.name = %{archive-tar-minitar}
- s.version = %{0.5.1}
- s.author = %{Austin Ziegler, Mauricio Fernandez}
- s.email = %{minitar@halostatue.ca}
- s.homepage = %{http://rubyforge.org/projects/ruwiki/}
- s.rubyforge_project = %{ruwiki}
-
- s.files = Dir.glob("**/*").delete_if do |item|
- item.include?("CVS") or item.include?(".svn") or
- item == "install.rb" or item =~ /~$/ or
- item =~ /gem(?:spec)?$/
- end
-
- s.summary = %{Provides POSIX tarchive management from Ruby programs.}
- s.platform = Gem::Platform::RUBY
-
- s.required_ruby_version = %(>=1.8.1)
-
- s.executables = %w(minitar)
- s.bindir = %(bin)
- s.default_executable = %(minitar)
-
- s.test_files = %w{tests/testall.rb}
-
- s.autorequire = %{archive/tar/minitar}
- s.require_paths = %w{lib}
-
- description = []
- File.open("README") do |file|
- file.each do |line|
- line.chomp!
- break if line.empty?
- description << "#{line.gsub(/\[\d\]/, '')}"
- end
- end
- s.description = description[2..-1].join(" ")
-
- s.has_rdoc = true
- s.rdoc_options = ["--title", "Archive::Tar::MiniTar -- A POSIX tarchive library", "--main", "README", "--line-numbers"]
- s.extra_rdoc_files = %w(README ChangeLog Install)
-end
diff --git a/minitar/trunk/ChangeLog b/minitar/trunk/ChangeLog
deleted file mode 100644
index 863e855..0000000
--- a/minitar/trunk/ChangeLog
+++ /dev/null
@@ -1,14 +0,0 @@
-Revision history for Ruby library Archive::Tar::Minitar. Unless explicitly
-noted otherwise, all changes are produced by Austin Ziegler
-<austin@rubyforge.org>.
-
-== 0.5.2
-* Fixed a Ruby 1.9 compatibility error.
-
-== 0.5.1
-* Fixed a variable name error.
-
-== Archive::Tar::Minitar 0.5.0
-* Initial release. Does files and directories. Command does create, extract,
-* and list.
-
diff --git a/minitar/trunk/Install b/minitar/trunk/Install
deleted file mode 100644
index 2693497..0000000
--- a/minitar/trunk/Install
+++ /dev/null
@@ -1,6 +0,0 @@
-Installing this package is as simple as:
-
-% ruby install.rb
-
-Alternatively, you can use the RubyGem version of Archive::Tar::Minitar
-available as archive-tar-minitar-0.5.2.gem from the usual sources.
diff --git a/minitar/trunk/README b/minitar/trunk/README
deleted file mode 100644
index a3fa934..0000000
--- a/minitar/trunk/README
+++ /dev/null
@@ -1,66 +0,0 @@
-Archive::Tar::Minitar README
-============================
-Archive::Tar::Minitar is a pure-Ruby library and command-line utility that
-provides the ability to deal with POSIX tar(1) archive files. The
-implementation is based heavily on Mauricio Ferna'ndez's implementation in
-rpa-base, but has been reorganised to promote reuse in other projects.
-
-This release is version 0.5.2, offering a Ruby 1.9 compatibility bugfix over
-version 0.5.1. The library can only handle files and directories at this
-point. A future version will be expanded to handle symbolic links and hard
-links in a portable manner. The command line utility, minitar, can only create
-archives, extract from archives, and list archive contents.
-
-Using this library is easy. The simplest case is:
-
- require 'zlib'
- require 'archive/tar/minitar'
- include Archive::Tar
-
- # Packs everything that matches Find.find('tests')
- File.open('test.tar', 'wb') { |tar| Minitar.pack('tests', tar) }
- # Unpacks 'test.tar' to 'x', creating 'x' if necessary.
- Minitar.unpack('test.tar', 'x')
-
-A gzipped tar can be written with:
-
- tgz = Zlib::GzipWriter.new(File.open('test.tgz', 'wb'))
- # Warning: tgz will be closed!
- Minitar.pack('tests', tgz)
-
- tgz = Zlib::GzipReader.new(File.open('test.tgz', 'rb'))
- # Warning: tgz will be closed!
- Minitar.unpack(tgz, 'x')
-
-As the case above shows, one need not write to a file. However, it will
-sometimes require that one dive a little deeper into the API, as in the case
-of StringIO objects. Note that I'm not providing a block with Minitar::Output,
-as Minitar::Output#close automatically closes both the Output object and the
-wrapped data stream object.
-
- begin
- sgz = Zlib::GzipWriter.new(StringIO.new(""))
- tar = Output.new(sgz)
- Find.find('tests') do |entry|
- Minitar.pack_file(entry, tar)
- end
- ensure
- # Closes both tar and sgz.
- tar.close
- end
-
-Copyright
-=========
-# Copyright 2004 Mauricio Julio Ferna'ndez Pradier and Austin Ziegler
-#
-# This program is based on and incorporates parts of RPA::Package from
-# rpa-base (lib/rpa/package.rb and lib/rpa/util.rb) by Mauricio and has been
-# adapted to be more generic by Austin.
-#
-# 'minitar' contains an adaptation of Ruby/ProgressBar by Satoru
-# Takabayashi <satoru@namazu.org>, copyright 2001 - 2004.
-#
-# This program is free software. It may be redistributed and/or modified
-# under the terms of the GPL version 2 (or later) or Ruby's licence.
-#
-# $Id$
diff --git a/minitar/trunk/Rakefile b/minitar/trunk/Rakefile
deleted file mode 100644
index 5985ab3..0000000
--- a/minitar/trunk/Rakefile
+++ /dev/null
@@ -1,113 +0,0 @@
-#! /usr/bin/env rake
-$LOAD_PATH.unshift('lib')
-
-require 'rubygems'
-require 'rake/gempackagetask'
-require 'rake/contrib/rubyforgepublisher'
-require 'archive/tar/minitar'
-require 'zlib'
-
-DISTDIR = "archive-tar-minitar-#{Archive::Tar::Minitar::VERSION}"
-TARDIST = "../#{DISTDIR}.tar.gz"
-
-DATE_RE = %r<(\d{4})[./-]?(\d{2})[./-]?(\d{2})(?:[\sT]?(\d{2})[:.]?(\d{2})[:.]?(\d{2})?)?>
-
-if ENV['RELEASE_DATE']
- year, month, day, hour, minute, second = DATE_RE.match(ENV['RELEASE_DATE']).captures
- year ||= 0
- month ||= 0
- day ||= 0
- hour ||= 0
- minute ||= 0
- second ||= 0
- ReleaseDate = Time.mktime(year, month, day, hour, minute, second)
-else
- ReleaseDate = nil
-end
-
-task :test do |t|
- require 'test/unit/testsuite'
- require 'test/unit/ui/console/testrunner'
-
- runner = Test::Unit::UI::Console::TestRunner
-
- $LOAD_PATH.unshift('tests')
- Dir['tests/tc_*.rb'].each do |testcase|
- load testcase
- end
-
- suite = Test::Unit::TestSuite.new
-
- ObjectSpace.each_object(Class) do |testcase|
- suite << testcase.suite if testcase < Test::Unit::TestCase
- end
-
- runner.run(suite)
-end
-
-spec = eval(File.read("archive-tar-minitar.gemspec"))
-desc "Build the RubyGem for Archive::Tar::Minitar."
-task :gem => [ :test ]
-Rake::GemPackageTask.new(spec) do |g|
- g.need_tar = false
- g.need_zip = false
- g.package_dir = ".."
-end
-
-desc "Build an Archive::Tar::Minitar .tar.gz distribution."
-task :tar => [ TARDIST ]
-file TARDIST do |t|
- current = File.basename(Dir.pwd)
- Dir.chdir("..") do
- begin
- files = Dir["#{current}/**/*"].select { |dd| dd !~ %r{(?:/CVS/?|~$)} }
- files.map! do |dd|
- ddnew = dd.gsub(/^#{current}/, DISTDIR)
- mtime = ReleaseDate || File.stat(dd).mtime
- if File.directory?(dd)
- { :name => ddnew, :mode => 0755, :dir => true, :mtime => mtime }
- else
- if dd =~ %r{bin/}
- mode = 0755
- else
- mode = 0644
- end
- data = File.read(dd)
- { :name => ddnew, :mode => mode, :data => data, :size => data.size,
- :mtime => mtime }
- end
- end
-
- ff = File.open(t.name.gsub(%r{^\.\./}o, ''), "wb")
- gz = Zlib::GzipWriter.new(ff)
- tw = Archive::Tar::Minitar::Writer.new(gz)
-
- files.each do |entry|
- if entry[:dir]
- tw.mkdir(entry[:name], entry)
- else
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
- end
- end
- ensure
- tw.close if tw
- gz.close if gz
- end
- end
-end
-task TARDIST => [ :test ]
-
-def sign(file)
- sh %("C:\\Program Files\\Windows Privacy Tools\\GnuPG\\Gpg.exe" -ba #{file})
-end
-
-task :signtar => [ :tar ] do
- sign TARDIST
-end
-task :signgem => [ :gem ] do
- sign "../#{DISTDIR}.gem"
-end
-
-desc "Build everything."
-task :default => [ :signtar, :signgem ] do
-end
diff --git a/minitar/trunk/archive-tar-minitar.gemspec b/minitar/trunk/archive-tar-minitar.gemspec
deleted file mode 100644
index d4e91b9..0000000
--- a/minitar/trunk/archive-tar-minitar.gemspec
+++ /dev/null
@@ -1,41 +0,0 @@
-Gem::Specification.new do |s|
- s.name = %{archive-tar-minitar}
- s.version = %{0.5.2}
- s.author = %{Austin Ziegler, Mauricio Fernandez}
- s.email = %{minitar@halostatue.ca}
- s.homepage = %{http://rubyforge.org/projects/ruwiki/}
- s.rubyforge_project = %{ruwiki}
-
- s.files = Dir.glob("**/*").delete_if do |item|
- item.include?("CVS") or item.include?(".svn") or
- item == "install.rb" or item =~ /~$/ or
- item =~ /gem(?:spec)?$/
- end
-
- s.summary = %{Provides POSIX tarchive management from Ruby programs.}
- s.platform = Gem::Platform::RUBY
-
- s.required_ruby_version = %(>=1.8.2)
-
- s.executables = %w(minitar)
- s.bindir = %(bin)
-
- s.test_files = %w{tests/testall.rb}
-
- s.autorequire = %{archive/tar/minitar}
- s.require_paths = %w{lib}
-
- description = []
- File.open("README") do |file|
- file.each do |line|
- line.chomp!
- break if line.empty?
- description << "#{line.gsub(/\[\d\]/, '')}"
- end
- end
- s.description = description[2..-1].join(" ")
-
- s.has_rdoc = true
- s.rdoc_options = ["--title", "Archive::Tar::MiniTar -- A POSIX tarchive library", "--main", "README", "--line-numbers"]
- s.extra_rdoc_files = %w(README ChangeLog Install)
-end
diff --git a/minitar/trunk/bin/minitar b/minitar/trunk/bin/minitar
deleted file mode 100644
index 26cc941..0000000
--- a/minitar/trunk/bin/minitar
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Archive::Tar::Minitar 0.5.2
-# Copyright 2004 Mauricio Julio Ferna'ndez Pradier and Austin Ziegler
-#
-# This program is based on and incorporates parts of RPA::Package from
-# rpa-base (lib/rpa/package.rb and lib/rpa/util.rb) by Mauricio and has been
-# adapted to be more generic by Austin.
-#
-# It is licensed under the GNU General Public Licence or Ruby's licence.
-#
-# $Id$
-#++
-
- # 1) Try to load Archive::Tar::Minitar from the gem.
- # 2) Try to load Archive::Tar::Minitar from $LOAD_PATH.
-begin
- require 'rubygems'
- require_gem 'archive-tar-minitar', '= 0.5.2'
-rescue LoadError
- nil
-end
-
-require 'archive/tar/minitar'
-require 'archive/tar/minitar/command'
-
-exit Archive::Tar::Minitar::Command.run(ARGV)
diff --git a/minitar/trunk/install.rb b/minitar/trunk/install.rb
deleted file mode 100644
index 8503b66..0000000
--- a/minitar/trunk/install.rb
+++ /dev/null
@@ -1,262 +0,0 @@
-#! /usr/bin/env ruby
-#--
-# Copyright 2004, 2008 Austin Ziegler <ruby-install@halostatue.ca>
-# Install utility. Based on the original installation script for rdoc by the
-# Pragmatic Programmers.
-#
-# This program is free software. It may be redistributed and/or modified under
-# the terms of the GPL version 2 (or later) or the Ruby licence.
-#
-# Usage
-# -----
-# In most cases, if you have a typical project layout, you will need to do
-# absolutely nothing to make this work for you. This layout is:
-#
-# bin/ # executable files -- "commands"
-# lib/ # the source of the library
-# tests/ # unit tests
-#
-# The default behaviour:
-# 1) Run all unit test files (ending in .rb) found in all directories under
-# tests/.
-# 2) Build Rdoc documentation from all files in bin/ (excluding .bat and .cmd),
-# all .rb files in lib/, ./README, ./ChangeLog, and ./Install.
-# 3) Build ri documentation from all files in bin/ (excluding .bat and .cmd),
-# and all .rb files in lib/. This is disabled by default on Win32.
-# 4) Install commands from bin/ into the Ruby bin directory. On Windows, if a
-# if a corresponding batch file (.bat or .cmd) exists in the bin directory,
-# it will be copied over as well. Otherwise, a batch file (always .bat) will
-# be created to run the specified command.
-# 5) Install all library files ending in .rb from lib/ into Ruby's
-# site_lib/version directory.
-#
-# $Id$
-#++
-
-require 'rbconfig'
-require 'find'
-require 'fileutils'
-require 'rdoc/rdoc'
-require 'optparse'
-require 'ostruct'
-
-InstallOptions = OpenStruct.new
-
-def glob(list)
- g = list.map { |i| Dir.glob(i) }
- g.flatten!
- g.compact!
- g.reject! { |e| e =~ /CVS/ }
- g
-end
-
- # Set these values to what you want installed.
-bins = glob(%w{bin/**/*}).reject { |e| e =~ /\.(bat|cmd)$/ }
-rdoc = glob(%w{bin/**/* lib/**/*.rb README ChangeLog Install}).reject { |e| e=~ /\.(bat|cmd)$/ }
-ri = glob(%w(bin/**/*.rb lib/**/*.rb)).reject { |e| e=~ /\.(bat|cmd)$/ }
-libs = glob(%w{lib/**/*.rb})
-tests = glob(%w{tests/**/*.rb})
-
-def do_bins(bins, target, strip = 'bin/')
- bins.each do |bf|
- obf = bf.gsub(/#{strip}/, '')
- install_binfile(bf, obf, target)
- end
-end
-
-def do_libs(libs, strip = 'lib/')
- libs.each do |lf|
- olf = File.join(InstallOptions.site_dir, lf.gsub(/#{strip}/, ''))
- op = File.dirname(olf)
- File.makedirs(op, true)
- File.chmod(0755, op)
- File.install(lf, olf, 0755, true)
- end
-end
-
-##
-# Prepare the file installation.
-#
-def prepare_installation
- InstallOptions.rdoc = true
- if RUBY_PLATFORM == "i386-mswin32"
- InstallOptions.ri = false
- else
- InstallOptions.ri = true
- end
- InstallOptions.tests = true
-
- ARGV.options do |opts|
- opts.banner = "Usage: #{File.basename($0)} [options]"
- opts.separator ""
- opts.on('--[no-]rdoc', 'Prevents the creation of RDoc output.', 'Default on.') do |onrdoc|
- InstallOptions.rdoc = onrdoc
- end
- opts.on('--[no-]ri', 'Prevents the creation of RI output.', 'Default off on mswin32.') do |onri|
- InstallOptions.ri = onri
- end
- opts.on('--[no-]tests', 'Prevents the execution of unit tests.', 'Default on.') do |ontest|
- InstallOptions.tests = ontest
- end
- opts.on('--quick', 'Performs a quick installation. Only the', 'installation is done.') do |quick|
- InstallOptions.rdoc = false
- InstallOptions.ri = false
- InstallOptions.tests = false
- end
- opts.on('--full', 'Performs a full installation. All', 'optional installation steps are run.') do |full|
- InstallOptions.rdoc = true
- InstallOptions.ri = true
- InstallOptions.tests = true
- end
- opts.separator("")
- opts.on_tail('--help', "Shows this help text.") do
- $stderr.puts opts
- exit
- end
-
- opts.parse!
- end
-
- bds = [".", ENV['TMP'], ENV['TEMP']]
-
- version = [Config::CONFIG["MAJOR"], Config::CONFIG["MINOR"]].join(".")
- ld = File.join(Config::CONFIG["libdir"], "ruby", version)
-
- sd = Config::CONFIG["sitelibdir"]
- if sd.nil?
- sd = $:.find { |x| x =~ /site_ruby/ }
- if sd.nil?
- sd = File.join(ld, "site_ruby")
- elsif sd !~ Regexp.quote(version)
- sd = File.join(sd, version)
- end
- end
-
- if (destdir = ENV['DESTDIR'])
- bd = "#{destdir}#{Config::CONFIG['bindir']}"
- sd = "#{destdir}#{sd}"
- bds << bd
-
- FileUtils.makedirs(bd)
- FileUtils.makedirs(sd)
- else
- bds << Config::CONFIG['bindir']
- end
-
- InstallOptions.bin_dirs = bds.compact
- InstallOptions.site_dir = sd
- InstallOptions.bin_dir = bd
- InstallOptions.lib_dir = ld
-end
-
-##
-# Build the rdoc documentation. Also, try to build the RI documentation.
-#
-def build_rdoc(files)
- r = RDoc::RDoc.new
- r.document(["--main", "README", "--title", "Diff::LCS -- A Diff Algorithm",
- "--line-numbers"] + files)
-
-rescue RDoc::RDocError => e
- $stderr.puts e.message
-rescue Exception => e
- $stderr.puts "Couldn't build RDoc documentation\n#{e.message}"
-end
-
-def build_ri(files)
- ri = RDoc::RDoc.new
- ri.document(["--ri-site", "--merge"] + files)
-rescue RDoc::RDocError => e
- $stderr.puts e.message
-rescue Exception => e
- $stderr.puts "Couldn't build Ri documentation\n#{e.message}"
-end
-
-def run_tests(test_list)
- require 'test/unit/ui/console/testrunner'
- $:.unshift "lib"
- test_list.each do |test|
- next if File.directory?(test)
- require test
- end
-
- tests = Test::Unit::TestSuite.new
- ObjectSpace.each_object(Class) { |o| tests << o.suite if o < Test::Unit::TestCase }
-
- Test::Unit::UI::Console::TestRunner.run(tests)
- $:.shift
-end
-
-##
-# Install file(s) from ./bin to Config::CONFIG['bindir']. Patch it on the way
-# to insert a #! line; on a Unix install, the command is named as expected
-# (e.g., bin/rdoc becomes rdoc); the shebang line handles running it. Under
-# windows, we add an '.rb' extension and let file associations do their stuff.
-def install_binfile(from, op_file, target)
- tmp_dir = nil
- InstallOptions.bin_dirs.each do |t|
- if File.directory?(t) and File.writable?(t)
- tmp_dir = t
- break
- end
- end
-
- fail "Cannot find a temporary directory" unless tmp_dir
- tmp_file = File.join(tmp_dir, '_tmp')
- ruby = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
-
- File.open(from) do |ip|
- File.open(tmp_file, "w") do |op|
- ruby = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
- op.puts "#!#{ruby}"
- op.write ip.read
- end
- end
-
- if Config::CONFIG["target_os"] =~ /win/io
- installed_wrapper = false
-
- if File.exists?("#{from}.bat")
- FileUtils.install("#{from}.bat", File.join(target, "#{op_file}.bat"), :mode => 0755, :verbose => true)
- installed_wrapper = true
- end
-
- if File.exists?("#{from}.cmd")
- FileUtils.install("#{from}.cmd", File.join(target, "#{op_file}.cmd"), :mode => 0755, :verbose => true)
- installed_wrapper = true
- end
-
- if not installed_wrapper
- tmp_file2 = File.join(tmp_dir, '_tmp_wrapper')
- cwn = File.join(Config::CONFIG['bindir'], op_file)
- cwv = CMD_WRAPPER.gsub('<ruby>', ruby.gsub(%r{/}) { "\\" }).gsub!('<command>', cwn.gsub(%r{/}) { "\\" } )
-
- File.open(tmp_file2, "wb") { |cw| cw.puts cwv }
- FileUtils.install(tmp_file2, File.join(target, "#{op_file}.bat"), :mode => 0755, :verbose => true)
-
- File.unlink(tmp_file2)
- installed_wrapper = true
- end
- end
- FileUtils.install(tmp_file, File.join(target, op_file), :mode => 0755, :verbose => true)
- File.unlink(tmp_file)
-end
-
-CMD_WRAPPER = <<-EOS
-@echo off
-if "%OS%"=="Windows_NT" goto WinNT
-<ruby> -x "<command>" %1 %2 %3 %4 %5 %6 %7 %8 %9
-goto done
-:WinNT
-<ruby> -x "<command>" %*
-goto done
-:done
-EOS
-
-prepare_installation
-
-run_tests(tests) if InstallOptions.tests
-build_rdoc(rdoc) if InstallOptions.rdoc
-build_ri(ri) if InstallOptions.ri
-do_bins(bins, Config::CONFIG['bindir'])
-do_libs(libs)
diff --git a/minitar/trunk/lib/archive/tar/minitar.rb b/minitar/trunk/lib/archive/tar/minitar.rb
deleted file mode 100644
index 6df28c9..0000000
--- a/minitar/trunk/lib/archive/tar/minitar.rb
+++ /dev/null
@@ -1,979 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Archive::Tar::Minitar 0.5.2
-# Copyright 2004 Mauricio Julio Ferna'ndez Pradier and Austin Ziegler
-#
-# This program is based on and incorporates parts of RPA::Package from
-# rpa-base (lib/rpa/package.rb and lib/rpa/util.rb) by Mauricio and has been
-# adapted to be more generic by Austin.
-#
-# It is licensed under the GNU General Public Licence or Ruby's licence.
-#
-# $Id$
-#++
-
-module Archive; end
-module Archive::Tar; end
-
- # = Archive::Tar::PosixHeader
- # Implements the POSIX tar header as a Ruby class. The structure of
- # the POSIX tar header is:
- #
- # struct tarfile_entry_posix
- # { // pack/unpack
- # char name[100]; // ASCII (+ Z unless filled) a100/Z100
- # char mode[8]; // 0 padded, octal, null a8 /A8
- # char uid[8]; // ditto a8 /A8
- # char gid[8]; // ditto a8 /A8
- # char size[12]; // 0 padded, octal, null a12 /A12
- # char mtime[12]; // 0 padded, octal, null a12 /A12
- # char checksum[8]; // 0 padded, octal, null, space a8 /A8
- # char typeflag[1]; // see below a /a
- # char linkname[100]; // ASCII + (Z unless filled) a100/Z100
- # char magic[6]; // "ustar\0" a6 /A6
- # char version[2]; // "00" a2 /A2
- # char uname[32]; // ASCIIZ a32 /Z32
- # char gname[32]; // ASCIIZ a32 /Z32
- # char devmajor[8]; // 0 padded, octal, null a8 /A8
- # char devminor[8]; // 0 padded, octal, null a8 /A8
- # char prefix[155]; // ASCII (+ Z unless filled) a155/Z155
- # };
- #
- # The +typeflag+ may be one of the following known values:
- #
- # <tt>"0"</tt>:: Regular file. NULL should be treated as a synonym, for
- # compatibility purposes.
- # <tt>"1"</tt>:: Hard link.
- # <tt>"2"</tt>:: Symbolic link.
- # <tt>"3"</tt>:: Character device node.
- # <tt>"4"</tt>:: Block device node.
- # <tt>"5"</tt>:: Directory.
- # <tt>"6"</tt>:: FIFO node.
- # <tt>"7"</tt>:: Reserved.
- #
- # POSIX indicates that "A POSIX-compliant implementation must treat any
- # unrecognized typeflag value as a regular file."
-class Archive::Tar::PosixHeader
- FIELDS = %w(name mode uid gid size mtime checksum typeflag linkname) +
- %w(magic version uname gname devmajor devminor prefix)
-
- FIELDS.each { |field| attr_reader field.intern }
-
- HEADER_PACK_FORMAT = "a100a8a8a8a12a12a7aaa100a6a2a32a32a8a8a155"
- HEADER_UNPACK_FORMAT = "Z100A8A8A8A12A12A8aZ100A6A2Z32Z32A8A8Z155"
-
- # Creates a new PosixHeader from a data stream.
- def self.new_from_stream(stream)
- data = stream.read(512)
- fields = data.unpack(HEADER_UNPACK_FORMAT)
- name = fields.shift
- mode = fields.shift.oct
- uid = fields.shift.oct
- gid = fields.shift.oct
- size = fields.shift.oct
- mtime = fields.shift.oct
- checksum = fields.shift.oct
- typeflag = fields.shift
- linkname = fields.shift
- magic = fields.shift
- version = fields.shift.oct
- uname = fields.shift
- gname = fields.shift
- devmajor = fields.shift.oct
- devminor = fields.shift.oct
- prefix = fields.shift
-
- empty = (data == "\0" * 512)
-
- new(:name => name, :mode => mode, :uid => uid, :gid => gid,
- :size => size, :mtime => mtime, :checksum => checksum,
- :typeflag => typeflag, :magic => magic, :version => version,
- :uname => uname, :gname => gname, :devmajor => devmajor,
- :devminor => devminor, :prefix => prefix, :empty => empty)
- end
-
- # Creates a new PosixHeader. A PosixHeader cannot be created unless the
- # #name, #size, #prefix, and #mode are provided.
- def initialize(vals)
- unless vals[:name] && vals[:size] && vals[:prefix] && vals[:mode]
- raise ArgumentError
- end
-
- vals[:mtime] ||= 0
- vals[:checksum] ||= ""
- vals[:typeflag] ||= "0"
- vals[:magic] ||= "ustar"
- vals[:version] ||= "00"
-
- FIELDS.each do |field|
- instance_variable_set("@#{field}", vals[field.intern])
- end
- @empty = vals[:empty]
- end
-
- def empty?
- @empty
- end
-
- def to_s
- update_checksum
- header(@checksum)
- end
-
- # Update the checksum field.
- def update_checksum
- hh = header(" " * 8)
- @checksum = oct(calculate_checksum(hh), 6)
- end
-
- private
- def oct(num, len)
- if num.nil?
- "\0" * (len + 1)
- else
- "%0#{len}o" % num
- end
- end
-
- def calculate_checksum(hdr)
- hdr.unpack("C*").inject { |aa, bb| aa + bb }
- end
-
- def header(chksum)
- arr = [name, oct(mode, 7), oct(uid, 7), oct(gid, 7), oct(size, 11),
- oct(mtime, 11), chksum, " ", typeflag, linkname, magic, version,
- uname, gname, oct(devmajor, 7), oct(devminor, 7), prefix]
- str = arr.pack(HEADER_PACK_FORMAT)
- str + "\0" * ((512 - str.size) % 512)
- end
-end
-
-require 'fileutils'
-require 'find'
-
- # = Archive::Tar::Minitar 0.5.2
- # Archive::Tar::Minitar is a pure-Ruby library and command-line
- # utility that provides the ability to deal with POSIX tar(1) archive
- # files. The implementation is based heavily on Mauricio Ferna'ndez's
- # implementation in rpa-base, but has been reorganised to promote
- # reuse in other projects.
- #
- # This tar class performs a subset of all tar (POSIX tape archive)
- # operations. We can only deal with typeflags 0, 1, 2, and 5 (see
- # Archive::Tar::PosixHeader). All other typeflags will be treated as
- # normal files.
- #
- # NOTE::: support for typeflags 1 and 2 is not yet implemented in this
- # version.
- #
- # This release is version 0.5.2. The library can only handle files and
- # directories at this point. A future version will be expanded to
- # handle symbolic links and hard links in a portable manner. The
- # command line utility, minitar, can only create archives, extract
- # from archives, and list archive contents.
- #
- # == Synopsis
- # Using this library is easy. The simplest case is:
- #
- # require 'zlib'
- # require 'archive/tar/minitar'
- # include Archive::Tar
- #
- # # Packs everything that matches Find.find('tests')
- # File.open('test.tar', 'wb') { |tar| Minitar.pack('tests', tar) }
- # # Unpacks 'test.tar' to 'x', creating 'x' if necessary.
- # Minitar.unpack('test.tar', 'x')
- #
- # A gzipped tar can be written with:
- #
- # tgz = Zlib::GzipWriter.new(File.open('test.tgz', 'wb'))
- # # Warning: tgz will be closed!
- # Minitar.pack('tests', tgz)
- #
- # tgz = Zlib::GzipReader.new(File.open('test.tgz', 'rb'))
- # # Warning: tgz will be closed!
- # Minitar.unpack(tgz, 'x')
- #
- # As the case above shows, one need not write to a file. However, it
- # will sometimes require that one dive a little deeper into the API,
- # as in the case of StringIO objects. Note that I'm not providing a
- # block with Minitar::Output, as Minitar::Output#close automatically
- # closes both the Output object and the wrapped data stream object.
- #
- # begin
- # sgz = Zlib::GzipWriter.new(StringIO.new(""))
- # tar = Output.new(sgz)
- # Find.find('tests') do |entry|
- # Minitar.pack_file(entry, tar)
- # end
- # ensure
- # # Closes both tar and sgz.
- # tar.close
- # end
- #
- # == Copyright
- # Copyright 2004 Mauricio Julio Ferna'ndez Pradier and Austin Ziegler
- #
- # This program is based on and incorporates parts of RPA::Package from
- # rpa-base (lib/rpa/package.rb and lib/rpa/util.rb) by Mauricio and
- # has been adapted to be more generic by Austin.
- #
- # 'minitar' contains an adaptation of Ruby/ProgressBar by Satoru
- # Takabayashi <satoru@namazu.org>, copyright 2001 - 2004.
- #
- # This program is free software. It may be redistributed and/or
- # modified under the terms of the GPL version 2 (or later) or Ruby's
- # licence.
-module Archive::Tar::Minitar
- VERSION = "0.5.2"
-
- # The exception raised when a wrapped data stream class is expected to
- # respond to #rewind or #pos but does not.
- class NonSeekableStream < StandardError; end
- # The exception raised when a block is required for proper operation of
- # the method.
- class BlockRequired < ArgumentError; end
- # The exception raised when operations are performed on a stream that has
- # previously been closed.
- class ClosedStream < StandardError; end
- # The exception raised when a filename exceeds 256 bytes in length,
- # the maximum supported by the standard Tar format.
- class FileNameTooLong < StandardError; end
- # The exception raised when a data stream ends before the amount of data
- # expected in the archive's PosixHeader.
- class UnexpectedEOF < StandardError; end
-
- # The class that writes a tar format archive to a data stream.
- class Writer
- # A stream wrapper that can only be written to. Any attempt to read
- # from this restricted stream will result in a NameError being thrown.
- class RestrictedStream
- def initialize(anIO)
- @io = anIO
- end
-
- def write(data)
- @io.write(data)
- end
- end
-
- # A RestrictedStream that also has a size limit.
- class BoundedStream < Archive::Tar::Minitar::Writer::RestrictedStream
- # The exception raised when the user attempts to write more data to
- # a BoundedStream than has been allocated.
- class FileOverflow < RuntimeError; end
-
- # The maximum number of bytes that may be written to this data
- # stream.
- attr_reader :limit
- # The current total number of bytes written to this data stream.
- attr_reader :written
-
- def initialize(io, limit)
- @io = io
- @limit = limit
- @written = 0
- end
-
- def write(data)
- raise FileOverflow if (data.size + @written) > @limit
- @io.write(data)
- @written += data.size
- data.size
- end
- end
-
- # With no associated block, +Writer::open+ is a synonym for
- # +Writer::new+. If the optional code block is given, it will be
- # passed the new _writer_ as an argument and the Writer object will
- # automatically be closed when the block terminates. In this instance,
- # +Writer::open+ returns the value of the block.
- def self.open(anIO)
- writer = Writer.new(anIO)
-
- return writer unless block_given?
-
- begin
- res = yield writer
- ensure
- writer.close
- end
-
- res
- end
-
- # Creates and returns a new Writer object.
- def initialize(anIO)
- @io = anIO
- @closed = false
- end
-
- # Adds a file to the archive as +name+. +opts+ must contain the
- # following values:
- #
- # <tt>:mode</tt>:: The Unix file permissions mode value.
- # <tt>:size</tt>:: The size, in bytes.
- #
- # +opts+ may contain the following values:
- #
- # <tt>:uid</tt>: The Unix file owner user ID number.
- # <tt>:gid</tt>: The Unix file owner group ID number.
- # <tt>:mtime</tt>:: The *integer* modification time value.
- #
- # It will not be possible to add more than <tt>opts[:size]</tt> bytes
- # to the file.
- def add_file_simple(name, opts = {}) # :yields BoundedStream:
- raise Archive::Tar::Minitar::BlockRequired unless block_given?
- raise Archive::Tar::ClosedStream if @closed
-
- name, prefix = split_name(name)
-
- header = { :name => name, :mode => opts[:mode], :mtime => opts[:mtime],
- :size => opts[:size], :gid => opts[:gid], :uid => opts[:uid],
- :prefix => prefix }
- header = Archive::Tar::PosixHeader.new(header).to_s
- @io.write(header)
-
- os = BoundedStream.new(@io, opts[:size])
- yield os
- # FIXME: what if an exception is raised in the block?
-
- min_padding = opts[:size] - os.written
- @io.write("\0" * min_padding)
- remainder = (512 - (opts[:size] % 512)) % 512
- @io.write("\0" * remainder)
- end
-
- # Adds a file to the archive as +name+. +opts+ must contain the
- # following value:
- #
- # <tt>:mode</tt>:: The Unix file permissions mode value.
- #
- # +opts+ may contain the following values:
- #
- # <tt>:uid</tt>: The Unix file owner user ID number.
- # <tt>:gid</tt>: The Unix file owner group ID number.
- # <tt>:mtime</tt>:: The *integer* modification time value.
- #
- # The file's size will be determined from the amount of data written
- # to the stream.
- #
- # For #add_file to be used, the Archive::Tar::Minitar::Writer must be
- # wrapping a stream object that is seekable (e.g., it responds to
- # #pos=). Otherwise, #add_file_simple must be used.
- #
- # +opts+ may be modified during the writing to the stream.
- def add_file(name, opts = {}) # :yields RestrictedStream, +opts+:
- raise Archive::Tar::Minitar::BlockRequired unless block_given?
- raise Archive::Tar::Minitar::ClosedStream if @closed
- raise Archive::Tar::Minitar::NonSeekableStream unless @io.respond_to?(:pos=)
-
- name, prefix = split_name(name)
- init_pos = @io.pos
- @io.write("\0" * 512) # placeholder for the header
-
- yield RestrictedStream.new(@io), opts
- # FIXME: what if an exception is raised in the block?
-
- size = @io.pos - (init_pos + 512)
- remainder = (512 - (size % 512)) % 512
- @io.write("\0" * remainder)
-
- final_pos = @io.pos
- @io.pos = init_pos
-
- header = { :name => name, :mode => opts[:mode], :mtime => opts[:mtime],
- :size => size, :gid => opts[:gid], :uid => opts[:uid],
- :prefix => prefix }
- header = Archive::Tar::PosixHeader.new(header).to_s
- @io.write(header)
- @io.pos = final_pos
- end
-
- # Creates a directory in the tar.
- def mkdir(name, opts = {})
- raise ClosedStream if @closed
- name, prefix = split_name(name)
- header = { :name => name, :mode => opts[:mode], :typeflag => "5",
- :size => 0, :gid => opts[:gid], :uid => opts[:uid],
- :mtime => opts[:mtime], :prefix => prefix }
- header = Archive::Tar::PosixHeader.new(header).to_s
- @io.write(header)
- nil
- end
-
- # Passes the #flush method to the wrapped stream, used for buffered
- # streams.
- def flush
- raise ClosedStream if @closed
- @io.flush if @io.respond_to?(:flush)
- end
-
- # Closes the Writer.
- def close
- return if @closed
- @io.write("\0" * 1024)
- @closed = true
- end
-
- private
- def split_name(name)
- raise FileNameTooLong if name.size > 256
- if name.size <= 100
- prefix = ""
- else
- parts = name.split(/\//)
- newname = parts.pop
-
- nxt = ""
-
- loop do
- nxt = parts.pop
- break if newname.size + 1 + nxt.size > 100
- newname = "#{nxt}/#{newname}"
- end
-
- prefix = (parts + [nxt]).join("/")
-
- name = newname
-
- raise FileNameTooLong if name.size > 100 || prefix.size > 155
- end
- return name, prefix
- end
- end
-
- # The class that reads a tar format archive from a data stream. The data
- # stream may be sequential or random access, but certain features only work
- # with random access data streams.
- class Reader
- # This marks the EntryStream closed for reading without closing the
- # actual data stream.
- module InvalidEntryStream
- def read(len = nil); raise ClosedStream; end
- def getc; raise ClosedStream; end
- def rewind; raise ClosedStream; end
- end
-
- # EntryStreams are pseudo-streams on top of the main data stream.
- class EntryStream
- Archive::Tar::PosixHeader::FIELDS.each do |field|
- attr_reader field.intern
- end
-
- def initialize(header, anIO)
- @io = anIO
- @name = header.name
- @mode = header.mode
- @uid = header.uid
- @gid = header.gid
- @size = header.size
- @mtime = header.mtime
- @checksum = header.checksum
- @typeflag = header.typeflag
- @linkname = header.linkname
- @magic = header.magic
- @version = header.version
- @uname = header.uname
- @gname = header.gname
- @devmajor = header.devmajor
- @devminor = header.devminor
- @prefix = header.prefix
- @read = 0
- @orig_pos = @io.pos
- end
-
- # Reads +len+ bytes (or all remaining data) from the entry. Returns
- # +nil+ if there is no more data to read.
- def read(len = nil)
- return nil if @read >= @size
- len ||= @size - @read
- max_read = [len, @size - @read].min
- ret = @io.read(max_read)
- @read += ret.size
- ret
- end
-
- # Reads one byte from the entry. Returns +nil+ if there is no more data
- # to read.
- def getc
- return nil if @read >= @size
- ret = @io.getc
- @read += 1 if ret
- ret
- end
-
- # Returns +true+ if the entry represents a directory.
- def directory?
- @typeflag == "5"
- end
- alias_method :directory, :directory?
-
- # Returns +true+ if the entry represents a plain file.
- def file?
- @typeflag == "0"
- end
- alias_method :file, :file?
-
- # Returns +true+ if the current read pointer is at the end of the
- # EntryStream data.
- def eof?
- @read >= @size
- end
-
- # Returns the current read pointer in the EntryStream.
- def pos
- @read
- end
-
- # Sets the current read pointer to the beginning of the EntryStream.
- def rewind
- raise NonSeekableStream unless @io.respond_to?(:pos=)
- @io.pos = @orig_pos
- @read = 0
- end
-
- def bytes_read
- @read
- end
-
- # Returns the full and proper name of the entry.
- def full_name
- if @prefix != ""
- File.join(@prefix, @name)
- else
- @name
- end
- end
-
- # Closes the entry.
- def close
- invalidate
- end
-
- private
- def invalidate
- extend InvalidEntryStream
- end
- end
-
- # With no associated block, +Reader::open+ is a synonym for
- # +Reader::new+. If the optional code block is given, it will be passed
- # the new _writer_ as an argument and the Reader object will
- # automatically be closed when the block terminates. In this instance,
- # +Reader::open+ returns the value of the block.
- def self.open(anIO)
- reader = Reader.new(anIO)
-
- return reader unless block_given?
-
- begin
- res = yield reader
- ensure
- reader.close
- end
-
- res
- end
-
- # Creates and returns a new Reader object.
- def initialize(anIO)
- @io = anIO
- @init_pos = anIO.pos
- end
-
- # Iterates through each entry in the data stream.
- def each(&block)
- each_entry(&block)
- end
-
- # Resets the read pointer to the beginning of data stream. Do not call
- # this during a #each or #each_entry iteration. This only works with
- # random access data streams that respond to #rewind and #pos.
- def rewind
- if @init_pos == 0
- raise NonSeekableStream unless @io.respond_to?(:rewind)
- @io.rewind
- else
- raise NonSeekableStream unless @io.respond_to?(:pos=)
- @io.pos = @init_pos
- end
- end
-
- # Iterates through each entry in the data stream.
- def each_entry
- loop do
- return if @io.eof?
-
- header = Archive::Tar::PosixHeader.new_from_stream(@io)
- return if header.empty?
-
- entry = EntryStream.new(header, @io)
- size = entry.size
-
- yield entry
-
- skip = (512 - (size % 512)) % 512
-
- if @io.respond_to?(:seek)
- # avoid reading...
- @io.seek(size - entry.bytes_read, IO::SEEK_CUR)
- else
- pending = size - entry.bytes_read
- while pending > 0
- bread = @io.read([pending, 4096].min).size
- raise UnexpectedEOF if @io.eof?
- pending -= bread
- end
- end
- @io.read(skip) # discard trailing zeros
- # make sure nobody can use #read, #getc or #rewind anymore
- entry.close
- end
- end
-
- def close
- end
- end
-
- # Wraps a Archive::Tar::Minitar::Reader with convenience methods and
- # wrapped stream management; Input only works with random access data
- # streams. See Input::new for details.
- class Input
- include Enumerable
-
- # With no associated block, +Input::open+ is a synonym for
- # +Input::new+. If the optional code block is given, it will be passed
- # the new _writer_ as an argument and the Input object will
- # automatically be closed when the block terminates. In this instance,
- # +Input::open+ returns the value of the block.
- def self.open(input)
- stream = Input.new(input)
- return stream unless block_given?
-
- begin
- res = yield stream
- ensure
- stream.close
- end
-
- res
- end
-
- # Creates a new Input object. If +input+ is a stream object that responds
- # to #read), then it will simply be wrapped. Otherwise, one will be
- # created and opened using Kernel#open. When Input#close is called, the
- # stream object wrapped will be closed.
- def initialize(input)
- if input.respond_to?(:read)
- @io = input
- else
- @io = open(input, "rb")
- end
- @tarreader = Archive::Tar::Minitar::Reader.new(@io)
- end
-
- # Iterates through each entry and rewinds to the beginning of the stream
- # when finished.
- def each(&block)
- @tarreader.each { |entry| yield entry }
- ensure
- @tarreader.rewind
- end
-
- # Extracts the current +entry+ to +destdir+. If a block is provided, it
- # yields an +action+ Symbol, the full name of the file being extracted
- # (+name+), and a Hash of statistical information (+stats+).
- #
- # The +action+ will be one of:
- # <tt>:dir</tt>:: The +entry+ is a directory.
- # <tt>:file_start</tt>:: The +entry+ is a file; the extract of the
- # file is just beginning.
- # <tt>:file_progress</tt>:: Yielded every 4096 bytes during the extract
- # of the +entry+.
- # <tt>:file_done</tt>:: Yielded when the +entry+ is completed.
- #
- # The +stats+ hash contains the following keys:
- # <tt>:current</tt>:: The current total number of bytes read in the
- # +entry+.
- # <tt>:currinc</tt>:: The current number of bytes read in this read
- # cycle.
- # <tt>:entry</tt>:: The entry being extracted; this is a
- # Reader::EntryStream, with all methods thereof.
- def extract_entry(destdir, entry) # :yields action, name, stats:
- stats = {
- :current => 0,
- :currinc => 0,
- :entry => entry
- }
-
- if entry.directory?
- dest = File.join(destdir, entry.full_name)
-
- yield :dir, entry.full_name, stats if block_given?
-
- if Archive::Tar::Minitar.dir?(dest)
- begin
- FileUtils.chmod(entry.mode, dest)
- rescue Exception
- nil
- end
- else
- FileUtils.mkdir_p(dest, :mode => entry.mode)
- FileUtils.chmod(entry.mode, dest)
- end
-
- fsync_dir(dest)
- fsync_dir(File.join(dest, ".."))
- return
- else # it's a file
- destdir = File.join(destdir, File.dirname(entry.full_name))
- FileUtils.mkdir_p(destdir, :mode => 0755)
-
- destfile = File.join(destdir, File.basename(entry.full_name))
- FileUtils.chmod(0600, destfile) rescue nil # Errno::ENOENT
-
- yield :file_start, entry.full_name, stats if block_given?
-
- File.open(destfile, "wb", entry.mode) do |os|
- loop do
- data = entry.read(4096)
- break unless data
-
- stats[:currinc] = os.write(data)
- stats[:current] += stats[:currinc]
-
- yield :file_progress, entry.full_name, stats if block_given?
- end
- os.fsync
- end
-
- FileUtils.chmod(entry.mode, destfile)
- fsync_dir(File.dirname(destfile))
- fsync_dir(File.join(File.dirname(destfile), ".."))
-
- yield :file_done, entry.full_name, stats if block_given?
- end
- end
-
- # Returns the Reader object for direct access.
- def tar
- @tarreader
- end
-
- # Closes the Reader object and the wrapped data stream.
- def close
- @io.close
- @tarreader.close
- end
-
- private
- def fsync_dir(dirname)
- # make sure this hits the disc
- dir = open(dirname, 'rb')
- dir.fsync
- rescue # ignore IOError if it's an unpatched (old) Ruby
- nil
- ensure
- dir.close if dir rescue nil
- end
- end
-
- # Wraps a Archive::Tar::Minitar::Writer with convenience methods and
- # wrapped stream management; Output only works with random access data
- # streams. See Output::new for details.
- class Output
- # With no associated block, +Output::open+ is a synonym for
- # +Output::new+. If the optional code block is given, it will be passed
- # the new _writer_ as an argument and the Output object will
- # automatically be closed when the block terminates. In this instance,
- # +Output::open+ returns the value of the block.
- def self.open(output)
- stream = Output.new(output)
- return stream unless block_given?
-
- begin
- res = yield stream
- ensure
- stream.close
- end
-
- res
- end
-
- # Creates a new Output object. If +output+ is a stream object that
- # responds to #read), then it will simply be wrapped. Otherwise, one will
- # be created and opened using Kernel#open. When Output#close is called,
- # the stream object wrapped will be closed.
- def initialize(output)
- if output.respond_to?(:write)
- @io = output
- else
- @io = ::File.open(output, "wb")
- end
- @tarwriter = Archive::Tar::Minitar::Writer.new(@io)
- end
-
- # Returns the Writer object for direct access.
- def tar
- @tarwriter
- end
-
- # Closes the Writer object and the wrapped data stream.
- def close
- @tarwriter.close
- @io.close
- end
- end
-
- class << self
- # Tests if +path+ refers to a directory. Fixes an apparently
- # corrupted <tt>stat()</tt> call on Windows.
- def dir?(path)
- File.directory?((path[-1] == ?/) ? path : "#{path}/")
- end
-
- # A convenience method for wrapping Archive::Tar::Minitar::Input.open
- # (mode +r+) and Archive::Tar::Minitar::Output.open (mode +w+). No other
- # modes are currently supported.
- def open(dest, mode = "r", &block)
- case mode
- when "r"
- Input.open(dest, &block)
- when "w"
- Output.open(dest, &block)
- else
- raise "Unknown open mode for Archive::Tar::Minitar.open."
- end
- end
-
- # A convenience method to packs the file provided. +entry+ may either be
- # a filename (in which case various values for the file (see below) will
- # be obtained from <tt>File#stat(entry)</tt> or a Hash with the fields:
- #
- # <tt>:name</tt>:: The filename to be packed into the tarchive.
- # *REQUIRED*.
- # <tt>:mode</tt>:: The mode to be applied.
- # <tt>:uid</tt>:: The user owner of the file. (Ignored on Windows.)
- # <tt>:gid</tt>:: The group owner of the file. (Ignored on Windows.)
- # <tt>:mtime</tt>:: The modification Time of the file.
- #
- # During packing, if a block is provided, #pack_file yields an +action+
- # Symol, the full name of the file being packed, and a Hash of
- # statistical information, just as with
- # Archive::Tar::Minitar::Input#extract_entry.
- #
- # The +action+ will be one of:
- # <tt>:dir</tt>:: The +entry+ is a directory.
- # <tt>:file_start</tt>:: The +entry+ is a file; the extract of the
- # file is just beginning.
- # <tt>:file_progress</tt>:: Yielded every 4096 bytes during the extract
- # of the +entry+.
- # <tt>:file_done</tt>:: Yielded when the +entry+ is completed.
- #
- # The +stats+ hash contains the following keys:
- # <tt>:current</tt>:: The current total number of bytes read in the
- # +entry+.
- # <tt>:currinc</tt>:: The current number of bytes read in this read
- # cycle.
- # <tt>:name</tt>:: The filename to be packed into the tarchive.
- # *REQUIRED*.
- # <tt>:mode</tt>:: The mode to be applied.
- # <tt>:uid</tt>:: The user owner of the file. (+nil+ on Windows.)
- # <tt>:gid</tt>:: The group owner of the file. (+nil+ on Windows.)
- # <tt>:mtime</tt>:: The modification Time of the file.
- def pack_file(entry, outputter) #:yields action, name, stats:
- outputter = outputter.tar if outputter.kind_of?(Archive::Tar::Minitar::Output)
-
- stats = {}
-
- if entry.kind_of?(Hash)
- name = entry[:name]
-
- entry.each { |kk, vv| stats[kk] = vv unless vv.nil? }
- else
- name = entry
- end
-
- name = name.sub(%r{\./}, '')
- stat = File.stat(name)
- stats[:mode] ||= stat.mode
- stats[:mtime] ||= stat.mtime
- stats[:size] = stat.size
-
- if RUBY_PLATFORM =~ /win32/
- stats[:uid] = nil
- stats[:gid] = nil
- else
- stats[:uid] ||= stat.uid
- stats[:gid] ||= stat.gid
- end
-
- case
- when File.file?(name)
- outputter.add_file_simple(name, stats) do |os|
- stats[:current] = 0
- yield :file_start, name, stats if block_given?
- File.open(name, "rb") do |ff|
- until ff.eof?
- stats[:currinc] = os.write(ff.read(4096))
- stats[:current] += stats[:currinc]
- yield :file_progress, name, stats if block_given?
- end
- end
- yield :file_done, name, stats if block_given?
- end
- when dir?(name)
- yield :dir, name, stats if block_given?
- outputter.mkdir(name, stats)
- else
- raise "Don't yet know how to pack this type of file."
- end
- end
-
- # A convenience method to pack files specified by +src+ into +dest+. If
- # +src+ is an Array, then each file detailed therein will be packed into
- # the resulting Archive::Tar::Minitar::Output stream; if +recurse_dirs+
- # is true, then directories will be recursed.
- #
- # If +src+ is an Array, it will be treated as the argument to Find.find;
- # all files matching will be packed.
- def pack(src, dest, recurse_dirs = true, &block)
- Output.open(dest) do |outp|
- if src.kind_of?(Array)
- src.each do |entry|
- pack_file(entry, outp, &block)
- if dir?(entry) and recurse_dirs
- Dir["#{entry}/**/**"].each do |ee|
- pack_file(ee, outp, &block)
- end
- end
- end
- else
- Find.find(src) do |entry|
- pack_file(entry, outp, &block)
- end
- end
- end
- end
-
- # A convenience method to unpack files from +src+ into the directory
- # specified by +dest+. Only those files named explicitly in +files+
- # will be extracted.
- def unpack(src, dest, files = [], &block)
- Input.open(src) do |inp|
- if File.exist?(dest) and (not dir?(dest))
- raise "Can't unpack to a non-directory."
- elsif not File.exist?(dest)
- FileUtils.mkdir_p(dest)
- end
-
- inp.each do |entry|
- if files.empty? or files.include?(entry.full_name)
- inp.extract_entry(dest, entry, &block)
- end
- end
- end
- end
- end
-end
diff --git a/minitar/trunk/lib/archive/tar/minitar/command.rb b/minitar/trunk/lib/archive/tar/minitar/command.rb
deleted file mode 100644
index fa20092..0000000
--- a/minitar/trunk/lib/archive/tar/minitar/command.rb
+++ /dev/null
@@ -1,814 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Archive::Tar::Baby 0.5.2
-# Copyright 2004 Mauricio Julio Ferna'ndez Pradier and Austin Ziegler
-# This is free software with ABSOLUTELY NO WARRANTY.
-#
-# This program is based on and incorporates parts of RPA::Package from
-# rpa-base (lib/rpa/package.rb and lib/rpa/util.rb) by Mauricio and has been
-# adapted to be more generic by Austin.
-#
-# This file contains an adaptation of Ruby/ProgressBar by Satoru
-# Takabayashi <satoru@namazu.org>, copyright 2001 - 2004.
-#
-# It is licensed under the GNU General Public Licence or Ruby's licence.
-#
-# $Id$
-#++
-
-require 'zlib'
-
-# TODO: add
-# TODO: delete ???
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-
-module Archive::Tar::Minitar::Command
- class ProgressBar
- VERSION = "0.8"
-
- attr_accessor :total
- attr_accessor :title
-
- def initialize (title, total, out = STDERR)
- @title = title
- @total = total
- @out = out
- @bar_width = 80
- @bar_mark = "o"
- @current = 0
- @previous = 0
- @is_finished = false
- @start_time = Time.now
- @previous_time = @start_time
- @title_width = 14
- @format = "%-#{@title_width}s %3d%% %s %s"
- @format_arguments = [:title, :percentage, :bar, :stat]
- show
- end
-
- private
- def convert_bytes (bytes)
- if bytes < 1024
- sprintf("%6dB", bytes)
- elsif bytes < 1024 * 1000 # 1000kb
- sprintf("%5.1fKB", bytes.to_f / 1024)
- elsif bytes < 1024 * 1024 * 1000 # 1000mb
- sprintf("%5.1fMB", bytes.to_f / 1024 / 1024)
- else
- sprintf("%5.1fGB", bytes.to_f / 1024 / 1024 / 1024)
- end
- end
-
- def transfer_rate
- bytes_per_second = @current.to_f / (Time.now - @start_time)
- sprintf("%s/s", convert_bytes(bytes_per_second))
- end
-
- def bytes
- convert_bytes(@current)
- end
-
- def format_time (t)
- t = t.to_i
- sec = t % 60
- min = (t / 60) % 60
- hour = t / 3600
- sprintf("%02d:%02d:%02d", hour, min, sec);
- end
-
- # ETA stands for Estimated Time of Arrival.
- def eta
- if @current == 0
- "ETA: --:--:--"
- else
- elapsed = Time.now - @start_time
- eta = elapsed * @total / @current - elapsed;
- sprintf("ETA: %s", format_time(eta))
- end
- end
-
- def elapsed
- elapsed = Time.now - @start_time
- sprintf("Time: %s", format_time(elapsed))
- end
-
- def stat
- if @is_finished then elapsed else eta end
- end
-
- def stat_for_file_transfer
- if @is_finished then
- sprintf("%s %s %s", bytes, transfer_rate, elapsed)
- else
- sprintf("%s %s %s", bytes, transfer_rate, eta)
- end
- end
-
- def eol
- if @is_finished then "\n" else "\r" end
- end
-
- def bar
- len = percentage * @bar_width / 100
- sprintf("|%s%s|", @bar_mark * len, " " * (@bar_width - len))
- end
-
- def percentage(value = nil)
- if @total.zero?
- 100
- else
- (value || @current) * 100 / @total
- end
- end
-
- def title
- @title[0,(@title_width - 1)] + ":"
- end
-
- def get_width
- # FIXME: I don't know how portable it is.
- default_width = 80
- # begin
- # tiocgwinsz = 0x5413
- # data = [0, 0, 0, 0].pack("SSSS")
- # if @out.ioctl(tiocgwinsz, data) >= 0 then
- # rows, cols, xpixels, ypixels = data.unpack("SSSS")
- # if cols >= 0 then cols else default_width end
- # else
- # default_width
- # end
- # rescue Exception
- # default_width
- # end
- end
-
- def show
- arguments = @format_arguments.map {|method| send(method) }
- line = sprintf(@format, *arguments)
-
- width = get_width
- if line.length == width - 1
- @out.print(line + eol)
- elsif line.length >= width
- @bar_width = [@bar_width - (line.length - width + 1), 0].max
- if @bar_width == 0 then @out.print(line + eol) else show end
- else # line.length < width - 1
- @bar_width += width - line.length + 1
- show
- end
- @previous_time = Time.now
- end
-
- def show_progress
- if @total.zero?
- cur_percentage = 100
- prev_percentage = 0
- else
- cur_percentage = (@current * 100 / @total).to_i
- prev_percentage = (@previous * 100 / @total).to_i
- end
-
- if cur_percentage > prev_percentage ||
- Time.now - @previous_time >= 1 ||
- @is_finished
- show
- end
- end
-
- public
- def file_transfer_mode
- @format_arguments = [:title, :percentage, :bar, :stat_for_file_transfer]
- end
-
- def format= (format)
- @format = format
- end
-
- def format_arguments= (arguments)
- @format_arguments = arguments
- end
-
- def finish
- @current = @total
- @is_finished = true
- show_progress
- end
-
- def halt
- @is_finished = true
- show_progress
- end
-
- def set (count)
- if count < 0 || count > @total
- raise "invalid count: #{count} (total: #{@total})"
- end
- @current = count
- show_progress
- @previous = @current
- end
-
- def inc (step = 1)
- @current += step
- @current = @total if @current > @total
- show_progress
- @previous = @current
- end
-
- def inspect
- "(ProgressBar: #{@current}/#{@total})"
- end
- end
-
- class CommandPattern
- class AbstractCommandError < Exception; end
- class UnknownCommandError < RuntimeError; end
- class CommandAlreadyExists < RuntimeError; end
-
- class << self
- def add(command)
- command = command.new if command.kind_of?(Class)
-
- @commands ||= {}
- if @commands.has_key?(command.name)
- raise CommandAlreadyExists
- else
- @commands[command.name] = command
- end
-
- if command.respond_to?(:altname)
- unless @commands.has_key?(command.altname)
- @commands[command.altname] = command
- end
- end
- end
-
- def <<(command)
- add(command)
- end
-
- attr_accessor :default
- def default=(command) #:nodoc:
- if command.kind_of?(CommandPattern)
- @default = command
- elsif command.kind_of?(Class)
- @default = command.new
- elsif @commands.has_key?(command)
- @default = @commands[command]
- else
- raise UnknownCommandError
- end
- end
-
- def command?(command)
- @commands.has_key?(command)
- end
-
- def command(command)
- if command?(command)
- @commands[command]
- else
- @default
- end
- end
-
- def [](cmd)
- self.command(cmd)
- end
-
- def default_ioe(ioe = {})
- ioe[:input] ||= $stdin
- ioe[:output] ||= $stdout
- ioe[:error] ||= $stderr
- ioe
- end
- end
-
- def [](args, opts = {}, ioe = {})
- call(args, opts, ioe)
- end
-
- def name
- raise AbstractCommandError
- end
-
- def call(args, opts = {}, ioe = {})
- raise AbstractCommandError
- end
-
- def help
- raise AbstractCommandError
- end
- end
-
- class CommandHelp < CommandPattern
- def name
- "help"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = CommandPattern.default_ioe(ioe)
-
- help_on = args.shift
-
- if CommandPattern.command?(help_on)
- ioe[:output] << CommandPattern[help_on].help
- elsif help_on == "commands"
- ioe[:output] << <<-EOH
-The commands known to minitar are:
-
- minitar create Creates a new tarfile.
- minitar extract Extracts files from a tarfile.
- minitar list Lists files in the tarfile.
-
-All commands accept the options --verbose and --progress, which are
-mutually exclusive. In "minitar list", --progress means the same as
---verbose.
-
- --verbose, -V Performs the requested command verbosely.
- --progress, -P Shows a progress bar, if appropriate, for the action
- being performed.
-
- EOH
- else
- ioe[:output] << "Unknown command: #{help_on}\n" unless help_on.nil? or help_on.empty?
- ioe[:output] << self.help
- end
-
- 0
- end
-
- def help
- help = <<-EOH
-This is a basic help message containing pointers to more information on
-how to use this command-line tool. Try:
-
- minitar help commands list all 'minitar' commands
- minitar help <COMMAND> show help on <COMMAND>
- (e.g., 'minitar help create')
- EOH
- end
-# minitar add Adds a file to an existing tarfile.
-# minitar delete Deletes a file from an existing tarfile.
- end
-
- class CommandCreate < CommandPattern
- def name
- "create"
- end
-
- def altname
- "cr"
- end
-
- def call(args, opts = {}, ioe = {})
- argv = []
-
- while (arg = args.shift)
- case arg
- when '--compress', '-z'
- opts[:compress] = true
- else
- argv << arg
- end
- end
-
- if argv.size < 2
- ioe[:output] << "Not enough arguments.\n\n"
- CommandPattern["help"][["create"]]
- return 255
- end
-
- output = argv.shift
- if '-' == output
- opts[:name] = "STDOUT"
- output = ioe[:output]
- opts[:output] = ioe[:error]
- else
- opts[:name] = output
- output = File.open(output, "wb")
- opts[:output] = ioe[:output]
- end
-
- if opts[:name] =~ /\.tar\.gz$|\.tgz$/ or opts[:compress]
- output = Zlib::GzipWriter.new(output)
- end
-
- files = []
- if argv.include?("--")
- # Read stdin for the list of files.
- files = ""
- files << ioe[:input].read while not ioe[:input].eof?
- files = files.split(/\r\n|\n|\r/)
- args.delete("--")
- end
-
- files << argv.to_a
- files.flatten!
-
- if opts[:verbose]
- watcher = lambda do |action, name, stats|
- opts[:output] << "#{name}\n" if action == :dir or action == :file_done
- end
- finisher = lambda { opts[:output] << "\n" }
- elsif opts[:progress]
- progress = ProgressBar.new(opts[:name], 1)
- watcher = lambda do |action, name, stats|
- case action
- when :file_start, :dir
- progress.title = File.basename(name)
- if action == :dir
- progress.total += 1
- progress.inc
- else
- progress.total += stats[:size]
- end
- when :file_progress
- progress.inc(stats[:currinc])
- end
- end
- finisher = lambda do
- progress.title = opts[:name]
- progress.finish
- end
- else
- watcher = nil
- finisher = lambda { }
- end
-
- Archive::Tar::Minitar.pack(files, output, &watcher)
- finisher.call
- 0
- ensure
- output.close if output and not output.closed?
- end
-
- def help
- help = <<-EOH
- minitar create [OPTIONS] <tarfile|-> <file|directory|-->+
-
-Creates a new tarfile. If the tarfile is named .tar.gz or .tgz, then it
-will be compressed automatically. If the tarfile is "-", then it will be
-output to standard output (stdout) so that minitar may be piped.
-
-The files or directories that will be packed into the tarfile are
-specified after the name of the tarfile itself. Directories will be
-processed recursively. If the token "--" is found in the list of files
-to be packed, additional filenames will be read from standard input
-(stdin). If any file is not found, the packaging will be halted.
-
-create Options:
- --compress, -z Compresses the tarfile with gzip.
-
- EOH
- end
- end
-
- class CommandExtract < CommandPattern
- def name
- "extract"
- end
-
- def altname
- "ex"
- end
-
- def call(args, opts = {}, ioe = {})
- argv = []
- output = nil
- dest = "."
- files = []
-
- while (arg = args.shift)
- case arg
- when '--uncompress', '-z'
- opts[:uncompress] = true
- when '--pipe'
- opts[:output] = ioe[:error]
- output = ioe[:output]
- when '--output', '-o'
- dest = args.shift
- else
- argv << arg
- end
- end
-
- if argv.size < 1
- ioe[:output] << "Not enough arguments.\n\n"
- CommandPattern["help"][["extract"]]
- return 255
- end
-
- input = argv.shift
- if '-' == input
- opts[:name] = "STDIN"
- input = ioe[:input]
- else
- opts[:name] = input
- input = File.open(input, "rb")
- end
-
- if opts[:name] =~ /\.tar\.gz$|\.tgz$/ or opts[:uncompress]
- input = Zlib::GzipReader.new(input)
- end
-
- files << argv.to_a
- files.flatten!
-
- if opts[:verbose]
- watcher = lambda do |action, name, stats|
- opts[:output] << "#{name}\n" if action == :dir or action == :file_done
- end
- finisher = lambda { opts[:output] << "\n" }
- elsif opts[:progress]
- progress = ProgressBar.new(opts[:name], 1)
- watcher = lambda do |action, name, stats|
- case action
- when :file_start, :dir
- progress.title = File.basename(name)
- if action == :dir
- progress.total += 1
- progress.inc
- else
- progress.total += stats[:entry].size
- end
- when :file_progress
- progress.inc(stats[:currinc])
- end
- end
- finisher = lambda do
- progress.title = opts[:name]
- progress.finish
- end
- else
- watcher = nil
- finisher = lambda { }
- end
-
- if output.nil?
- Archive::Tar::Minitar.unpack(input, dest, files, &watcher)
- finisher.call
- else
- Archive::Tar::Minitar::Input.open(input) do |inp|
- inp.each do |entry|
- stats = {
- :mode => entry.mode,
- :mtime => entry.mtime,
- :size => entry.size,
- :gid => entry.gid,
- :uid => entry.uid,
- :current => 0,
- :currinc => 0,
- :entry => entry
- }
-
- if files.empty? or files.include?(entry.full_name)
- if entry.directory?
- puts "Directory: #{entry.full_name}"
- watcher[:dir, dest, stats] unless watcher.nil?
- else
- puts "File: #{entry.full_name}"
- watcher[:file_start, destfile, stats] unless watcher.nil?
- loop do
- data = entry.read(4096)
- break unless data
- stats[:currinc] = output.write(data)
- stats[:current] += stats[:currinc]
-
- watcher[:file_progress, name, stats] unless watcher.nil?
- end
- watcher[:file_done, name, stats] unless watcher.nil?
- end
- end
- end
- end
- end
-
- 0
- end
-
- def help
- help = <<-EOH
- minitar extract [OPTIONS] <tarfile|-> [<file>+]
-
-Extracts files from an existing tarfile. If the tarfile is named .tar.gz
-or .tgz, then it will be uncompressed automatically. If the tarfile is
-"-", then it will be read from standard input (stdin) so that minitar
-may be piped.
-
-The files or directories that will be extracted from the tarfile are
-specified after the name of the tarfile itself. Directories will be
-processed recursively. Files must be specified in full. A file
-"foo/bar/baz.txt" cannot simply be specified by specifying "baz.txt".
-Any file not found will simply be skipped and an error will be reported.
-
-extract Options:
- --uncompress, -z Uncompresses the tarfile with gzip.
- --pipe Emits the extracted files to STDOUT for piping.
- --output, -o Extracts the files to the specified directory.
-
- EOH
- end
- end
-
- class CommandList < CommandPattern
- def name
- "list"
- end
-
- def altname
- "ls"
- end
-
- def modestr(mode)
- s = "---"
- s[0] = ?r if (mode & 4) == 4
- s[1] = ?w if (mode & 2) == 2
- s[2] = ?x if (mode & 1) == 1
- s
- end
-
- def call(args, opts = {}, ioe = {})
- argv = []
- output = nil
- dest = "."
- files = []
- opts[:field] = "name"
-
- while (arg = args.shift)
- case arg
- when '--sort', '-S'
- opts[:sort] = true
- opts[:field] = args.shift
- when '--reverse', '-R'
- opts[:reverse] = true
- opts[:sort] = true
- when '--uncompress', '-z'
- opts[:uncompress] = true
- when '-l'
- opts[:verbose] = true
- else
- argv << arg
- end
- end
-
- if argv.size < 1
- ioe[:output] << "Not enough arguments.\n\n"
- CommandPattern["help"][["list"]]
- return 255
- end
-
- input = argv.shift
- if '-' == input
- opts[:name] = "STDIN"
- input = ioe[:input]
- else
- opts[:name] = input
- input = File.open(input, "rb")
- end
-
- if opts[:name] =~ /\.tar\.gz$|\.tgz$/ or opts[:uncompress]
- input = Zlib::GzipReader.new(input)
- end
-
- files << argv.to_a
- files.flatten!
-
- if opts[:verbose] or opts[:progress]
- format = "%10s %4d %8s %8s %8d %12s %s"
- datefmt = "%b %d %Y"
- timefmt = "%b %d %H:%M"
- fields = %w(permissions inodes user group size date fullname)
- else
- format = "%s"
- fields = %w(fullname)
- end
-
- opts[:field] = opts[:field].intern
- opts[:field] = :full_name if opts[:field] == :name
-
- output = []
-
- Archive::Tar::Minitar::Input.open(input) do |inp|
- today = Time.now
- oneyear = Time.mktime(today.year - 1, today.month, today.day)
- inp.each do |entry|
- value = format % fields.map do |ff|
- case ff
- when "permissions"
- s = entry.directory? ? "d" : "-"
- s << modestr(entry.mode / 0100)
- s << modestr(entry.mode / 0010)
- s << modestr(entry.mode)
- when "inodes"
- entry.size / 512
- when "user"
- entry.uname || entry.uid || 0
- when "group"
- entry.gname || entry.gid || 0
- when "size"
- entry.size
- when "date"
- if Time.at(entry.mtime) > (oneyear)
- Time.at(entry.mtime).strftime(timefmt)
- else
- Time.at(entry.mtime).strftime(datefmt)
- end
- when "fullname"
- entry.full_name
- end
- end
-
- if opts[:sort]
- output << [entry.send(opts[:field]), value]
- else
- ioe[:output] << value << "\n"
- end
-
- end
- end
-
- if opts[:sort]
- output = output.sort { |a, b| a[0] <=> b[0] }
- if opts[:reverse]
- output.reverse_each { |oo| ioe[:output] << oo[1] << "\n" }
- else
- output.each { |oo| ioe[:output] << oo[1] << "\n" }
- end
- end
-
- 0
- end
-
- def help
- help = <<-EOH
- minitar list [OPTIONS] <tarfile|-> [<file>+]
-
-Lists files in an existing tarfile. If the tarfile is named .tar.gz or
-.tgz, then it will be uncompressed automatically. If the tarfile is "-",
-then it will be read from standard input (stdin) so that minitar may be
-piped.
-
-If --verbose or --progress is specified, then the file list will be
-similar to that produced by the Unix command "ls -l".
-
-list Options:
- --uncompress, -z Uncompresses the tarfile with gzip.
- --sort [<FIELD>], -S Sorts the list of files by the specified
- field. The sort defaults to the filename.
- --reverse, -R Reverses the sort.
- -l Lists the files in detail.
-
-Sort Fields:
- name, mtime, size
-
- EOH
- end
- end
-
- CommandPattern << CommandHelp
- CommandPattern << CommandCreate
- CommandPattern << CommandExtract
- CommandPattern << CommandList
-# CommandPattern << CommandAdd
-# CommandPattern << CommandDelete
-
- def self.run(argv, input = $stdin, output = $stdout, error = $stderr)
- ioe = {
- :input => input,
- :output => output,
- :error => error,
- }
- opts = { }
-
- if argv.include?("--version")
- output << <<-EOB
-minitar #{Archive::Tar::Minitar::VERSION}
- Copyright 2004 Mauricio Julio Ferna'ndez Pradier and Austin Ziegler
- This is free software with ABSOLUTELY NO WARRANTY.
-
- see http://rubyforge.org/projects/ruwiki for more information
- EOB
- end
-
- if argv.include?("--verbose") or argv.include?("-V")
- opts[:verbose] = true
- argv.delete("--verbose")
- argv.delete("-V")
- end
-
- if argv.include?("--progress") or argv.include?("-P")
- opts[:progress] = true
- opts[:verbose] = false
- argv.delete("--progress")
- argv.delete("-P")
- end
-
- command = CommandPattern[(argv.shift or "").downcase]
- command ||= CommandPattern["help"]
- return command[argv, opts, ioe]
- end
-end
diff --git a/minitar/trunk/tests/tc_tar.rb b/minitar/trunk/tests/tc_tar.rb
deleted file mode 100644
index a6261f1..0000000
--- a/minitar/trunk/tests/tc_tar.rb
+++ /dev/null
@@ -1,614 +0,0 @@
-#!/usr/bin/env ruby
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'archive/tar/minitar'
-require 'test/unit'
-require 'stringio'
-require 'yaml'
-require 'zlib'
-
-module TarTester
-private
- def assert_headers_equal(h1, h2)
- fields = %w(name 100 mode 8 uid 8 gid 8 size 12 mtime 12 checksum 8
- typeflag 1 linkname 100 magic 6 version 2 uname 32 gname 32
- devmajor 8 devminor 8 prefix 155)
- offset = 0
- until fields.empty?
- name = fields.shift
- length = fields.shift.to_i
- if name == "checksum"
- chksum_off = offset
- offset += length
- next
- end
- assert_equal(h1[offset, length], h2[offset, length],
- "Field #{name} of the tar header differs.")
- offset += length
- end
- assert_equal(h1[chksum_off, 8], h2[chksum_off, 8], "Checksumes differ.")
- end
-
- def tar_file_header(fname, dname, mode, length)
- h = header("0", fname, dname, length, mode)
- checksum = calc_checksum(h)
- header("0", fname, dname, length, mode, checksum)
- end
-
- def tar_dir_header(name, prefix, mode)
- h = header("5", name, prefix, 0, mode)
- checksum = calc_checksum(h)
- header("5", name, prefix, 0, mode, checksum)
- end
-
- def header(type, fname, dname, length, mode, checksum = nil)
- checksum ||= " " * 8
- arr = [ASCIIZ(fname, 100), Z(to_oct(mode, 7)), Z(to_oct(nil, 7)),
- Z(to_oct(nil, 7)), Z(to_oct(length, 11)), Z(to_oct(0, 11)),
- checksum, type, "\0" * 100, "ustar\0", "00", ASCIIZ("", 32),
- ASCIIZ("", 32), Z(to_oct(nil, 7)), Z(to_oct(nil, 7)),
- ASCIIZ(dname, 155) ]
- arr = arr.join("").split(//).map{ |x| x[0] }
- h = arr.pack("C100C8C8C8C12C12C8CC100C6C2C32C32C8C8C155")
- ret = h + "\0" * (512 - h.size)
- assert_equal(512, ret.size)
- ret
- end
-
- def calc_checksum(header)
- sum = header.unpack("C*").inject { |s, a| s + a }
- SP(Z(to_oct(sum, 6)))
- end
-
- def to_oct(n, pad_size)
- if n.nil?
- "\0" * pad_size
- else
- "%0#{pad_size}o" % n
- end
- end
-
- def ASCIIZ(str, length)
- str + "\0" * (length - str.length)
- end
-
- def SP(s)
- s + " "
- end
-
- def Z(s)
- s + "\0"
- end
-
- def SP_Z(s)
- s + " \0"
- end
-end
-
-class TC_Tar__Header < Test::Unit::TestCase
- include Archive::Tar::Minitar
- include TarTester
-
- def test_arguments_are_checked
- e = ArgumentError
- assert_raises(e) { Archive::Tar::PosixHeader.new(:name => "", :size => "", :mode => "") }
- assert_raises(e) { Archive::Tar::PosixHeader.new(:name => "", :size => "", :prefix => "") }
- assert_raises(e) { Archive::Tar::PosixHeader.new(:name => "", :prefix => "", :mode => "") }
- assert_raises(e) { Archive::Tar::PosixHeader.new(:prefix => "", :size => "", :mode => "") }
- end
-
- def test_basic_headers
- header = { :name => "bla", :mode => 012345, :size => 10, :prefix => "", :typeflag => "0" }
- assert_headers_equal(tar_file_header("bla", "", 012345, 10),
- Archive::Tar::PosixHeader.new(header).to_s)
- header = { :name => "bla", :mode => 012345, :size => 0, :prefix => "", :typeflag => "5" }
- assert_headers_equal(tar_dir_header("bla", "", 012345),
- Archive::Tar::PosixHeader.new(header).to_s)
- end
-
- def test_long_name_works
- header = { :name => "a" * 100, :mode => 012345, :size => 10, :prefix => "" }
- assert_headers_equal(tar_file_header("a" * 100, "", 012345, 10),
- Archive::Tar::PosixHeader.new(header).to_s)
- header = { :name => "a" * 100, :mode => 012345, :size => 10, :prefix => "bb" * 60 }
- assert_headers_equal(tar_file_header("a" * 100, "bb" * 60, 012345, 10),
- Archive::Tar::PosixHeader.new(header).to_s)
- end
-
- def test_new_from_stream
- header = tar_file_header("a" * 100, "", 012345, 10)
- h = nil
- header = StringIO.new(header)
- assert_nothing_raised { h = Archive::Tar::PosixHeader.new_from_stream(header) }
- assert_equal("a" * 100, h.name)
- assert_equal(012345, h.mode)
- assert_equal(10, h.size)
- assert_equal("", h.prefix)
- assert_equal("ustar", h.magic)
- end
-
- def test_new_from_stream_with_evil_name
- header = tar_file_header("a \0" + "\0" * 97, "", 012345, 10)
- h = nil
- header = StringIO.new(header)
- assert_nothing_raised{ h = Archive::Tar::PosixHeader.new_from_stream header }
- assert_equal("a ", h.name)
- end
-end
-
-class TC_Tar__Writer < Test::Unit::TestCase
- include Archive::Tar::Minitar
- include TarTester
-
- class DummyIO
- attr_reader :data
-
- def initialize
- @data = ""
- end
-
- def write(dat)
- data << dat
- dat.size
- end
-
- def reset
- @data = ""
- end
- end
-
- def setup
- @data = "a" * 10
- @dummyos = DummyIO.new
- @os = Writer.new(@dummyos)
- end
-
- def teardown
- @os.close
- end
-
- def test_add_file_simple
- @dummyos.reset
-
- Writer.open(@dummyos) do |os|
- os.add_file_simple("lib/foo/bar", :mode => 0644, :size => 10) do |f|
- f.write "a" * 10
- end
- os.add_file_simple("lib/bar/baz", :mode => 0644, :size => 100) do |f|
- f.write "fillme"
- end
- end
-
- assert_headers_equal(tar_file_header("lib/foo/bar", "", 0644, 10),
- @dummyos.data[0, 512])
- assert_equal("a" * 10 + "\0" * 502, @dummyos.data[512, 512])
- assert_headers_equal(tar_file_header("lib/bar/baz", "", 0644, 100),
- @dummyos.data[512 * 2, 512])
- assert_equal("fillme" + "\0" * 506, @dummyos.data[512 * 3, 512])
- assert_equal("\0" * 512, @dummyos.data[512 * 4, 512])
- assert_equal("\0" * 512, @dummyos.data[512 * 5, 512])
- end
-
- def test_write_operations_fail_after_closed
- @dummyos.reset
- @os.add_file_simple("sadd", :mode => 0644, :size => 20) { |f| }
- @os.close
- assert_raises(ClosedStream) { @os.flush }
- assert_raises(ClosedStream) { @os.add_file("dfdsf", :mode => 0644) {} }
- assert_raises(ClosedStream) { @os.mkdir "sdfdsf", :mode => 0644 }
- end
-
- def test_file_name_is_split_correctly
- # test insane file lengths, and: a{100}/b{155}, etc
- @dummyos.reset
- names = [ "#{'a' * 155}/#{'b' * 100}", "#{'a' * 151}/#{'qwer/' * 19}bla" ]
- o_names = [ "#{'b' * 100}", "#{'qwer/' * 19}bla" ]
- o_prefixes = [ "a" * 155, "a" * 151 ]
- names.each do |name|
- @os.add_file_simple(name, :mode => 0644, :size => 10) { }
- end
- o_names.each_with_index do |nam, i|
- assert_headers_equal(tar_file_header(nam, o_prefixes[i], 0644, 10),
- @dummyos.data[2 * i * 512, 512])
- end
- assert_raises(FileNameTooLong) do
- @os.add_file_simple(File.join("a" * 152, "b" * 10, "a" * 92),
- :mode => 0644, :size => 10) { }
- end
- assert_raises(FileNameTooLong) do
- @os.add_file_simple(File.join("a" * 162, "b" * 10),
- :mode => 0644, :size => 10) { }
- end
- assert_raises(FileNameTooLong) do
- @os.add_file_simple(File.join("a" * 10, "b" * 110),
- :mode => 0644, :size => 10) { }
- end
- end
-
- def test_add_file
- dummyos = StringIO.new
- class << dummyos
- def method_missing(meth, *a)
- self.string.send(meth, *a)
- end
- end
- os = Writer.new dummyos
- content1 = ('a'..'z').to_a.join("") # 26
- content2 = ('aa'..'zz').to_a.join("") # 1352
- Writer.open(dummyos) do |os|
- os.add_file("lib/foo/bar", :mode => 0644) { |f, opts| f.write "a" * 10 }
- os.add_file("lib/bar/baz", :mode => 0644) { |f, opts| f.write content1 }
- os.add_file("lib/bar/baz", :mode => 0644) { |f, opts| f.write content2 }
- os.add_file("lib/bar/baz", :mode => 0644) { |f, opts| }
- end
- assert_headers_equal(tar_file_header("lib/foo/bar", "", 0644, 10),
- dummyos[0, 512])
- assert_equal(%Q(#{"a" * 10}#{"\0" * 502}), dummyos[512, 512])
- offset = 512 * 2
- [content1, content2, ""].each do |data|
- assert_headers_equal(tar_file_header("lib/bar/baz", "", 0644,
- data.size), dummyos[offset, 512])
- offset += 512
- until !data || data == ""
- chunk = data[0, 512]
- data[0, 512] = ""
- assert_equal(chunk + "\0" * (512 - chunk.size),
- dummyos[offset, 512])
- offset += 512
- end
- end
- assert_equal("\0" * 1024, dummyos[offset, 1024])
- end
-
- def test_add_file_tests_seekability
- assert_raises(Archive::Tar::Minitar::NonSeekableStream) do
- @os.add_file("libdfdsfd", :mode => 0644) { |f| }
- end
- end
-
- def test_write_header
- @dummyos.reset
- @os.add_file_simple("lib/foo/bar", :mode => 0644, :size => 0) { |f| }
- @os.flush
- assert_headers_equal(tar_file_header("lib/foo/bar", "", 0644, 0),
- @dummyos.data[0, 512])
- @dummyos.reset
- @os.mkdir("lib/foo", :mode => 0644)
- assert_headers_equal(tar_dir_header("lib/foo", "", 0644),
- @dummyos.data[0, 512])
- @os.mkdir("lib/bar", :mode => 0644)
- assert_headers_equal(tar_dir_header("lib/bar", "", 0644),
- @dummyos.data[512 * 1, 512])
- end
-
- def test_write_data
- @dummyos.reset
- @os.add_file_simple("lib/foo/bar", :mode => 0644, :size => 10) do |f|
- f.write @data
- end
- @os.flush
- assert_equal(@data + ("\0" * (512-@data.size)),
- @dummyos.data[512, 512])
- end
-
- def test_file_size_is_checked
- @dummyos.reset
- assert_raises(Archive::Tar::Minitar::Writer::BoundedStream::FileOverflow) do
- @os.add_file_simple("lib/foo/bar", :mode => 0644, :size => 10) do |f|
- f.write "1" * 100
- end
- end
- assert_nothing_raised do
- @os.add_file_simple("lib/foo/bar", :mode => 0644, :size => 10) {|f| }
- end
- end
-end
-
-class TC_Tar__Reader < Test::Unit::TestCase
- include Archive::Tar::Minitar
- include TarTester
-
- def setup
- end
-
- def teardown
- end
-
- def test_multiple_entries
- str = tar_file_header("lib/foo", "", 010644, 10) + "\0" * 512
- str += tar_file_header("bar", "baz", 0644, 0)
- str += tar_dir_header("foo", "bar", 012345)
- str += "\0" * 1024
- names = %w[lib/foo bar foo]
- prefixes = ["", "baz", "bar"]
- modes = [010644, 0644, 012345]
- sizes = [10, 0, 0]
- isdir = [false, false, true]
- isfile = [true, true, false]
- Reader.new(StringIO.new(str)) do |is|
- i = 0
- is.each_entry do |entry|
- assert_kind_of(Reader::EntryStream, entry)
- assert_equal(names[i], entry.name)
- assert_equal(prefixes[i], entry.prefix)
- assert_equal(sizes[i], entry.size)
- assert_equal(modes[i], entry.mode)
- assert_equal(isdir[i], entry.directory?)
- assert_equal(isfile[i], entry.file?)
- if prefixes[i] != ""
- assert_equal(File.join(prefixes[i], names[i]), entry.full_name)
- else
- assert_equal(names[i], entry.name)
- end
- i += 1
- end
- assert_equal(names.size, i)
- end
- end
-
- def test_rewind_entry_works
- content = ('a'..'z').to_a.join(" ")
- str = tar_file_header("lib/foo", "", 010644, content.size) + content +
- "\0" * (512 - content.size)
- str << "\0" * 1024
- Reader.new(StringIO.new(str)) do |is|
- is.each_entry do |entry|
- 3.times do
- entry.rewind
- assert_equal(content, entry.read)
- assert_equal(content.size, entry.pos)
- end
- end
- end
- end
-
- def test_rewind_works
- content = ('a'..'z').to_a.join(" ")
- str = tar_file_header("lib/foo", "", 010644, content.size) + content +
- "\0" * (512 - content.size)
- str << "\0" * 1024
- Reader.new(StringIO.new(str)) do |is|
- 3.times do
- is.rewind
- i = 0
- is.each_entry do |entry|
- assert_equal(content, entry.read)
- i += 1
- end
- assert_equal(1, i)
- end
- end
- end
-
- def test_read_works
- contents = ('a'..'z').inject(""){|s, x| s << x * 100}
- str = tar_file_header("lib/foo", "", 010644, contents.size) + contents
- str += "\0" * (512 - (str.size % 512))
- Reader.new(StringIO.new(str)) do |is|
- is.each_entry do |entry|
- assert_kind_of(Reader::EntryStream, entry)
- data = entry.read(3000) # bigger than contents.size
- assert_equal(contents, data)
- assert_equal(true, entry.eof?)
- end
- end
- Reader.new(StringIO.new(str)) do |is|
- is.each_entry do |entry|
- assert_kind_of(Reader::EntryStream, entry)
- data = entry.read(100)
- (entry.size - data.size).times {|i| data << entry.getc.chr }
- assert_equal(contents, data)
- assert_equal(nil, entry.read(10))
- assert_equal(true, entry.eof?)
- end
- end
- Reader.new(StringIO.new(str)) do |is|
- is.each_entry do |entry|
- assert_kind_of(Reader::EntryStream, entry)
- data = entry.read
- assert_equal(contents, data)
- assert_equal(nil, entry.read(10))
- assert_equal(nil, entry.read)
- assert_equal(nil, entry.getc)
- assert_equal(true, entry.eof?)
- end
- end
- end
-
- def test_eof_works
- str = tar_file_header("bar", "baz", 0644, 0)
- Reader.new(StringIO.new(str)) do |is|
- is.each_entry do |entry|
- assert_kind_of(Reader::EntryStream, entry)
- data = entry.read
- assert_equal(nil, data)
- assert_equal(nil, entry.read(10))
- assert_equal(nil, entry.read)
- assert_equal(nil, entry.getc)
- assert_equal(true, entry.eof?)
- end
- end
- str = tar_dir_header("foo", "bar", 012345)
- Reader.new(StringIO.new(str)) do |is|
- is.each_entry do |entry|
- assert_kind_of(Reader::EntryStream, entry)
- data = entry.read
- assert_equal(nil, data)
- assert_equal(nil, entry.read(10))
- assert_equal(nil, entry.read)
- assert_equal(nil, entry.getc)
- assert_equal(true, entry.eof?)
- end
- end
- str = tar_dir_header("foo", "bar", 012345)
- str += tar_file_header("bar", "baz", 0644, 0)
- str += tar_file_header("bar", "baz", 0644, 0)
- Reader.new(StringIO.new(str)) do |is|
- is.each_entry do |entry|
- assert_kind_of(Reader::EntryStream, entry)
- data = entry.read
- assert_equal(nil, data)
- assert_equal(nil, entry.read(10))
- assert_equal(nil, entry.read)
- assert_equal(nil, entry.getc)
- assert_equal(true, entry.eof?)
- end
- end
- end
-end
-
-class TC_Tar__Input < Test::Unit::TestCase
- include Archive::Tar::Minitar
- include TarTester
-
- require 'rbconfig'
-
- TEST_TGZ = "\037\213\010\000\001B1A\000\vKI,I\324+I,\322K\257b\240\0250\000\002sSS\254\342 `dj\306``nnnbndbjd\000\0247336`P0\240\231\213\220@i1\320\367@+\351a\327 \004\362\335\034\f\313\034\r\035\031\270\337Ns\344b2\344q\335\375M\304\266QM1W\357\321>\221U\021\005\246\306\367\356\367u3\262;\212\004\265\236\\\334}\351,\377\037;\217\223\301e\247\030\024\\\236\211\277\347\346sii\265\010\330\355\234\240\362\274\371[\202\361\366\302S\316\335o&~m\237r\355\377\303\230\365\352WNW\334\266_\373\273\237\347Q\315t?\263{\377?\006\271\337?\367\207\325\346]\371\376y\307_\234~d\3772\265\346\261}\323\317\373\315\352\377O\376\271/\305\377?X\253\324\303S\373\361\347\277\372^)\267\377\363\03460\331\311\\wW|\031\203\300@\207\325p\004i\2319\251\3064\266\203P\376702B\313\377\246\246\006&\243\371\237\036 $#\263X\001\210@\351@\301XO\201\227k\240]4\nF\301(\030\005\243\200\036\000\000\004\330t\023\000\f\000\000"
- FILETIMES = Time.mktime(2004).to_i
-
- TEST_CONTENTS = [
- [ "data.tar.gz", 174, 0755 ],
- [ "file3", 18, 0755 ],
- ]
-
- TEST_DATA_CONTENTS = [
- [ "data", 0, 040755 ],
- [ "data/file1", 16, 010644 ],
- [ "data/file2", 16, 010644 ],
- [ "data/__dir__", 0, 010644 ],
- ]
-
- def setup
- FileUtils.mkdir_p("data__")
- end
-
- def teardown
- FileUtils.rm_rf("data__")
- end
-
- def test_each_works
- gzr = Zlib::GzipReader.new(StringIO.new(TEST_TGZ))
- Input.open(gzr) do |is|
- ii = 0
- is.each_with_index do |entry, ii|
- assert_kind_of(Reader::EntryStream, entry)
- assert_equal(TEST_CONTENTS[ii][0], entry.name)
- assert_equal(TEST_CONTENTS[ii][1], entry.size)
- assert_equal(TEST_CONTENTS[ii][2], entry.mode)
- assert_equal(FILETIMES, entry.mtime)
-
- if 0 == ii
- gzr2 = Zlib::GzipReader.new(StringIO.new(entry.read))
- Input.open(gzr2) do |is2|
- jj = 0
- is2.each_with_index do |entry2, jj|
- assert_kind_of(Reader::EntryStream, entry2)
- assert_equal(TEST_DATA_CONTENTS[jj][0], entry2.name)
- assert_equal(TEST_DATA_CONTENTS[jj][1], entry2.size)
- assert_equal(TEST_DATA_CONTENTS[jj][2], entry2.mode)
- assert_equal(FILETIMES, entry2.mtime)
- end
- assert_equal(3, jj)
- end
- end
- end
- assert_equal(1, ii)
- end
- end
-
- def test_extract_entry_works
- gzr = Zlib::GzipReader.new(StringIO.new(TEST_TGZ))
- Input.open(gzr) do |is|
- ii = 0
- is.each_with_index do |entry, ii|
- is.extract_entry("data__", entry)
- name = File.join("data__", entry.name)
-
- if entry.directory?
- assert(File.directory?(name))
- else
- assert(File.file?(name))
-
- assert_equal(TEST_CONTENTS[ii][1], File.stat(name).size)
- end
- assert_equal(TEST_CONTENTS[ii][2], File.stat(name).mode & 0777) unless RUBY_PLATFORM =~ /win32/
-
- if 0 == ii
- begin
- ff = File.open(name, "rb")
- gzr2 = Zlib::GzipReader.new(ff)
- Input.open(gzr2) do |is2|
- jj = 0
- is2.each_with_index do |entry2, jj|
- is2.extract_entry("data__", entry2)
- name2 = File.join("data__", entry2.name)
-
- if entry2.directory?
- assert(File.directory?(name2))
- else
- assert(File.file?(name2))
- assert_equal(TEST_DATA_CONTENTS[jj][1], File.stat(name2).size, name2)
- end
- assert_equal(TEST_DATA_CONTENTS[jj][2], File.stat(name2).mode, name2) unless RUBY_PLATFORM =~ /win32/
- end
- end
- ensure
- ff.close unless ff.closed?
- end
- end
- end
- assert_equal(1, ii)
- end
- end
-end
-
-class TC_Tar__Output < Test::Unit::TestCase
- include Archive::Tar::Minitar
- include TarTester
-
- def setup
- FileUtils.mkdir_p("data__")
- %w(a b c).each do |filename|
- name = File.join("data__", filename)
- File.open(name, "wb") { |f| f.puts "#{name}: 123456789012345678901234567890" }
- end
- @tarfile = "data__/bla2.tar"
- end
-
- def teardown
- FileUtils.rm_rf("data__")
- end
-
- def test_file_looks_good
- Output.open(@tarfile) do |os|
- Dir.chdir("data__") do
- %w(a b c).each do |name|
- stat = File.stat(name)
- opts = { :size => stat.size, :mode => 0644 }
- os.tar.add_file_simple(name, opts) do |ss|
- File.open(name, "rb") { |ff| ss.write(ff.read(4096)) until ff.eof? }
- end
- end
- end
- end
- ff = File.open(@tarfile, "rb")
- Reader.open(ff) do |is|
- ii = 0
- is.each do |entry|
- case ii
- when 0
- assert_equal("a", entry.name)
- when 1
- assert_equal("b", entry.name)
- when 2
- assert_equal("c", entry.name)
- end
- ii += 1
- end
- assert_equal(3, ii)
- end
- ensure
- ff.close if ff
- end
-end
diff --git a/minitar/trunk/tests/testall.rb b/minitar/trunk/tests/testall.rb
deleted file mode 100644
index 22834b4..0000000
--- a/minitar/trunk/tests/testall.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env ruby
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-puts "Checking for test cases:"
-Dir['tc*.rb'].each do |testcase|
- puts "\t#{testcase}"
- require testcase
-end
-puts " "
diff --git a/ruwiki/tags/experimental-0.7/Default/ProjectIndex b/ruwiki/tags/experimental-0.7/Default/ProjectIndex
deleted file mode 100644
index 67ebf73..0000000
--- a/ruwiki/tags/experimental-0.7/Default/ProjectIndex
+++ /dev/null
@@ -1,27 +0,0 @@
-id: 0
-topic: ProjectIndex
-version: 1
-#EHDR
-= Ruwiki
-Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI and
-\WEBrick interfaces, templates, and CSS formatting. Additionally, it supports
-project namespaces, so that two pages can be named the same for differing
-projects without colliding or having to resort to odd naming conventions.
-Please see ::Ruwiki for more information.
-
-The current version is 0.7.0. Several fixes have been made to text
-preservation, an API change to plugins has been made (please read
-Ruwiki::Extending_Ruwiki for details), and a calendar plugin has been added
-(please read Ruwiki::WikiMarkup for details).
-
-The \APIs for Ruwiki should not at this point be considered stable; a large
-number of \APIs will be changing explicitly in 0.8.0 leading up to Ruwiki 1.0.
-
-Known Projects:
-* ::Default
-* ::Ruwiki
-
-Please go to ::Ruwiki if you are unfamiliar with the concept of Wikis in
-general. If you want to play with \WikiFormatting, use the Ruwiki::SandBox.
-
-$Id$
diff --git a/ruwiki/tags/experimental-0.7/README b/ruwiki/tags/experimental-0.7/README
deleted file mode 100644
index ce07647..0000000
--- a/ruwiki/tags/experimental-0.7/README
+++ /dev/null
@@ -1,46 +0,0 @@
-Ruwiki 0.7.0
-------------
-Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI and
-WEBrick interfaces, templates, and CSS formatting. Additionally, it supports
-project namespaces, so that two pages can be named the same for differing
-projects without colliding or having to resort to odd naming conventions.
-Please see the ::Ruwiki project in the running Wiki for more information.
-Ruwiki 0.7.0 has German and Spanish translations available.
-
-Quick Start (CGI)
------------------
-1. Place the Ruwiki directory in a place that your webserver can execute CGI
- programs and ensure that ruwiki.cgi is executable on your webserver.
-2. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
-2. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of Ruwiki
-without editing the servlet; use ruwiki_servlet --help for more information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-* This software includes algorithm/diff by Lars Christensen, available for
- download from the RAA at: http://raa.ruby-lang.org/list.rhtml?name=diff
-* This software includes template.rb from Dave Thomas's rdoc system, available
- for download from SourceForge: http://rdoc.sourceforge.net
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen]
- on 2003.10.22. Note that the initial template translations (./templates/de/)
- were done via AltaVista Babelfish and should not be blamed on Christian.
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández]
- on 2003.10.22. Note that the initial template translations (./templates/es/)
- were done via AltaVista Babelfish and should not be blamed on Mauricio.
-
-$Id$
diff --git a/ruwiki/tags/experimental-0.7/Ruwiki/BugTracking b/ruwiki/tags/experimental-0.7/Ruwiki/BugTracking
deleted file mode 100644
index 7881730..0000000
--- a/ruwiki/tags/experimental-0.7/Ruwiki/BugTracking
+++ /dev/null
@@ -1,28 +0,0 @@
-id: 0
-topic: BugTracking
-version: 1
-#EHDR
-= Ruwiki 0.7.0 Bug Tracking
-This page is for tracking bugs in Ruwiki. Only bugs from recent distributions
-are tracked. In addition to this source-based bug tracking, there is the
-[http://rubyforge.org RubyForge]
-[http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug tracker]
-for Ruwiki.
-
-Those interested in Ruwiki development may also find the Ruwiki::To_Do list
-useful.
-
-----
-== Open Bugs
-* 0.6.2: Not all formatting is applied consistently. The token rankings may need adjusting. Eivind Eklund has suggested a scheme that may help with this, but it will require architectural adjustment and will probably slow things down.
-
-----
-== Closed Bugs
-* 0.7.0: Fixed a link detection problem in \[wikiword] format. Thanks to [mailto:eivind@FreeBSD.org Eivind Eklund] for the patch.
-* 0.7.0: Fixed a problem with &lt;pre&gt; paragraph detection and generation.
-* 0.7.0: Fixed a problem with &lt;p&gt; generation.
-* 0.7.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=197&group_id=84&atid=407 Run-away ruby on some links in default distribution]. This may be related to a runaway header problem that was reported to me on IRC some time back that I believe has been fixed. Please advise.
-* 0.6.1: Projects aren't created appropriately.
-* 0.6.1: Saving without editing (or repost) appears to cause problems. A fix has been applied to attempt to address this. Pages that have not been changed will not be saved.
-
-$Id$
diff --git a/ruwiki/tags/experimental-0.7/Ruwiki/ChangeLog b/ruwiki/tags/experimental-0.7/Ruwiki/ChangeLog
deleted file mode 100644
index c1a77ea..0000000
--- a/ruwiki/tags/experimental-0.7/Ruwiki/ChangeLog
+++ /dev/null
@@ -1,53 +0,0 @@
-id: 0
-topic: ChangeLog
-version: 2
-#EHDR
-= Ruwiki 0.7.0 ChangeLog
-Uncompleted to-do items can be found in To_Do. Bugs in Ruwiki are tracked in
-BugTracking.
-== Version 0.7.0+
-* Added Topic List and Project List controls on template and backend
-* Added simple search on backend (need to refine this). Expect validation check on frontend
-* Added RecentChanges list to backend and controls
-
-== Version 0.7.0
-* Changed the tokenization API so that the #post_replace call is made at the Token class level instead of the instance level.
-* Improved HTML code generation.
-* Added servlet runner batch files for Windows. They <strong>will</strong> require modification to run properly.
-* Added %calendar(...) support. See Ruwiki::WikiMarkup for more information.
-
-== Version 0.6.2
-* Removed dependencies on Ruwiki from a number of classes (\Ruwiki::Backend, \Ruwiki::Backend::Flatfiles, \Ruwiki::Page, \Ruwiki::Wiki, \Ruwiki::Wiki::Tokens, and various tokens).
-* Ruwiki now initializes a \Ruwiki::BackendDelegator, which creates the requisite \Ruwiki::Backend instance with \Ruwiki::Config#storage_options.
-* Added German (Christian Neukirchen <cneukirchin@yahoo.de>) and Spanish translations (Mauricio Fernández <batsman.geo@yahoo.com>).
-
-== Version 0.6.1
-* Changed Config#data_path to Config#storage_options[:flatfiles][:data_path]. This represents a generalisation of storage type options so that the Config object is not polluted with storage type options. Config#storage_options keys should be the same Ruby Symbol as is used in Config#storage_type.
-* Added Config#storage_options[:flatfiles][:extension], based on a request by Chad Fowler. This allows you to have Project/\TopicFile actually stored as Project/\TopicFile.wiki if Config#storage_options[:flatfiles][:extension] is set to <tt>wiki</tt>. The default for Config#storage_options[:flatfiles][:extension] is <tt>nil</tt>.
-* Fixed incorrect references. I had been incorrectly attributing [http://sourceforge.net/projects/rdoc-wiki RDoc Wiki] to Dave Thomas. \RDoc Wiki is by Michael Neumann. However, the project I pulled from <strong>is</strong> by Dave Thomas, but it's [http://sourceforge.net/projects/rublog RubLog]. Apologies to both developers.
-* Added RuwikiTemplatingLibrary documentation.
-* Internationalized messages, except for the templating library.
-* Added configuration API for future work surrounding features. The existing wiki is mostly feature complete. Additional features (such as access controls) will be added through the feature interface.
-* Fixed project creation.
-* Fixed problems with \WikiWord links.
-* Added Wikipedia-style Wiki links (\[[list of words]]).
-* Fixed a potential problem with re-posted data or saving without editing.
-* Added the ability to put commands in the URL.
-
-== Version 0.6.0
-* Added Ruby mailing list reference support (e.g., \[ruby-talk:12345]).
-* Reorganised the code (again) to better support alternative frontends. Based, in part, on [http://sourceforge.net/projects/rublog RubLog] by Dave Thomas. (Reference corrected in 0.6.1.)
-* Added a [http://www.webrick.org WEBrick] servlet interface. Based, in part, on the WEBrick servlet interface provided with RubLog by Chad Fowler.
-* Added templates, using the [http://rdoc.sourceforge.net RDoc] template.rb library.
-* Changed the default topic to be \ProjectIndex instead of \DefaultProject.
-* Added a new \WikiWord format, \Wiki_Word_with_Spaces.
-* Completed lots of Ruwiki documentation.
-* Updated the save page.
-* Fixed a problem with the linking of project specific pages.
-
-== Version 0.5.0
-* Reorganized the code significantly to be easier to edit and extend.
-* Added abbreviation capabilities.
-* Cleaned up a lot of tokenizing code.
-
-$Id$
diff --git a/ruwiki/tags/experimental-0.7/Ruwiki/Configuring_Ruwiki b/ruwiki/tags/experimental-0.7/Ruwiki/Configuring_Ruwiki
deleted file mode 100644
index fb039e5..0000000
--- a/ruwiki/tags/experimental-0.7/Ruwiki/Configuring_Ruwiki
+++ /dev/null
@@ -1,188 +0,0 @@
-id: 0
-topic: Configuring_Ruwiki
-version: 1
-#EHDR
-= Configuring Ruwiki 0.7.0
-
-Ruwiki is configured similarly for both CGI and \WEBrick. The biggest
-distinction is that because the Wiki servlet is created after the \WEBrick
-server is created (during the dispatch to the servlet), it is necessary to
-configure the wiki with a global \Ruwiki::Config object, <em>$config</em>.
-Thus, in the examples below, replace <em>wiki.config</em> with
-<em>$config</em> where necessary.
-
-: This will probably be changed in a future version prior to 1.8.
-
-== wiki.config Options
-
-=== wiki.config.title
-
-This configuration option names the Wiki, by default this is <tt>Ruwiki</tt>.
-This affects the display of the home link and the &lt;title&gt; element of
-pages.
-
-=== wiki.config.webmaster
-
-The email address for the webmaster. This is used in generating error reports
-that can be emailed to the wiki's webmaster.
-
-=== wiki.config.default_page, wiki.config.default_project
-
-These options indicate what will happen when the wiki's URL is specified
-without any parameters (the default page in the default project is opened),
-when a topic is specified without a project (the topic is opened in the
-default project), and when a project is specified without a topic (the default
-page is opened in the project).
-
-=== wiki.config.storage_type, wiki.config.storage_options
-
-<tt>wiki.config.storage_type</tt> specifies the back-end storage mechanism as
-a Ruby Symbol. Currently, only <tt>:flatfiles</tt> is implemented. See
-Extending_Ruwiki for more information.
-
-<tt>wiki.config.storage_options</tt> is a hash of option hashes for each known
-storage type known to the Wiki. This must use the same Symbol as
-<tt>wiki.config.storage_type</tt> as the top-level hash key.
-
-==== ...storage_options[:flatfiles][:data_path]
-
-The directory in which the wiki files will be found. By default, this is
-<tt>"./data/"</tt>.
-
-==== ...storage_options[:flatfiles][:extension]
-
-The extension of the wiki files. By default, this is +nil+ (no extension).
-
-=== wiki.config.template_path
-This specifies the paths where the Wiki templates will be found. The process
-running the Wiki must have read access to the template_path.
-
-=== wiki.config.template_set, wiki.config.css
-These two options indicate which template set will be used. Three template
-sets are provided in the release package, "default", "es", and "de". The only
-CSS file used initially is "ruwiki.css". Templates work such that they will be
-found in <em>template_path</em>/<em>template_set</em>. All CSS files are
-loaded from the template set directory and emitted as part of the output
-stream.
-
-: The bad news is that this means that the CSS never caches on the client side
-: as it would if it were a separate file. However, because the templates may
-: not be in a web-accessible directory, this is necessary.
-
-> Template paths will be modified in the future to be based on the template
-> set name and the language, e.g., "default/en", "default/es", and
-> "default/de".
-
-== Templates
-Templating is done with the \RDoc template.rb library, included in the
-distribution of Ruwiki. The templating library allows for nested templates,
-and this is used extensively in Ruwiki. This library is documented in
-RuwikiTemplatingLibrary.
-
-There are four major templates: content, edit, save, and error. Each of these
-has a slightly different combination of template files used, and this means
-that there are different sets of variables available.
-
-The major templates are combined templates that are defined as follows:
-; content : body.tmpl, content.tmpl, controls.tmpl
-; edit : body.tmpl, edit.tmpl
-; save : body.tmpl, save.tmpl, controls.tmpl
-; error : body.tmpl, error.tmpl
-
-=== body.tmpl
-The body template knows two template keys (<tt>%wiki_title%</tt> and
-<tt>%css_link%</tt>) and includes one other template. The values for
-%wiki_title% key differs depending on context, but no other key should be used
-or expected in the body template.
-
- <html>
- <head>
- <title>%wiki_title%</title>
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
- </html>
-
-=== content.tmpl
-The content template knows one template key (<tt>%content%</tt>) and includes
-one other template. (This may change moving forward so that there's a footer
-as well as a control header.)
-
- !INCLUDE!
- <!-- topic content -->
- %content%
- <!-- topic content -->
-
-=== controls.tmpl
-The controls template offers a navigation bar. It knows four template keys:
-
-; %cgi_url% : The URL to the wiki, suitable for building further links from.
-; %home_link% : The root topic of the wiki.
-; %page_project% : The project for the current page topic.
-; %page_topic% : The topic of the current page.
-
- <div class="rw_nav">
- %home_link% |
- Topic: <strong>%page_topic%</strong> Project: <a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a> |
- <a href="%cgi_url%?action=edit&amp;project=%page_project%&amp;%page_topic%">Edit</a>
- </div>
-
-=== edit.tmpl
-The edit template is the most complex template with the most keys. Of
-necessity, it provides a restricted form of the navigation bar, the edit form,
-the raw body of the page, and the formatted body of the page.
-
-; %cgi_url% : The URL to the wiki, suitable for building further links from.
-; %home_link% : The root topic of the wiki.
-; %orig_page% : The unedited original page encoded as Base64.
-; %page_content% : The editable page content.
-; %page_old_version% : The old version number of the page.
-; %page_project% : The project for the current page topic being edited.
-; %page_topic% : The topic of the current page being edited.
-; %page_version% : The new version number of the page.
-; %pre_page_content% : The unedited original page content for display in a &lt;pre&gt; tagset.
-; %unedited_page_content% : The formatted unedited orignal page content.
-
- <div class="rw_nav">%home_link% | <em>Editing</em> Topic: <strong>%page_topic%</strong> Project: <strong>%page_project%</strong></div><br />
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <input type="submit" name="action" value="Save" />
- <input type="submit" name="action" value="Cancel" />
- </form>
- <div class="rw_edit_raw"><h2>Raw Original Value</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2>Formatted Version</h2>%unedited_page_content%</div>
-
-=== save.tmpl
-An alternative content page for use when a page is saved after editing. This
-knows <tt>%page_project%</tt>, <tt>%page_tolink%</tt> (used to link directly
-to the page), and <tt>%content%</tt>.
-
- !INCLUDE!
- Saved page %page_project%::%page_tolink%<hr />
- <!-- topic content -->
- %content%
- <!-- topic content -->
-
-=== error.tmpl
-This template is used for reporting errors to the user and offering an
-opportunity to the user to send a report to the wiki webmaster.
-
-; %backtrace% : The error backtrace.
-; %backtrace_email% : The error backtrace in a format suitable for email.
-; %home_link% : The root topic of the wiki.
-; %name% : The name of the error.
-; %webmaster% : The email address of the wiki webmaster.
-
- <div class="rw_nav">%home_link%</div>
- <h1>%name%</h1>
- <p>Send the webmaster a report by <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
- <p>%backtrace%</p>
-
-$Id$
diff --git a/ruwiki/tags/experimental-0.7/Ruwiki/Extending_Ruwiki b/ruwiki/tags/experimental-0.7/Ruwiki/Extending_Ruwiki
deleted file mode 100644
index a977868..0000000
--- a/ruwiki/tags/experimental-0.7/Ruwiki/Extending_Ruwiki
+++ /dev/null
@@ -1,226 +0,0 @@
-id: 0
-topic: Extending_Ruwiki
-version: 1
-#EHDR
-= Extending Ruwiki 0.7.0
-Ruwiki is relatively easily extended to support new features. There are three
-primary ways in which Ruwiki can be extended by the end user: markup,
-backends, and translating Ruwiki error messages.
-
-: <strong>WARNING:</strong> These \APIs are likely to change moving forward,
-: and new \APIs may be added as well. (There are definite changes in 0.8.0.
-: You have been warned.)
-
-== Extending Ruwiki Markup
-Ruwiki's WikiMarkup can be extended by creating a new \Ruwiki::Wiki::Token.
-Tokens will be automatically loaded if they are placed in
-<em>ruwiki/wiki/tokens</em>.
-
-It is recommended that new tokens be added to the test cases in
-<tt>tests/tc_tokens.rb</tt>.
-
-The following \Ruwiki::Wiki::Token class will convert strings in the forms of
-\[ruby-talk:12345] to links.
-
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
-=== Known Instance Variables
-==== @match
-The match data for this token instance is is kept in @match. This is what will
-be used in #replace and #restore.
-
-==== @project
-The project being processed.
-
-==== @backend
-The Backend for the wiki. If you are using Ruwiki tokenizers outside of
-Ruwiki, this does not need to be a \BackendDelegator, but can be the direct
-Backend (which expects less information).
-
-==== @script
-The URI to the script.
-
-=== Required Methods
-==== ::regexp
-Ruwiki tokens are matched only through regular expression matches. As shown in
-the example above, the regular expression for ruby-talk mailing list posts is
-<tt>%r{\[ruby-\talk:(\d+)\]}</tt>. The purpose of the ::regexp method is to
-return the regexp for matching.
-
-For most inline matches, Ruwiki will ensure that the escape character (\)
-works automatically. For whole-line matches, it is necessary to match the
-escape character manually and provide a #restore method.
-
-As an example, the \HRule class implements these methods.
-
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
-It may also be necessary to match escapes manually on inline matches that must
-be along word boundaries where the regular expression includes characters that
-normally match word boundaries. The project index match (e.g., \::Ruwiki)
-regular expression does this <tt>%r{(\B|\\)::([A-Z][a-z]+)}</tt>.
-
-==== #replace
-This returns the formatted token. In the \RubyTalkLinks class above, the
-matched regular expression will be replaced with a hyperlink. The text of the
-hyperlink will be the matched text; the target of the hyperlink will include
-the first captured value.
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
-
-=== Optional Methods
-==== ::rank
-By default, a token will be processed in the order created. Tokens may be
-given a specific rank to ensure that they are processed in a particular order.
-The default rank is <tt>9999</tt>.
-
-==== #restore
-Restores the token without replacement. Implements the results of the escape
-character. Each Token class is responsible for its own restoration. As noted
-in #regexp, whole-line tokens are most likely to need a #restore
-implementation.
-
-==== ::post_replace
-Performs any necessary massaging of the data. The Lists token uses this to
-ensure that lists are collapsed together; the Paragraph token uses this to
-ensure that there are no empty paragraph tag pairs (&lt;p&gt;&lt;/p&gt;).
-
-: <strong>Note:</strong> This has been changed from Ruwiki 0.6.x. Plugins
-: written for the Ruwiki 0.6.x Token API will need to be modified so that this
-: is defined as:
-
- def self.post_replace
- ...
- end
-
-: as opposed to:
-
- def post_replace
- ...
- end
-
-== Extending Ruwiki Backends
-Ruwiki can support varying backends, as the backend interface has been
-abstracted completely from the data store. The backend <strong>must</strong>:
-
-# reside in <em>ruwiki/backends/</em> as <em>backend_name</em>.rb.
-# be registered by adding the <em>backend_name</em> as a symbol (e.g., :<em>backend_name</em>) to \Ruwiki::KNOWN_BACKENDS.
-# inherit from \Ruwiki::Backend.
-# exist as \Ruwiki::Backend::<em>\Backend_name</em>.
-
-=== Required Methods
-==== #initialize(storage_options)
-The backend may only obtain its configuration information from the provided
-ruwiki instance (through Ruwiki#config) and must set @ruwiki (this can be
-achieved by calling <tt>super ruwiki</tt>).
-
-If a configuration error is detected during initialization, the backend should
-raise the \Ruwiki::Backend exception class \BackendError. This would be done with:
-
- raise Ruwiki::Backend::BackendError.new([:message_symbol, [message_parameters]])
-
-Backend writers should add messages to the <em>lang/en.rb</em> at a minimum. The
-\BackendDelegator will detect this and report the results appropriately.
-
-==== #load(topic, project)
-The backend will be provided the name of the topic and project and must return
-the selected page as an array, one row per line. If the backend you have
-chosen returns the page as a single text block, it will be necessary to do a
-String#split("\n") on it.
-
-==== #save(page)
-This method must store the provided page in the backend. Note that the return
-value of the Page#rawtext method must be stored. This method may call the
-private method Backend#make_diff to generate the differences hash.
-
- diff = {
- 'old_version' => page.old_version,
- 'new_version' => page.version,
- 'change_date' => Time.now,
- 'change_ip' => page.change_ip,
- 'change_id' => page.change_id,
- 'diff' => Diff.diff(oldpage, newpage)
- }
-
-===== Backend#make_diff(page, oldpage, newpage)
-This method expects the page object, the old page text, and the new page text.
-They must be Diffable. \Ruwiki::Backend::Flatfiles provides oldpage and newpage to
-Diff#diff as arrays (each line as a separate entry in the array).
-
-==== #obtain_lock(page, address = 'UKNOWN', timeout = 600)
-Obtains an exclusive lock on the page. The lock should have a timeout and
-permit access from the same IP address without restriction. This should
-<strong>not</strong> be a filesystem lock. The time stored for purposes of locking
-should include the timeout (e.g., Time.now.to_i + time).
-
-==== #release_lock(page, address = 'UNKNOWN')
-Releases the exclusive lock on the page. The lock should not be released
-unless the IP address on the lock is the same or the lock has expired.
-
-==== #project_exists?(project)
-Returns <tt>true</tt> if the project exists.
-
-==== #page_exists?(topic, project = 'Default')
-Returns <tt>true</tt> if the page exists within the specified project.
-
-=== Optional Methods
-Note that these methods are currently optional (they are not yet called from
-Ruwiki), but will become required moving forward as the functions are
-implemented in Ruwiki.
-
-==== #destroy(page)
-Removes the page from the wiki. This should <strong>not</strong> remove the change
-history of the topic (in the event that the page has been removed
-maliciously). There will be a separate method to remove the page history.
-
-==== #create_project(project)
-Attempts to create the project.
-
-==== #destroy_project(project)
-Attempts to destroy the project.
-
-== Translating Ruwiki Error Messages
-Ruwiki is internationalized. This method sets the Ruwiki error messages (and a
-few other messages) to the specified language Module. The language Module must
-have a constant Hash called <tt>Message</tt> containing a set of symbols and
-localized versions of the messages associated with them.
-
-If the file <em>ruwiki/lang/es.rb</em> contains the module
-<tt>\Ruwiki::Lang::ES</tt>, the messages for RSS could be localized to Spanish
-thus:
-
- require 'ruwiki/lang/es'
- ...
- wiki.config.language = Ruwiki::Lang::ES
-
-Localization is per wiki instance. In a servlet environment, this may mean
-that only a single language is recognised.
-
-It is recommended that Message.default be set to a proc that reports unknown
-message keys.
-
- Message.default = proc { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
-
-$Id$
diff --git a/ruwiki/tags/experimental-0.7/Ruwiki/LicenseAndAuthorInfo b/ruwiki/tags/experimental-0.7/Ruwiki/LicenseAndAuthorInfo
deleted file mode 100644
index e90fd7f..0000000
--- a/ruwiki/tags/experimental-0.7/Ruwiki/LicenseAndAuthorInfo
+++ /dev/null
@@ -1,30 +0,0 @@
-id: 0
-topic: LicenseAndAuthorInfo
-version: 1
-#EHDR
-= Ruwiki Licence
-Ruwiki is copyright © 2002 - 2004 [mailto:alan@digikata.com Alan Chen] and
-[mailto:ruwiki@halostatue.ca Austin Ziegler].
-
-Ruwiki is provided free of use and without any warranty express or implied.
-You may use, distribute, or modify Ruwiki under the conditions of Ruby's
-licence or the [http://www.gnu.org/copyleft/gpl.html GNU General Public
-Licence].
-
-* Ruwiki includes algorithm/diff by Lars Christensen, available for download from the RAA at: http://raa.ruby-lang.org/list.rhtml?name=diff
-* Ruwiki includes template.rb from Dave Thomas's \RDoc system, included as part of the standard Ruby distribution since Ruby 1.8.
-
-== Translations
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen] on 2003.10.22. Note that the initial template translations (./templates/de/) were done via \AltaVista Babelfish and should not be blamed on Christian.
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández] on 2003.10.22. Note that the initial template translations (./templates/es/) were done via \AltaVista Babelfish and should not be blamed on Mauricio.
-
-
-== Other Projects
-Austin has also released several other projects available on the RAA that you may be interested in:
-* [http://raa.ruby-lang.org/list.rhtml?name=mime-types MIME::Types]
-* [http://raa.ruby-lang.org/list.rhtml?name=pdf-writer PDF::Writer]
-* [http://raa.ruby-lang.org/list.rhtml?name=text-format Text::Format]
-* [http://raa.ruby-lang.org/list.rhtml?name=trans-simple Transaction::Simple]
-* [http://raa.ruby-lang.org/list.rhtml?name=uninheritable Uninheritable]
-
-$Id$
diff --git a/ruwiki/tags/experimental-0.7/Ruwiki/ProjectIndex b/ruwiki/tags/experimental-0.7/Ruwiki/ProjectIndex
deleted file mode 100644
index d1ef6e7..0000000
--- a/ruwiki/tags/experimental-0.7/Ruwiki/ProjectIndex
+++ /dev/null
@@ -1,33 +0,0 @@
-id: 0
-topic: ProjectIndex
-version: 1
-#EHDR
-= Ruwiki 0.7.0
-This is the \ProjectIndex page for Ruwiki. For any given project, the
-\ProjectIndex topic will be the default topic for plain project links.
-
-----
-
-== Features and Information
-* This wiki supports a variety of WikiFeatures that you may be interested in. The rules for WikiMarkup are similar to some other wikis, but there are a few unique markup capabilities in Ruwiki.
-* Configuring_Ruwiki is simple.
-* Extending_Ruwiki is almost as simple.
-* Who wrote Ruwiki? Look at the LicenseAndAuthorInfo.
-
-== Tracking Ruwiki Development
-The development progress of Ruwiki is kept in the wiki itself.
-* The BugTracking page in Ruwiki keeps track of open and closed bugs in Ruwiki.
-* The To_Do list keeps track of major development goals for Ruwiki.
-
-----
-
-== Different Features?
-If this wiki doesn't have the right combination of features, (or if it just
-doesn't feel right) try these other Ruby-based Wikis:
-
-* Amrita Wiki - http://www.walrus-ruby.org/amrita/cgi-bin/aswiki/aswiki.cgi
-* \RWiki - http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=top
-* \MiniRubyWiki - http://www.xpsd.com/MiniRubyWiki
-* Instiki - http://instiki.rubyforge.org/
-
-$Id$
diff --git a/ruwiki/tags/experimental-0.7/Ruwiki/RuwikiTemplatingLibrary b/ruwiki/tags/experimental-0.7/Ruwiki/RuwikiTemplatingLibrary
deleted file mode 100644
index 68bef53..0000000
--- a/ruwiki/tags/experimental-0.7/Ruwiki/RuwikiTemplatingLibrary
+++ /dev/null
@@ -1,74 +0,0 @@
-id: 0
-topic: RuwikiTemplatingLibrary
-version: 1
-#EHDR
-= Ruwiki 0.7.0 Templating
-Ruwiki uses the \RDoc templating system, described by its creator as:
-
-> \RDoc's cheap-n-cheerful HTML page template system.
-
-== Templates
-Templates in the templating system are essentially plain strings with
-particular references to templating keys or an include directive.
-
-=== Templating Keys
-The template interacts with a value hash provided by ruwiki. The keys known to
-the templates expected by Ruwiki are detailed in Configuring_Ruwiki. Nested
-key references are found from the inside-out. That is, the closest resolving
-key to the current level is found, not the furthest resolving key.
-
-==== Simple Templating Keys
-Ruwiki only uses the simplest form of \RDoc templating at this point, which is
-the enclosing of variable names between percent signs (e.g.,
-<tt>%wiki_title%</tt>).
-
-==== Repeating Block Keys
-The \RDoc templating library supports a block format:
-
- START:key
- ... stuff ...
- END:key
-
-The block between <tt>\START:key</tt> and <tt>\END:key</tt> will be repeated
-once for each hash entry found in the array at <tt>key</tt> in the main value
-hash. Blocks may be nested arbitrarily deeply.
-
-==== Conditional Block Keys
- IF:key
- ... stuff ...
- ENDIF:key
-
-The block between <tt>\IF:key</tt> and <tt>\ENDIF:key</tt> will be included in
-the output only if the corresponding key is set in the value hash.
-
-=== Including Other Templates
-Templates may include other templates to any arbitrary level by using the
-!INCLUDE! directive.
-
-== Example
-Given the set of templates T1, T2, and T3 (shown below), here's how we would
-use the templating system.
-
- values = { "name" => "Dave", "state" => "TX" }
- t = TemplatePage.new(T1, T2, T3)
- File.open(name, w) { |f| t.write_html_on(f, values) }
-
-or:
-
- values = { "name" => "Dave" }
- res = ""
- t.write_html_on(res, values)
-
-=== T1
- Templates can subsitute a wide variety of values.
- !INCLUDE!
-
-=== T2
- Name: %name% !INCLUDE!
-
-=== T3
- IF:state
- State: %state%
- ENDIF:state
-
-$Id$
diff --git a/ruwiki/tags/experimental-0.7/Ruwiki/SandBox b/ruwiki/tags/experimental-0.7/Ruwiki/SandBox
deleted file mode 100644
index 64d42ef..0000000
--- a/ruwiki/tags/experimental-0.7/Ruwiki/SandBox
+++ /dev/null
@@ -1,8 +0,0 @@
-id: 0
-topic: SandBox
-version: 1
-#EHDR
-This page is intended for users to play with freely to practice their
-\WikiFormatting.
-
-$Id$
diff --git a/ruwiki/tags/experimental-0.7/Ruwiki/To_Do b/ruwiki/tags/experimental-0.7/Ruwiki/To_Do
deleted file mode 100644
index 045a6f1..0000000
--- a/ruwiki/tags/experimental-0.7/Ruwiki/To_Do
+++ /dev/null
@@ -1,61 +0,0 @@
-id: 0
-topic: To_Do
-version: 3
-#EHDR
-= Ruwiki 0.7.0 To Do Tracking
-Completed to-do items can be found in the ChangeLog. Bugs in Ruwiki are
-tracked in BugTracking.
-
-Note that Ruwiki 0.7.0 was originally supposed to be 0.6.3, but the
-Tokenization API change demanded a full version change instead. Thus, there
-are still three planned API-changing releases between now and 1.0.
-
-== Well-Defined To Do Items
-=== Ruwiki 0.8.0
-; Versioning : complete the change history. Change history is currently stored in a file <em>topic</em>.rdiff. There is no way to display the change history at this point.
-; \Ruwiki::Wiki::Handler : Change the way that Tokens get their configuration information to be its own class.
-; Rename \Ruwiki::Handler to \Ruwiki::NetworkHandler to reduce confusion with the new Network Handler.
-; YAML : Convert the page, header, and diff formats to YAML from custom and Marshal formats.
-; Frozen content : make it so that frozen content can be provided on a per-page or Wiki basis. Will provide both headers and footers. <strong>Note:</strong> Ruwiki 0.7.0 will only provide the ability to present the information, not create it.
-; Frozen pages : provide the ability to freeze content in place; the page is no longer "wiki" editable and is effectively a plain HTML page.
-; Function tokens : generalize the %<function-name>[(<args>)] calling method so that function tokens can be created without having to create a custom regular expression.
-=== Ruwiki 0.9.0
-; Full Text search : searches for user specified text on a per-project or whole-Wiki basis.
-; Topic backlink search : searches for mentions of the topic in the other topics for the project.
-; Versioning : complete the change history. Change history is currently stored in a file <em>topic</em>.rdiff. There is no way to display the change history at this point.
-; Recent changes list : displays the list of recent changes to on a per-project or whole-Wiki basis.
-=== Ruwiki 0.10.0
-; Project topic listing : provide a special link (perhaps \Project::Project) that displays the list of topics known to that project.
-; Project listing : provide a special link (perhaps ::*) that displays the list of known projects.
-; Authentication : allow user creation and authentication.
-=== Ruwiki 0.11.0
-; Topic renaming : add the ability to rename a topic within a project. Topic change history should be maintained.
-; Topic moving : add the ability to move and/or rename a topic between projects. Topic change history should be maintained.
-; Complete documentation : Complete the documentation of Ruwiki.
-=== Ruwiki 1.0.0
-; Escape HTML Entities : HTML Entities such as &, <, and > are not currently escaped. This may cause problems with some browsers and should be fixed <strong>without</strong> impairing the ability to add at least some raw HTML. Note that the current engine does not check raw HTML and thus could potentially be vulnerable to cross-site-scripting attacks.
-; Features : Ruwiki will be programmatically extensible with entirely new features: commands, \ACLs, and more. This is planned for 1.0.0.
-
-== General To Do Items
-; Preview button : add a preview button to the save page.
-; Alternative templating systems : not as high priority now that there's a real templating system in place.
-; Alternative markup systems : potentially allow \RedCloth (Textile) and/or \BlueCloth (Markdown) to be processed for a page. This could be implemented as a %function.
-; Project/topic security : allow certain projects to be restricted/authenticated for read/write based on user.
-; RSS Feed :
-; Track last <em>n</em> links/topics : ?
-; Write a markup debugger : ?
-; Validate topic formatting from cgi : ?
-; Validate project from cgi : ?
-; Project-based backend : Allow different projects to have different backends.
-; Hierachical project namespaces : ?
-
-== Future To Do Items
-; E-mail gateway : accept topic appends via e-mail.
-; alternative backends : access other wiki data storage, or other formats, e.g. e-mail boxes in mh or mbox formats
-; backend-to-backend storage format conversion : as noted
-; bug tracker backend : with alternate markup
-; add setup and user config methods : for backend plugin classes, then we can use them with an interactive or gui tool frontend to setup data storage backends. The user might have to run as root or other user with database create permissions.
-; add id="" to various markup elements (make id specific to topic) : Later we can allow users to tweak a page using uploaded css fragments which might get appended onto the standard css contents.
-; ruby action : upload a ruby code fragment to add a smart "action" to that wiki page. Need some sort of security + approval system to handle this safely.
-
-$Id$
diff --git a/ruwiki/tags/experimental-0.7/Ruwiki/WikiFeatures b/ruwiki/tags/experimental-0.7/Ruwiki/WikiFeatures
deleted file mode 100644
index 13d4c0f..0000000
--- a/ruwiki/tags/experimental-0.7/Ruwiki/WikiFeatures
+++ /dev/null
@@ -1,16 +0,0 @@
-id: 0
-version: 1
-topic: WikiFeatures
-#EHDR
-Ruwiki is a [http://www.ruby-lang.org Ruby]-based wiki. It is ideal for
-personal or small team use.
-
-Ruwiki:
-* Uses the [http://www.ruby-lang.org Ruby] language.
-* Runs quickly and easily as a CGI or \WEBrick servlet.
-* Uses a simple templating system and CSS for presentation.
-* Has flatfile storage with simple versioning.
-* Offers project namespaces. Different projects can have the same topic names and not collide. Thus, \Default::ReadMe and \Project::ReadMe are two different pages.
-* Offers a calendar for date-based collaborative editing.
-
-$Id$
diff --git a/ruwiki/tags/experimental-0.7/Ruwiki/WikiMarkup b/ruwiki/tags/experimental-0.7/Ruwiki/WikiMarkup
deleted file mode 100644
index 8258492..0000000
--- a/ruwiki/tags/experimental-0.7/Ruwiki/WikiMarkup
+++ /dev/null
@@ -1,214 +0,0 @@
-id: 0
-topic: WikiMarkup
-version: 1
-#EHDR
-= Ruwiki Markup
-A [http://c2.com/cgi/wiki Wiki] obeys certain formatting rules to make it easy
-to format text without needing to know HTML. This Wiki obeys the following
-rules by default. Because Ruwiki is extensible, there may be additional
-formatting rules. These rules are those rules that apply as of Ruwiki 0.7.0.
-
-== \WikiWords, \WikiProjects, Calendars, and External Resources
-While reading stuff on this Wiki, you will see some words mashed together with
-capitalisation (like \WikiWords). While this may seem odd at first, this
-feature allows internal links to be created across the Wiki.
-
-There are several allowable forms for \WikiWords.
-# Two or more words concatenated directly. Each word must begin with a capital letter and be followed by zero or more lowercase letters. Thus, \FooBar, \CPlusPlus, and \AbC are all valid \WikiWords, but ABC is not.
-# Two or more words concatenated with underscores. The first word must begin with a capital letter. This makes \Foo_Bar, \C_Plus_Plus, and \A_b_C valid \WikiWords. These \WikiWords will be displayed with spaces instead of underscores.\C_Plus_Plus will be displayed as "C Plus Plus".
-# One or more words contained in double square brackets. This the form supported by [http://wikipedia.com/ Wikipedia], and looks like \[[A Wiki Phrase]]. These links will be displayed exactly as entered between the brackets.
-# One or more words contained in double square brackets with display text separated by a vertical bar. These \WikiWords look like \[[A Wiki Phrase|but show this text]]. The link will be to the page "A Wiki Phrase" and "but show this text" will be the hyperlink.
-
-If a \WikiWord is found that does not have a page defining the \WikiWord, then
-the word will be shown with a hyperlink question mark following it, allowing
-the \WikiWord to be created.
-
-=== \WikiProjects
-This Wiki supports "projects." Within each project, a given \WikiWord is
-unique. Thus, if you have a Default project and a Ruwiki project, you can have
-two pages called \ReadMe. Any given \WikiWord refers only to topics within its
-project. That is, if I have \WikiWord in the \ReadMe topic of the Default
-project, it will refer to the \WikiWord topic of the Default project. (Another
-term for this capability is "namespaces.")
-
-A cross-project link is composed of the project's name, two colons (::), and
-the \WikiWord desired. Thus, from \Default::ReadMe, I can have \Ruwiki::ReadMe
-as a link. The project index can be referred to with \::Project. This is the
-same as doing \Project::ProjectIndex. Thus, \::Ruwiki becomes ::Ruwiki, which
-is the same as \Ruwiki::ProjectIndex (Ruwiki::ProjectIndex).
-
-=== Calendars
-: <strong>New to Ruwiki 0.7.0!</strong>
-
-Ruwiki now has a calendar. It is possible to tell Ruwiki to generate a
-calendar for a particular month with %calendar. The format of %calendar is:
-
- %calendar(<year>, <month>[, <project>])
- %calendar(today[, <project>])
-
-%calendar accepts either the English word "today" (displaying the calendar for
-the current month and year) or a specific month and year for display. A
-calendar for the specified month will be generated where each date in the
-month is treated as a \WikiWord (as are the links to the current month, the
-previous month, and the next month) ready for display or editing. As with all
-other \WikiWord links in Ruwiki, a project may be specified in %calendar,
-making "%calendar(today, Ruwiki)" different from "%calendar(today, Default)".
-
-%calendar(today)
-%calendar(1999, 08, Default)
-
-=== External Resources
-Ruwiki behaves intelligently about resources external to the Wiki itself.
-
-==== External Links
-\URLs to external resources are automatically detected for web addresses, FTP
-addresses, newsgroups, and email links. They are automatically converted to
-clickable \URLs. Be aware that some things that look like URL schemas may be
-make clickable but are not really \URLs.
-
-* \http://www.ruby-lang.org becomes http://www.ruby-lang.org
-
-\URLs may be named with the [url name] syntax. If the name is omitted, the URL
-will be numbered. Numbering is contained to within the page.
-
-* \[http://www.rubygarden.org RubyGarden] becomes [http://www.rubygarden.org RubyGarden].
-* \[http://www.halostatue.ca] and \[http://www.halostatue.ca/ruby] become [http://www.halostatue.ca] and [http://www.halostatue.ca/ruby].
-
-==== Images
-If \URLs are to JPEG (.jpg, .jpeg), PNG (.png), or GIF (.gif) resources, they
-will be rendered as inline images. This works with automatically converted
-\URLs, named \URLs, or numbered \URLs. Named and numbered \URLs affect the
-TITLE and ALT attribute of the image.
-
-* \http://www.halostatue.ca/graphics/maple_leaf.gif http://www.halostatue.ca/graphics/maple_leaf.gif
-* \[http://www.halostatue.ca/graphics/maple_leaf.gif Maple Leaf] [http://www.halostatue.ca/graphics/maple_leaf.gif Maple Leaf]
-* \[http://www.halostatue.ca/graphics/maple_leaf.gif] [http://www.halostatue.ca/graphics/maple_leaf.gif]
-
-==== Ruby Mailing Lists
-If a Ruby mailing list message tag is provided, it will be converted appropriately.
-
-* \[ruby-talk:12345] will become [ruby-talk:12345]
-* \[ruby-core:12345] will become [ruby-core:12345]
-* \[ruby-doc:12345] will become [ruby-doc:12345]
-
-== Headings and Lists
-=== Headings
-Use equals signs (=) for headings. Up to six equals signs can be used for HTML headings 1 - 6.
-
-\===== Heading five<br />
-\====== Heading six
-===== Heading five
-====== Heading six
-
-=== Lists
-==== Bulleted Lists
-Use asterisks (*) to create bulleted lists. More asterisks means more levels.
-
-\* level 1<br />
-\** level 2<br />
-\*** level 3
-
-* level 1
-** level 2
-*** level 3
-==== Numbered Lists
-Use hash marks (#) for numbered lists. More hash marks means deeper levels.
-
-\# level 1<br />
-\## level 2<br />
-\### level 3<br />
-\# level 1.2
-
-# level 1
-## level 2
-### level 3
-# level 1.2
-==== Definition Lists
-Definitions can be created similar to other lists. Unlike "standard" lists,
-though, definition lists have both the term and the definition. They are
-specified like so. As with other lists, repeating the first item (;) will
-increase the indentation level.
-
-\; term : definition<br />
-\;; term2 : definition<br />
-\;;; term3 : definition
-
-; term : definition
-;; term2 : definition
-;;; term3 : definition
-== Paragraph Formatting
-=== Rules
-Four or more dashes ("----") on a line by itself makes a horizontal rule, like
-so:
-
-\----
-----
-=== Paragraphs
-A blank line (it may have whitespace on it) marks a new paragraph. All other
-lines are joined together (excepting headers, lists, and rules).
-
-This line is a new paragraph.
-=== Block Indent Paragraphs
-Paragraphs can be indented by beginning the paragraph with one or more colons
-(:).
-
-\: Indent Level 1<br />
-\:: Indent Level 2<br />
-\::: Indent Level 3
-
-: Indent Level 1
-:: Indent Level 2
-::: Indent Level 3
-
-Paragraphs may be indented as "cites" by using one or more greater-than signs
-(>) at the beginning of the line.
-
-\> Indent Level 1<br />
-\>> Indent Level 2<br />
-\>>> Indent Level 3
-
-> Indent Level 1
->> Indent Level 2
->>> Indent Level 3
-=== Code
-Text that is indented will be presented as formatted in a monospaced font. The
-only change is to escape HTML entities &lt; (&amp;lt;), &gt; (&amp;gt;), and
-&amp; (&amp;amp;).
-
- def replace
- content = @match[1]
- %Q{<pre>#{content}</pre>}
- end
-
-== Miscellaneous Formatting
-=== HTML
-The Ruwiki engine currently passes through HTML without changes. Thus,
-&lt;strong&gt;strong&lt;/strong&gt; would be shown as <strong>strong</strong>.
-<strong><em>Note:</em></strong> This capability could be very dangerous as it
-could expose the Wiki to cross-site scripting (XSS) vulnerabilities. This will
-be remedied prior to the 1.0 release of Ruwiki.
-
-=== Abbreviations
-Certain abbreviations may be known to the Wiki. While there is not yet any way
-for a user to query what abbreviations are known, if the abbreviations are
-told to the users, they may be used. Abbreviations are presented with @{key},
-where <em>key</em> is the abbreviation desired. This Wiki, for example, knows
-that \@{PM} means @{PM}. The special form \@{} will produce the current list
-of known abbreviations. Unknown abbreviations will simply be put back into the
-data stream unchanged. Thus, \@{unknownkey} results in @{unknownkey}.
-
-==== Known Abbreviations
-@{}
-
-=== Preventing Formatting
-If you wish to prevent a word or sequence from being interpreted, put a
-backslash (\) in front of it. This works on all formatting options except
-paragraph positioning. Thus, if I want to prevent a \WikiWord from being
-turned into a hyperlink, I need to backslash it: \\WikiWord.
-
-=== Other Possible Considerations
-I'm looking at adding styles similar to what is shown on the Wiki below.
-
-* http://www.pmichaud.com/wiki/PmWiki/WikiStyles
-
-$Id$
diff --git a/ruwiki/tags/experimental-0.7/lib/algorithm/diff.rb b/ruwiki/tags/experimental-0.7/lib/algorithm/diff.rb
deleted file mode 100644
index af36214..0000000
--- a/ruwiki/tags/experimental-0.7/lib/algorithm/diff.rb
+++ /dev/null
@@ -1,220 +0,0 @@
-#
-# algorith/diff - a Ruby module to compute difference sets between two
-# objects. Copyright (c) 2001-2002 Lars Christensen.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
-
-module Diff
-
- VERSION = 0.4
-
- attr_reader :diffs
-
- def Diff.lcs(a, b)
- astart = 0
- bstart = 0
- afinish = a.length-1
- bfinish = b.length-1
- mvector = []
-
- # First we prune off any common elements at the beginning
- while (astart <= afinish && bstart <= afinish && a[astart] == b[bstart])
- mvector[astart] = bstart
- astart += 1
- bstart += 1
- end
-
- # now the end
- while (astart <= afinish && bstart <= bfinish && a[afinish] == b[bfinish])
- mvector[afinish] = bfinish
- afinish -= 1
- bfinish -= 1
- end
-
- bmatches = b.reverse_hash(bstart..bfinish)
- thresh = []
- links = []
-
- (astart..afinish).each { |aindex|
- aelem = a[aindex]
- next unless bmatches.has_key? aelem
- k = nil
- bmatches[aelem].reverse_each { |bindex|
- if k && (thresh[k] > bindex) && (thresh[k-1] < bindex)
- thresh[k] = bindex
- else
- k = thresh.replacenextlarger(bindex, k)
- end
- links[k] = [ k!=0 && links[k-1], aindex, bindex ] if k
- }
- }
-
- if !thresh.empty?
- link = links[thresh.length-1]
- while link
- mvector[link[1]] = link[2]
- link = link[0]
- end
- end
-
- return mvector
- end
-
- def Diff.makediff(a, b)
- mvector = Diff.lcs(a, b)
- ai = bi = 0
- while ai < mvector.length
- bline = mvector[ai]
- if bline
- while bi < bline
- yield :+, bi, b[bi]
- bi += 1
- end
- bi += 1
- else
- yield :-, ai, a[ai]
- end
- ai += 1
- end
- while ai < a.length
- yield :-, ai, a[ai]
- ai += 1
- end
- while bi < b.length
- yield :+, bi, b[bi]
- bi += 1
- end
- 1
- end
-
- def Diff.diff(a, b, &block)
- isstring = b.kind_of? String
- diffs = []
-
- block ||= proc { |action, index, element|
- prev = diffs[-1]
- if prev && prev[0] == action &&
- prev[1] + prev[2].length == index
- prev[2] << element
- else
- diffs.push [ action, index, isstring ? element.chr : [element] ]
- end
- }
-
- Diff.makediff(a, b, &block)
-
- return diffs
- end
-
-end
-
-module Diffable
- def diff(b)
- Diff.diff(self, b)
- end
-
- # Create a hash that maps elements of the array to arrays of indices
- # where the elements are found.
-
- def reverse_hash(range = (0...self.length))
- revmap = {}
- range.each { |i|
- elem = self[i]
- if revmap.has_key? elem
- revmap[elem].push i
- else
- revmap[elem] = [i]
- end
- }
- return revmap
- end
-
- # Replace the first element which is larger than value. Assumes that
- # the element indexed by high, if given is larger than value.
-
- def replacenextlarger(value, high = nil)
- high ||= length
- low = 0
- index = found = nil
- while low < high
- index = (high+low) >> 1
- found = self[index]
- if value > found # this first, most common case
- low = index + 1
- elsif value == found
- return nil
- else
- high = index
- end
- end
- self[low] = value
- return low
- end
-
- # Patches self with the given set of differences.
-
- def patch(diffs)
- newary = nil
- kindofstring = kind_of? String
- if kindofstring
- newary = self.class.new('')
- else
- newary = self.class.new
- end
- ai = 0
- bi = 0
- diffs.each { |action,position,elements|
- case action
- when :-
- while ai < position
- newary << self[ai]
- ai += 1
- bi += 1
- end
- ai += elements.length
- when :+
- while bi < position
- newary << self[ai]
- ai += 1
- bi += 1
- end
- if kindofstring
- newary << elements
- else
- newary.push *elements
- end
- bi += elements.length
- else
- raise "Unknown diff action"
- end
- }
- while ai < self.length
- newary << self[ai]
- ai += 1
- bi += 1
- end
- return newary
- end
-end
-
-class Array
- include Diffable
-end
-
-class String
- include Diffable
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki.rb
deleted file mode 100644
index 2f6570a..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki.rb
+++ /dev/null
@@ -1,401 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-require 'digest/md5'
-require 'ruwiki/handler'
-require 'ruwiki/template'
-require 'ruwiki/lang/en' # Default to the English language.
-require 'ruwiki/config'
-require 'ruwiki/backend'
-require 'ruwiki/wiki'
-require 'ruwiki/page'
-
- # = Ruwiki
- # Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI
- # and WEBrick interfaces, templates, and CSS formatting. Additionally, it
- # supports project namespaces, so that two pages can be named the same for
- # differing projects without colliding or having to resort to odd naming
- # conventions. Please see the ::Ruwiki project in the running Wiki for more
- # information. Ruwiki 0.7.0 has German and Spanish translations available.
- #
- # == Quick Start (CGI)
- # 1. Place the Ruwiki directory in a place that your webserver can execute
- # CGI programs and ensure that ruwiki.cgi is executable on your webserver.
- # 2. Point your web browser to the appropriate URL.
- #
- # == Quick Start (WEBrick)
- # 1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
- # 2. Point your web browser to <http://localhost:8808/>.
- #
- # == Configuration
- # There are extensive configuration options available. The Ruwiki WEBrick
- # servlet offers command-line options that simplify the configuration of
- # Ruwiki without editing the servlet; use ruwiki_servlet --help for more
- # information.
- #
- # == Copyright
- # Copyright:: Copyright © 2002 - 2004, Digikata and HaloStatue, Ltd.
- # Authors:: Alan Chen (alan@digikata.com)
- # Austin Ziegler (ruwiki@halostatue.ca)
- # Licence:: Ruby's
-class Ruwiki
- VERSION = '0.7'
-
- ALLOWED_ACTIONS = %w(edit create)
- EDIT_ACTIONS = %w(save cancel)
- EDIT_VARS = %w(newpage origpage topic project old_version version)
- RESERVED = ['action', EDIT_VARS].flatten
-
- # Returns the current configuration object.
- attr_reader :config
- # Returns the current Response object.
- attr_reader :response
- # Returns the current Request object.
- attr_reader :request
- # Returns the current Markup object.
- attr_reader :markup
- # Returns the current Backend object.
- attr_reader :backend
-
- # Sets the configuration object to a new configuration object.
- def config=(c)
- raise message()[:config_not_ruwiki_config] unless c.kind_of?(Ruwiki::Config)
- @config = c
- @markup.default_project = @config.default_project
- end
-
- # The message hash.
- def message
- @config.message
- end
-
- # Initializes Ruwiki.
- def initialize(handler)
- @request = handler.request
- @response = handler.response
-
- @config = Ruwiki::Config.new
-
- @path_info = @request.determine_request_path || ""
-
- @type = nil
- @error = {}
-
- @markup = Ruwiki::Wiki.new(@config.default_project,
- @request.script_url)
- end
-
- # Initializes the backend for Ruwiki.
- def set_backend
- @backend = BackendDelegator.new(self, @config.storage_type)
- @markup.backend = @backend
- end
-
- # Runs the steps to process the wiki.
- def run
- @config.verify
- set_backend
- set_page
- process_page
- render
- rescue Exception => e
- render(:error, e)
- ensure
- output
- end
-
- # Initializes current page for Ruwiki.
- def set_page
- path_info = @path_info.split(%r{/}, -1).map { |e| e.empty? ? nil : e }
-
- if path_info.size == 1 or (path_info.size > 1 and path_info[0])
- raise message()[:invalid_path_info_value] % [@path_info] unless path_info[0].nil?
- end
-
- # path_info[0] will ALWAYS be nil.
- path_info.shift
-
- case path_info.size
- when 0 # Safety check.
- nil
- when 1 # /PageTopic OR /_edit
- set_page_name_or_action(path_info[0])
- when 2 # /Project/ OR /Project/PageTopic OR /Project/_edit OR /Project/create
- @project = path_info.shift
- set_page_name_or_action(path_info[0])
- else # /Project/PageTopic/_edit OR /Project/diff/3,4 OR something else.
- @project = path_info.shift
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- else
- @topic = item
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- end
- end
- end
-
-#@request.each_parameter { |key, val| puts "#{key} :: #{val.class}" }
-
- @request.each_parameter do |key, val|
- next if RESERVED.include?(key)
- @topic = key
- end
-
- @project ||= @request.parameters['project']
- @project ||= @config.default_project
- @topic ||= @config.default_page
- end
-
- # Processes the page through the necessary steps. This is where the edit,
- # save, cancel, and display actions are present.
- def process_page
- content = nil
- page_init = @backend.retrieve(@topic, @project)
-
- page_init[:markup] = @markup
- page_init[:project] ||= @config.default_project
- page_init[:remote_host] = @request.environment['REMOTE_HOST']
- page_init[:remote_addr] = @request.environment['REMOTE_ADDR']
-
- @page = Ruwiki::Page.new(page_init)
-
- @type = :content
-
- # TODO Detect if @action has already been set.
- @action = @request.parameters['action'].downcase if @request.parameters['action']
- # TODO: can we remove this if and put the else logic under the
- # case-else logic?
- if @action
- case @action
- when 'searchproj'
- # get search string
- srchstr = @request.parameters['searchstr']
- # validate and cleanse search string
- vsrchstr = validate_search_string(srchstr)
- @page.content = "Search results for: #{vsrchstr}"
- hits = @backend.search_project(@page.project, vsrchstr)
-
- # debug hit returns
- # hits.each { |key,val| @page.content += "\n #{key} : #{val}" }
-
- # turn hit hash into content
- hitarr = []
- # organize by number of hits
- hits.each do |key,val|
- hitarr[val] ||= []
- hitarr[val].push key
- end
- rhitarr = hitarr.reverse
- maxhits = hitarr.size
- rhitarr.each_with_index do |tarray,rnhits|
- next if( tarray.nil? || tarray.size == 0 )
- nhits = maxhits - rnhits - 1
- @page.content += "\n== #{nhits} Hits\n* " + tarray.join("\n* ") unless nhits <= 0
- end
-
- content = @page.to_html
- @type = :content
-
- when 'topiclist'
- topic_list = @backend.list_topics(@page.project)
-
- # todo: make this localized
- if( topic_list.size == 0 )
- @page.content = "No topics"
- else
- @page.content = <<EPAGE
-= Topics for ::#{@page.project}
-* #{topic_list.join("\n* ")}
-EPAGE
- end
-
- content = @page.to_html
- @type = :content
-
- when 'projectlist'
- proj_list = @backend.list_projects
-
- if( proj_list.size == 0 )
- @page.content = "No projects"
- else
- #todo: make this localized
- @page.content = <<EPAGE
-= Projects in #{@config.title}
-* ::#{proj_list.join("\n* ::")}
-EPAGE
- end
-
- content = @page.to_html
- @type = :content
-
- when 'edit', 'create'
- # Automatically create the project if it doesn't exist or if the
- # action is 'create'.
- @backend.create_project(@page.project) if @action == 'create'
- @backend.create_project(@page.project) unless @backend.project_exists?(@page.project)
- @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR'])
-
- content = nil
- @type = :edit
- when 'save'
- np = @request.parameters['newpage'].gsub(/\r/, "").chomp
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
-
- op = @request.parameters['origpage'].unpack("m*")[0]
-
- if np == op
- @page.content = op
- @type = :content
- else
- @page.content = np
- @page.old_version = @request.parameters['old_version'].to_i + 1
- @page.version = @request.parameters['version'].to_i + 1
- @page.edit_comment = @request.parameters['edcomment']
- @type = :save
- @backend.store(@page)
-
- # hack to ensure that Recent Changes are updated correctly
- if( @page.topic == 'RecentChanges' )
- recentraw = @backend.retrieve(@page.topic, @page.project)
- recentraw[:markup] = @page.markup
- recentpg = Page.new(recentraw)
- @page.content = recentpg.content
- end
- end
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
-
- content = @page.to_html
- when 'cancel'
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.content = @request.parameters['origpage'].unpack("m*")[0]
- @page.old_version = @request.parameters['old_version'].to_i
- @page.version = @request.parameters['version'].to_i
-
- content = @page.to_html
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- else
- # TODO Return a 501 Not Implemented error
- nil
- end
- else
- content = @page.to_html
- end
- rescue Exception => e
- @type = :error
- if e.kind_of?(Ruwiki::Backend::BackendError)
- @error[:name] = "#{message()[:error]}: #{e.to_s}"
- else
- @error[:name] = "#{message()[:complete_utter_failure]}: #{e.to_s}"
- end
- @error[:backtrace] = e.backtrace.join("<br />\n")
- content = nil
- ensure
- @content = content
- end
-
- # Renders the page.
- def render(*args)
- if args.empty?
- type = @type
- error = @error
- else
- raise ArgumentError, message()[:render_arguments] unless args.size == 2
- type = args[0]
- error = {}
- error[:name] = args[1].inspect.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;')
- error[:backtrace] = args[1].backtrace.join("<br />\n")
- end
-
- @rendered_page = ""
- values = { "css_link" => @config.css_link,
- "home_link" => %Q(<a href="#{@request.script_url}">#{@config.title}</a>),
- "encoding" => @config.message[:encoding]
- }
-
- case type
- when :content, :save
- values["wiki_title"] = "#{message()[:error]} - #{@config.title}" if @page.nil?
- values["wiki_title"] ||= "#{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_topic"] = CGI.unescape(@page.topic)
- values["page_raw_topic"] = @page.topic
- values["page_project"] = @page.project
- values["cgi_url"] = @request.script_url
- values["content"] = @content
- if type == :content
- template = TemplatePage.new(@config.template(:body), @config.template(:content), @config.template(:controls))
- else
- template = TemplatePage.new(@config.template(:body), @config.template(:save), @config.template(:controls))
- end
- when :edit
- template = TemplatePage.new(@config.template(:body), @config.template(:edit))
- values["wiki_title"] = "#{message()[:editing]}: #{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_topic"] = CGI.unescape(@page.topic)
- values["page_raw_topic"] = @page.topic
- values["page_project"] = @page.project
- values["cgi_url"] = @request.script_url
- values["page_content"] = @page.content
- values["orig_page"] = [@page.content].pack("m*")
- values["page_old_version"] = @page.old_version.to_s
- values["page_version"] = @page.version.to_s
- values["unedited_page_content"] = @page.to_html
- values["pre_page_content"] = CGI.escapeHTML(@page.content)
- when :error
- template = TemplatePage.new(@config.template(:body), @config.template(:error))
- values["wiki_title"] = "#{message()[:error]} - #{@config.title}"
- values["name"] = error[:name]
- values["backtrace"] = error[:backtrace]
- values["backtrace_email"] = error[:backtrace].gsub(/<br \/>/, '')
- values["webmaster"] = @config.webmaster
- end
-
- template.write_html_on(@rendered_page, values)
- end
-
- # Outputs the page.
- def output
- @response.add_header("Content-type", "text/html")
- @response.add_header("Cache-Control", "max_age=0")
- @response.write_headers
- @response << @rendered_page
- end
-
- # nil if string is invalid
- def validate_search_string(instr)
- return nil if( instr == '' )
-
- modstr = instr.dup
-
- #TODO: add validation of modstr
-
- return modstr
- end
-
-private
- RE_ACTION = %r{^_([[:lower:]]+)$}
-
- def set_page_name_or_action(item)
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- else
- @topic = item
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/backend.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/backend.rb
deleted file mode 100644
index 2448074..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/backend.rb
+++ /dev/null
@@ -1,219 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'algorithm/diff'
-
-class Ruwiki
- # The list of known backends.
- KNOWN_BACKENDS = [:flatfiles]
-
- # The Ruwiki backend delegator. Ruwiki will always instantiate a version
- # of this class which delegates the actual method execution to the Backend
- # class. Error handling is handled by capturing (and possibly forwarding)
- # exceptions raised by the delegate class.
- class BackendDelegator
- def initialize(ruwiki, backend)
- @message = ruwiki.config.message
- options = ruwiki.config.storage_options
-
- unless Ruwiki::KNOWN_BACKENDS.include?(backend)
- raise RuntimeError, @message[:backend_unknown] % [backend]
- end
-
- beconst = (befile = backend.id2name).capitalize
-
- require "ruwiki/backend/#{befile}"
-
- beoptions = options[backend]
- @delegate = Ruwiki::Backend.const_get(beconst).new(beoptions)
- rescue Ruwiki::Backend::BackendError => e
- if e.kind_of?(Array)
- raise Ruwiki::Backend::BackendError.new(nil), @message[e.reason[0]] % e.reason[1]
- else
- raise
- end
- end
-
- # Retrieve the specified topic and project page. Calls Backend#load
- # after verifying that the project exists.
- def retrieve(topic, project = 'Default')
- unless page_exists?(topic, project)
- if project_exists?(project)
- return { :content => "", :topic => topic, :project => project }
- else
- return { :content => @message[:project_does_not_exist] % [project],
- :topic => topic, :project => project }
- end
- end
-
- buffer = @delegate.load(topic, project)
- return { :rawtext => buffer.join(""), :project => project, :topic => topic }
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_read_topic] % [project, topic]
- rescue Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_retrieve_topic] % p
- end
-
- # Stores the specified topic and project page.
- def store(page)
- @delegate.store(page)
-
- # update change page
- begin
- recent_changes = nil
- if( page.topic == 'RecentChanges' )
- recent_changes = page.dup
- else
- rawpage = retrieve( 'RecentChanges', page.project )
- rawpage[:markup] = page.markup
- recent_changes = Page.new(rawpage)
- end
-
- changeline = "* #{Time.now}, #{page.topic}"
- changeline += " : #{page.edit_comment}" unless page.edit_comment == ''
- changeline += "\n"
-
- # add changeline to top of page
- recent_changes.content = changeline + recent_changes.content
- @delegate.store(recent_changes)
- rescue Exception => e
- throw "Couldn't save RecentChanges\n#{e.backtrace}"
- end
-
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_store_topic] % [page.project, page.topic]
- rescue Exception => e
- p = [page.project, page.topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_store_topic] % p
- end
-
- # Destroys the specified topic and project page.
- def destroy(page)
- @delegate.destroy(page)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_destroy_topic] % [page.project, page.topic]
- rescue Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_destroy_topic] % p
- end
-
- # Releases the lock on the page.
- def release_lock(page, address = 'UNKNOWN')
- @delegate.release_lock(page, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_release_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:error_releasing_lock] % p
- end
-
- # Attempts to obtain a lock on the page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- @delegate.obtain_lock(page, address, timeout)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_obtain_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:error_creating_lock] % p
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- @delegate.project_exists?(project)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- @delegate.page_exists?(topic, project)
- end
-
- # Attempts to create the project.
- def create_project(project)
- @delegate.create_project(project)
- rescue Ruwiki::Backend::ProjectExists => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:project_already_exists] % [project]
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_create_project] % [project]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_create_project] % p
- end
-
- # Attempts to destroy the project.
- def destroy_project(project)
- @delegate.destroy_project(project)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_destroy_project] % [project]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_destroy_project] % p
- end
-
- # search a project
- def search_project(project, searchstr)
- #TODO: Validate searchstr is a safe regexp?
- @delegate.search_project(project, searchstr)
- rescue Exception => e
- p = [project, searchstr, e.class, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:search_project_fail] % p
- end
-
- # Return an array of projects
- def list_projects()
- @delegate.list_projects()
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_list_projects]
- rescue Exception => e
- p = ['', %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_list_projects] % p
- end
-
- # Return an array of projects
- def list_topics( projname )
- @delegate.list_topics(projname)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_list_topics] % [projname]
- rescue Exception => e
- p = ['', %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_list_topics] % p
- end
- end
-
-
-
- # The Ruwiki backend abstract class and factory.
- class Backend
- class ProjectExists < StandardError #:nodoc:
- end
- class BackendError < StandardError #:nodoc:
- attr_reader :reason
-
- def initialize(reason, *args)
- @reason = reason
- end
- end
- def initialize(storage_options)
- end
-
- private
- # Creates the current diff object.
- def make_diff(page, oldpage, newpage)
- {
- 'old_version' => page.old_version,
- 'new_version' => page.version,
- 'change_date' => Time.now,
- 'change_ip' => page.change_ip,
- 'change_id' => page.change_id,
- 'diff' => Diff.diff(oldpage, newpage)
- }
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/backend/flatfiles.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/backend/flatfiles.rb
deleted file mode 100644
index 6572aca..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/backend/flatfiles.rb
+++ /dev/null
@@ -1,215 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Backend
- # Stores Ruwiki pages as flatfiles.
- class Flatfiles < Ruwiki::Backend
- # Initializes the flatfile backend. This will read
- # storage_options[:flatfiles] to determine the options set by the
- # user. The following options are known for <tt>:flatfiles</tt>:
- #
- # :data_path:: The directory in which the wiki files will be found.
- # By default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+.
- def initialize(options)
- options[:data_path] ||= "./data/"
- @data_path = options[:data_path]
- @extension = options[:extension]
- if not (File.exists?(@data_path) and File.directory?(@data_path))
- raise Ruwiki::Backend::BackendError.new([:flatfiles_no_data_directory, [@data_path]])
- end
- super options
- end
-
- # Loads the topic page from disk.
- def load(topic, project)
- pagefile = page_file(topic, project)
- buffer = File.readlines(pagefile)
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pf = page_file(page.topic, page.project)
- cf = "#{pf}.rdiff"
-
- oldfile = File.readlines(pf) rescue []
- oldfile.collect! { |e| e.chomp }
- newfile = page.rawtext.split(/\n/)
-
- diff = make_diff(page, oldfile, newfile)
- diffs = []
- File.open(cf, 'rb') { |f| diffs = Marshal.load(f) } if File.exists?(cf)
- diffs << diff
- changes = Marshal.dump(diffs)
-
- File.open(cf, 'wb') { |cfh| cfh.print changes }
- File.open(pf, 'wb') { |pfh| pfh.puts page.rawtext }
- end
-
- # Destroys the topic page.
- def destroy(page)
- pf = page_file(page.topic, page.project)
- File.unlink(pf) if File.exists?(pf)
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- pd = project_directory(project)
- File.exists?(pd) and File.directory?(pd)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- pf = page_file(topic, project)
- project_exists?(project) and File.exists?(pf)
- end
-
- # Tries to create the project.
- def create_project(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::ProjectExists if File.exists?(pd)
- Dir.mkdir(pd)
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # string search all topic names and content in a project and return a
- # has of topic hits
- def search_project(project, searchstr)
-
- re_search = Regexp.new(searchstr, Regexp::IGNORECASE)
-
- hits = {}
- topic_list = list_topics(project)
-
- return hits if( topic_list.size == 0 )
-
- topic_list.each { |topicname| hits[topicname] = 0 }
-
- # search topic content
- topic_list.each do |topicname|
- # search name
- topicname.gsub(re_search) { |mtxt| hits[topicname] += 1 }
-
- # check content
- begin
- buf = load( topicname, project )
- rescue
- # in dev CVS is a directory and fails...
- buf = ['']
- end
- buf.each do |line|
- line.gsub(re_search) { |mtxt| hits[topicname] += 1 }
- end
- end
-
- hits
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
- time = Time.now.to_i
-
- lock_okay = false
- # See if we have the lock already.
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, we don't care how old it
- # is. Thus, release it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lock_okay = true
- end
-
- if lock_okay
- open(lf, 'w') { |lfh| lfh.puts "#{address}\n#{time + timeout}" }
- else
- raise Ruwiki::Backend::BackendError(nil)
- end
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
- time = Time.now.to_i
-
- lock_okay = false
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, then we can safely remove
- # it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lock_okay = true
- end
-
- if lock_okay
- File.unlink(lf) if File.exists?(lf)
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- end
-
- # list projects found in data path
- def list_projects()
- projs = []
- Dir[@data_path + "/*" ].each do |fpath|
- next unless File.directory?( fpath )
- pdir,projdir = File.split(fpath)
- projs.push projdir
- end
- projs
- end
-
- # list topics found in data path
- def list_topics(project)
- pjdir = project_directory(project)
- unless File.exist?(pjdir)
- raise Ruwiki::Backend::BackendError(:no_project)
- end
-
- topiclist = []
- Dir[pjdir + "/*"].each do |tpfile|
- next if( tpfile =~ /.rdiff$/ )
- next unless( File.file?( tpfile ) )
- topiclist.push( File.split(tpfile)[1] )
- end
- topiclist
- end
-
- private
- def project_directory(project)
- File.join(@data_path, project)
- end
-
- def page_file(topic, project = 'Default')
- if @extension.nil?
- File.join(project_directory(project), topic)
- else
- File.join(project_directory(project), "#{topic}.#{@extension}")
- end
- end
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/config.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/config.rb
deleted file mode 100644
index ba3acea..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/config.rb
+++ /dev/null
@@ -1,134 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Features known to Ruwiki.
- KNOWN_FEATURES = [ ]
-
- # Ruwiki configuration.
- class Config
- # Templates known to Ruwiki.
- TEMPLATES = [ :body, :content, :error, :edit, :controls, :save ]
-
- # Adds additional information to the (rare) error reports. Defaults to
- # +false+.
- attr_accessor :debug
- # The default page for display when Ruwiki is called without any
- # arguments. Defaults to +ProjectIndex+
- attr_accessor :default_page
- # The default project for display when Ruwiki is called without any
- # arguments or a project specification. Defaults to +Default+
- attr_accessor :default_project
- # The storage type as a Symbol. Corresponds to a filename that will be
- # found in ruwiki/backend. In this version of Ruwiki, only flatfiles.rb
- # (e.g., :flatfiles) is defined. Defaults to <tt>:flatfiles</tt>.
- attr_accessor :storage_type
- # The options for the specified storage type. This is a hash of hashes
- # with auto-vifification. See the storage type for available options.
- attr_reader :storage_options
- # The options for the specified feature. This is a hash of hashes with
- # auto-vifification. See #features for more information.
- attr_reader :feature_options
- # The path for templates. Defaults to <tt>./templates/</tt>.
- attr_accessor :template_path
- # The name of the Wiki. Defaults to <tt>ruwiki</tt>
- attr_accessor :title
- # The email address of the webmaster for the Wiki. Defaults to +nil+.
- attr_accessor :webmaster
- # The name of the Ruwiki CSS file. Defaults to <tt>ruwiki.css</tt>.
- attr_accessor :css
- # The template set. Templates are always named as
- # <template_path>/<template_set>/<template_kind>.
- #Template filename. Must be reachable by File#read.
- attr_accessor :template_set
- # Ruwiki is internationalized. This method sets the Ruwiki error
- # messages (and a few other messages) )to the specified language Module.
- # The language Module must have a constant Hash called +Message+
- # containing a set of symbols and localized versions of the messages
- # associated with them.
- #
- # If the file 'ruwiki/lang/es.rb' contains the module
- # <tt>Ruwiki::Lang::ES</tt>, the error messages for RSS could be
- # localized to Español thus:
- #
- # require 'ruwiki/lang/es'
- # ...
- # wiki.config.language = Ruwiki::Lang::ES
- #
- # Localization is per wiki instance. In a servlet environment, this may
- # mean that only a single language is recognised.
- #
- # See Ruwiki::Lang::EN for more information.
- attr_accessor :language
- # The message hash.
- attr_reader :message
-
- def language=(l) #:nodoc:
- @language = l
- @message = l::Message
- @message.default = l::Message.default
- end
-
- # Returns the template string
- def template(kind = :body)
- raise ConfigError, message[:no_template_found] % [kind.inspect, @template_set] unless TEMPLATES.include?(kind)
- File.read(File.join(@template_path, @template_set, "#{kind.to_s}.tmpl"))
- end
-
- # Returns a copy of the list of features supported by this Wiki.
- def features
- @features.dup
- end
-
- # Adds a new feature to the Wiki.
- def add_feature(feature)
- raise ConfigError, message[:unknown_feature] % [feature.inspect] unless KNOWN_FEATURES.include?(feature)
- @features << feature
- end
-
- # Returns the CSS stylesheet content for the Wiki. This previously
- # returned the <link> to the stylesheet, but instead returns a <style>
- # block in the head so that the CSS is kept with the template set, which
- # may be kept outside of the HTML area.
- def css_link
- %Q[<style>#{File.read(File.join(@template_path, @template_set, @css))}</style>]
- end
-
- # Creates a new configuration object.
- def initialize
- @debug = false
- @default_project = "Default"
- @default_page = "ProjectIndex"
- @storage_type = :flatfiles
- @storage_options = Hash.new { |h, k| h[k] = {} }
- @template_path = "./templates/"
- @template_set = "default"
- @css = "ruwiki.css"
- @webmaster = nil
- @title = "Ruwiki"
- @features = []
- @feature_options = Hash.new { |h, k| h[k] = {} }
-
- self.language = Ruwiki::Lang::EN
- end
-
- # Verifies that required configuration options are actually set. Right
- # now, it only checks the values that are defaulted to +nil+.
- def verify
- raise ConfigError, message[:no_webmaster_defined] if @webmaster.nil?
- raise ConfigError, message[:invalid_template_dir] % [@template_path] unless File.exists?(@template_path) and File.directory?(@template_path)
- t = File.join(@template_path, @template_set)
- raise ConfigError, message[:no_template_set] % [@template_set] unless File.exists?(t) and File.directory?(t)
- end
-
- class ConfigError < StandardError #:nodoc:
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/handler.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/handler.rb
deleted file mode 100644
index e31bbc1..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/handler.rb
+++ /dev/null
@@ -1,207 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Handler
- class << self
- # Generate a new Handler pair from a CGI request.
- def from_cgi(cgi, output_stream = $stdout)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::CGIRequest.new(cgi)
- o.response = Ruwiki::Handler::CGIResponse.new(cgi, output_stream)
- end
- end
-
- # Generate a new Handler pair from a WEBrick request.
- def from_webrick(req, res)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::WEBrickRequest.new(req)
- o.response = Ruwiki::Handler::WEBrickResponse.new(res)
- end
- end
- end
-
- # Returns the handler's request object.
- attr_accessor :request
- # Returns the handler's response object.
- attr_accessor :response
-
- # Creates the handler pair.
- def initialize(&block) #:yields: self
- @request = nil
- @response = nil
- yield self if block_given?
- end
-
- # REpresents an abstract incoming request. This insulates the rest of
- # the code from knowing whether parameters are passed as part of the
- # path, as parameters in the URL, or in some other fashion.
- class AbstractRequest
- def initialize(*args)
- end
- end
-
- # Handles all requests from web applications.
- #
- # Subclasses should provide:
- # @parameters:: Hash-like object that responds to #[] and #hash_key?]
- # @environment:: Hash-like object that responds to #[]
- class AbstractWebRequest < AbstractRequest
- # The parameters provided via the web request.
- attr_reader :parameters
- # The environment provided to the web request.
- attr_reader :environment
- # The request path.
- attr_reader :path
-
- # Yields each parameter key in succession.
- def each_parameter #:yields: key, value
- @parameters.each { |k, v| yield k, v }
- end
-
- def each_environment #:yields: key, value
- @environment.each { |k, v| yield k, v }
- end
-
- # Return the URL of our server.
- def server_url
- res = "http://" # should detect whether we're in secure server mode.
- if @environment['HTTP_HOST']
- res << @environment['HTTP_HOST']
- else
- res << "#{@environment['SERVER_NAME']}:#{@environment['SERVER_PORT']}"
- end
- end
-
- # Return the URL of this script.
- def script_url
- server_url << @environment['SCRIPT_NAME'].to_s
- end
-
- # Return the URL of this request.
- def request_url
- res = script_url
- res << @environment['PATH_INFO'] if @environment['PATH_INFO']
- query = @environment['QUERY_STRING']
- res << "?#{@environment['QUERY_STRING']}" if query && !query.empty?
- res
- end
-
- # Convert a file path into a URL
- def make_url(project, path)
- "#{server_url}/#{project}/#{path}"
- end
-
- def determine_request_path
- @path = ""
- return @path if @environment['PATH_INFO'].nil?
- @path = @environment['PATH_INFO'].dup
- end
- end
-
- # Request for CGI-based activity to ruwiki.
- class CGIRequest < AbstractWebRequest
- def initialize(cgi, output_stream = $stdout)
- @environment = ENV
- @cgi = cgi
- @parameters = {}
- cgi.params.each { |k, v| @parameters[k] = v[0] }
- super
- end
- end
-
- # Request for WEBrick based servlet activity to ruwiki.
- class WEBrickRequest < AbstractWebRequest
- def initialize(req)
- @environment = req.meta_vars
- @parameters = req.query
- super
- end
- end
-
- # Used to write responses in different execution environments such as
- # CGI and Webrick.
- #
- # If you want to create a new response object, you'll need to implement
- # #add_header, #write_headers, and #<<.
- #
- # The Response object is instantiated with an output stream which must
- # supply +<<+ and +puts+ methods.
- class AbstractResponse
- # Add to the list of headers to be sent back to the client.
- def add_header(key, value)
- raise "Not implemented"
- end
-
- # Write the accumulated headers back to the client.
- def write_headers
- raise "Not implemented"
- end
-
- # Write the string to the client.
- def <<(string)
- raise "Not implemented"
- end
-
- # output_stream must respond to #<< and #puts.
- def initialize(output_stream = $stdout)
- @headers = {}
- @output_stream = output_stream
- end
- end
-
- # CGIResponse is the response object for CGI mode.
- class CGIResponse < AbstractResponse
- # output_stream must respond to #<< and #puts.
- def initialize(cgi, output_stream = $stdout)
- @cgi = cgi
- super(output_stream)
- end
-
- # Add the header pair for later output as a CGI header.
- def add_header(key, value)
- @headers[key] = value
- end
-
- # Write the headers to the stream. The headers can only be written
- # once.
- def write_headers
- return if @written
- @headers.each { |key, value| @output_stream.puts "#{key}: #{value}\r\n" }
- @output_stream.puts
- @written = true
- end
-
- # Output the string to the stream provided.
- def <<(string)
- @output_stream << string
- end
- end
-
- # WEBrickResponse is the response object for WEBrick servlet mode.
- class WEBrickResponse < AbstractResponse
- def initialize(webrick_response)
- @response = webrick_response
- end
-
- def add_header(key,value)
- @response[key] = value
- end
-
- def write_headers
- # Webrick will take care of this on its own.
- end
-
- def <<(string)
- @response.body << string
- end
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/lang/de.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/lang/de.rb
deleted file mode 100644
index a1ffafc..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/lang/de.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Translation by Christian Neukirchen (chneukirchen@yahoo.de) on 22oct2003
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- module Lang
- # Ruwiki::Lang::DE is the German-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module DE
- Message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :encoding => "iso-8859-1",
- # Backend-related messages.
- :backend_unknown => "Unbekanntes Backend %s.",
- :cannot_create_project => "Kann %s nicht erstellen: %s",
- :cannot_destroy_project => "Kann %s nicht zerstören: %s",
- :cannot_destroy_topic => "Kann %s::%s nicht zerstören: %s",
- :cannot_obtain_lock => "Kann keine Sperre für %s::%s erhalten. Bitte in Kürze nochmal versuchen.",
- :cannot_release_lock => "Kann die Sperre für %s::%s nicht lösen. Bitte später nochmal versuchen.",
- :cannot_retrieve_topic => "Kann auf %s::%s nicht zugreifen: %s",
- :cannot_store_topic => "Kann %s::%s nicht speichern: %s",
- :error_creating_lock => "Fehler beim Erzeugen der Sperre von %s::%s: %s",
- :error_releasing_lock => "Fehler beim Lösen der Sperre von %s::%s: %s",
- :flatfiles_no_data_directory => "Das Daten-Verzeichnis (%s) existiert nicht.",
- :no_access_to_create_project => "Keine Berechtigung um das Projekt (%s) zu erstellen.",
- :no_access_to_destroy_project => "Keine Berechtigung um das Projekt (%s) zu zerstören.",
- :no_access_to_destroy_topic => "Kann %s::%s nicht zerstören: %s.",
- :no_access_to_read_topic => "Kann auf %s::%s nicht zugreifen: %s.",
- :no_access_to_store_topic => "Kann %s::%s nicht speichern: %s.",
- :project_already_exists => "Das Projekt %s existiert bereits.",
- :project_does_not_exist => "Das Projekt %s existiert nicht.",
- :no_access_list_projects => "Keine Berechtigung um das Projektliste",
- :no_access_list_topics => "Keine Berechtigung um das Themaliste (%s).",
- :search_project_fail => "Suchprojektausfallen %s Zeichenkette %s",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Die Konfiguration muss von Typ der Klasse Ruwiki::Config sein.",
- :invalid_template_dir => "Der angegebene Pfad für Schablonen (%s) existiert nicht oder ist kein Verzeichnis.",
- :no_template_found => "Keine Schablone %s im Schablonen-Set '%s' gefunden.",
- :no_template_set => "Es gibt kein Schablonen-Set '%s' im Schablonen-Pfad.",
- :no_webmaster_defined => "Konfigurations-Fehler: Webmaster nicht definiert.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fataler Fehler",
- :editing => "Editieren",
- :error => "Fehler",
- :invalid_path_info_value => "Fataler Fehler in der Web-Umgebung. PATH_INFO = %s",
- # Should this really get translated? --chris
- :render_arguments => "Ruwiki#render muss mit zwei oder mehr Argumenten aufgerufen werden.",
- :unknown_feature => "Unbekanntes Feature %s."
- }
- Message.default = proc { |h, k| "Sprachdatei-FEHLER: Unbekannter Nachrichten-Typ #{k.inspect}." }
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/lang/en.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/lang/en.rb
deleted file mode 100644
index bce4273..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/lang/en.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- module Lang
- # Ruwiki::Lang::EN is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module EN
- Message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :encoding => "iso-8859-1",
- # Backend-related messages.
- :backend_unknown => "Backend %s is unknown.",
- :cannot_create_project => "Cannot create project %s: %s",
- :cannot_destroy_project => "Cannot destroy project %s: %s",
- :cannot_destroy_topic => "Cannot destroy %s::%s: %s",
- :cannot_obtain_lock => "Unable to obtain a lock on %s::%s. Try again shortly.",
- :cannot_release_lock => "Unable to release the lock on %s::%s. Try again shortly.",
- :cannot_retrieve_topic => "Cannot retrieve %s::%s: %s",
- :cannot_store_topic => "Cannot store project %s::%s: %s",
- :error_creating_lock => "Error creating lock on %s::%s: %s",
- :error_releasing_lock => "Error releasing lock on %s::%s: %s",
- :flatfiles_no_data_directory => "The data directory (%s) does not exist.",
- :no_access_to_create_project => "No permission to create project %s.",
- :no_access_to_destroy_project => "No permission to destroy project %s::%s.",
- :no_access_to_destroy_topic => "No permission to destroy topic %s::%s.",
- :no_access_to_read_topic => "No permission to retrieve the %s::%s.",
- :no_access_to_store_topic => "No permission to store the %s::%s.",
- :project_already_exists => "Project %s already exists.",
- :project_does_not_exist => "Project %s does not exist.",
- :no_access_list_projects => "No permission to list projects.",
- :no_access_list_topics => "No permission to list topics in project %s.",
- :search_project_fail => "Failure searching project %s with string %s.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Configuration must be of class Ruwiki::Config.",
- :invalid_template_dir => "The specified path for templates (%s) does not exist or is not a directory.",
- :no_template_found => "No template of %s found in template set %s.",
- :no_template_set => "There is no template set '%s' in the template path.",
- :no_webmaster_defined => "Configuration error: Webmaster is unset.",
- # Miscellaneous messages.
- :complete_utter_failure => "Complete and Utter Failure",
- :editing => "Editing",
- :error => "Error",
- :invalid_path_info_value => "Something has gone seriously wrong with the web environment. PATH_INFO = %s",
- :render_arguments => "Ruwiki#render must be called with zero or two arguments.",
- :unknown_feature => "Unknown feature %s."
- }
- Message.default = proc { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/lang/es.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/lang/es.rb
deleted file mode 100644
index aff3019..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/lang/es.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Mauricio Julio Fernández Pradier (batsman.geo@yahoo.com)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- module Lang
- # Ruwiki::Lang::ES is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module ES
- Message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :encoding => "iso-8859-1",
- # Backend-related messages.
- :backend_unknown => "Clase Backend desconocida: %s.",
- :cannot_create_project => "No puede crearse el proyecto %s: %s",
- :cannot_destroy_project => "No puede borrarse el proyecto %s: %s",
- :cannot_destroy_topic => "No puede borrarse %s::%s: %s",
- :cannot_obtain_lock => "Imposible obtener acceso exclusivo sobre %s::%s. Reinténtelo en breve.",
- :cannot_release_lock => "Imposible liberar acceso exclusivo sobre %s::%s. Reinténtelo en breve.",
- :cannot_retrieve_topic => "No puede leerse %s::%s: %s",
- :cannot_store_topic => "No puede archivarse %s::%s: %s",
- :error_creating_lock => "Error al crear el cerrojo sobre %s::%s: %s",
- :error_releasing_lock => "Error al liberar el cerrojo sobre %s::%s: %s",
- :flatfiles_no_data_directory => "El directorio de datos (%s) no existe.",
- :no_access_to_create_project => "Permiso denegado al crear el proyecto %s.",
- :no_access_to_destroy_project => "Permiso denegado al borrar el proyecto %s::%s.",
- :no_access_to_destroy_topic => "Permiso denegado al borrar el nodo %s::%s.",
- :no_access_to_read_topic => "Permiso denegado al leer el nodo %s::%s.",
- :no_access_to_store_topic => "Permiso denegado al salvar el nodo %s::%s.",
- :project_already_exists => "El proyecto %s ya existe.",
- :project_does_not_exist => "El proyecto %s no existe.",
- :no_access_list_projects => "Permiso denegado al lista del proyecto.",
- :no_access_list_topics => "Permiso denagado al lista del nodo, procecto: %s.",
- :search_project_fail => "Falta que busca proyecto %s con la secuencia %s.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "La configuración debe ser de clase Ruwiki::Config.",
- :invalid_template_dir => "El path especificado para plantillas (%s) no existe o no es un directorio.",
- :no_template_found => "No se encontró ninguna plantilla para %s en el conjunto %s.",
- :no_template_set => "No hay ningún juego de plantillas '%s' en el path.",
- :no_webmaster_defined => "Error de configuración: Webmaster no está definido.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fallo total y absoluto.",
- :editing => "Editando",
- :error => "Error",
- :invalid_path_info_value => "Algo huele a podrido en su entorno Web. PATH_INFO = %s",
- :render_arguments => "Ruwiki#render debe ser llamado con cero o dos argumentos.",
- :unknown_feature => "Clase Feature desconocida: %s."
- }
- Message.default = proc { |h, k| "ERROR De la Lengua: Llave desconocida del mensaje #{k.inspect}." }
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/page.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/page.rb
deleted file mode 100644
index 5159f57..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/page.rb
+++ /dev/null
@@ -1,137 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # A generic page for Ruwiki.
- class Page
- # The page ID.
- attr_accessor :page_id
- # The current version of the page.
- attr_accessor :version
- # The previous version of the page.
- attr_accessor :old_version
- # The page topic (the name of the page).
- attr_accessor :topic
- # The project of the page.
- attr_accessor :project
- # Unformatted page text.
- attr_reader :content
- # Formatted page text.
- attr_accessor :formatted
- # need access to markup object for RecentChanges
- attr_accessor :markup
- # on save, the form may provide an edit comment for RecentChanges
- attr_accessor :edit_comment
-
- # The IP address of the person who made the last change.
- def change_ip
- %Q(#{@remote_host} #{@remote_addr})
- end
-
- # The ID, if present, of the person who made the last change. Not yet
- # implemented.
- def change_id
- nil
- end
-
- # Creates a Ruwiki page.
- def initialize(init = {})
- @markup = init[:markup]
- @script = init[:script]
-
- @remote_host = init[:remote_host]
- @remote_addr = init[:remote_addr]
-
- @project = init[:project] || "Default"
- @topic = init[:topic] || "NewTopic"
- @content = init[:content] || ""
- @page_id = init[:page_id] || 0
- @version = init[:version] || 0
- @old_version = @version - 1
-
- @edit_comment = init[:edit_comment] || ""
-
- if init.has_key?(:rawtext)
- @rawtext = init[:rawtext].dup
- @content = parse_header(@rawtext.dup)
- @formatted = parse_content(@content, @project)
- elsif not @content.empty?
- @formatted = parse_content(@content.dup, @project)
- else
- @formatted = ""
- end
- @content.gsub!(/\r/, "")
- end
-
- # The content of the page.
- def content=(content)
- @content = content.gsub(/\r/, "")
- @formatted = parse_content(content, @project)
- end
-
- # Output raw header and raw page context for saving.
- def rawtext
- return <<-EOS
-id: #{@page_id}
-topic: #{@topic}
-version: #{@version}
-#EHDR
-#{@content}
- EOS
- end
-
- # Outputs the HTML version of the page.
- def to_html
- @formatted
- end
-
- private
- HEADER_RE = /^([a-z]+)\s*:\s*(.*)$/
- HEADER_END_RE = /^#EHDR$/
-
- # Parse the header.
- def parse_header(rawtext)
- rawbuf = rawtext.split("\n")
-
- loop do
- break if rawbuf.nil? or rawbuf.empty?
-
- if rawbuf[0] =~ HEADER_END_RE
- rawbuf.shift
- break
- end
-
- match = HEADER_RE.match(rawbuf[0])
-
- if match
- case match[1].intern
- when :id
- @page_id = match[2].to_i
- when :topic
- @topic = match[2]
- when :version
- @version = match[2].to_i
- @old_version = @version - 1
- end
- rawbuf.shift
- end
- end
-
- rawbuf.join("\n")
- end
-
- # Parse the content.
- def parse_content(content, project)
- parsed = @markup.parse(content, project)
-
- parsed
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/servlet.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/servlet.rb
deleted file mode 100644
index d687539..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/servlet.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'webrick'
-
-class Ruwiki
- class Servlet < WEBrick::HTTPServlet::AbstractServlet
- def initialize(config)
- @config = config
- end
-
- # Converts a POST into a GET.
- def do_POST(req, res)
- do_GET(req, res)
- end
-
- def do_GET(req, res)
- # Generate the reponse handlers for Ruwiki from the request and response
- # objects provided.
- wiki = Ruwiki.new(Ruwiki::Handler.from_webrick(req, res))
-
- # Configuration defaults to certain values. This overrides the defaults.
- wiki.config = $config unless $config.nil?
- wiki.run
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/template.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/template.rb
deleted file mode 100644
index 9655f21..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/template.rb
+++ /dev/null
@@ -1,223 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file is originally from rdoc by Dave Thomas (dave@pragprog.com).
-#
-# $Id$
-#++
-class Ruwiki
- # RDoc's cheap-n-cheerful HTML page template system. You create a template
- # containing:
- #
- # * variable names between percent signs (<tt>%fred%</tt>)
- # * blocks of repeating stuff:
- # START:key
- # ... stuff
- # END:key
- #
- # You feed the code a hash. For simple variables, the values are resolved
- # directly from the hash. For blocks, the hash entry corresponding to +key+
- # will be an array of hashes. The block will be generated once for each
- # entry. Blocks can be nested arbitrarily deeply.
- #
- # The template may also contain:
- # IF:key
- # ... stuff
- # ENDIF:key
- #
- # _stuff_ will only be included in the output if the corresponding key is
- # set in the value hash.
- #
- # Usage: Given a set of templates <tt>T1, T2,</tt> etc
- # values = { "name" => "Dave", state => "TX" }
- # t = TemplatePage.new(T1, T2, T3)
- # File.open(name, "w") {|f| t.write_html_on(f, values)}
- # or
- # res = ''
- # t.write_html_on(res, values)
- #
- class TemplatePage
-
- # A context holds a stack of key/value pairs (like a symbol table). When
- # asked to resolve a key, it first searches the top of the stack, then
- # the next level, and so on until it finds a match (or runs out of
- # entries).
- class Context
- def initialize
- @stack = []
- end
-
- def push(hash)
- @stack.push(hash)
- end
-
- def pop
- @stack.pop
- end
-
- # Find a scalar value, throwing an exception if not found. This method
- # is used when substituting the %xxx% constructs
- def find_scalar(key)
- @stack.reverse_each do |level|
- if val = level[key]
- return val unless val.kind_of? Array
- end
- end
- raise "Template error: can't find variable '#{key}'"
- end
-
- # Lookup any key in the stack of hashes
- def lookup(key)
- @stack.reverse_each do |level|
- val = level[key]
- return val if val
- end
- nil
- end
- end
-
- # Simple class to read lines out of a string
- class LineReader
- # we're initialized with an array of lines
- def initialize(lines)
- @lines = lines
- end
-
- # read the next line
- def read
- @lines.shift
- end
-
- # Return a list of lines up to the line that matches a pattern. That
- # last line is discarded.
- def read_up_to(pattern)
- res = []
- while line = read
- if pattern.match(line)
- return LineReader.new(res)
- else
- res << line
- end
- end
- raise "Missing end tag in template: #{pattern.source}"
- end
-
- # Return a copy of ourselves that can be modified without affecting us
- def dup
- LineReader.new(@lines.dup)
- end
- end
-
- # +templates+ is an array of strings containing the templates. We start at
- # the first, and substitute in subsequent ones where the string
- # <tt>!INCLUDE!</tt> occurs. For example, we could have the overall page
- # template containing
- #
- # <html><body>
- # <h1>Master</h1>
- # !INCLUDE!
- # </bost></html>
- #
- # and substitute subpages in to it by passing [master, sub_page]. This
- # gives us a cheap way of framing pages
- def initialize(*templates)
- result = "!INCLUDE!"
- templates.each do |content|
- result.sub!(/!INCLUDE!/, content)
- end
- @lines = LineReader.new(result.split($/))
- end
-
- # Render the templates into HTML, storing the result on +op+ using the
- # method <tt><<</tt>. The <tt>value_hash</tt> contains key/value pairs
- # used to drive the substitution (as described above)
- def write_html_on(op, value_hash)
- @context = Context.new
- op << substitute_into(@lines, value_hash).tr("\000", '\\')
- end
-
- # Substitute a set of key/value pairs into the given template. Keys with
- # scalar values have them substituted directly into the page. Those with
- # array values invoke <tt>substitute_array</tt> (below), which examples a
- # block of the template once for each row in the array.
- #
- # This routine also copes with the <tt>IF:</tt>_key_ directive, removing
- # chunks of the template if the corresponding key does not appear in the
- # hash, and the START: directive, which loops its contents for each value
- # in an array
- def substitute_into(lines, values)
- @context.push(values)
- skip_to = nil
- result = []
-
- while line = lines.read
-
- case line
-
- when /^IF:(\w+)/
- lines.read_up_to(/^ENDIF:#$1/) unless @context.lookup($1)
-
- when /^IFNOT:(\w+)/
- lines.read_up_to(/^ENDIF:#$1/) if @context.lookup($1)
-
- when /^ENDIF:/
- ;
-
- when /^START:(\w+)/
- tag = $1
- body = lines.read_up_to(/^END:#{tag}/)
- inner_values = @context.lookup(tag)
- raise "unknown tag: #{tag}" unless inner_values
- raise "not array: #{tag}" unless inner_values.kind_of?(Array)
- inner_values.each do |vals|
- result << substitute_into(body.dup, vals)
- end
- else
- result << expand_line(line.dup)
- end
- end
-
- @context.pop
-
- result.join("\n")
- end
-
- # Given an individual line, we look for %xxx% constructs and
- # HREF:ref:name: constructs, substituting for each.
- def expand_line(line)
- # Generate a cross reference if a reference is given,
- # otherwise just fill in the name part
-
- line.gsub!(/HREF:(\w+?):(\w+?):/) do
- ref = @context.lookup($1)
- name = @context.find_scalar($2)
-
- if ref and !ref.kind_of?(Array)
- "<a href=\"#{ref}\">#{name}</a>"
- else
- name
- end
- end
-
- # Substitute in values for %xxx% constructs. This is made complex
- # because the replacement string may contain characters that are
- # meaningful to the regexp (like \1)
-
- line = line.gsub(/%([a-zA-Z]\w*)%/) do
- val = @context.find_scalar($1)
- val.tr('\\', "\000")
- end
-
- line
- rescue Exception => e
- $stderr.puts "Error in template: #{e}"
- $stderr.puts "Original line: #{line}"
- exit
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki.rb
deleted file mode 100644
index d315357..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Ruwiki's Wiki markup class. This will convert the Wiki markup known by
- # Ruwiki (defined by Token classes). The algorithm is as follows:
- #
- # 1. For each known Token class, match each instance of it in the content
- # stream. Replace each instance in the content stream with a Token
- # marker: TOKEN_x or \TOKEN_x, where x is a digit representing the
- # Token. (\TOKEN_x is a special case of token matching. See
- # Ruwiki::Markup::Token for more information.) Store the Token for
- # later processing.
- # 2. Go back through the content, replacing each instance of \TOKEN_x
- # with the Token's defined restore value (which should be the same
- # value as was originally matched).
- # 3. Go through the content, replacing each instance of TOKEN_x with the
- # Token's defined replacement value.
- # 4. Go through the tokens, in reverse, and execute the post replacement
- # routine defined by the Token. (This may be necessary to collapse
- # consecutive HTML structures.)
- # 5. Return the parsed content and the collected metadata.
- #
- # == Tokens
- # Look at Ruwiki::Markup::Token describes how to create Token objects.
- class Wiki
- def parse(content, project)
- content = content.dup
- tokens = []
- project ||= @default_project
-
- Token.tokenlist.each do |token|
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, project, @backend, @script)
- tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{tokens.size - 1}"
- else
- "TOKEN_#{tokens.size - 1}"
- end
- end
- end
-
- replaced = []
- s = true
- loop do
- break if replaced.size >= tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].restore
- }
-
- s = content.gsub!(/TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].replace
- }
- end
-
- token_classes = tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
-
- content
- end
-
- attr_accessor :default_project
- attr_accessor :script
- attr_accessor :backend
-
- # Creates the markup class.
- def initialize(default_project, script)
- @default_project = default_project
- @script = script
- end
- end
-end
-
-require 'ruwiki/wiki/tokens'
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens.rb
deleted file mode 100644
index c7ff6c7..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens.rb
+++ /dev/null
@@ -1,132 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # The base Token class. All Token classes must inherit from Token and
- # *must* implement the following methods:
- #
- # [self.regexp] The regular expression that the Token will be
- # replacing.
- # [replace] The mechanism for replacing the Token with the desired
- # results.
- #
- # Token classes <i>should</i> implement the following method:
- # [self.rank] Default: <tt>5000</tt>. Affects the sort order.
- # Must return an integer.
- #
- # Token classes <i>may</i> implement the following methods:
- # [restore] Restores the token without replacement.
- # Implements the results of the escape character.
- # NOTE: each Token class is responsible for its own
- # restore. Tokens that are anchored to the
- # beginning of a line are the most likely to need
- # to reimplement this.
- # [self.post_replace] Performs any necessary massaging of the data. See
- # the implementation of Ruwiki::Wiki::Lists for
- # more information.
- class Token
- @@tokenlist = []
- @@sorted = false
-
- class << self
- # Tokens should define rank if they must be first or last in
- # processing. Otherwise, they are sorted in the order defined.
- def rank
- 5000
- end
-
- # The Wiki parsing routine uses Token.tokenlist to determine the
- # tokens that are processed, and the order in which they are
- # processed. See Token.rank for more information.
- def tokenlist
- unless @@sorted
- head = @@tokenlist.shift
- @@tokenlist.sort! { |a, b| a.rank <=> b.rank }
- @@tokenlist.unshift(head)
- sorted = true
- end
- @@tokenlist
- end
-
- def inherited(child_class) #:nodoc:
- @@tokenlist << Token if @@tokenlist.empty?
-
- # Make the child class post_replace a blank function because we
- # don't want to propogate the currently defined post_replace.
- # The current post_replace is specific to Token_Base only.
- class << child_class
- def self.post_replace(content)
- content
- end
- end
-
- @@tokenlist << child_class
- @@sorted = false
- end
-
- # The replacement regular expression.
- def regexp
- /TOKEN_(\d*)/
- end
- end
-
- # All Token classes must match this header signature if they define
- # #initialize.
- #
- # [match] The MatchData object for this Token.
- # [project] The project being processed.
- # [backend] The backend for the wiki. This is used to determine if
- # the page or project exists. The object passed must
- # respond to #project_exists?(project) and
- # #page_exists?(page, project).
- # [script] The URI to the script.
- def initialize(match, project, backend, script)
- @match = match
- @project = project
- @backend = backend
- @script = script
- end
-
- # The replacement method. Uses @match to replace the token with the
- # appropriate values.
- def replace
- "TOKEN_#{@match[1]}"
- end
-
- # Restores the token without replacement. By default, replaces
- # "dangerous" HTML characters.
- def restore
- @match[0].gsub(/&/, "&amp;").gsub(/</, "&lt;").gsub(/>/, "&gt;")
- end
-
- # The content may need massaging after processing.
- def self.post_replace(content)
- content
- end
- end
- end
-end
-
- # Load the tokens from the ruwiki/wiki/tokens directory.
-tokens_dir = 'ruwiki/wiki/tokens'
-
-$LOAD_PATH.each do |path|
- target = "#{path}/#{tokens_dir}"
- if File.exists?(target) and File.directory?(target)
- Dir::glob("#{target}/*.rb") do |token|
- begin
- require token
- rescue LoadError
- nil
- end
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/00default.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/00default.rb
deleted file mode 100644
index 448ff3f..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/00default.rb
+++ /dev/null
@@ -1,188 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-# $debug = File.open("output.txt", "w")
-
-class Ruwiki
- class Wiki
- # The Paragraph Token class changes blank lines to <p> tags. This class,
- # under the current implementation, should be *first* in the Token list
- # after Token.
- class Paragraph < Ruwiki::Wiki::Token
- # This Token is #rank 0, because it should be first in the Token list.
- def self.rank
- 0
- end
-
- # Matches blank lines. %r{^\s*$}
- def self.regexp
- %r{(^\s*$)}
- end
-
- # Replaces with "<p>"
- def replace
- "</p><p>"
- end
-
- # Ensures that <p> won't be surrounded by <br> tags.
- def self.post_replace(content)
- content.gsub!(%r{\A}, '<p>')
- content.gsub!(%r{\z}, '</p>')
- content.gsub!(%r{^}, '<p>')
- content.gsub!(%r{\n}, "</p>\n")
- content.gsub!(%r{<p>(<p>)+}, '<p>')
- content.gsub!(%r{</p>(</p>)+}, '</p>')
- content.gsub!(%r{((?:<p>(?:.*?)</p>\n)+?<p></p><p></p>)}) do |m|
- r = m.gsub(%r{</p>\n<p>}, "\n<p>")
- r.gsub!(%r{<p></p><p></p>}, "</p>")
- r.gsub!(%r{\n<p>}, "\n")
- r.gsub!(%r{\n</p>}, '</p>')
- r
- end
- content.gsub!(%r{<p></p>}, '')
- content
- end
- end
-
- # The Code Token class converts indented text to "unformatted" (<pre>)
- # text. This class should be *second* in the Token list.
- class Code < Ruwiki::Wiki::Token
- # This Token is #rank 1, because it should be second in the Token list.
- def self.rank
- 1
- end
-
- # Matches indented text. %r{^(\s+\S.*)$}
- def self.regexp
- %r{^(\s+\S.*)$}
- end
-
- # Replaces the text to <pre>content</pre>.
- def replace
- content = @match.captures[0]
- content.gsub!(/&/, '&amp;')
- content.gsub!(/</, '&lt;')
- content.gsub!(/>/, '&gt;')
-
- %Q{</p><pre>#{content}</pre>}
- end
-
- # Converts cases of %r{</pre>(\n|<br ?/?>)<pre>} to \1.
- def self.post_replace(content)
- content.gsub!(%r{</pre>((\n)*</p>(\n)*)?<pre>}, "\n")
- content.gsub!(%r{</pre>(\n|<br ?/?>)?<pre>}, '\1')
- content.gsub!(%r{<p><pre>}, '<pre>')
- content.gsub!(%r{</pre></p>}, '</pre>')
- content
- end
- end
-
- RE_URI_SCHEME = %r{[\w.]+?:}
- RE_URI_PATH = %r{[^\s<>\]]}
- RE_URI_TEXT = %r{[^\]]*}
- RE_IMAGE = /(jpg|jpeg|png|gif)$/
-
- # Converts URLs in the form of [url] to numbered links.
- class NumberedLinks < Ruwiki::Wiki::Token
- class << self
- attr_accessor :count
- end
-
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\]}
- end
-
- def replace
- extlink = @match.captures[0]
-
- NumberedLinks.count ||= 0
- NumberedLinks.count += 1
- name = "[#{NumberedLinks.count}]"
-
- if extlink =~ RE_IMAGE
- %Q{<img src="#{extlink}" title="#{name}" alt="#{name}" />}
- else
- %Q{<a class="rw_extlink" href="#{extlink}">#{name}</a>}
- end
- end
- end
-
- # Converts URLs in the form of [url name] to named links.
- class NamedLinks < Ruwiki::Wiki::Token
- def self.rank
- 3
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\s+(#{RE_URI_TEXT})\]}
- end
-
- def replace
- extlink = @match.captures[0]
- name = @match.captures[1]
-
- if extlink =~ RE_IMAGE
- %Q{<img src="#{extlink}" title="#{name}" alt="#{name}" />}
- else
- %Q{<a class="rw_extlink" href="#{extlink}">#{name}</a>}
- end
- end
- end
-
- # Converts URLs to links where the "name" of the link is the URL itself.
- class ExternalLinks < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{\b(#{RE_URI_SCHEME}#{RE_URI_PATH}+)}
- end
-
- def replace
- extlink = @match.captures[0]
-
- if extlink =~ RE_IMAGE
- %Q{<img src="#{extlink}" title="Image at: #{extlink}" alt="Image at: #{extlink}" />}
- else
- %Q{<a class="rw_extlink" href="#{extlink}">#{extlink}</a>}
- end
- end
- end
-
- # Creates a horizontal rule.
- class HRule < Ruwiki::Wiki::Token
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def replace
- "<hr />"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(<p>)*<hr ?/?>(</p>)*}, "<hr />")
- content.gsub!(%r{\n<hr />}, "</p>\n<hr />")
- content.gsub!(%r{<hr ?/?>\n<br ?/?>}, "<hr />")
- content.gsub!(%r{(\n|<br ?/?>)?<hr>(\n|<br ?/?>)?}, "<hr />")
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/01wikilinks.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/01wikilinks.rb
deleted file mode 100644
index 586bff8..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/01wikilinks.rb
+++ /dev/null
@@ -1,168 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki
- class Wiki
- # This provides the basic WikiWord match. This supports WikiWord,
- # CPlusPlus, ThisIsALink, and C_Plus_Plus.
- RE_WIKI_WORDS = %r{[[:upper:]][\w_]*(?:[[:lower:]]+[[:upper:]_]|[[:upper:]_]+[[:lower:]])[\w_]*}
- # This provides wikipedia format matches, e.g., [[wikipedia links]]. The
- # only restriction on words in this format is that they must NOT begin
- # with an underscore ('_').
- RE_WIKIPEDIA_WORDS = %r{\[\[([^_].*?)\]\]}
- # This provides the basic Wiki Project match.
- RE_PROJECT_WORD = %r{[[:upper:]][[:lower:]]+}
-
- # This provides the Wiki view link format:
- VIEW_LINK = %Q[<a class="rw_pagelink" href="%s">%s</a>]
- EDIT_LINK = %Q[<span class="rw_edittext">%s</span><a class="rw_pagelink" href="%s">?</a>]
-
- # Creates a crosslink for a Project::WikiPage.
- class ProjectCrossLink < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::(#{RE_WIKI_WORDS})}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic.gsub(/_/, ' ')}"]
- else
- EDIT_LINK % ["#{project}::#{topic.gsub(/_/, ' ')}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a crosslink for a Project::WikiPage using a Wikipedia link
- # format.
- class ProjectCrossLinkWikipedia < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::#{RE_WIKIPEDIA_WORDS}}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- if @backend.page_exists?(topic, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic}"]
- else
- EDIT_LINK % ["#{project}::#{topic}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to the project index from ::Project.
- class ProjectIndex < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{(\B|\\)::(#{RE_PROJECT_WORD})}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- project = @match.captures[1]
-
- if @backend.page_exists?('ProjectIndex', project)
- VIEW_LINK % ["#{@script}/#{project}/ProjectIndex", project]
- else
- if @backend.project_exists?(project)
- EDIT_LINK % [project, "#{@script}/#{project}/ProjectIndex/_edit"]
- else
- EDIT_LINK % [project, "#{@script}/#{project}/_create"]
- end
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project.
- class WikiLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\b|\\)(#{RE_WIKI_WORDS})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic.gsub(/_/, ' ')]
- else
- EDIT_LINK % [topic.gsub(/_/, ' '), "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project using a Wikipedia
- # link format.
- class WikipediaLinks < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(\B|\\)#{RE_WIKIPEDIA_WORDS}\B}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- ALT_TEXT = %r{(.+)\|(.+)}o
-
- def replace
- captures = @match.captures
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- at = ALT_TEXT.match(topic)
-
- if not at.nil?
- topic = at.captures[1]
- link = CGI.escape(at.captures[0])
- end
-
- if @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic]
- else
- EDIT_LINK % [topic, "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/abbreviations.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/abbreviations.rb
deleted file mode 100644
index 3329fab..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/abbreviations.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts abbreviations.
- class Abbreviations < Ruwiki::Wiki::Token
- ABBREVIATIONS = {
- "PM" => "PocoMail"
- }
-
- def self.regexp
- %r!@\{([^\}]*)\}!
- end
-
- def replace
- k = @match.captures[0]
- if k.nil? or k.empty?
- data = "<dl>"
- ABBREVIATIONS.each do |k, v|
- data << "<dt>#{k}</dt><dd>#{v}</dd>"
- end
- data << "</dl>"
- else
- if ABBREVIATIONS.has_key?(k)
- data = ABBREVIATIONS[k]
- else
- data = @match[0]
- end
- end
- data
- end
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/calendar.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/calendar.rb
deleted file mode 100644
index 4c38d59..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/calendar.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces Lists
- class Calendar < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?%calendar\s*\((?:(today)|(\d+),\s*(\d+))(?:,\s*(#{RE_PROJECT_WORD}))?\)}
- end
-
- def self.make(year, month)
- result = []
- t = Time.local(year, month, 1)
- r = Array.new(t.wday, nil)
- r << 1
-
- 2.upto(31) do |i|
- break if Time.local(year, month, i).month != month
- r << i
- end
-
- r += Array.new((- r.size) % 7, nil)
-
- 0.step(r.size - 1, 7) do |i|
- result << r[i, 7]
- end
- result
- end
-
- def make_month_link(project, year, month, state = nil)
- ym = "%04d%02d" % [year, month]
- case state
- when :prev
- title = "&laquo; #{year}.#{month}"
- when :next
- title = "#{year}.#{month} &raquo;"
- else
- title = "#{project}::#{year}.#{month}"
- end
- url = "#{@script}/#{project}/#{ym}"
-
- if @backend.page_exists?(ym, project)
- VIEW_LINK % [url, title]
- else
- EDIT_LINK % [title, "#{url}/_edit"]
- end
- end
-
- def replace
- today = @match.captures[0]
- project = @match.captures[3] || @project
- now = Time.now
-
- if today.nil?
- year = @match.captures[1].to_i
- month = @match.captures[2].to_i
- else
- year = now.year
- month = now.month
- end
-
- if (year == now.year) and (month == now.month)
- show_today = now.day
- else
- show_today = nil
- end
-
- result = <<-"CALENDAR_HEAD"
-</p>
-<div class="rw_calendar">
-<table class="rw_calendar" summary="calendar for ::#{project}: #{year}.#{month}">
-<thead>
- CALENDAR_HEAD
-
- result << %Q{ <tr>\n<th colspan="7" class="rw_calendar-current-month">}
- result << make_month_link(project, year, month)
- result << %Q{</th>\n </tr>\n <tr>\n<th colspan="2" class="rw_calendar-prev-month">}
- result << make_month_link(project, year, month - 1, :prev)
- result << %Q{</th>\n<th colspan="3"></th>\n<th colspan="2" class="rw_calendar-next-month">}
- result << make_month_link(project, year, month + 1, :next)
- result << "</th>\n"
-
- result << <<-"CALENDAR_HEAD2"
- </tr>
- <tr>
- <th class="rw_calendar-weekend">Su</th>
- <th class="rw_calendar-weekday">Mo</th>
- <th class="rw_calendar-weekday">Tu</th>
- <th class="rw_calendar-weekday">We</th>
- <th class="rw_calendar-weekday">Th</th>
- <th class="rw_calendar-weekday">Fr</th>
- <th class="rw_calendar-weekend">Sa</th>
- </tr>
-</thead>
-<tbody>
- CALENDAR_HEAD2
-
- Calendar.make(year, month).each do |week|
- result << " <tr>\n"
- week.each do |day|
- if day.nil?
- result << %Q{ <td class="rw_calendar-day"></td>\n}
- else
- date = "%04d%02d%02d" % [year, month, day]
- # Add the ability to create pages based on date here.
- if show_today == day
- result << %Q{ <td class="rw_calendar-today">}
- else
- result << %Q{ <td class="rw_calendar-day">}
- end
- if @backend.page_exists?(date, project)
- result << VIEW_LINK % ["#{@script}/#{project}/#{date}", day]
- else
- result << EDIT_LINK % [day, "#{@script}/#{project}/#{date}/_edit"]
- end
- result << %Q{</td>\n}
- end
- end
- result << " </tr>\n"
- end
-
- result << "</tbody>\n</table>\n</div>\n<p>"
- result
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<p>(\s*</?div(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p>(\s*</?table(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p>(\s*</?t(?:head|body|r)(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p>(\s*<t[hd].+?</t[hd]>\s*)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/headings.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/headings.rb
deleted file mode 100644
index 069f3df..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/headings.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts headings.
- class Headings < Ruwiki::Wiki::Token
-# def self.rank
-# 5
-# end
-
- def self.regexp
- %r{^\\?(=+)\s+(.*)}
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def replace
- level = @match.captures[0].count("=")
- content = @match.captures[1]
- level = 6 if level > 6
- "<h#{level}>#{content}</h#{level}>"
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(</h\d>)\n}) { |m| "#{$1}\n<p>" }
- content.gsub!(%r{(</h\d>)</p>\n<p>}) { |m| "#{$1}\n<p>" }
- content.gsub!(%r{<p>(<h\d>)}, '\1')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/lists.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/lists.rb
deleted file mode 100644
index 9826a9b..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/lists.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces Lists
- class Lists < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((\*)+|(#)+)\s+(.*)}
- end
-
- def replace
- content = @match.captures[3]
-
- if @match.captures[2].nil?
- char = '*'
- elem = 'ul'
- else
- char = '#'
- elem = 'ol'
- end
-
- indent = @match.captures[0].count(char)
-
- pre = ''
- post = ''
- indent.times do
- pre << "<#{elem}><li>"
- post << "</li></#{elem}>"
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<p><([uo]l)>}, '<\1>')
- content.gsub!(%r{</([uo]l)></p>}, '</\1>')
- content.gsub!(%r{</[uo]l>\n?<[uo]l>}, '')
- content.gsub!(%r{</ol>(\n|(<br ?/?>))?<ol>}, '')
- content.gsub!(%r{</ul>(\n|(<br ?/?>))?<ul>}, '')
- content.gsub!(%r{<li><([uo]l)>}, '<\1>')
- content.gsub!(%r{</li><li>}, "</li>\n<li>")
- content.gsub!(%r{</([uo]l)></li>}, '</\1>')
- content.gsub!(%r{([^>])\n<([uo]l)>}) { |m| "#{$1}</p>\n<#{$2}>" }
- content
- end
- end
-
- # Produces block quotes.
- class Blockquotes < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((:+)|(>+))(\s+.*)$}
- end
-
- def replace
- content = @match.captures[3]
-
- if @match.captures[2].nil?
- char = ':'
- cite = ''
- else
- char = '>'
- cite = ' type="cite"'
- end
- indent = @match.captures[0].count(char)
-
- pre = ''
- post = ''
- indent.times do
- pre << "<blockquote#{cite}>"
- post << "</blockquote>"
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</blockquote>(\n|<br ?/?>)?<blockquote[^>]*>}, '')
- content.gsub!(%r{(</?blockquote[^>]*>\n?)\s*}, '\1')
- content.gsub!(%r{</blockquote>(<blockquote[^>]*>)+}, '\1')
- content
- end
- end
-
- # Produces definition lists. Does not completely work correctly.
- class Definitions < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(;+)\s+([^:]+)\s+:\s+(.*)}
- end
-
- def replace
- definition = @match.captures[2]
- term = @match.captures[1]
- indent = @match.captures[0].count(';')
-
- pre = ''
- post = ''
- indent.times do
- pre << "<dl>"
- post << "</dl>"
- end
- "#{pre}<dt>#{term}</dt><dd>#{definition}</dd>#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</dl>(\n|<br ?/?>)?<dl>}, '')
- content.gsub!(%r{</dl>(<dl>)+}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/rubylists.rb b/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/rubylists.rb
deleted file mode 100644
index a33f0df..0000000
--- a/ruwiki/tags/experimental-0.7/lib/ruwiki/wiki/tokens/rubylists.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Convert ruby-talk mailing list references (e.g., [ruby-talk:12345])
- # into named links.
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- # Convert ruby-core/ext/dev/list/math mailing list references (e.g.,
- # [ruby-core:12345]) into named links.
- class OtherRubyLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-(list|doc|core|dev|ext|math):(\d+)\]}
- end
-
- def replace
- ln, lm = @match.captures[0..1]
- %Q(<a class="rw_extlink" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-#{ln}/#{lm}">#{@match[0]}</a>)
- end
- end
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/ruwiki.cgi b/ruwiki/tags/experimental-0.7/ruwiki.cgi
deleted file mode 100644
index 38ede56..0000000
--- a/ruwiki/tags/experimental-0.7/ruwiki.cgi
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.7.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-
- # Customize this if you put the RuWiki files in a different location.
-$LOAD_PATH.unshift("lib")
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-wiki.config.webmaster = "webmaster@domain.com"
-
-# wiki.config.debug = false
-# wiki.config.title = "Ruwiki"
-# wiki.config.default_page = "ProjectIndex"
-# wiki.config.default_project = "Default"
-# wiki.config.storage_type = :flatfiles
-# wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# wiki.config.storage_options[:flatfiles][:extension] = nil
-# wiki.config.template_path = "./templates/"
-# wiki.config.template_set = "default"
-# wiki.config.css = "ruwiki.css"
-
-wiki.run
diff --git a/ruwiki/tags/experimental-0.7/ruwiki_servlet b/ruwiki/tags/experimental-0.7/ruwiki_servlet
deleted file mode 100644
index 846eff1..0000000
--- a/ruwiki/tags/experimental-0.7/ruwiki_servlet
+++ /dev/null
@@ -1,253 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.7.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-$LOAD_PATH.unshift("lib")
-
-require 'webrick'
-require 'ruwiki'
-require 'ruwiki/servlet'
-
-require 'optparse'
-require 'ostruct'
-
-copyright_banner = <<-"COPYRIGHT"
-Ruwiki #{Ruwiki::VERSION}
- Copyright © 2002 - 2004, Digikata and HaloStatue
-
- http://rubyforge.org/projects/ruwiki/
-
- Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-
-Licensed under the same terms as Ruby.
-
-$Id$
-COPYRIGHT
-
- # This is for the WEBrick version of Ruwiki. This has been abstracted to
- # accept a Config global variable to reconfigure Ruwiki after initial
- # creation.
-$config = Ruwiki::Config.new
-
- # Because the servlet can be started from the command-line, provide defaults
- # for all possible configuration options.
-opts = OpenStruct.new
-opts.port = 8808
-opts.addresses = []
-opts.mount = '/'
-opts.do_log = true
-opts.log_dest = $stderr
-opts.threads = 1
-
- # Ruwiki::Config options.
-opts.webmaster = 'webmaster@domain.com'
-opts.debug = false
-opts.title = "Ruwiki"
-opts.default_page = "ProjectIndex"
-opts.default_project = "Default"
-opts.template_path = "./templates/"
-opts.template_set = "default"
-opts.css = "ruwiki.css"
-
-opts.storage_type = :flatfiles
-opts.storage_options = Hash.new { |h, k| h[k] = {} }
-opts.storage_options[opts.storage_type][:data_path] = "./data/"
-opts.storage_options[opts.storage_type][:extension] = nil
-
-ARGV.options do |o|
- o.banner = "Usage: #{File.basename($0)} [options]"
- o.separator ""
- o.separator "WEBrick options:"
- o.on('-P', '--port PORT', Numeric,
- 'Runs the Ruwiki servlet on the specified',
- 'port. Default 8808.') do |port|
- opts.port = port
- end
- o.on('-A', '--accept ADDRESS,ADDRESS,ADDRESS', Array,
- 'Restricts the Ruwiki servlet to accepting',
- 'connections from the specified address or',
- '(comma-separated) addresses. May be',
- 'specified multiple times. Defaults to all',
- 'addresses.') do |address|
- opts.addresses += address
- end
- o.on('-L', '--local',
- 'Restricts the Ruwiki servlet to accepting',
- 'only local connections (12.0.0.1).',
- 'Overrides any previous --accept addresses.') do |local|
- opts.addresses = ["127.0.0.1"]
- end
- o.on('-M', '--mount MOUNT-POINT',
- 'The relative URI from which Ruwiki ',
- 'will be accessible. Defaults to "/".') do |mp|
- opts.mount = mp
- end
- o.on('--[no-]log',
- 'Log WEBrick activity. Default is --log.') do |log|
- opts.do_log = log
- end
- o.on('--logfile LOGFILE', 'The file to which WEBrick logs are',
- 'written. Default is standard error.') do |lf|
- opts.log_dest = lf
- end
- o.on('-T', '--threads THREADS', Integer,
- 'Sets the WEBrick threadcount.') do |tc|
- opts.threads = tc
- end
- o.separator ""
- o.separator "Ruwiki options:"
- o.on('--webmaster WEBMASTER',
- 'The Ruwiki webmaster email address.',
- 'Defaults to "webmaster@domain.com".') do |wm|
- opts.webmaster = wm
- end
- o.on('--[no-]debug',
- 'Turns on Ruwiki debugging. Defaults',
- 'to --no-debug.') do |d|
- opts.debug = d
- end
- o.on('--title TITLE',
- 'Provides the Ruwiki title. Default is',
- '"Ruwiki".') do |t|
- opts.title = t
- end
- o.on('--default-page PAGENAME',
- 'An alternate default page. Default is',
- '"ProjectIndex".') do |dp|
- opts.default_page = dp
- end
- o.on('--default-project PAGENAME',
- 'An alternate default project. Default is',
- '"Default".') do |dp|
- opts.default_project = dp
- end
- o.on('--template-path TEMPLATE_PATH',
- 'The location of Ruwiki templates. Default',
- 'is "./templates".') do |tp|
- opts.template_path = tp
- end
- o.on('--templates TEMPLATES',
- 'The name of the Ruwiki templates. Default',
- 'is "default".') do |tp|
- opts.template_set = tp
- end
- o.on('--css CSS_NAME',
- 'The name of the CSS file in the template',
- 'path. Default is "ruwiki.css".') do |css|
- opts.css = css
- end
- o.on('--storage-type TYPE', Ruwiki::KNOWN_BACKENDS,
- 'Select the storage type:',
- "#{Ruwiki::KNOWN_BACKENDS.join(", ")}") do |st|
- opts.storage_type = st
- end
- o.on('--flatfiles-data-path PATH',
- 'The path where data files are stored.',
- 'Default is "./data".') do |fdp|
- opts.storage_options[:flatfiles][:data_path] = fdp
- end
- o.on('--flatfiles-extension EXT',
- 'The extension for data files. Default',
- 'none.') do |ext|
- opts.storage_options[:flatfiles][:extension] = ext
- end
- o.separator ""
- o.separator "General info:"
- o.on_tail('--help', 'Shows this text.') do
- $stderr.puts o
- exit
- end
- o.on_tail('--version', 'Shows the version of Ruwiki.') do
- $stderr.puts copyright_banner
- exit
- end
- o.parse!
-end
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$config.webmaster = opts.webmaster
-$config.debug = opts.debug
-$config.title = opts.title
-$config.default_page = opts.default_page
-$config.default_project = opts.default_project
-$config.storage_type = opts.storage_type
-$config.storage_options[opts.storage_type] = opts.storage_options[opts.storage_type]
-$config.template_path = opts.template_path
-$config.template_set = opts.template_set
-$config.css = opts.css
-
- # If the list of accepted addresses is not empty, provide IP-based
- # restrictions.
-if not opts.addresses.empty?
- localonly = proc do |sock|
- if not opts.addresses.include?(sock.peeraddr[3])
- msg = "Rejected peer address #{sock.peeraddr[3]}. Connections are only accepted from: #{opts.addresses.join(", ")}."
- raise WEBrick::ServerError, msg
- end
- end
-else
- localonly = nil
-end
-
-if opts.do_log
- if opts.log_dest = $stderr
- dest = $stderr
- opts.log_dest = "stderr"
- else
- dest = File.open(opts.log_dest, "wb+")
- end
- logger = WEBrick::Log.new(dest, WEBrick::Log::DEBUG)
-else
- logger = nil
-end
-
-banner = <<-"BANNER"
-#{copyright_banner}
-
-WEBrick options:
- Port #{opts.port}
- Accepted Addresses #{opts.addresses.join(", ")}
- Mount Point #{opts.mount}
- Logging? #{opts.do_log}
- Log Destination #{opts.log_dest}
- Threads #{opts.threads}
-
-Ruwiki options:
- Webmaster #{opts.webmaster}
- Debugging? #{opts.debug}
- Title #{opts.title}
- Default Project #{opts.default_project}
- Default Page #{opts.default_page}
- Template Path #{opts.template_path}
- Template Set #{opts.template_set}
- CSS Source #{opts.css}
-
- Storage Type #{opts.storage_type}
- Data Path #{opts.storage_options[opts.storage_type][:data_path]}
- Extension #{opts.storage_options[opts.storage_type][:extension]}
-
-BANNER
-
-unless logger.nil?
- banner.each { |b| logger.info(b) }
-end
-# logger << banner unless logger.nil?
-
-server = WEBrick::HTTPServer.new(:Port => opts.port.to_i,
- :StartThreads => opts.threads.to_i,
- :AcceptCallback => localonly,
- :Logger => logger)
-server.mount(opts.mount, Ruwiki::Servlet)
-trap("INT") { server.shutdown; exit }
-server.start
diff --git a/ruwiki/tags/experimental-0.7/ruwiki_servlet.bat b/ruwiki/tags/experimental-0.7/ruwiki_servlet.bat
deleted file mode 100644
index 8d07f19..0000000
--- a/ruwiki/tags/experimental-0.7/ruwiki_servlet.bat
+++ /dev/null
@@ -1,16 +0,0 @@
-@echo off
-REM Ruwiki 0.7.0
-REM Copyright © 2002 - 2004, Digikata and HaloStatue
-REM Alan Chen (alan@digikata.com)
-REM Austin Ziegler (ruwiki@halostatue.ca)
-REM
-REM Licensed under the same terms as Ruby.
-REM $Id$
-REM
-if "%OS%"=="Windows_NT" goto WinNT
-ruby -x "ruwiki_servlet" %1 %2 %3 %4 %5 %6 %7 %8 %9
-goto done
-:WinNT
-ruby -x "ruwiki_servlet" %*
-goto done
-:done
diff --git a/ruwiki/tags/experimental-0.7/templates/de/body.tmpl b/ruwiki/tags/experimental-0.7/templates/de/body.tmpl
deleted file mode 100644
index 85dc5c1..0000000
--- a/ruwiki/tags/experimental-0.7/templates/de/body.tmpl
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=%encoding%" />
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/experimental-0.7/templates/de/content.tmpl b/ruwiki/tags/experimental-0.7/templates/de/content.tmpl
deleted file mode 100644
index f15bf2f..0000000
--- a/ruwiki/tags/experimental-0.7/templates/de/content.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-!INCLUDE!
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/experimental-0.7/templates/de/controls.tmpl b/ruwiki/tags/experimental-0.7/templates/de/controls.tmpl
deleted file mode 100644
index ba01f26..0000000
--- a/ruwiki/tags/experimental-0.7/templates/de/controls.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<form class="rw_nav" action="_searchproj">
- %home_link%
- |
- Thema: <b>%page_topic%</b>
- Projekt: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a>
- <br/>
- <a href="%cgi_url%/%page_project%/RecentChanges">Neue Änderungen</a>
- <a href="%cgi_url%/%page_project%/_topiclist">Themaliste</a>
- <a href="%cgi_url%/_projectlist">Projektliste</a>
- |
- <a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">Edit</a>
- |
- SuchcProjekt:<input type="text" name="searchstr" size="10">
-</form>
diff --git a/ruwiki/tags/experimental-0.7/templates/de/edit.tmpl b/ruwiki/tags/experimental-0.7/templates/de/edit.tmpl
deleted file mode 100644
index 99edfbf..0000000
--- a/ruwiki/tags/experimental-0.7/templates/de/edit.tmpl
+++ /dev/null
@@ -1,15 +0,0 @@
-<div class="rw_nav">%home_link% | <i>Editieren</i> Thema: <b>%page_topic%</b> Projekt: <b>%page_project%</b></div><br />
-
-<form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <p/>Redigieren Sie Anmerkung: <input type="text" name="edcomment" size="10" />
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button accesskey="A" type="submit" name="action" value="save">Außer</button>
- <button accesskey="L" type="submit" name="action" value="cancel" />Löschen</button>
-</form>
-<div class="rw_edit_raw"><h2>Formatfreie Ursprüngliche Version</h2><pre>%pre_page_content%</pre></div>
-<div class="rw_edit_format"><h2>Formatierte Version</h2>%unedited_page_content%</div>
diff --git a/ruwiki/tags/experimental-0.7/templates/de/error.tmpl b/ruwiki/tags/experimental-0.7/templates/de/error.tmpl
deleted file mode 100644
index 0fdbf00..0000000
--- a/ruwiki/tags/experimental-0.7/templates/de/error.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class="rw_nav">%home_link%</div>
-<h1>%name%</h1>
-<p>Schicken Sie dem webmaster einen Report durch <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
-<p>%backtrace%</p>
diff --git a/ruwiki/tags/experimental-0.7/templates/de/ruwiki.css b/ruwiki/tags/experimental-0.7/templates/de/ruwiki.css
deleted file mode 100644
index 5e7ce32..0000000
--- a/ruwiki/tags/experimental-0.7/templates/de/ruwiki.css
+++ /dev/null
@@ -1,32 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #F2FFA7;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-pre { background-color: #FFFFA7; border: 1px solid black; }
-pre pre { border: 0 }
-
-.rw_nav { background-color: #E9967A }
-.rw_edittext { border: 1px dotted blue }
-.rw_pagelink { }
-.rw_extlink { border: 1px solid red }
-.rw_projectxlink { }
-.rw_projectindex { }
-.rw_edit_form { }
-.rw_edit_raw {
- border: 2px solid green;
- float: left;
- max-width: 48%;
- overflow: scroll;
- clear: right;
-}
-.rw_edit_format {
- border: 2px solid blue;
- float: right;
- max-width: 48%;
- clear: none;
-}
diff --git a/ruwiki/tags/experimental-0.7/templates/de/save.tmpl b/ruwiki/tags/experimental-0.7/templates/de/save.tmpl
deleted file mode 100644
index 569c134..0000000
--- a/ruwiki/tags/experimental-0.7/templates/de/save.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-!INCLUDE!
-Gespeicherte Seite <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic%</a><hr />
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/experimental-0.7/templates/default/body.tmpl b/ruwiki/tags/experimental-0.7/templates/default/body.tmpl
deleted file mode 100644
index 2283094..0000000
--- a/ruwiki/tags/experimental-0.7/templates/default/body.tmpl
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=%encoding%" />
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/experimental-0.7/templates/default/content.tmpl b/ruwiki/tags/experimental-0.7/templates/default/content.tmpl
deleted file mode 100644
index f15bf2f..0000000
--- a/ruwiki/tags/experimental-0.7/templates/default/content.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-!INCLUDE!
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/experimental-0.7/templates/default/controls.tmpl b/ruwiki/tags/experimental-0.7/templates/default/controls.tmpl
deleted file mode 100644
index 76da812..0000000
--- a/ruwiki/tags/experimental-0.7/templates/default/controls.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<form class="rw_nav" action="_searchproj">
- %home_link%
- |
- Topic: <b>%page_topic%</b>
- Project: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a>
- <br/>
- <a href="%cgi_url%/%page_project%/RecentChanges">Recent Changes</a>
- <a href="%cgi_url%/%page_project%/_topiclist">Topic List</a>
- <a href="%cgi_url%/_projectlist">Project List</a>
- |
- <a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">Edit</a>
- |
- Search Project:<input type="text" name="searchstr" size="10">
-</form>
diff --git a/ruwiki/tags/experimental-0.7/templates/default/edit.tmpl b/ruwiki/tags/experimental-0.7/templates/default/edit.tmpl
deleted file mode 100644
index 4f702a8..0000000
--- a/ruwiki/tags/experimental-0.7/templates/default/edit.tmpl
+++ /dev/null
@@ -1,15 +0,0 @@
-<div class="rw_nav">%home_link% | <i>Editing</i> Topic: <b>%page_topic%</b> Project: <b>%page_project%</b></div><br />
-
-<form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <p/>Edit Comment: <input type="text" name="edcomment" size="10" />
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button accesskey="S" type="submit" name="action" value="save">Save</button>
- <button accesskey="C" type="submit" name="action" value="cancel" />Cancel</button>
-</form>
-<div class="rw_edit_raw"><h2>Raw Original Value</h2><pre>%pre_page_content%</pre></div>
-<div class="rw_edit_format"><h2>Formatted Version</h2>%unedited_page_content%</div>
diff --git a/ruwiki/tags/experimental-0.7/templates/default/error.tmpl b/ruwiki/tags/experimental-0.7/templates/default/error.tmpl
deleted file mode 100644
index 7c91995..0000000
--- a/ruwiki/tags/experimental-0.7/templates/default/error.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class="rw_nav">%home_link%</div>
-<h1>%name%</h1>
-<p>Send the webmaster a report by <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
-<p>%backtrace%</p>
diff --git a/ruwiki/tags/experimental-0.7/templates/default/ruwiki.css b/ruwiki/tags/experimental-0.7/templates/default/ruwiki.css
deleted file mode 100644
index 6879b1d..0000000
--- a/ruwiki/tags/experimental-0.7/templates/default/ruwiki.css
+++ /dev/null
@@ -1,41 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #F2FFA7;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-pre { background-color: #FFFFA7; border: 1px solid black; }
-pre pre { border: 0 }
-
-.rw_nav { background-color: #E9967A }
-.rw_edittext { border: 1px dotted blue }
-.rw_pagelink { }
-.rw_extlink { border: 1px solid red }
-.rw_projectxlink { }
-.rw_projectindex { }
-.rw_edit_form { }
-.rw_edit_raw {
- border: 2px solid green;
- float: left;
- max-width: 48%;
- overflow: scroll;
- clear: right;
-}
-.rw_edit_format {
- border: 2px solid blue;
- float: right;
- max-width: 48%;
- clear: none;
-}
-.rw_searchbox {
-}
-
-div.rw_calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rw_calendar-today { background-color: #FFFFA7; }
diff --git a/ruwiki/tags/experimental-0.7/templates/default/save.tmpl b/ruwiki/tags/experimental-0.7/templates/default/save.tmpl
deleted file mode 100644
index c1ede91..0000000
--- a/ruwiki/tags/experimental-0.7/templates/default/save.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-!INCLUDE!
-Saved page <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic%</a><hr />
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/experimental-0.7/templates/es/body.tmpl b/ruwiki/tags/experimental-0.7/templates/es/body.tmpl
deleted file mode 100644
index 53bca17..0000000
--- a/ruwiki/tags/experimental-0.7/templates/es/body.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
- <head>
- <title>%wiki_title%</title>
- <!-- 20040306az: Overrode the encoding to use the encoding provided by Batsman. -->
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
-<!--<meta http-equiv="Content-Type" content="text/html; charset=%encoding%" />-->
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/experimental-0.7/templates/es/content.tmpl b/ruwiki/tags/experimental-0.7/templates/es/content.tmpl
deleted file mode 100644
index f15bf2f..0000000
--- a/ruwiki/tags/experimental-0.7/templates/es/content.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-!INCLUDE!
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/experimental-0.7/templates/es/controls.tmpl b/ruwiki/tags/experimental-0.7/templates/es/controls.tmpl
deleted file mode 100644
index bcfcb35..0000000
--- a/ruwiki/tags/experimental-0.7/templates/es/controls.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<form class="rw_nav" action="_searchproj">
- %home_link%
- |
- Nodo: <b>%page_topic%</b>
- Proyecto: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a>
- <br/>
- <a href="%cgi_url%/%page_project%/RecentChanges">Cambios Recientes</a>
- <a href="%cgi_url%/%page_project%/_topiclist">Lista del Nodo</a>
- <a href="%cgi_url%/_projectlist">Lista del Proyecto</a>
- |
- <a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">Editar</a>
- |
- Proyecto De la Búsqueda:<input type="text" name="searchstr" size="10">
-</form>
diff --git a/ruwiki/tags/experimental-0.7/templates/es/edit.tmpl b/ruwiki/tags/experimental-0.7/templates/es/edit.tmpl
deleted file mode 100644
index b45e5e3..0000000
--- a/ruwiki/tags/experimental-0.7/templates/es/edit.tmpl
+++ /dev/null
@@ -1,15 +0,0 @@
-<div class="rw_nav">%home_link% | <i>Editando</i> Nodo: <b>%page_topic%</b> Proyecto: <b>%page_project%</b></div><br />
-
-<form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <p/>Corrija el Comentario: <input type="text" name="edcomment" size="10" />
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button accesskey="S" type="submit" name="action" value="save">Salvar</button>
- <button accesskey="C" type="submit" name="action" value="cancel">Cancelar</button>
-</form>
-<div class="rw_edit_raw"><h2>Texto Original Sin formato</h2><pre>%pre_page_content%</pre></div>
-<div class="rw_edit_format"><h2>Versión con formato</h2>%unedited_page_content%</div>
diff --git a/ruwiki/tags/experimental-0.7/templates/es/error.tmpl b/ruwiki/tags/experimental-0.7/templates/es/error.tmpl
deleted file mode 100644
index 788ba61..0000000
--- a/ruwiki/tags/experimental-0.7/templates/es/error.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="rw_nav">%home_link%</div>
-<h1>%name%</h1>
-<p>Envíe al admistrador de este sitio una notificación por <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">correo electrónico</a>.</p>
-
-<p>%backtrace%</p>
diff --git a/ruwiki/tags/experimental-0.7/templates/es/ruwiki.css b/ruwiki/tags/experimental-0.7/templates/es/ruwiki.css
deleted file mode 100644
index 5e7ce32..0000000
--- a/ruwiki/tags/experimental-0.7/templates/es/ruwiki.css
+++ /dev/null
@@ -1,32 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #F2FFA7;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-pre { background-color: #FFFFA7; border: 1px solid black; }
-pre pre { border: 0 }
-
-.rw_nav { background-color: #E9967A }
-.rw_edittext { border: 1px dotted blue }
-.rw_pagelink { }
-.rw_extlink { border: 1px solid red }
-.rw_projectxlink { }
-.rw_projectindex { }
-.rw_edit_form { }
-.rw_edit_raw {
- border: 2px solid green;
- float: left;
- max-width: 48%;
- overflow: scroll;
- clear: right;
-}
-.rw_edit_format {
- border: 2px solid blue;
- float: right;
- max-width: 48%;
- clear: none;
-}
diff --git a/ruwiki/tags/experimental-0.7/templates/es/save.tmpl b/ruwiki/tags/experimental-0.7/templates/es/save.tmpl
deleted file mode 100644
index 3355885..0000000
--- a/ruwiki/tags/experimental-0.7/templates/es/save.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-!INCLUDE!
-Página salvaguardada <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic%</a><hr />
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/experimental-0.7/tests/harness-cgi.rb b/ruwiki/tags/experimental-0.7/tests/harness-cgi.rb
deleted file mode 100644
index 3872b42..0000000
--- a/ruwiki/tags/experimental-0.7/tests/harness-cgi.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'harness'
-
-ENV["REQUEST_METHOD"] = "HEAD"
-
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_options[:flatfiles][:data_path] = "../data"
-$wiki.config.template_path = "../templates/"
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.storage_options[:flatfiles][:extension] = nil
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/experimental-0.7/tests/harness.rb b/ruwiki/tags/experimental-0.7/tests/harness.rb
deleted file mode 100644
index 2cc233e..0000000
--- a/ruwiki/tags/experimental-0.7/tests/harness.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-$LOAD_PATH.unshift("../lib")
-
-ENV["REQUEST_METHOD"] = "HEAD"
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_options[:flatfiles][:data_path] = "../data"
-$wiki.config.template_path = "../templates/"
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.storage_options[:flatfiles][:extension] = nil
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/experimental-0.7/tests/tc_backend.rb b/ruwiki/tags/experimental-0.7/tests/tc_backend.rb
deleted file mode 100644
index 6991a94..0000000
--- a/ruwiki/tags/experimental-0.7/tests/tc_backend.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.x
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-require 'fileutils'
-
-class TC_Backend_Flatfile < Test::Unit::TestCase
- def setup
- @ffopts = { :data_path => "./test/data" }
-
- # generate a database
- if( File.exists?( @ffopts[:data_path] ) )
- raise "Setup Error: #{@ffopts[:data_path]} exists"
- end
- @flatbase = { 'Proj1' => ['P1TopicOne:this is the content',
- 'P1TopicTwo:more content'],
- 'Proj2' => ['P2TopicOne:this is the content',
- 'P2TopicTwo:more content',
- 'P2TopicThree:even more more content']
- }
-
- @flatbase.each do |key,val|
- prjdir = @ffopts[:data_path] + "/#{key}"
- FileUtils.mkdir_p(prjdir)
- val.each do |topcon|
- topic,content = topcon.split(":")
- File.open(prjdir + "/" + topic, 'w') { |fh| fh.puts content }
- end
- end
-
- @backend = nil
- @pg = nil
- end
-
- def teardown
- # remove testing flatabase
- FileUtils.rm_rf( @ffopts[:data_path] )
- Dir.rmdir("./test") # ugly but it works
- end
-
- def test_list_projects
- assert_nothing_raised do
- @backend = ::Ruwiki::Backend::Flatfiles.new(@ffopts)
- end
-
- # should be ['Proj1', 'Proj2']
- assert_equal( @flatbase.keys, @backend.list_projects )
- end
-
- def test_list_topics
- assert_nothing_raised do
- @backend = ::Ruwiki::Backend::Flatfiles.new(@ffopts)
- end
-
- @flatbase.keys.sort.each do |proj|
- got_topics = @backend.list_topics( proj )
- exp_topics = @flatbase[proj].map { |ent| ent.split(':')[0] }
- assert_equal( exp_topics, got_topics )
- end
- end
-
- # test simple one word lookups
- # need to add more complex search strings
- def test_search_project
- assert_nothing_raised do
- @backend = ::Ruwiki::Backend::Flatfiles.new(@ffopts)
- end
-
- assert_equal( { 'P1TopicOne'=>1, 'P1TopicTwo'=>0 }, @backend.search_project('Proj1', 'this') )
- assert_equal( { 'P1TopicOne'=>0, 'P1TopicTwo'=>1 }, @backend.search_project('Proj1', 'more') )
- assert_equal( { 'P1TopicOne'=>1, 'P1TopicTwo'=>1 }, @backend.search_project('Proj1', 'topic') )
- assert_equal( { 'P1TopicOne'=>1, 'P1TopicTwo'=>1 }, @backend.search_project('Proj1', 'content') )
- assert_equal( { 'P2TopicOne'=>0, 'P2TopicTwo'=>1, 'P2TopicThree'=>2 }, @backend.search_project('Proj2', 'more') )
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/tests/tc_bugs.rb b/ruwiki/tags/experimental-0.7/tests/tc_bugs.rb
deleted file mode 100644
index 8313496..0000000
--- a/ruwiki/tags/experimental-0.7/tests/tc_bugs.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.x
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-
-# see if we can reproduce the LicenseandAuthor hang
-# described in bug id 147 on rubyforge
-class TC_LicenseAndAuthorHang < Test::Unit::TestCase
- def setup
- @ffopts = { :data_path => "../data" }
-
- @backend = nil
- @pg = nil
- end
-
- # load "to the metal"
- def test_ffload
- assert_nothing_raised do
- @backend = ::Ruwiki::Backend::Flatfiles.new(@ffopts)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.load('LicenseAndAuthorInfo', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-
- # abstract backend retreive
- def test_beload
- @backend = nil
- assert_nothing_raised do
- mock_ruwiki = OpenStruct.new
- mock_ruwiki.config = OpenStruct.new
- mock_ruwiki.config.message = {}
- mock_ruwiki.config.storage_options = { :flatfiles => @ffopts }
-
- @backend = ::Ruwiki::BackendDelegator.new(mock_ruwiki, :flatfiles)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.retrieve('LicenseAndAuthorInfo', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-end
-
-# if __FILE__ == $0
-# ObjectSpace.each_object { |o| tests << o if o.kind_of?(Class) }
-# tests.delete_if { |o| !o.ancestors.include?(Test::Unit::TestCase) }
-# tests.delete_if { |o| o == Test::Unit::TestCase }
-
-# tests.each { |test| Test::Unit::UI::Console::TestRunner.run(test) }
-# end
diff --git a/ruwiki/tags/experimental-0.7/tests/tc_tokens.rb b/ruwiki/tags/experimental-0.7/tests/tc_tokens.rb
deleted file mode 100644
index ce6082f..0000000
--- a/ruwiki/tags/experimental-0.7/tests/tc_tokens.rb
+++ /dev/null
@@ -1,266 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.1
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-require 'test/unit'
-require 'harness-cgi'
-
-class TokenTestCases < Test::Unit::TestCase
- def setup
- @mrw = MockRuwiki.new
- end
-
- class MockRuwiki
- def initialize
- @project = "Default"
- @tokens = []
- end
-
- def __tokenize(content, token)
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, @project, $wiki.backend, $wiki.request.script_url)
- @tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{@tokens.size - 1}"
- else
- "TOKEN_#{@tokens.size - 1}"
- end
- end
- content
- end
-
- def __replace(content)
- replaced = []
- s = true
- loop do
- break if replaced.size >= @tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].restore
- end
-
- s = content.gsub!(/TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].replace
- end
- end
- content
- end
-
- def __post_replace(content)
- token_classes = @tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
- content
- end
-
- end
-
- def __process(token, content, tokenized, replaced, result)
- assert_equal(tokenized, content = @mrw.__tokenize(content, token))
- assert_equal(replaced, content = @mrw.__replace(content))
- assert_equal(result, content = @mrw.__post_replace(content))
- end
-
- def __display(token, content)
- p tokenized = @mrw.__tokenize(content.dup, token)
- p replaced = @mrw.__replace(tokenized.dup)
- p result = @mrw.__post_replace(replaced.dup)
- end
-
- def test_Paragraph
- token = Ruwiki::Wiki::Paragraph
- content = "\nABC\n\nabc\n"
- tkv = "TOKEN_0\nABC\nTOKEN_1\nabc\n"
- rpv = "</p><p>\nABC\n</p><p>\nabc\n"
- res = "<p>\nABC</p>\n<p>abc</p>\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Code
- content = " line 1\n line 2\nline3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_0\nTOKEN_1\nline3\n"
- rpv = "</p><pre> line 1</pre>\n</p><pre> line 2</pre>\nline3\n"
- res = "</p><pre> line 1\n line 2</pre>\nline3\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NumberedLinks
- token = Ruwiki::Wiki::NumberedLinks
- content = "[http://www.ruby-lang.org] \\[http://www.rubyforge.org]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
- res = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NamedLinks
- token = Ruwiki::Wiki::NamedLinks
- content = "[http://www.ruby-lang.org Ruby] \\[http://www.rubyforge.org RubyForge]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
- res = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ExternalLinks
- token = Ruwiki::Wiki::ExternalLinks
- content = "http://www.ruby-lang.org \\http://www.rubyforge.org"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
- res = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_HRule
- token = Ruwiki::Wiki::HRule
- content = "----\n\\----"
- tkv = "TOKEN_0\n\\TOKEN_1"
- rpv = "<hr />\n----"
- res = "<hr />\n----"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLink
- token = Ruwiki::Wiki::ProjectCrossLink
- content = "Ruwiki::ChangeLog \\Ruwiki::To_Do Ruwiki::NotExist \\Ruwiki::NotExist"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rw_edittext">Ruwiki::NotExist</span><a class="rw_pagelink" href="http://:/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
- res = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rw_edittext">Ruwiki::NotExist</span><a class="rw_pagelink" href="http://:/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLinkWikipedia
- token = Ruwiki::Wiki::ProjectCrossLinkWikipedia
- content = "Ruwiki::[[ChangeLog]] \\Ruwiki::[[To_Do]] Ruwiki::[[Does Not Exist]] \\Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 Ruwiki::[[_invalid]]"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rw_edittext">Ruwiki::Does Not Exist</span><a class="rw_pagelink" href="http://:/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
- res = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rw_edittext">Ruwiki::Does Not Exist</span><a class="rw_pagelink" href="http://:/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectIndex
- token = Ruwiki::Wiki::ProjectIndex
- content = "::Ruwiki \\::Ruwiki ::Newproject \\::Newproject"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rw_edittext">Newproject</span><a class="rw_pagelink" href="http://:/Newproject/_create">?</a> ::Newproject}
- res = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rw_edittext">Newproject</span><a class="rw_pagelink" href="http://:/Newproject/_create">?</a> ::Newproject}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikiLinks
- token = Ruwiki::Wiki::WikiLinks
- content = "ProjectIndex \\ProjectIndex AustinZiegler \\AustinZiegler Alan_Chen \\Alan_Chen"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rw_edittext">AustinZiegler</span><a class="rw_pagelink" href="http://:/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rw_edittext">Alan Chen</span><a class="rw_pagelink" href="http://:/Default/Alan_Chen/_edit">?</a> Alan_Chen}
- res = %Q{<a class="rw_pagelink" href="http://:/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rw_edittext">AustinZiegler</span><a class="rw_pagelink" href="http://:/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rw_edittext">Alan Chen</span><a class="rw_pagelink" href="http://:/Default/Alan_Chen/_edit">?</a> Alan_Chen}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikipediaLinks
- token = Ruwiki::Wiki::WikipediaLinks
- content = "[[ProjectIndex]] \\[[ProjectIndex]] [[Austin Ziegler]] \\[[Austin Ziegler]] [[_Alan Chen]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 [[_Alan Chen]]"
- rpv = %Q{<a class=\"rw_pagelink\" href=\"http://:/Default/ProjectIndex\">ProjectIndex</a> [[ProjectIndex]] <span class=\"rw_edittext\">Austin Ziegler</span><a class=\"rw_pagelink\" href=\"http://:/Default/Austin+Ziegler/_edit\">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
- res = %Q{<a class=\"rw_pagelink\" href=\"http://:/Default/ProjectIndex\">ProjectIndex</a> [[ProjectIndex]] <span class=\"rw_edittext\">Austin Ziegler</span><a class=\"rw_pagelink\" href=\"http://:/Default/Austin+Ziegler/_edit\">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Abbreviations
- token = Ruwiki::Wiki::Abbreviations
- content = "@{PM}\n@{}\n\\@{PM}"
- tkv = "TOKEN_0\nTOKEN_1\n\\TOKEN_2"
- rpv = "PocoMail\n<dl><dt>PM</dt><dd>PocoMail</dd></dl>\n@{PM}"
- res = "PocoMail\n<dl><dt>PM</dt><dd>PocoMail</dd></dl>\n@{PM}"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Headings
- token = Ruwiki::Wiki::Headings
- content = "= header 1\n== header 2\n=== header 3\n==== header 4\n===== header 5\n====== header 6\n======= header 7->6\n\\== noheader 2\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\nTOKEN_6\n\\TOKEN_7\n"
- rpv = "<h1>header 1</h1>\n<h2>header 2</h2>\n<h3>header 3</h3>\n<h4>header 4</h4>\n<h5>header 5</h5>\n<h6>header 6</h6>\n<h6>header 7->6</h6>\n== noheader 2\n"
- res = "<h1>header 1</h1>\n<h2>header 2</h2>\n<h3>header 3</h3>\n<h4>header 4</h4>\n<h5>header 5</h5>\n<h6>header 6</h6>\n<h6>header 7->6</h6>\n<p>== noheader 2\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Lists
- content = "* level 1\n** level 2\n*** level 3\n* level 1, item 2\n\\* not an item\n"
- content << "# level 1\n## level 2\n### level 3\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\nTOKEN_5\nTOKEN_6\nTOKEN_7\nTOKEN_8\n\\TOKEN_9\n"
- rpv = "<ul><li>level 1</li></ul>\n<ul><li><ul><li>level 2</li></ul></li></ul>\n<ul><li><ul><li><ul><li>level 3</li></ul></li></ul></li></ul>\n<ul><li>level 1, item 2</li></ul>\n* not an item\n<ol><li>level 1</li></ol>\n<ol><li><ol><li>level 2</li></ol></li></ol>\n<ol><li><ol><li><ol><li>level 3</li></ol></li></ol></li></ol>\n<ol><li>level 1, item 2</li></ol>\n# not an item\n"
- res = "<ul><li>level 1</li><ul><li>level 2</li><ul><li>level 3</li></ul></ul><li>level 1, item 2</li></ul>\n* not an item\n<ol><li>level 1</li><ol><li>level 2</li><ol><li>level 3</li></ol></ol><li>level 1, item 2</li></ol>\n# not an item\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Blockquotes
- token = Ruwiki::Wiki::Blockquotes
- content = ": level 1\n:: level 2\n::: level 3\n: level 1, para 2\n\\: not a blockquote\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = "<blockquote> level 1</blockquote>\n<blockquote><blockquote> level 2</blockquote></blockquote>\n<blockquote><blockquote><blockquote> level 3</blockquote></blockquote></blockquote>\n<blockquote> level 1, para 2</blockquote>\n: not a blockquote\n"
- res = "<blockquote>level 1<blockquote>level 2<blockquote>level 3</blockquote></blockquote>level 1, para 2</blockquote>\n: not a blockquote\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Definitions
- content = "; word1 : val1\n;; word2 : val2\n;;; word3 : val3\n; word1/2 : val1/2\n\\; not-a-word : not-a-val\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = "<dl><dt>word1</dt><dd>val1</dd></dl>\n<dl><dl><dt>word2</dt><dd>val2</dd></dl></dl>\n<dl><dl><dl><dt>word3</dt><dd>val3</dd></dl></dl></dl>\n<dl><dt>word1/2</dt><dd>val1/2</dd></dl>\n; not-a-word : not-a-val\n"
- res = "<dl><dt>word1</dt><dd>val1</dd><dl><dt>word2</dt><dd>val2</dd><dl><dt>word3</dt><dd>val3</dd></dl></dl><dt>word1/2</dt><dd>val1/2</dd></dl>\n; not-a-word : not-a-val\n"
-
-# __display(token, content)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_RubyTalkLinks
- token = Ruwiki::Wiki::RubyTalkLinks
- content = "[ruby-talk:12345] \\[ruby-talk:12345]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = "<a class=\"rw_extlink\" href=\"http://www.ruby-talk.org/12345\">[ruby-talk:12345]</a> [ruby-talk:12345]"
- res = "<a class=\"rw_extlink\" href=\"http://www.ruby-talk.org/12345\">[ruby-talk:12345]</a> [ruby-talk:12345]"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_OtherRubyLinks
- token = Ruwiki::Wiki::OtherRubyLinks
- content = "[ruby-list:123] \\[ruby-list:123] [ruby-doc:123] \\[ruby-doc:123] [ruby-core:123] \\[ruby-core:123] [ruby-dev:123] \\[ruby-dev:123] [ruby-ext:123] \\[ruby-ext:123] [ruby-math:123] \\[ruby-math:123]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5 TOKEN_6 \\TOKEN_7 TOKEN_8 \\TOKEN_9 TOKEN_10 \\TOKEN_11"
- rpv = "<a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123\">[ruby-list:123]</a> [ruby-list:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123\">[ruby-doc:123]</a> [ruby-doc:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123\">[ruby-core:123]</a> [ruby-core:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123\">[ruby-dev:123]</a> [ruby-dev:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123\">[ruby-ext:123]</a> [ruby-ext:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123\">[ruby-math:123]</a> [ruby-math:123]"
- res = "<a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123\">[ruby-list:123]</a> [ruby-list:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123\">[ruby-doc:123]</a> [ruby-doc:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123\">[ruby-core:123]</a> [ruby-core:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123\">[ruby-dev:123]</a> [ruby-dev:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123\">[ruby-ext:123]</a> [ruby-ext:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123\">[ruby-math:123]</a> [ruby-math:123]"
-
- __process(token, content, tkv, rpv, res)
- end
-end
diff --git a/ruwiki/tags/experimental-0.7/tests/testall.rb b/ruwiki/tags/experimental-0.7/tests/testall.rb
deleted file mode 100755
index 2ec06a8..0000000
--- a/ruwiki/tags/experimental-0.7/tests/testall.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env ruby
-
-puts "Checking for test cases:"
-Dir['tc*.rb'].each do |testcase|
- puts "\t#{testcase}"
- require testcase
-end
-puts " "
diff --git a/ruwiki/tags/release-0.6.1/Default/ProjectIndex b/ruwiki/tags/release-0.6.1/Default/ProjectIndex
deleted file mode 100644
index be7db9b..0000000
--- a/ruwiki/tags/release-0.6.1/Default/ProjectIndex
+++ /dev/null
@@ -1,19 +0,0 @@
-id: 0
-topic: ProjectIndex
-version: 1
-#EHDR
-= Ruwiki
-Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI and
-\WEBrick interfaces, templates, and CSS formatting. Additionally, it supports
-project namespaces, so that two pages can be named the same for differing
-projects without colliding or having to resort to odd naming conventions.
-Please see ::Ruwiki for more information.
-
-The current version is 0.6.1.
-
-Projects:
-* ::Default
-* ::Ruwiki
-
-Please go to ::Ruwiki if you are unfamiliar with the concept of Wikis in
-general. If you want to play with \WikiFormatting, use the Ruwiki::SandBox.
diff --git a/ruwiki/tags/release-0.6.1/README b/ruwiki/tags/release-0.6.1/README
deleted file mode 100644
index 0f39755..0000000
--- a/ruwiki/tags/release-0.6.1/README
+++ /dev/null
@@ -1,48 +0,0 @@
-Ruwiki 0.6.1
-------------
-Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI and
-WEBrick interfaces, templates, and CSS formatting. Additionally, it supports
-project namespaces, so that two pages can be named the same for differing
-projects without colliding or having to resort to odd naming conventions.
-Please see ::Ruwiki in the running Wiki for more information.
-
-Quick Install (CGI)
--------------------
-1. Place the Ruwiki directory in a place that your webserver can execute CGI
- programs. Ensure that ruwiki.cgi is executable on your webserver. You may
- wish to protect templates/, data/, and lib/ from casual access.
-2. Modify the following lines in ruwiki.cgi:
- wiki.config.webmaster = ...
- wiki.config.title = ...
-3. Point your web browser to the appropriate URL.
-
-Quick Install (WEBrick)
------------------------
-1. Modify the following lines in ruwiki_servlet.rb:
- $config.webmaster = ...
- $config.title = ...
-2. Run ruwiki_servlet.rb to start a WEBrick instance on localhost:8808 with
- ruwiki bound to the root path (e.g., http://localhost:8808/).
-3. Point your web browser to the appropriate URL.
-
-Use
----
-Ruwiki is able to be called with one of several URI forms:
-
- http://domain.com/ruwiki.cgi?PageName
- http://domain.com/ruwiki.cgi?PageName&project=Project
- http://domain.com/ruwiki.cgi/PageName
- http://domain.com/ruwiki.cgi/Project/
- http://domain.com/ruwiki.cgi/Project/PageName
-
-Copyright: Copyright © 2003 - 2003, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-* This software includes algorithm/diff by Lars Christensen, available for
- download from the RAA at: http://raa.ruby-lang.org/list.rhtml?name=diff
-* This software includes template.rb from Dave Thomas's rdoc system, available
- for download from SourceForge: http://rdoc.sourceforge.net
-
-$Id$
diff --git a/ruwiki/tags/release-0.6.1/Ruwiki/BugTracking b/ruwiki/tags/release-0.6.1/Ruwiki/BugTracking
deleted file mode 100644
index 85de912..0000000
--- a/ruwiki/tags/release-0.6.1/Ruwiki/BugTracking
+++ /dev/null
@@ -1,19 +0,0 @@
-id: 0
-topic: BugTracking
-version: 1
-#EHDR
-= Ruwiki 0.6.1 Bug Tracking
-This page is for tracking bugs in the Ruwiki project. Because of the extensive
-nature of the changes between Ruwiki 0.3.0 and Ruwiki 0.5.0 (and 0.6.x), the
-previously listed bugs have been erased.
-
-You may also be interested in the Ruwiki::To_Do list.
-
-----
-== Closed Bugs
-* Projects aren't created appropriately. Fixed in 0.6.1.
-* Saving without editing (or repost) appears to cause problems. A fix has been applied to attempt to address this. Pages that have not been changed will not be saved.
-
-----
-== Open Bugs
-* Not all formatting is applied consistently. The token rankings may need adjusting.
diff --git a/ruwiki/tags/release-0.6.1/Ruwiki/ChangeLog b/ruwiki/tags/release-0.6.1/Ruwiki/ChangeLog
deleted file mode 100644
index 014c2c7..0000000
--- a/ruwiki/tags/release-0.6.1/Ruwiki/ChangeLog
+++ /dev/null
@@ -1,36 +0,0 @@
-id: 0
-version: 1
-topic: ChangeLog
-#EHDR
-= Ruwiki 0.6.1 ChangeLog
-Uncompleted to-do items can be found in To_Do. Bugs in Ruwiki are tracked in
-BugTracking.
-
-== Version 0.6.1
-* Changed Config#data_path to Config#storage_options[:flatfiles][:data_path]. This represents a generalisation of storage type options so that the Config object is not polluted with storage type options. Config#storage_options keys should be the same Ruby Symbol as is used in Config#storage_type.
-* Added Config#storage_options[:flatfiles][:extension], based on a request by Chad Fowler. This allows you to have Project/\TopicFile actually stored as Project/\TopicFile.wiki if Config#storage_options[:flatfiles][:extension] is set to <tt>wiki</tt>. The default for Config#storage_options[:flatfiles][:extension] is <tt>nil</tt>.
-* Fixed incorrect references. I had been incorrectly attributing [http://sourceforge.net/projects/rdoc-wiki RDoc Wiki] to Dave Thomas. RDoc Wiki is by Michael Neumann. However, the project I pulled from <b>is</b> by Dave Thomas, but it's [http://sourceforge.net/projects/rublog RubLog]. Apologies to both developers.
-* Added RuwikiTemplatingLibrary documentation.
-* Internationalized messages, except for the templating library.
-* Added configuration API for future work surrounding features. The existing wiki is mostly feature complete. Additional features (such as access controls) will be added through the feature interface.
-* Fixed project creation.
-* Fixed problems with WikiWord links.
-* Added Wikipedia-style Wiki links (\[[list of words]]).
-* Fixed a potential problem with re-posted data or saving without editing.
-* Added the ability to put commands in the URL.
-
-== Version 0.6.0
-* Added Ruby mailing list reference support (e.g., \[ruby-talk:12345]).
-* Reorganised the code (again) to better support alternative frontends. Based, in part, on [http://sourceforge.net/projects/rublog RubLog] by Dave Thomas. (Reference corrected in 0.6.1.)
-* Added a [http://www.webrick.org WEBrick] servlet interface. Based, in part, on the WEBrick servlet interface provided with RubLog by Chad Fowler.
-* Added templates, using the [http://rdoc.sourceforge.net RDoc] template.rb library.
-* Changed the default topic to be \ProjectIndex instead of \DefaultProject.
-* Added a new \WikiWord format, \Wiki_Word_with_Spaces.
-* Completed lots of Ruwiki documentation.
-* Updated the save page.
-* Fixed a problem with the linking of project specific pages.
-
-== Version 0.5.0
-* Reorganized the code significantly to be easier to edit and extend.
-* Added abbreviation capabilities.
-* Cleaned up a lot of tokenizing code.
diff --git a/ruwiki/tags/release-0.6.1/Ruwiki/Configuring_Ruwiki b/ruwiki/tags/release-0.6.1/Ruwiki/Configuring_Ruwiki
deleted file mode 100644
index 61743d6..0000000
--- a/ruwiki/tags/release-0.6.1/Ruwiki/Configuring_Ruwiki
+++ /dev/null
@@ -1,178 +0,0 @@
-id: 0
-topic: Configuring_Ruwiki
-version: 1
-#EHDR
-= Configuring Ruwiki 0.6.1
-
-Ruwiki is configured similarly for both CGI and WEBrick modes. The biggest
-distinction is that because the Wiki is created after WEBrick server is
-created (during the dispatch to the servlet), it is necessary to configure the
-wiki with a global \Ruwiki::Config object, <i>$config</i>. Thus, in the
-examples below, replace <i>wiki.config</i> with <i>$config</i> where
-necessary.
-
-== wiki.config Options
-
-=== wiki.config.title
-
-This configuration option names the Wiki, by default this is <tt>Ruwiki</tt>.
-This affects the display of the home link and the &lt;title&gt; element of
-pages.
-
-=== wiki.config.webmaster
-
-The email address for the webmaster. This is used in generating error reports
-that can be emailed to the wiki's webmaster.
-
-=== wiki.config.default_page, wiki.config.default_project
-
-These options indicate what will happen when the wiki's URL is specified
-without any parameters (the default page in the default project is opened),
-when a topic is specified without a project (the topic is opened in the
-default project), and when a project is specified without a topic (the default
-page is opened in the project).
-
-=== wiki.config.storage_type, wiki.config.storage_options
-
-<tt>wiki.config.storage_type</tt> specifies the back-end storage mechanism as
-a Ruby Symbol. Currently, only <tt>:flatfiles</tt> is implemented. See
-Extending_Ruwiki for more information.
-
-<tt>wiki.config.storage_options</tt> is a hash of option hashes for each known
-storage type known to the Wiki. This must use the same Symbol as
-<tt>wiki.config.storage_type</tt> as the top-level hash key.
-
-==== ...storage_options[:flatfiles][:data_path]
-
-The directory in which the wiki files will be found. By default, this is
-<tt>"./data/"</tt>.
-
-==== ...storage_options[:flatfiles][:extension]
-
-The extension of the wiki files. By default, this is +nil+ (no extension).
-
-=== wiki.config.template_path
-This specifies the paths where the Wiki templates will be found. The process
-running the Wiki must have read access to the template_path.
-
-=== wiki.config.template_set, wiki.config.css
-These two options indicate which template set will be used. Only one template
-set is provided in the release package, "default". The only CSS file used
-initially is "ruwiki.css". Templates work such that they will be found in
-<i>template_path</i>/<i>template_set</i>. All CSS files are loaded from the
-template set directory and emitted as part of the output stream.
-
-: The bad news is that this means that the CSS never caches on the client side
-: as it would if it were a separate file. However, because the templates may
-: not be in a web-accessible directory, this is necessary.
-
-== Templates
-Templating is done with the RDoc template.rb library, included in the
-distribution of Ruwiki. The templating library allows for nested templates,
-and this is used extensively in Ruwiki. This library is documented in
-RuwikiTemplatingLibrary.
-
-There are four major templates: content, edit, save, and error. Each of these
-has a slightly different combination of template files used, and this means
-that there are different sets of variables available.
-
-The major templates are combined templates that are defined as follows:
-; content : body.tmpl, content.tmpl, controls.tmpl
-; edit : body.tmpl, edit.tmpl
-; save : body.tmpl, save.tmpl, controls.tmpl
-; error : body.tmpl, error.tmpl
-
-=== body.tmpl
-The body template knows two template keys (<tt>%wiki_title%</tt> and
-<tt>%css_link%</tt>) and includes one other template. The values for
-%wiki_title% key differs depending on context, but no other key should be
-used or expected in the body template.
-
- <html>
- <head>
- <title>%wiki_title%</title>
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
- </html>
-
-=== content.tmpl
-The content template knows one template key (<tt>%content%</tt>) and includes
-one other template. (This may change moving forward so that there's a footer
-as well as a control header.)
-
- !INCLUDE!
- <!-- topic content -->
- %content%
- <!-- topic content -->
-
-=== controls.tmpl
-The controls template offers a navigation bar. It knows four template keys:
-; %cgi_url% : The URL to the wiki, suitable for building further links from.
-; %home_link% : The root topic of the wiki.
-; %page_project% : The project for the current page topic.
-; %page_topic% : The topic of the current page.
-
- <div class="rw_nav">
- %home_link% |
- Topic: <b>%page_topic%</b> Project: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a> |
- <a href="%cgi_url%?action=edit&amp;project=%page_project%&amp;%page_topic%">Edit</a>
- </div>
-
-=== edit.tmpl
-The edit template is the most complex template with the most keys. Of
-necessity, it provides a restricted form of the navigation bar, the edit form,
-the raw body of the page, and the formatted body of the page.
-
-; %cgi_url% : The URL to the wiki, suitable for building further links from.
-; %home_link% : The root topic of the wiki.
-; %orig_page% : The unedited original page encoded as Base64.
-; %page_content% : The editable page content.
-; %page_old_version% : The old version number of the page.
-; %page_project% : The project for the current page topic being edited.
-; %page_topic% : The topic of the current page being edited.
-; %page_version% : The new version number of the page.
-; %pre_page_content% : The unedited original page content for display in a &lt;pre&gt; tagset.
-; %unedited_page_content% : The formatted unedited orignal page content.
-
- <div class="rw_nav">%home_link% | <i>Editing</i> Topic: <b>%page_topic%</b> Project: <b>%page_project%</b></div><br />
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <input type="submit" name="action" value="Save" />
- <input type="submit" name="action" value="Cancel" />
- </form>
- <div class="rw_edit_raw"><h2>Raw Original Value</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2>Formatted Version</h2>%unedited_page_content%</div>
-
-=== save.tmpl
-An alternative content page for use when a page is saved after editing. This
-knows <tt>%page_project%</tt>, <tt>%page_tolink%</tt> (used to link directly
-to the page), and <tt>%content%</tt>.
-
- !INCLUDE!
- Saved page %page_project%::%page_tolink%<hr />
- <!-- topic content -->
- %content%
- <!-- topic content -->
-
-=== error.tmpl
-This template is used for reporting errors to the user and offering an
-opportunity to the user to send a report to the wiki webmaster.
-
-; %backtrace% : The error backtrace.
-; %backtrace_email% : The error backtrace in a format suitable for email.
-; %home_link% : The root topic of the wiki.
-; %name% : The name of the error.
-; %webmaster% : The email address of the wiki webmaster.
-
- <div class="rw_nav">%home_link%</div>
- <h1>%name%</h1>
- <p>Send the webmaster a report by <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
- <p>%backtrace%</p>
diff --git a/ruwiki/tags/release-0.6.1/Ruwiki/Extending_Ruwiki b/ruwiki/tags/release-0.6.1/Ruwiki/Extending_Ruwiki
deleted file mode 100644
index 248380d..0000000
--- a/ruwiki/tags/release-0.6.1/Ruwiki/Extending_Ruwiki
+++ /dev/null
@@ -1,173 +0,0 @@
-id: 0
-topic: Extending_Ruwiki
-version: 1
-#EHDR
-= Extending Ruwiki 0.6.1
-
-Ruwiki is relatively easily extended to support new features. There are two
-primary ways in which Ruwiki can be extended by the end user: markup and
-backends.
-
-== Extending Ruwiki Markup
-
-Ruwiki's WikiMarkup can be extended by creating a new Ruwiki::Wiki::Token.
-Tokens will be automatically loaded if they are placed in
-<i>ruwiki/wiki/tokens</i>.
-
-It is recommended that new tokens be added to the test cases in
-<tt>tests/</tt>.
-
-The following Ruwiki::Wiki::Token class will convert strings in the forms of
-\[ruby-talk:12345] to links.
-
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
-=== Required Methods
-==== ::regexp
-
-Ruwiki tokens are matched only through regular expression matches. As shown in
-the example above, the regular expression for ruby-talk mailing list posts is
-<tt>%r{\[ruby-talk:(\d+)\]}</tt>. The purpose of the ::regexp method is to
-return the regexp for matching.
-
-For most inline matches, Ruwiki will ensure that the escape character (\)
-works automatically. For whole-line matches, it is necessary to match the
-escape character manually and provide a #restore method.
-
-As an example, the HRule class implements these methods.
-
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
-It may also be necessary to match escapes manually on inline matches that must
-be along word boundaries where the regular expression includes characters that
-normally match word boundaries. The project index match (e.g., \::Ruwiki)
-regular expression does this <tt>%r{(\B|\\)::([A-Z][a-z]+)}</tt>.
-
-==== #replace
-
-This returns the formatted token. In the \RubyTalkLinks class above, the
-matched regular expression will be replaced with a hyperlink. The text of the
-hyperlink will be the matched text; the target of the hyperlink will include
-the first captured value.
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
-
-=== Optional Methods
-==== ::rank
-
-By default, a token will be processed in the order created. Tokens may be
-given a specific rank to ensure that they are processed in a particular order.
-The default rank is <tt>9999</tt>.
-
-==== #restore
-
-Restores the token without replacement. Implements the results of the escape
-character. Each Token class is responsible for its own restoration. As noted
-in #regexp, whole-line tokens are most likely to need a #restore
-implementation.
-
-==== #post_replace
-
-Performs any necessary massaging of the data. The Lists token uses this to
-ensure that lists are collapsed together; the Paragraph token uses this to
-ensure that there are no empty paragraph tag pairs (&lt;p&gt;&lt;/p&gt;).
-
-== Extending Ruwiki Backends
-
-Ruwiki can support varying backends, as the backend interface has been
-abstracted completely from the data store. The backend <b>must</b>:
-
-# reside in <i>ruwiki/backends/</i> as <i>backend_name</i>.rb.
-# be registered by adding the <i>backend_name</i> as a symbol (e.g., :<i>backend_name</i>) to Ruwiki::Backend::BACKENDS.
-# inherit from Ruwiki::Backend.
-# exist as Ruwiki::Backend::<i>\Backend_name</i>.
-
-=== Required Methods
-==== #initialize(ruwiki)
-
-The backend may only obtain its configuration information from the provided
-ruwiki instance (through Ruwiki#config) and must set @ruwiki (this can be
-achieved by calling <tt>super ruwiki</tt>).
-
-==== #load(topic, project)
-
-The backend will be provided the name of the topic and project and must return
-the selected page as an array, one row per line. If the backend you have
-chosen returns the page as a single text block, it will be necessary to do a
-String#split("\n") on it.
-
-==== #save(page)
-
-This method must store the provided page in the backend. Note that the return
-value of the Page#rawtext method must be stored. This method may call
-Backend#make_diff to generate the differences hash.
-
- diff = {
- 'old_version' => page.old_version,
- 'new_version' => page.version,
- 'change_date' => Time.now,
- 'change_ip' => page.change_ip,
- 'change_id' => page.change_id,
- 'diff' => Diff.diff(oldpage, newpage)
- }
-
-==== #obtain_lock(page)
-
-Obtains an exclusive lock on the page. The lock should have a ten minute (600
-second) timeout and permit access from the same IP address without
-restriction. This should <b>not</b> be a filesystem lock.
-
-==== #release_lock(page)
-
-Releases the exclusive lock on the page. The lock should not be released
-unless the IP address on the lock is the same or the lock has expired (600
-seconds).
-
-==== #project_exists?(project)
-
-Returns <tt>true</tt> if the project exists.
-
-==== #page_exists?(topic, project = 'Default')
-Returns <tt>true</tt> if the page exists within the specified project.
-
-=== Optional Methods
-
-Note that these methods are currently optional (they are not yet called from
-Ruwiki), but will become required moving forward as the functions are
-implemented in Ruwiki.
-
-==== #destroy(page)
-
-Removes the page from the wiki. This should <b>not</b> remove the change
-history of the topic (in the event that the page has been removed
-maliciously). There will be a separate method to remove the page history.
-
-==== #create_project(project)
-
-Attempts to create the project.
-
-==== #destroy_project(project)
-
-Attempts to destroy the project.
diff --git a/ruwiki/tags/release-0.6.1/Ruwiki/LicenseAndAuthorInfo b/ruwiki/tags/release-0.6.1/Ruwiki/LicenseAndAuthorInfo
deleted file mode 100644
index 8cfb9fc..0000000
--- a/ruwiki/tags/release-0.6.1/Ruwiki/LicenseAndAuthorInfo
+++ /dev/null
@@ -1,21 +0,0 @@
-id: 0
-topic: LicenseAndAuthorInfo
-version: 1
-#EHDR
-Ruwiki is copyright © 2002 - 2003 [mailto:alan@digikata.com Alan Chen] and
-[mailto:ruwiki@halostatue.ca Austin Ziegler].
-
-Ruwiki is provided free of use and without any warranty express or implied. You may use,
-distribute, or modify Ruwiki under the conditions of Ruby's licence or the
-[http://www.gnu.org/copyleft/gpl.html GNU General Public Licence].
-
-* Ruwiki includes algorithm/diff by Lars Christensen, available for download from the RAA at: http://raa.ruby-lang.org/list.rhtml?name=diff
-* Ruwiki includes template.rb from Dave Thomas's RDoc system, available for download from SourceForge: http://rdoc.sourceforge.net
-
-Austin has also released several other projects available on the RAA that you
-may be interested in:
-* [http://raa.ruby-lang.org/list.rhtml?name=mime-types MIME::Types]
-* [http://raa.ruby-lang.org/list.rhtml?name=pdf-writer PDF::Writer]
-* [http://raa.ruby-lang.org/list.rhtml?name=text-format Text::Format]
-* [http://raa.ruby-lang.org/list.rhtml?name=trans-simple Transaction::Simple]
-* [http://raa.ruby-lang.org/list.rhtml?name=uninheritable Uninheritable]
diff --git a/ruwiki/tags/release-0.6.1/Ruwiki/ProjectIndex b/ruwiki/tags/release-0.6.1/Ruwiki/ProjectIndex
deleted file mode 100644
index 50bd99f..0000000
--- a/ruwiki/tags/release-0.6.1/Ruwiki/ProjectIndex
+++ /dev/null
@@ -1,28 +0,0 @@
-id: 0
-topic: ProjectIndex
-version: 1
-#EHDR
-= Ruwiki 0.6.1
-This is the \ProjectIndex page for Ruwiki. For any given project, the
-\ProjectIndex topic will be the default topic for plain project links. As of
-Ruwiki 0.6.0, \ProjectIndex it is also the standard default page (not
-\DefaultPage).
-----
-== Features and Information
-* This wiki supports a variety of WikiFeatures that you may be interested in. The rules for WikiMarkup are similar to some other wikis, but there are a few unique markup capabilities in Ruwiki.
-* Configuring_Ruwiki is simple.
-* Extending_Ruwiki is almost as simple.
-* Who wrote Ruwiki? Look at the LicenseAndAuthorInfo.
-
-== Tracking Ruwiki Development
-The development progress of Ruwiki is kept in the wiki itself.
-* The BugTracking page in Ruwiki keeps track of open and closed bugs in Ruwiki.
-* The To_Do list keeps track of major development goals for Ruwiki.
-----
-== Different Features?
-If this wiki doesn't have the right combination of features, (or if it just
-doesn't feel right) try these other Ruby-based Wikis:
-
-* Amrita Wiki - http://www.walrus-ruby.org/amrita/cgi-bin/aswiki/aswiki.cgi
-* RWiki - http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=top
-* \MiniRubyWiki - http://www.xpsd.com/MiniRubyWiki
diff --git a/ruwiki/tags/release-0.6.1/Ruwiki/RuwikiTemplatingLibrary b/ruwiki/tags/release-0.6.1/Ruwiki/RuwikiTemplatingLibrary
deleted file mode 100644
index d39cb9a..0000000
--- a/ruwiki/tags/release-0.6.1/Ruwiki/RuwikiTemplatingLibrary
+++ /dev/null
@@ -1,82 +0,0 @@
-id: 0
-topic: RuwikiTemplatingLibrary
-version: 1
-#EHDR
-= Ruwiki 0.6.1 Templating
-
-Ruwiki uses the RDoc templating system, described by its creator as:
-
- RDoc's cheap-n-cheerful HTML page template system.
-
-== Templates
-
-Templates in the templating system are essentially plain strings with
-particular references to templating keys or an include directive.
-
-=== Templating Keys
-
-The template interacts with a value hash provided by ruwiki. The keys known to
-the templates expected by Ruwiki are detailed in Configuring_Ruwiki. Nested
-key references are found from the inside-out. That is, the closest resolving
-key to the current level is found, not the furthest resolving key.
-
-==== Simple Templating Keys
-Ruwiki only uses the simplest form of RDoc templating at this point, which is
-the enclosing of variable names between percent signs (e.g.,
-<tt>%wiki_title%</tt>).
-
-==== Repeating Block Keys
-The RDoc templating library supports a block format:
-
- START:key
- ... stuff ...
- END:key
-
-The block between <tt>START:key</tt> and <tt>END:key</tt> will be repeated
-once for each hash entry found in the array at <tt>key</tt> in the main value
-hash. Blocks may be nested arbitrarily deeply.
-
-==== Conditional Block Keys
-
- IF:key
- ... stuff ...
- ENDIF:key
-
-The block between <tt>IF:key</tt> and <tt>ENDIF:key</tt> will be included in
-the output only if the corresponding key is set in the value hash.
-
-=== Including Other Templates
-
-Templates may include other templates to any arbitrary level by using the
-!INCLUDE! directive.
-
-== Example
-
-Given the set of templates T1, T2, and T3 (shown below), here's how we would
-use the templating system.
-
- values = { "name" => "Dave", "state" => "TX" }
- t = TemplatePage.new(T1, T2, T3)
- File.open(name, w) { |f| t.write_html_on(f, values) }
-
-or:
-
- values = { "name" => "Dave" }
- res = ""
- t.write_html_on(res, values)
-
-=== T1
-
- Templates can subsitute a wide variety of values.
- !INCLUDE!
-
-=== T2
-
- Name: %name% !INCLUDE!
-
-=== T3
-
- IF:state
- State: %state%
- ENDIF:state
-
diff --git a/ruwiki/tags/release-0.6.1/Ruwiki/SandBox b/ruwiki/tags/release-0.6.1/Ruwiki/SandBox
deleted file mode 100644
index 21e6a36..0000000
--- a/ruwiki/tags/release-0.6.1/Ruwiki/SandBox
+++ /dev/null
@@ -1,5 +0,0 @@
-id: 0
-topic: SandBox
-version: 1
-#EHDR
-This page is intended for users to play with freely to practice their \WikiFormatting.
diff --git a/ruwiki/tags/release-0.6.1/Ruwiki/To_Do b/ruwiki/tags/release-0.6.1/Ruwiki/To_Do
deleted file mode 100644
index 3addc22..0000000
--- a/ruwiki/tags/release-0.6.1/Ruwiki/To_Do
+++ /dev/null
@@ -1,42 +0,0 @@
-id: 0
-topic: To_Do
-version: 1
-#EHDR
-= Ruwiki 0.6.1 To Do Tracking
-Completed to-do items can be found in the ChangeLog. Bugs in Ruwiki are
-tracked in BugTracking.
-
-== Well-Defined To Do Items
-=== Ruwiki 0.7.0
-; Versioning : complete the change history. Change history is currently stored in a file <i>topic</i>.rdiff. There is no way to display the change history at this point.
-=== Ruwiki 0.8.0
-; In-project topic search : searches for mentions of the topic in the other topics for the project.
-; Project topic listing : provide a special link (perhaps Project::Project) that displays the list of topics known to that project.
-; Project listing : provide a special link (perhaps ::*) that displays the list of known projects.
-=== Ruwiki 0.9.0
-; Topic renaming : add the ability to rename a topic within a project. Topic change history should be maintained.
-; Topic moving : add the ability to move and/or rename a topic between projects. Topic change history should be maintained.
-; Complete documentation : Complete the documentation of Ruwiki.
-=== Ruwiki 1.0.0
-; Escape HTML Entities : HTML Entities such as &amp;, &lt;, and &gt; are not currently escaped. This may cause problems with some browsers and should be fixed <b>without</b> impairing the ability to add at least some raw HTML. Note that the current engine does not check raw HTML and thus could potentially be vulnerable to cross-site-scripting attacks.
-; Features : Ruwiki will be programmatically extensible with entirely new features: commands, ACLs, and more. This is planned for 1.0.0.
-
-== General To Do Items
-; Preview button : add a preview button to the save page.
-; Alternative templating systems : not as high priority now that there's a real templating system in place.
-; Project/topic security : allow certain projects to be restricted/authenticated for read/write based on user.
-; Track last <i>n</i> links/topics : ?
-; Write a markup debugger : ?
-; Validate topic formatting from cgi : ?
-; Validate project from cgi : ?
-; Project-based backend : Allow different projects to have different backends.
-; Hierachical project namespaces : ?
-
-== Future To Do Items
-; E-mail gateway : accept topic appends via e-mail.
-; alternative backends : access other wiki data storage, or other formats, e.g. e-mail boxes in mh or mbox formats
-; backend-to-backend storage format conversion : as noted
-; bug tracker backend : with alternate markup
-; add setup and user config methods : for backend plugin classes, then we can use them with an interactive or gui tool frontend to setup data storage backends. The user might have to run as root or other user with database create permissions.
-; add id="" to various markup elements (make id specific to topic) : Later we can allow users to tweak a page using uploaded css fragments which might get appended onto the standard css contents.
-; ruby action : upload a ruby code fragment to add a smart "action" to that wiki page. Need some sort of security + approval system to handle this safely.
diff --git a/ruwiki/tags/release-0.6.1/Ruwiki/WikiFeatures b/ruwiki/tags/release-0.6.1/Ruwiki/WikiFeatures
deleted file mode 100644
index 162c436..0000000
--- a/ruwiki/tags/release-0.6.1/Ruwiki/WikiFeatures
+++ /dev/null
@@ -1,13 +0,0 @@
-id: 0
-version: 1
-topic: WikiFeatures
-#EHDR
-Ruwiki is a [http://www.ruby-lang.org Ruby]-based wiki. It is ideal for
-personal or small team use.
-
-Ruwiki:
-* Uses the [http://www.ruby-lang.org Ruby] language.
-* Runs quickly and easily as a CGI or WEBrick servlet.
-* Uses a simple templating system and CSS for presentation.
-* Has flatfile storage with simple versioning.
-* Offers project namespaces. Different projects can have the same topic names and not collide. Thus, \Default::ReadMe and \Project::ReadMe are two different pages.
diff --git a/ruwiki/tags/release-0.6.1/Ruwiki/WikiMarkup b/ruwiki/tags/release-0.6.1/Ruwiki/WikiMarkup
deleted file mode 100644
index 58c6216..0000000
--- a/ruwiki/tags/release-0.6.1/Ruwiki/WikiMarkup
+++ /dev/null
@@ -1,173 +0,0 @@
-id: 0
-topic: WikiMarkup
-version: 1
-#EHDR
-= Wiki Markup
-A [http://c2.com/cgi/wiki Wiki] obeys certain formatting rules to make it easy
-to format text without needing to know HTML. This Wiki obeys the following
-rules by default. Because Ruwiki is extensible, there may be additional
-formatting rules.
-
-== \WikiWords, \WikiProjects, Links, and Images
-While reading stuff on this Wiki, you will see some words mashed together with
-capitalisation (like \WikiWords). While this may seem odd at first, this
-feature allows internal links to be created across the Wiki.
-
-There are several allowable forms for \WikiWords.
-# Two or more words concatenated directly. Each word must begin with a capital letter and be followed by zero or more lowercase letters. Thus, \FooBar, \CPlusPlus, and \AbC are all valid \WikiWords, but ABC is not.
-# Two or more words concatenated with underscores. The first word must begin with a capital letter. This makes \Foo_Bar, \C_Plus_Plus, and \A_b_C valid \WikiWords. These \WikiWords will be displayed with spaces instead of underscores.\C_Plus_Plus will be displayed as "C Plus Plus".
-# One or more words contained in double square brackets. This the form supported by [http://wikipedia.com/ Wikipedia], and looks like \[[A Wiki Phrase]]. These links will be displayed exactly as entered between the brackets.
-
-If a \WikiWord is found that does not have a page defining the \WikiWord, then
-the word will be shown with a hyperlink question mark following it, allowing
-the \WikiWord to be created.
-
-=== \WikiProjects
-This Wiki supports "projects." Within each project, a given \WikiWord is
-unique. Thus, if you have a Default project and a Ruwiki project, you can have
-two pages called \ReadMe. Any given \WikiWord refers only to topics within its
-project. That is, if I have \WikiWord in the \ReadMe topic of the Default
-project, it will refer to the \WikiWord topic of the Default project. (Another
-term for this capability is "namespaces.")
-
-A cross-project link is composed of the project's name, two colons (::), and
-the \WikiWord desired. Thus, from \Default::ReadMe, I can have \Ruwiki::ReadMe
-as a link. The project index can be referred to with \::Project. This is the
-same as doing \Project::ProjectIndex. Thus, \::Ruwiki becomes ::Ruwiki, which
-is the same as \Ruwiki::ProjectIndex (Ruwiki::ProjectIndex).
-
-=== External Links and Resources
-URLs to external resources are automatically detected for web addresses, FTP
-addresses, newsgroups, and email links. They are automatically converted to
-clickable URLs.
-
-* \http://www.ruby-lang.org becomes http://www.ruby-lang.org
-
-URLs may be named with the [url name] syntax. If the name is omitted, the URL will be numbered.
-
-* \[http://www.rubygarden.org RubyGarden] becomes [http://www.rubygarden.org RubyGarden].
-* \[http://www.halostatue.ca] and \[http://www.halostatue.ca/ruby] become [http://www.halostatue.ca] and [http://www.halostatue.ca/ruby].
-
-=== Images
-If URLs are to JPEG (.jpg, .jpeg), PNG (.png), or GIF (.gif) resources, they will be rendered as inline images. This works with automatically converted URLs, named URLs, or numbered URLs. Named and numbered URLs affect the TITLE and ALT attribute of the image.
-
-* \http://www.halostatue.ca/graphics/maple_leaf.gif http://www.halostatue.ca/graphics/maple_leaf.gif
-* \[http://www.halostatue.ca/graphics/maple_leaf.gif Maple Leaf] [http://www.halostatue.ca/graphics/maple_leaf.gif Maple Leaf]
-* \[http://www.halostatue.ca/graphics/maple_leaf.gif] [http://www.halostatue.ca/graphics/maple_leaf.gif]
-
-=== Ruby Mailing Lists
-If a Ruby mailing list message tag is provided, it will be converted appropriately.
-
-* \[ruby-talk:12345] will become [ruby-talk:12345]
-* \[ruby-core:12345] will become [ruby-core:12345]
-* \[ruby-doc:12345] will become [ruby-doc:12345]
-
-== Headings and Lists
-=== Headings
-Use equals signs (=) for headings. Up to six equals signs can be used for HTML
-headings 1 - 6.
-
-\===== Heading five<br />
-\====== Heading six
-
-===== Heading five
-====== Heading six
-
-=== Lists
-==== Bulleted Lists
-Use asterisks (*) to create bulleted lists. More asterisks means more levels.
-
-\* level 1<br />
-\** level 2<br />
-\*** level 3
-
-* level 1
-** level 2
-*** level 3
-==== Numbered Lists
-Use hash marks (#) for numbered lists. More hash marks means deeper levels.
-
-\# level 1<br />
-\## level 2<br />
-\### level 3<br />
-\# level 1.2
-
-# level 1
-## level 2
-### level 3
-# level 1.2
-==== Definition Lists
-Definitions can be created similar to other lists. Unlike "standard" lists,
-though, definition lists have both the term and the definition. They are
-specified like so. As with other lists, repeating the first item (;) will
-increase the indentation level.
-
-\; term : definition<br />
-\;; term2 : definition<br />
-\;;; term3 : definition
-
-; term : definition
-;; term2 : definition
-;;; term3 : definition
-== Paragraph Formatting
-=== Rules
-Four or more dashes ("----") on a line by itself makes a horizontal rule, like
-so:
-
-\----
-----
-=== Paragraphs
-A blank line (it may have whitespace on it) marks a new paragraph. All other
-lines are joined together (excepting headers, lists, and rules).
-
-This line is a new paragraph.
-=== Block Indent Paragraphs
-Paragraphs can be indented by beginning the paragraph with one or more colons
-(:).
-
-\: Indent Level 1<br />
-\:: Indent Level 2<br />
-\::: Indent Level 3
-
-: Indent Level 1
-:: Indent Level 2
-::: Indent Level 3
-=== Code
-Text that is indented will be presented as formatted in a monospaced font. The
-only change is to escape HTML entities &lt; (<), &gt; (>), and &amp; (&).
-
- def replace
- content = @match[1]
- %Q{<pre>#{content}</pre>}
- end
-
-== Miscellaneous Formatting
-=== HTML
-The Ruwiki engine passes through HTML without changes. Thus,
-&lt;b&gt;bold&lt;/b&gt; would be shown as <b>bold</b>. <b><i>Note:</i></b>
-This capability could be very dangerous as it could expose the Wiki to
-cross-site scripting (XSS) vulnerabilities. This will be remedied prior to the
-1.0 release of Ruwiki.
-
-=== Abbreviations
-Certain abbreviations may be known to the Wiki. While there is not yet any way
-for a user to query what abbreviations are known, if the abbreviations are
-told to the users, they may be used. Abbreviations are presented with @{key},
-where <i>key</i> is the abbreviation desired. This Wiki, for example, knows
-that \@{PM} means @{PM}. The special form \@{} will produce the current list
-of known abbreviations. Unknown abbreviations will simply be put back into the
-data stream unchanged. Thus, \@{unknownkey} results in @{unknownkey}.
-
-==== Known Abbreviations
-@{}
-
-=== Preventing Formatting
-If you wish to prevent a word or sequence from being interpreted, put a
-backslash (\) in front of it. This works on all formatting options except
-paragraph positioning. Thus, if I want to prevent a \WikiWord from being
-turned into a hyperlink, I need to backslash it: \\WikiWord.
-
-=== Other Possible Considerations
-I'm looking at adding styles similar to what is shown on the Wiki below.
-
-* http://www.pmichaud.com/wiki/PmWiki/WikiStyles
diff --git a/ruwiki/tags/release-0.6.1/lib/algorithm/diff.rb b/ruwiki/tags/release-0.6.1/lib/algorithm/diff.rb
deleted file mode 100644
index af36214..0000000
--- a/ruwiki/tags/release-0.6.1/lib/algorithm/diff.rb
+++ /dev/null
@@ -1,220 +0,0 @@
-#
-# algorith/diff - a Ruby module to compute difference sets between two
-# objects. Copyright (c) 2001-2002 Lars Christensen.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
-
-module Diff
-
- VERSION = 0.4
-
- attr_reader :diffs
-
- def Diff.lcs(a, b)
- astart = 0
- bstart = 0
- afinish = a.length-1
- bfinish = b.length-1
- mvector = []
-
- # First we prune off any common elements at the beginning
- while (astart <= afinish && bstart <= afinish && a[astart] == b[bstart])
- mvector[astart] = bstart
- astart += 1
- bstart += 1
- end
-
- # now the end
- while (astart <= afinish && bstart <= bfinish && a[afinish] == b[bfinish])
- mvector[afinish] = bfinish
- afinish -= 1
- bfinish -= 1
- end
-
- bmatches = b.reverse_hash(bstart..bfinish)
- thresh = []
- links = []
-
- (astart..afinish).each { |aindex|
- aelem = a[aindex]
- next unless bmatches.has_key? aelem
- k = nil
- bmatches[aelem].reverse_each { |bindex|
- if k && (thresh[k] > bindex) && (thresh[k-1] < bindex)
- thresh[k] = bindex
- else
- k = thresh.replacenextlarger(bindex, k)
- end
- links[k] = [ k!=0 && links[k-1], aindex, bindex ] if k
- }
- }
-
- if !thresh.empty?
- link = links[thresh.length-1]
- while link
- mvector[link[1]] = link[2]
- link = link[0]
- end
- end
-
- return mvector
- end
-
- def Diff.makediff(a, b)
- mvector = Diff.lcs(a, b)
- ai = bi = 0
- while ai < mvector.length
- bline = mvector[ai]
- if bline
- while bi < bline
- yield :+, bi, b[bi]
- bi += 1
- end
- bi += 1
- else
- yield :-, ai, a[ai]
- end
- ai += 1
- end
- while ai < a.length
- yield :-, ai, a[ai]
- ai += 1
- end
- while bi < b.length
- yield :+, bi, b[bi]
- bi += 1
- end
- 1
- end
-
- def Diff.diff(a, b, &block)
- isstring = b.kind_of? String
- diffs = []
-
- block ||= proc { |action, index, element|
- prev = diffs[-1]
- if prev && prev[0] == action &&
- prev[1] + prev[2].length == index
- prev[2] << element
- else
- diffs.push [ action, index, isstring ? element.chr : [element] ]
- end
- }
-
- Diff.makediff(a, b, &block)
-
- return diffs
- end
-
-end
-
-module Diffable
- def diff(b)
- Diff.diff(self, b)
- end
-
- # Create a hash that maps elements of the array to arrays of indices
- # where the elements are found.
-
- def reverse_hash(range = (0...self.length))
- revmap = {}
- range.each { |i|
- elem = self[i]
- if revmap.has_key? elem
- revmap[elem].push i
- else
- revmap[elem] = [i]
- end
- }
- return revmap
- end
-
- # Replace the first element which is larger than value. Assumes that
- # the element indexed by high, if given is larger than value.
-
- def replacenextlarger(value, high = nil)
- high ||= length
- low = 0
- index = found = nil
- while low < high
- index = (high+low) >> 1
- found = self[index]
- if value > found # this first, most common case
- low = index + 1
- elsif value == found
- return nil
- else
- high = index
- end
- end
- self[low] = value
- return low
- end
-
- # Patches self with the given set of differences.
-
- def patch(diffs)
- newary = nil
- kindofstring = kind_of? String
- if kindofstring
- newary = self.class.new('')
- else
- newary = self.class.new
- end
- ai = 0
- bi = 0
- diffs.each { |action,position,elements|
- case action
- when :-
- while ai < position
- newary << self[ai]
- ai += 1
- bi += 1
- end
- ai += elements.length
- when :+
- while bi < position
- newary << self[ai]
- ai += 1
- bi += 1
- end
- if kindofstring
- newary << elements
- else
- newary.push *elements
- end
- bi += elements.length
- else
- raise "Unknown diff action"
- end
- }
- while ai < self.length
- newary << self[ai]
- ai += 1
- bi += 1
- end
- return newary
- end
-end
-
-class Array
- include Diffable
-end
-
-class String
- include Diffable
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki.rb
deleted file mode 100644
index e210fee..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki.rb
+++ /dev/null
@@ -1,312 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-require 'digest/md5'
-require 'ruwiki/handler'
-require 'ruwiki/template'
-require 'ruwiki/lang/en' # Default to the English language.
-require 'ruwiki/config'
-require 'ruwiki/backend'
-require 'ruwiki/wiki'
-require 'ruwiki/page'
-
- # = Ruwiki
- # Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI
- # and WEBrick interfaces, templates, and CSS formatting. Additionally, it
- # supports project namespaces, so that two pages can be named the same for
- # differing projects without colliding or having to resort to odd naming
- # conventions. Please see ::Ruwiki in the running Wiki for more information.
- #
- # == Quick Install (CGI)
- # 1. Place the Ruwiki directory in a place that your webserver can execute
- # CGI programs. Ensure that ruwiki.cgi is executable on your webserver.
- # You may wish to protect templates/, data/, and lib/ from casual access.
- # 2. Modify the following lines in ruwiki.cgi:
- # wiki.config.webmaster = ...
- # wiki.config.title = ...
- # 3. Point your web browser to the appropriate URL.
- #
- # == Quick Install (WEBrick)
- # 1. Modify the following lines in ruwiki_servlet.rb:
- # $config.webmaster = ...
- # $config.title = ...
- # 2. Run ruwiki_servlet.rb to start a WEBrick instance on localhost:8808 with
- # ruwiki bound to the root path (e.g., http://localhost:8808/).
- # 3. Point your web browser to the appropriate URL.
- #
- # == Use
- # Ruwiki is able to be called with one of several URI forms:
- #
- # http://domain.com/ruwiki.cgi?PageName
- # http://domain.com/ruwiki.cgi?PageName&project=Project
- # http://domain.com/ruwiki.cgi?topic=PageName&project=Project
- # http://domain.com/ruwiki.cgi/PageName
- # http://domain.com/ruwiki.cgi/Project/
- # http://domain.com/ruwiki.cgi/Project/PageName
- #
- # Copyright:: Copyright © 2003 - 2003, Digikata and HaloStatue, Ltd.
- # Authors:: Alan Chen (alan@digikata.com)
- # Austin Ziegler (ruwiki@halostatue.ca)
- # Licence:: Ruby's
-class Ruwiki
- VERSION = '0.6.1.0'
-
- ALLOWED_ACTIONS = %w(edit create)
- EDIT_ACTIONS = %w(save cancel)
- EDIT_VARS = %w(newpage origpage topic project old_version version)
- RESERVED = ['action', EDIT_VARS].flatten
-
- # Returns the current configuration object.
- attr_reader :config
- # Returns the current Response object.
- attr_reader :response
- # Returns the current Request object.
- attr_reader :request
- # Returns the current Markup object.
- attr_reader :markup
- # Returns the current Backend object.
- attr_reader :backend
-
- # Sets the configuration object to a new configuration object.
- def config=(c)
- raise message()[:config_not_ruwiki_config] unless c.kind_of?(Ruwiki::Config)
- @config = c
- end
-
- # The message hash.
- def message
- @config.message
- end
-
- # Initializes Ruwiki.
- def initialize(handler)
- @request = handler.request
- @response = handler.response
-
- @config = Ruwiki::Config.new
-
- @path_info = @request.determine_request_path || ""
-
- @type = nil
- @error = {}
-
- @markup = Ruwiki::Wiki.new(self)
- end
-
- # Initializes the backend for Ruwiki.
- def set_backend
- @backend = Backend[@config.storage_type, self]
- end
-
- # Runs the steps to process the wiki.
- def run
- @config.verify
- set_backend
- set_page
- process_page
- render
- rescue Exception => e
- render(:error, e)
- ensure
- output
- end
-
- # Initializes current page for Ruwiki.
- def set_page
- path_info = @path_info.split(%r{/}, -1).map { |e| e.empty? ? nil : e }
-
- if path_info.size == 1 or (path_info.size > 1 and path_info[0])
- raise message()[:invalid_path_info_value] % [@path_info] unless path_info[0].nil?
- end
-
- # path_info[0] will ALWAYS be nil.
- path_info.shift
-
- case path_info.size
- when 0 # Safety check.
- nil
- when 1 # /PageTopic OR /_edit
- set_page_name_or_action(path_info[0])
- when 2 # /Project/ OR /Project/PageTopic OR /Project/_edit OR /Project/create
- @project_name = path_info.shift
- set_page_name_or_action(path_info[0])
- else # /Project/PageTopic/_edit OR /Project/diff/3,4 OR something else.
- @project_name = path_info.shift
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- else
- @page_name = item
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- end
- end
- end
-
- @request.each_parameter do |key, val|
- next if RESERVED.include?(key)
- @page_name = key
- end
-
- @project_name ||= @request.parameters['project']
- @project_name ||= @config.default_project
- @page_name ||= @config.default_page
- end
-
- # Processes the page through the necessary steps. This is where the edit,
- # save, cancel, and display actions are present.
- def process_page
- content = nil
- @page = @backend.retrieve(@page_name, @project_name)
- @type = :content
- # TODO Detect if @action has already been set.
- @action = @request.parameters['action'].downcase if @request.parameters['action']
-
- if @action
- case @action
- when 'edit', 'create'
- # Automatically create the project if it doesn't exist or if the
- # action is 'create'.
- @backend.create_project(@page.project) if @action == 'create'
- @backend.create_project(@page.project) unless @backend.project_exists?(@page.project)
- @backend.obtain_lock(@page)
-
- content = nil
- @type = :edit
- when 'save'
- np = @request.parameters['newpage'].gsub(/\r/, "").chomp
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
-
- op = @request.parameters['origpage'].unpack("m*")[0]
-
- if np == op
- @page.content = op
- @type = :content
- else
- @page.content = np
- @page.old_version = @request.parameters['old_version'].to_i + 1
- @page.version = @request.parameters['version'].to_i + 1
- @type = :save
- @backend.store(@page)
- end
- @backend.release_lock(@page)
-
- content = @page.to_html
- when 'cancel'
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.content = @request.parameters['origpage'].unpack("m*")[0]
- @page.old_version = @request.parameters['old_version'].to_i
- @page.version = @request.parameters['version'].to_i
-
- content = @page.to_html
- @backend.release_lock(@page)
- else
- # TODO Return a 501 Not Implemented error
- nil
- end
- else
- content = @page.to_html
- end
- rescue Exception => e
- @type = :error
- if e.kind_of?(Ruwiki::Backend::BackendError)
- @error[:name] = "#{message()[:error]}: #{e.to_s}"
- else
- @error[:name] = "#{message()[:complete_utter_failure]}: #{e.to_s}"
- end
- @error[:backtrace] = e.backtrace.join("<br />\n")
- content = nil
- ensure
- @content = content
- end
-
- # Renders the page.
- def render(*args)
- if args.empty?
- type = @type
- error = @error
- else
- raise ArgumentError, message()[:render_arguments] unless args.size == 2
- type = args[0]
- error = {}
- error[:name] = args[1].inspect.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;')
- error[:backtrace] = args[1].backtrace.join("<br />\n")
- end
-
- @rendered_page = ""
- values = { "css_link" => @config.css_link,
- "home_link" => %Q(<a href="#{@request.script_url}">#{@config.title}</a>) }
-
- case type
- when :content, :save
- values["wiki_title"] = "#{message()[:error]} - #{@config.title}" if @page.nil?
- values["wiki_title"] ||= "#{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_topic"] = CGI.unescape(@page.topic)
- values["page_raw_topic"] = @page.topic
- values["page_project"] = @page.project
- values["cgi_url"] = @request.script_url
- values["content"] = @content
- if type == :content
- template = TemplatePage.new(@config.template(:body), @config.template(:content), @config.template(:controls))
- else
- template = TemplatePage.new(@config.template(:body), @config.template(:save), @config.template(:controls))
- end
- when :edit
- template = TemplatePage.new(@config.template(:body), @config.template(:edit))
- values["wiki_title"] = "#{message()[:editing]}: #{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_topic"] = CGI.unescape(@page.topic)
- values["page_raw_topic"] = @page.topic
- values["page_project"] = @page.project
- values["cgi_url"] = @request.script_url
- values["page_content"] = @page.content
- values["orig_page"] = [@page.content].pack("m*")
- values["page_old_version"] = @page.old_version.to_s
- values["page_version"] = @page.version.to_s
- values["unedited_page_content"] = @page.to_html
- values["pre_page_content"] = CGI.escapeHTML(@page.content)
- when :error
- template = TemplatePage.new(@config.template(:body), @config.template(:error))
- values["wiki_title"] = "#{message()[:error]} - #{@config.title}"
- values["name"] = error[:name]
- values["backtrace"] = error[:backtrace]
- values["backtrace_email"] = error[:backtrace].gsub(/<br \/>/, '')
- values["webmaster"] = @config.webmaster
- end
-
- template.write_html_on(@rendered_page, values)
- end
-
- # Outputs the page.
- def output
- @response.add_header("Content-type", "text/html")
- @response.write_headers
- @response << @rendered_page
- end
-
-private
- RE_ACTION = %r{^_([[:lower:]]+)$}
-
- def set_page_name_or_action(item)
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- else
- @page_name = item
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/backend.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/backend.rb
deleted file mode 100644
index 2b88587..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/backend.rb
+++ /dev/null
@@ -1,124 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'algorithm/diff'
-
-class Ruwiki
- # The Ruwiki backend abstract class and factory.
- class Backend
- BACKENDS = [:flatfiles] # :postgresql, :mysql, :odbc]
-
- class ProjectExists < StandardError #:nodoc:
- end
- class BackendError < StandardError #:nodoc:
- end
-
- # The default initializer for backend classes.
- def initialize(ruwiki)
- @ruwiki = ruwiki
- end
-
- # The Backend Factory. Requires and initializes the backend requested.
- def self.[](backend, ruwiki)
- raise RuntimeError, ruwiki.message[:unknown_backend] % [backend] unless BACKENDS.include?(backend)
- befile = backend.to_s
- beconst = befile.capitalize
-
- require "ruwiki/backend/#{befile}"
-
- be = Ruwiki::Backend.const_get(beconst)
- be.new(ruwiki)
- end
-
- # Retrieve the specified topic and project page. Calls Backend#load
- # after verifying that the project exists.
- def retrieve(topic, project = 'Default')
- unless page_exists?(topic, project)
- if project_exists?(project)
- return Ruwiki::Page.new(@ruwiki,
- :content => "",
- :topic => topic,
- :project => project)
- else
- return Ruwiki::Page.new(@ruwiki,
- :content => @ruwiki.message[:project_does_not_exist] % [project],
- :topic => topic,
- :project => project)
- end
- end
-
- buffer = load(topic, project)
- Ruwiki::Page.new(@ruwiki,
- :rawtext => buffer.join(''),
- :project => project,
- :topic => topic)
- end
-
- # Creates the current diff object.
- def make_diff(page, oldpage, newpage)
- {
- 'old_version' => page.old_version,
- 'new_version' => page.version,
- 'change_date' => Time.now,
- 'change_ip' => page.change_ip,
- 'change_id' => page.change_id,
- 'diff' => Diff.diff(oldpage, newpage)
- }
- end
-
- # Stores the specified topic and project page. Calls Backend#save.
- def store(page)
- save(page)
- end
-
- # Destroies the specified topic and project page.
- def destroy(page)
- raise
- end
-
- # Releases the lock on the page.
- def release_lock(page)
- raise
- end
-
- # Attempts to obtain a lock on the page.
- def obtain_lock(page)
- raise
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- raise
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- raise
- end
-
- # Attempts to create the project.
- def create_project(project)
- raise
- end
-
- # Attempts to destroy the project.
- def destroy_project(project)
- raise
- end
-
- def load(topic, project) #:nodoc:
- raise
- end
-
- def save(page) #:nodoc
- raise
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/backend/flatfiles.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/backend/flatfiles.rb
deleted file mode 100644
index 046c19a..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/backend/flatfiles.rb
+++ /dev/null
@@ -1,190 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Backend
- # Stores Ruwiki pages as flatfiles.
- class Flatfiles < Ruwiki::Backend
- # Initializes the flatfile backend. This will read
- # ruwiki.config.storage_options[:flatfiles] to determine the options
- # set by the user. The following options are known for
- # <tt>:flatfiles</tt>:
- #
- # :data_path:: The directory in which the wiki files will be found.
- # By default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+.
- def initialize(ruwiki)
- options = ruwiki.config.storage_options[:flatfiles]
- options[:data_path] ||= "./data/"
- @data_path = options[:data_path]
- @extension = options[:extension]
- raise Ruwiki::Backend::StandardError,
- ruwiki.message[:no_data_directoy] % [@data_path] unless File.exists?(@data_path) and File.directory?(@data_path)
- super ruwiki
- end
-
- # Loads the topic page from disk.
- def load(topic, project)
- pagefile = page_file(topic, project)
- buffer = File.readlines(pagefile)
- rescue Errno::EACCES
- raise Ruwiki::Backend::BackendError, @ruwiki.message[:backend_no_access_read]
- rescue Exception => e
- raise Ruwiki::Backend::BackendError, @ruwiki.message[:cannot_retrieve_topic] % p
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def save(page)
- pf = page_file(page.topic, page.project)
- cf = "#{pf}.rdiff"
-
- oldfile = File.readlines(pf) rescue []
- oldfile.collect! { |e| e.chomp }
- newfile = page.rawtext.split(/\n/)
-
- diff = make_diff(page, oldfile, newfile)
- diffs = []
- File.open(cf, 'rb') { |f| diffs = Marshal.load(f) } if File.exists?(cf)
- diffs << diff
- changes = Marshal.dump(diffs)
-
- File.open(cf, 'wb') { |cfh| cfh.print changes }
- File.open(pf, 'wb') { |pfh| pfh.puts page.rawtext }
- rescue Errno::EACCES
- raise Ruwiki::Backend::BackendError, @ruwiki.message[:backend_no_access_store]
- rescue Exception => e
- p = [project, topic, %Q~ (#{@ruwiki.message[:file]} #{pf}~, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise BackendError, @ruwiki.message[:cannot_store_topic] % p
- end
-
- # Destroys the topic page.
- def destroy(page)
- pf = page_file(page.topic, page.project)
- File.unlink(pf) if File.exists?(pf)
- rescue Errno::EACCES
- raise BackendError, @ruwiki.message[:backend_no_access_dtopic]
- rescue Exception => e
- p = [project, topic, %Q~ (#{@ruwiki.message[:file]} #{pf})~, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise BackendError, @ruwiki.message[:cannot_destroy_topic] % p
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- pd = project_directory(project)
- File.exists?(pd) and File.directory?(pd)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- pf = page_file(topic, project)
- project_exists?(project) and File.exists?(pf)
- end
-
- # Tries to create the project.
- def create_project(project)
- pd = project_directory(project)
- raise Backend::ProjectExists, @ruwiki.message[:project_already_exists] % [project] if File.exists?(pd)
- Dir.mkdir(pd)
- rescue Backend::ProjectExists
- raise
- rescue Errno::EACCES
- raise BackendError, @ruwiki.message[:backend_no_access_create]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise BackendError, @ruwiki.message[:cannot_create_project] % p
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- rescue Errno::EACCES
- raise BackendError, @ruwiki.message[:backend_no_access_dproject]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise BackendError, @ruwiki.message[:cannot_destroy_project] % p
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page)
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
-
- lock_okay = false
- # See if we have the lock already.
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, we don't care how old it
- # is. Thus, release it.
- lock_okay ||= (data[0].chomp == @ruwiki.request.environment['REMOTE_ADDR'])
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= ((data[1].to_i + 600) < Time.now.to_i)
- else
- lock_okay = true
- end
-
- if lock_okay
- open(lf, 'w') { |lfh| lfh.puts "#{@ruwiki.request.environment['REMOTE_ADDR']}\n#{Time.now.to_i + 600}" }
- else
- raise BackendError, @ruwiki.message[:backend_cannot_obtain_lock] % [page.project, page.topic]
- end
- rescue BackendError
- raise
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~ (#{@ruwiki.message[:file]} #{pf})~, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise BackendError, @ruwiki.message[:error_creating_lock] % p
- end
-
- # Releases the lock on the topic page.
- def release_lock(page)
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
-
- lock_okay = false
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, then we can safely remove
- # it.
- lock_okay ||= (data[0].chomp == @ruwiki.request.environment['REMOTE_ADDR'])
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < Time.now.to_i)
- else
- lock_okay = true
- end
-
- if lock_okay
- File.unlink(lf) if File.exists?(lf)
- else
- raise BackendError, @ruwiki.message[:backend_cannot_release_lock] % [page.project, page.topic]
- end
- rescue BackendError
- raise
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~ (#{@ruwiki.message[:file]} #{pf})~, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise BackendError, @ruwiki.message[:error_releasing_lock] % p
- end
-
- private
- def project_directory(project)
- File.join(@data_path, project)
- end
-
- def page_file(topic, project = 'Default')
- if @extension.nil?
- File.join(project_directory(project), topic)
- else
- File.join(project_directory(project), "#{topic}.#{extension}")
- end
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/config.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/config.rb
deleted file mode 100644
index a92be70..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/config.rb
+++ /dev/null
@@ -1,132 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Features known to Ruwiki.
- KNOWN_FEATURES = [ ]
-
- # Ruwiki configuration.
- class Config
- # Templates known to Ruwiki.
- TEMPLATES = [ :body, :content, :error, :edit, :controls, :save ]
-
- # Adds additional information to the (rare) error reports. Defaults to
- # +false+.
- attr_accessor :debug
- # The default page for display when Ruwiki is called without any
- # arguments. Defaults to +ProjectIndex+
- attr_accessor :default_page
- # The default project for display when Ruwiki is called without any
- # arguments or a project specification. Defaults to +Default+
- attr_accessor :default_project
- # The storage type as a Symbol. Corresponds to a filename that will be
- # found in ruwiki/backend. In this version of Ruwiki, only flatfiles.rb
- # (e.g., :flatfiles) is defined. Defaults to <tt>:flatfiles</tt>.
- attr_accessor :storage_type
- # The options for the specified storage type. This is a hash of hashes
- # with auto-vifification. See the storage type for available options.
- attr_reader :storage_options
- # The options for the specified feature. This is a hash of hashes with
- # auto-vifification. See #features for more information.
- attr_reader :feature_options
- # The path for templates. Defaults to <tt>./templates/</tt>.
- attr_accessor :template_path
- # The name of the Wiki. Defaults to <tt>ruwiki</tt>
- attr_accessor :title
- # The email address of the webmaster for the Wiki. Defaults to +nil+.
- attr_accessor :webmaster
- # The name of the Ruwiki CSS file. Defaults to <tt>ruwiki.css</tt>.
- attr_accessor :css
- # The template set. Templates are always named as
- # <template_path>/<template_set>/<template_kind>.
- #Template filename. Must be reachable by File#read.
- attr_accessor :template_set
- # Ruwiki is internationalized. This method sets the Ruwiki error
- # messages to the specified language Module. The language Module must
- # have a constant Hash called +Message+ containing a set of symbols and
- # localized versions of the messages associated with them.
- #
- # If the file 'ruwiki/lang/es.rb' contains the module
- # <tt>Ruwiki::Lang::ES</tt>, the error messages for RSS could be
- # localized to Español thus:
- #
- # require 'ruwiki/lang/es'
- # ...
- # wiki.config.language = Ruwiki::Lang::ES
- #
- # Localization is per wiki instance. In a servlet environment, this may
- # mean that only a single language is recognised.
- #
- # See Ruwiki::Lang::EN for more information.
- attr_accessor :language
- # The message hash.
- attr_reader :message
-
- def language=(l) #:nodoc:
- @language = l
- @message = l::Message
- end
-
- # Returns the template string
- def template(kind = :body)
- raise ConfigError, message[:no_template_found] % [kind.inspect, @template_set] unless TEMPLATES.include?(kind)
- File.read(File.join(@template_path, @template_set, "#{kind.to_s}.tmpl"))
- end
-
- # Returns a copy of the list of features supported by this Wiki.
- def features
- @features.dup
- end
-
- # Adds a new feature to the Wiki.
- def add_feature(feature)
- raise ConfigError, message[:unknown_feature] % [feature.inspect] unless KNOWN_FEATURES.include?(feature)
- @features << feature
- end
-
- # Returns the CSS stylesheet content for the Wiki. This previously
- # returned the <link> to the stylesheet, but instead returns a <style>
- # block in the head so that the CSS is kept with the template set, which
- # may be kept outside of the HTML area.
- def css_link
- %Q[<style>#{File.read(File.join(@template_path, @template_set, @css))}</style>]
- end
-
- # Creates a new configuration object.
- def initialize
- @debug = false
- @default_project = "Default"
- @default_page = "ProjectIndex"
- @storage_type = :flatfiles
- @storage_options = Hash.new { |h, k| h[k] = {} }
- @template_path = "./templates/"
- @template_set = "default"
- @css = "ruwiki.css"
- @webmaster = nil
- @title = "Ruwiki"
- @features = []
- @feature_options = Hash.new { |h, k| h[k] = {} }
-
- self.language = Ruwiki::Lang::EN
- end
-
- # Verifies that required configuration options are actually set. Right
- # now, it only checks the values that are defaulted to +nil+.
- def verify
- raise ConfigError, message[:no_webmaster_defined] if @webmaster.nil?
- raise ConfigError, message[:invalid_template_dir] % [@template_path] unless File.exists?(@template_path) and File.directory?(@template_path)
- t = File.join(@template_path, @template_set)
- raise ConfigError, message[:no_template_set] % [@template_set] unless File.exists?(t) and File.directory?(t)
- end
-
- class ConfigError < StandardError #:nodoc:
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/handler.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/handler.rb
deleted file mode 100644
index 2bf24a5..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/handler.rb
+++ /dev/null
@@ -1,207 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Handler
- class << self
- # Generate a new Handler pair from a CGI request.
- def from_cgi(cgi, output_stream = $stdout)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::CGIRequest.new(cgi)
- o.response = Ruwiki::Handler::CGIResponse.new(cgi, output_stream)
- end
- end
-
- # Generate a new Handler pair from a WEBrick request.
- def from_webrick(req, res)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::WEBrickRequest.new(req)
- o.response = Ruwiki::Handler::WEBrickResponse.new(res)
- end
- end
- end
-
- # Returns the handler's request object.
- attr_accessor :request
- # Returns the handler's response object.
- attr_accessor :response
-
- # Creates the handler pair.
- def initialize(&block) #:yields: self
- @request = nil
- @response = nil
- yield self if block_given?
- end
-
- # REpresents an abstract incoming request. This insulates the rest of
- # the code from knowing whether parameters are passed as part of the
- # path, as parameters in the URL, or in some other fashion.
- class AbstractRequest
- def initialize(*args)
- end
- end
-
- # Handles all requests from web applications.
- #
- # Subclasses should provide:
- # @parameters:: Hash-like object that responds to #[] and #hash_key?]
- # @environment:: Hash-like object that responds to #[]
- class AbstractWebRequest < AbstractRequest
- # The parameters provided via the web request.
- attr_reader :parameters
- # The environment provided to the web request.
- attr_reader :environment
- # The request path.
- attr_reader :path
-
- # Yields each parameter key in succession.
- def each_parameter #:yields: key, value
- @parameters.each { |k, v| yield k, v }
- end
-
- def each_environment #:yields: key, value
- @environment.each { |k, v| yield k, v }
- end
-
- # Return the URL of our server.
- def server_url
- res = "http://" # should detect whether we're in secure server mode.
- if @environment['HTTP_HOST']
- res << @environment['HTTP_HOST']
- else
- res << "#{@environment['SERVER_NAME']}:#{@environment['SERVER_PORT']}"
- end
- end
-
- # Return the URL of this script.
- def script_url
- server_url << @environment['SCRIPT_NAME'].to_s
- end
-
- # Return the URL of this request.
- def request_url
- res = script_url
- res << @environment['PATH_INFO'] if @environment['PATH_INFO']
- query = @environment['QUERY_STRING']
- res << "?#{@environment['QUERY_STRING']}" if query && !query.empty?
- res
- end
-
- # Convert a file path into a URL
- def make_url(project, path)
- "#{server_url}/#{project}/#{path}"
- end
-
- def determine_request_path
- @path = ""
- return @path if @environment['PATH_INFO'].nil?
- @path = @environment['PATH_INFO'].dup
- end
- end
-
- # Request for CGI-based activity to ruwiki.
- class CGIRequest < AbstractWebRequest
- def initialize(cgi, output_stream = $stdout)
- @environment = ENV
- @cgi = cgi
- @parameters = {}
- cgi.params.each { |k, v| @parameters[k] = v[0] }
- super
- end
- end
-
- # Request for WEBrick based servlet activity to ruwiki.
- class WEBrickRequest < AbstractWebRequest
- def initialize(req)
- @environment = req.meta_vars
- @parameters = req.query
- super
- end
- end
-
- # Used to write responses in different execution environments such as
- # CGI and Webrick.
- #
- # If you want to create a new response object, you'll need to implement
- # #add_header, #write_headers, and #<<.
- #
- # The Response object is instantiated with an output stream which must
- # supply +<<+ and +puts+ methods.
- class AbstractResponse
- # Add to the list of headers to be sent back to the client.
- def add_header(key, value)
- raise "Not implemented"
- end
-
- # Write the accumulated headers back to the client.
- def write_headers
- raise "Not implemented"
- end
-
- # Write the string to the client.
- def <<(string)
- raise "Not implemented"
- end
-
- # output_stream must respond to #<< and #puts.
- def initialize(output_stream = $stdout)
- @headers = {}
- @output_stream = output_stream
- end
- end
-
- # CGIResponse is the response object for CGI mode.
- class CGIResponse < AbstractResponse
- # output_stream must respond to #<< and #puts.
- def initialize(cgi, output_stream = $stdout)
- @cgi = cgi
- super(output_stream)
- end
-
- # Add the header pair for later output as a CGI header.
- def add_header(key, value)
- @headers[key] = value
- end
-
- # Write the headers to the stream. The headers can only be written
- # once.
- def write_headers
- return if @written
- @headers.each { |key, value| @output_stream.puts "#{key}: #{value}\r\n" }
- @output_stream.puts
- @written = true
- end
-
- # Output the string to the stream provided.
- def <<(string)
- @output_stream << string
- end
- end
-
- # WEBrickResponse is the response object for WEBrick servlet mode.
- class WEBrickResponse < AbstractResponse
- def initialize(webrick_response)
- @response = webrick_response
- end
-
- def add_header(key,value)
- @response[key] = value
- end
-
- def write_headers
- # Webrick will take care of this on its own.
- end
-
- def <<(string)
- @response.body << string
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/lang/en.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/lang/en.rb
deleted file mode 100644
index 81c93d3..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/lang/en.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- module Lang
- # Ruwiki::Lang::EN is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module EN
- Message = {
- :backend_cannot_obtain_lock => "Unable to obtain a lock on project [%s] topic %s. Try again later.",
- :backend_cannot_release_lock => "Unable to release the lock on project [%s] topic %s. Try again later.",
- :backend_no_access_create => "No access to create project.",
- :backend_no_access_dproject => "No access to destroy project.",
- :backend_no_access_dtopic => "No access to destroy topic.",
- :backend_no_access_read => "No access to retrieve the topic.",
- :backend_no_access_store => "No access to store the topic.",
- :cannot_create_project => "Cannot create project [%s]: %s",
- :cannot_destroy_project => "Cannot destroy project [%s]: %s",
- :cannot_destroy_topic => "Cannot destroy project [%s] topic [%s]%s: %s",
- :cannot_retrieve_topic => "Cannot retrieve project [%s] topic [%s]%s: %s",
- :cannot_store_topic => "Cannot store project [%s] topic [%s]%s: %s",
- :complete_utter_failure => "Complete and Utter Failure",
- :config_not_ruwiki_config => "Configuration must be of class Ruwiki::Config.",
- :editing => "Editing",
- :error => "Error",
- :error_creating_lock => "Error creating lock on project [%s] topic [%s]%s: %s",
- :error_releasing_lock => "Error releasing lock on project [%s] topic [%s]%s: %s",
- :file => "File",
- :invalid_template_dir => "The specified path for templates (%s) does not exist or is not a directory.",
- :invalid_path_info_value => "Something has gone seriously wrong with the web environment. PATH_INFO = %s",
- :no_data_directory => "The data directory (%s) does not exist",
- :no_template_found => "No template of %s found in template set %s.",
- :no_template_set => "There is no template set '%s' in the template path.",
- :no_webmaster_defined => "Configuration error: Webmaster is unset.",
- :project_already_exists => "Project %s already exists.",
- :project_does_not_exist => "Project %s does not exist.",
- :render_arguments => "Ruwiki#render must be called with zero or two arguments.",
- :unknown_backend => "Unknown backend %s.",
- :unknown_feature => "Unknown feature %s."
- }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/page.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/page.rb
deleted file mode 100644
index 3434dd7..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/page.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # A generic page for Ruwiki.
- class Page
- # The page ID.
- attr_accessor :page_id
- # The current version of the page.
- attr_accessor :version
- # The previous version of the page.
- attr_accessor :old_version
- # The page topic (the name of the page).
- attr_accessor :topic
- # The project of the page.
- attr_accessor :project
- # Unformatted page text.
- attr_reader :content
- # Formatted page text.
- attr_accessor :formatted
-
- # The IP address of the person who made the last change.
- def change_ip
- %Q<#{@ruwiki.request.environment['REMOTE_HOST']} (#{@ruwiki.request.environment['REMOTE_ADDR']})>
- end
-
- # The ID, if present, of the person who made the last change. Not yet
- # implemented.
- def change_id
- nil
- end
-
- # Creates a Ruwiki page.
- def initialize(ruwiki, init = {})
- @ruwiki = ruwiki
-
- @project = init[:project] || @ruwiki.config.default_project
- @topic = init[:topic] || "NewTopic"
- @content = init[:content] || ""
- @page_id = init[:page_id] || 0
- @version = init[:version] || 0
- @old_version = @version - 1
-
- if init.has_key?(:rawtext)
- @rawtext = init[:rawtext].dup
- @content = parse_header(@rawtext.dup)
- @formatted = parse_content(@content, @project)
- elsif not @content.empty?
- @formatted = parse_content(@content.dup, @project)
- else
- @formatted = ""
- end
- @content.gsub!(/\r/, "")
- end
-
- # The content of the page.
- def content=(content)
- @content = content.gsub(/\r/, "")
- @formatted = parse_content(content, @project)
- end
-
- # Output raw header and raw page context for saving.
- def rawtext
- return <<-EOS
-id: #{@page_id}
-topic: #{@topic}
-version: #{@version}
-#EHDR
-#{@content}
- EOS
- end
-
- # Outputs the HTML version of the page.
- def to_html
- @formatted
- end
-
- private
- HEADER_RE = /^([a-z]+)\s*:\s*(.*)$/
- HEADER_END_RE = /^#EHDR$/
-
- # Parse the header.
- def parse_header(rawtext)
- rawbuf = rawtext.split("\n")
-
- loop do
- break if rawbuf.nil? or rawbuf.empty?
-
- if rawbuf[0] =~ HEADER_END_RE
- rawbuf.shift
- break
- end
-
- match = HEADER_RE.match(rawbuf[0])
-
- if match
- case match[1].intern
- when :id
- @page_id = match[2].to_i
- when :topic
- @topic = match[2]
- when :version
- @version = match[2].to_i
- @old_version = @version - 1
- end
- rawbuf.shift
- end
- end
-
- rawbuf.join("\n")
- end
-
- # Parse the content.
- def parse_content(content, project)
- parsed = @ruwiki.markup.parse(content, project)
-
- parsed
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/servlet.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/servlet.rb
deleted file mode 100644
index 3144b23..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/servlet.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'webrick'
-
-class Ruwiki
- class Servlet < WEBrick::HTTPServlet::AbstractServlet
- def initialize(config)
- @config = config
- end
-
- # Converts a POST into a GET.
- def do_POST(req, res)
- do_GET(req, res)
- end
-
- def do_GET(req, res)
- # Generate the reponse handlers for Ruwiki from the request and response
- # objects provided.
- wiki = Ruwiki.new(Ruwiki::Handler.from_webrick(req, res))
-
- # Configuration defaults to certain values. This overrides the defaults.
- wiki.config = $config unless $config.nil?
- wiki.run
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/template.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/template.rb
deleted file mode 100644
index a285eed..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/template.rb
+++ /dev/null
@@ -1,223 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file is originally from rdoc by Dave Thomas (dave@pragprog.com).
-#
-# $Id$
-#++
-class Ruwiki
- # RDoc's cheap-n-cheerful HTML page template system. You create a template
- # containing:
- #
- # * variable names between percent signs (<tt>%fred%</tt>)
- # * blocks of repeating stuff:
- # START:key
- # ... stuff
- # END:key
- #
- # You feed the code a hash. For simple variables, the values are resolved
- # directly from the hash. For blocks, the hash entry corresponding to +key+
- # will be an array of hashes. The block will be generated once for each
- # entry. Blocks can be nested arbitrarily deeply.
- #
- # The template may also contain:
- # IF:key
- # ... stuff
- # ENDIF:key
- #
- # _stuff_ will only be included in the output if the corresponding key is
- # set in the value hash.
- #
- # Usage: Given a set of templates <tt>T1, T2,</tt> etc
- # values = { "name" => "Dave", state => "TX" }
- # t = TemplatePage.new(T1, T2, T3)
- # File.open(name, "w") {|f| t.write_html_on(f, values)}
- # or
- # res = ''
- # t.write_html_on(res, values)
- #
- class TemplatePage
-
- # A context holds a stack of key/value pairs (like a symbol table). When
- # asked to resolve a key, it first searches the top of the stack, then
- # the next level, and so on until it finds a match (or runs out of
- # entries).
- class Context
- def initialize
- @stack = []
- end
-
- def push(hash)
- @stack.push(hash)
- end
-
- def pop
- @stack.pop
- end
-
- # Find a scalar value, throwing an exception if not found. This method
- # is used when substituting the %xxx% constructs
- def find_scalar(key)
- @stack.reverse_each do |level|
- if val = level[key]
- return val unless val.kind_of? Array
- end
- end
- raise "Template error: can't find variable '#{key}'"
- end
-
- # Lookup any key in the stack of hashes
- def lookup(key)
- @stack.reverse_each do |level|
- val = level[key]
- return val if val
- end
- nil
- end
- end
-
- # Simple class to read lines out of a string
- class LineReader
- # we're initialized with an array of lines
- def initialize(lines)
- @lines = lines
- end
-
- # read the next line
- def read
- @lines.shift
- end
-
- # Return a list of lines up to the line that matches a pattern. That
- # last line is discarded.
- def read_up_to(pattern)
- res = []
- while line = read
- if pattern.match(line)
- return LineReader.new(res)
- else
- res << line
- end
- end
- raise "Missing end tag in template: #{pattern.source}"
- end
-
- # Return a copy of ourselves that can be modified without affecting us
- def dup
- LineReader.new(@lines.dup)
- end
- end
-
- # +templates+ is an array of strings containing the templates. We start at
- # the first, and substitute in subsequent ones where the string
- # <tt>!INCLUDE!</tt> occurs. For example, we could have the overall page
- # template containing
- #
- # <html><body>
- # <h1>Master</h1>
- # !INCLUDE!
- # </bost></html>
- #
- # and substitute subpages in to it by passing [master, sub_page]. This
- # gives us a cheap way of framing pages
- def initialize(*templates)
- result = "!INCLUDE!"
- templates.each do |content|
- result.sub!(/!INCLUDE!/, content)
- end
- @lines = LineReader.new(result.split($/))
- end
-
- # Render the templates into HTML, storing the result on +op+ using the
- # method <tt><<</tt>. The <tt>value_hash</tt> contains key/value pairs
- # used to drive the substitution (as described above)
- def write_html_on(op, value_hash)
- @context = Context.new
- op << substitute_into(@lines, value_hash).tr("\000", '\\')
- end
-
- # Substitute a set of key/value pairs into the given template. Keys with
- # scalar values have them substituted directly into the page. Those with
- # array values invoke <tt>substitute_array</tt> (below), which examples a
- # block of the template once for each row in the array.
- #
- # This routine also copes with the <tt>IF:</tt>_key_ directive, removing
- # chunks of the template if the corresponding key does not appear in the
- # hash, and the START: directive, which loops its contents for each value
- # in an array
- def substitute_into(lines, values)
- @context.push(values)
- skip_to = nil
- result = []
-
- while line = lines.read
-
- case line
-
- when /^IF:(\w+)/
- lines.read_up_to(/^ENDIF:#$1/) unless @context.lookup($1)
-
- when /^IFNOT:(\w+)/
- lines.read_up_to(/^ENDIF:#$1/) if @context.lookup($1)
-
- when /^ENDIF:/
- ;
-
- when /^START:(\w+)/
- tag = $1
- body = lines.read_up_to(/^END:#{tag}/)
- inner_values = @context.lookup(tag)
- raise "unknown tag: #{tag}" unless inner_values
- raise "not array: #{tag}" unless inner_values.kind_of?(Array)
- inner_values.each do |vals|
- result << substitute_into(body.dup, vals)
- end
- else
- result << expand_line(line.dup)
- end
- end
-
- @context.pop
-
- result.join("\n")
- end
-
- # Given an individual line, we look for %xxx% constructs and
- # HREF:ref:name: constructs, substituting for each.
- def expand_line(line)
- # Generate a cross reference if a reference is given,
- # otherwise just fill in the name part
-
- line.gsub!(/HREF:(\w+?):(\w+?):/) do
- ref = @context.lookup($1)
- name = @context.find_scalar($2)
-
- if ref and !ref.kind_of?(Array)
- "<a href=\"#{ref}\">#{name}</a>"
- else
- name
- end
- end
-
- # Substitute in values for %xxx% constructs. This is made complex
- # because the replacement string may contain characters that are
- # meaningful to the regexp (like \1)
-
- line = line.gsub(/%([a-zA-Z]\w*)%/) do
- val = @context.find_scalar($1)
- val.tr('\\', "\000")
- end
-
- line
- rescue Exception => e
- $stderr.puts "Error in template: #{e}"
- $stderr.puts "Original line: #{line}"
- exit
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki.rb
deleted file mode 100644
index c1e7e61..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Ruwiki's Wiki markup class. This will convert the Wiki markup known by
- # Ruwiki (defined by Token classes). The algorithm is as follows:
- #
- # 1. For each known Token class, match each instance of it in the content
- # stream. Replace each instance in the content stream with a Token
- # marker: TOKEN_x or \TOKEN_x, where x is a digit representing the
- # Token. (\TOKEN_x is a special case of token matching. See
- # Ruwiki::Markup::Token for more information.) Store the Token for
- # later processing.
- # 2. Go back through the content, replacing each instance of \TOKEN_x
- # with the Token's defined restore value (which should be the same
- # value as was originally matched).
- # 3. Go through the content, replacing each instance of TOKEN_x with the
- # Token's defined replacement value.
- # 4. Go through the tokens, in reverse, and execute the post replacement
- # routine defined by the Token. (This may be necessary to collapse
- # consecutive HTML structures.)
- # 5. Return the parsed content and the collected metadata.
- #
- # == Tokens
- # Look at Ruwiki::Markup::Token describes how to create Token objects.
- class Wiki
- def parse(content, project = nil)
- content = content.dup
- tokens = []
- project ||= @ruwiki.config.default_project
-
- Token.tokenlist.each do |token|
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(@ruwiki, match, project)
- tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{tokens.size - 1}"
- else
- "TOKEN_#{tokens.size - 1}"
- end
- end
- end
-
- replaced = []
- s = true
- loop do
- break if replaced.size >= tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].restore
- }
-
- s = content.gsub!(/TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].replace
- }
- end
-
- 3.times do
- tokens.reverse_each { |token| token.post_replace(content) }
- end
-
- content
- end
-
- # Creates the markup class.
- def initialize(ruwiki)
- @ruwiki = ruwiki
- end
- end
-end
-
-require 'ruwiki/wiki/tokens'
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens.rb
deleted file mode 100644
index 45a2a1b..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens.rb
+++ /dev/null
@@ -1,126 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # The base Token class. All Token classes must inherit from Token and
- # *must* implement the following methods:
- #
- # [self.regexp] The regular expression that the Token will be
- # replacing.
- # [replace] The mechanism for replacing the Token with the desired
- # results.
- #
- # Token classes <i>should</i> implement the following method:
- # [self.rank] Default: <tt>5000</tt>. Affects the sort order. Must
- # return an integer.
- #
- # Token classes <i>may</i> implement the following methods:
- # [restore] Restores the token without replacement. Implements the
- # results of the escape character. NOTE: each Token
- # class is responsible for its own restore. Tokens that
- # are anchored to the beginning of a line are the most
- # likely to need to reimplement this.
- # [post_replace] Performs any necessary massaging of the data. See the
- # implementation of Ruwiki::Wiki::Lists for more
- # information.
- class Token
- @@tokenlist = []
- @@sorted = false
-
- class << self
- # Tokens should define rank if they must be first or last in
- # processing. Otherwise, they are sorted in the order defined.
- def rank
- 5000
- end
-
- # The Wiki parsing routine uses Token.tokenlist to determine the
- # tokens that are processed, and the order in which they are
- # processed. See Token.rank for more information.
- def tokenlist
- unless @@sorted
- head = @@tokenlist.shift
- @@tokenlist.sort! { |a, b| a.rank <=> b.rank }
- @@tokenlist.unshift(head)
- sorted = true
- end
- @@tokenlist
- end
-
- def inherited(child_class) #:nodoc:
- @@tokenlist << Token if @@tokenlist.empty?
-
- # Make the child class post_replace a blank function because we
- # don't want to propogate the currently defined post_replace.
- # The current post_replace is specific to Token_Base only.
- class << child_class
- def post_replace(content)
- content
- end
- end
-
- @@tokenlist << child_class
- @@sorted = false
- end
-
- # The replacement regular expression.
- def regexp
- /TOKEN_(\d*)/
- end
- end
-
- # All Token classes must match this header signature if they define
- # #initialize.
- #
- # [ruwiki] The owner Ruwiki object.
- # [match] The MatchData object for this Token.
- # [project] The project being processed.
- def initialize(ruwiki, match, project = nil)
- @ruwiki = ruwiki
- @match = match
- @project = project || @ruwiki.config.default_project
- end
-
- # The replacement method. Uses @match to replace the token with the
- # appropriate values.
- def replace
- "TOKEN_#{@match[1]}"
- end
-
- # Restores the token without replacement. By default, replaces
- # "dangerous" HTML characters.
- def restore
- @match[0].gsub(/&/, "&amp;").gsub(/</, "&lt;").gsub(/>/, "&gt;")
- end
-
- # The content may need massaging after processing.
- def post_replace(content)
- content
- end
- end
- end
-end
-
- # Load the tokens from the ruwiki/wiki/tokens directory.
-tokens_dir = 'ruwiki/wiki/tokens'
-
-$LOAD_PATH.each do |path|
- target = "#{path}/#{tokens_dir}"
- if File.exists?(target) and File.directory?(target)
- Dir::glob("#{target}/*.rb") do |token|
- begin
- require token
- rescue LoadError
- nil
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/00default.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/00default.rb
deleted file mode 100644
index 7ec185b..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/00default.rb
+++ /dev/null
@@ -1,174 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-class Ruwiki
- class Wiki
- # The Paragraph Token class changes blank lines to <p> tags. This class,
- # under the current implementation, should be *first* in the Token list
- # after Token.
- class Paragraph < Ruwiki::Wiki::Token
- # This Token is #rank 0, because it should be first in the Token list.
- def self.rank
- 0
- end
-
- # Matches blank lines. %r{^\s*$}
- def self.regexp
- %r{(^\s*$)}
- end
-
- # Replaces with "<p>"
- def replace
- "<p>"
- end
-
- # Ensures that <p> won't be surrounded by <br> tags.
- def post_replace(content)
- content.gsub!(%r{\n$}, '</p>')
- content.gsub!(%r{(\n|<br ?/?>)?<p>(\n|<br ?/?>)?}, '<p>')
- content.gsub!(%r{<p>}, '</p><p>')
- content.gsub!(%r{</p>(</p>)+}, '</p>')
- content.gsub!(%r{<body></p>}, '<body>')
- content.gsub!(%r{</body>}, '</p></body>')
- content.gsub!(%r{<p></p>}, '')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content.gsub!(%r{^</p>}, '')
- content
- end
- end
-
- # The Code Token class converts indented text to "unformatted" (<pre>)
- # text. This class should be *second* in the Token list.
- class Code < Ruwiki::Wiki::Token
- # This Token is #rank 1, because it should be second in the Token list.
- def self.rank
- 1
- end
-
- # Matches indented text. %r{^(\s+\S.*)$}
- def self.regexp
- %r{^(\s+\S.*)$}
- end
-
- # Replaces the text to <pre>content</pre>.
- def replace
- content = @match[1].gsub(/&/) { "&amp;" }.gsub(/</) { "&lt;" }.gsub(/>/) { "&gt;" }
- %Q{<pre>#{content}</pre>}
- end
-
- # Converts cases of %r{</pre>(\n|<br ?/?>)<pre>} to \1.
- def post_replace(content)
- content.gsub!(%r{</pre>(\n|<br ?/?>)?<pre>}, '\1')
- content.gsub!(%r{<p><pre>}, '<pre>')
- content.gsub!(%r{</pre></p>}, '</pre>')
- content
- end
- end
-
- RE_URI_SCHEME = %r{[\w.]+?:}
- RE_URI_PATH = %r{[^\s<>\]]}
- RE_URI_TEXT = %r{[^\]]*}
- RE_IMAGE = /(jpg|jpeg|png|gif)$/
-
- # Converts URLs in the form of [url] to numbered links.
- class NumberedLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def initialize(ruwiki, match, project = nil)
- super
- @@count = 0
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\]}
- end
-
- def replace
- extlink = @match.captures[0]
-
- @@count += 1
- name = "[#{@@count}]"
-
- if extlink =~ RE_IMAGE
- %Q{<img src="#{extlink}" title="#{name}" alt="#{name}" />}
- else
- %Q{<a class="rw_extlink" href="#{extlink}">#{name}</a>}
- end
- end
- end
-
- # Converts URLs in the form of [url name] to named links.
- class NamedLinks < Ruwiki::Wiki::Token
- def self.rank
- 3
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\s+(#{RE_URI_TEXT})\]}
- end
-
- def replace
- extlink = @match.captures[0]
- name = @match.captures[1]
-
- if extlink =~ RE_IMAGE
- %Q{<img src="#{extlink}" title="#{name}" alt="#{name}" />}
- else
- %Q{<a class="rw_extlink" href="#{extlink}">#{name}</a>}
- end
- end
- end
-
- # Converts URLs to links where the "name" of the link is the URL itself.
- class ExternalLinks < Ruwiki::Wiki::Token
- def self.rank
- 504
- end
-
- def self.regexp
- %r{\b(#{RE_URI_SCHEME}#{RE_URI_PATH}+)}
- end
-
- def replace
- extlink = @match[1]
-
- if extlink =~ RE_IMAGE
- %Q{<img src="#{extlink}" title="Image at: #{extlink}" alt="Image at: #{extlink}" />}
- else
- %Q{<a class="rw_extlink" href="#{extlink}">#{extlink}</a>}
- end
- end
- end
-
- # Creates a horizontal rule.
- class HRule < Ruwiki::Wiki::Token
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def replace
- "<hr />"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def post_replace(content)
- content.gsub!(%r{<hr ?/?>\n<br ?/?>}, "<hr />")
- content.gsub!(%r{(\n|<br ?/?>)?<hr>(\n|<br ?/?>)?}, "<hr />")
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/01wikilinks.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/01wikilinks.rb
deleted file mode 100644
index cbb34e9..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/01wikilinks.rb
+++ /dev/null
@@ -1,161 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki
- class Wiki
- # This provides the basic WikiWord match. This supports WikiWord,
- # CPlusPlus, ThisIsALink, and C_Plus_Plus.
- RE_WIKI_WORDS = %r{[[:upper:]][\w_]*(?:[[:lower:]]+[[:upper:]_]|[[:upper:]_]+[[:lower:]])[\w_]*}
- # This provides wikipedia format matches, e.g., [[wikipedia links]]. The
- # only restriction on words in this format is that they must NOT begin
- # with an underscore ('_').
- RE_WIKIPEDIA_WORDS = %r{\[\[([^_].*?)\]\]}
- # This provides the basic Wiki Project match.
- RE_PROJECT_WORD = %r{[[:upper:]][[:lower:]]+}
-
- # This provides the Wiki view link format:
- VIEW_LINK = %Q[<a class="rw_pagelink" href="%s">%s</a>]
- EDIT_LINK = %Q[<span class="rw_edittext">%s</span><a class="rw_pagelink" href="%s">?</a>]
-
- # Creates a crosslink for a Project::WikiPage.
- class ProjectCrossLink < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::(#{RE_WIKI_WORDS})}
- end
-
- def replace
- captures = @match.captures
- project = captures[0]
- topic = captures[1]
- link = CGI.escape(topic.dup)
-
- if @ruwiki.backend.page_exists?(topic, project)
- VIEW_LINK % ["#{@ruwiki.request.script_url}/#{project}/#{link}", "#{project}::#{topic.gsub(/_/, ' ')}"]
- else
- EDIT_LINK % ["#{project}::#{topic.gsub(/_/, ' ')}", "#{@ruwiki.request.script_url}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a crosslink for a Project::WikiPage using a Wikipedia link
- # format.
- class ProjectCrossLinkWikipedia < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::#{RE_WIKIPEDIA_WORDS}}
- end
-
- def replace
- captures = @match.captures
- project = captures[0]
- link = CGI.escape(captures[1])
- topic = captures[1]
-
- if @ruwiki.backend.page_exists?(topic, project)
- VIEW_LINK % ["#{@ruwiki.request.script_url}/#{project}/#{link}", "#{project}::#{topic}"]
- else
- EDIT_LINK % ["#{project}::#{topic}", "#{@ruwiki.request.script_url}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to the project index from ::Project.
- class ProjectIndex < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{(\B|\\)::(#{RE_PROJECT_WORD})}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- project = @match.captures[1]
-
- if @ruwiki.backend.page_exists?('ProjectIndex', project)
- VIEW_LINK % ["#{@ruwiki.request.script_url}/#{project}/ProjectIndex", project]
- else
- if @ruwiki.backend.project_exists?(project)
- EDIT_LINK % [project, "#{@ruwiki.request.script_url}/#{project}/ProjectIndex/_edit"]
- else
- EDIT_LINK % [project, "#{@ruwiki.request.script_url}/#{project}/_create"]
- end
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project.
- class WikiLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\b|\\)(#{RE_WIKI_WORDS})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @ruwiki.backend.page_exists?(topic, @project)
- VIEW_LINK % ["#{@ruwiki.request.script_url}/#{@project}/#{link}", topic.gsub(/_/, ' ')]
- else
- EDIT_LINK % [topic.gsub(/_/, ' '), "#{@ruwiki.request.script_url}/#{@project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project using a Wikipedia
- # link format.
- class WikipediaLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\B|\\)#{RE_WIKIPEDIA_WORDS}\B}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- captures = @match.captures
- link = CGI.escape(captures[1])
- topic = captures[1]
-
- if @ruwiki.backend.page_exists?(topic, @project)
- VIEW_LINK % ["#{@ruwiki.request.script_url}/#{@project}/#{link}", topic]
- else
- EDIT_LINK % [topic, "#{@ruwiki.request.script_url}/#{@project}/#{link}/_edit"]
- end
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/abbreviations.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/abbreviations.rb
deleted file mode 100644
index fbac715..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/abbreviations.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts abbreviations.
- class Abbreviations < Ruwiki::Wiki::Token
- ABBREVIATIONS = {
- "PM" => "PocoMail"
- }
-
- def self.regexp
- %r!@{([^}]*)}!
- end
-
- def replace
- k = @match[1]
- if k.nil? or k.empty?
- data = "<dl>"
- ABBREVIATIONS.each do |k, v|
- data << "<dt>#{k}</dt><dd>#{v}</dd>"
- end
- data << "</dl>"
- else
- if ABBREVIATIONS.has_key?(k)
- data = ABBREVIATIONS[k]
- else
- data = @match[0]
- end
- end
- data
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/headings.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/headings.rb
deleted file mode 100644
index 21da302..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/headings.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts headings.
- class Headings < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{^\\?(=+)\s+(.*)}
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def replace
- level = @match[1].count("=")
- content = @match[2]
- level = 6 if level > 6
- "<h#{level}>#{content}</h#{level}>"
- end
-
- def post_replace(content)
- content.gsub!(%r{<p>(<h\d>)}, '\1')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/lists.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/lists.rb
deleted file mode 100644
index 11769b5..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/lists.rb
+++ /dev/null
@@ -1,114 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces Lists
- class Lists < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((\*)+|(#)+)\s+(.*)}
- end
-
- def replace
- content = @match[4]
-
- if @match[3].nil?
- char = '*'
- elem = 'ul'
- else
- char = '#'
- elem = 'ol'
- end
-
- indent = @match[1].count(char)
-
- pre = ""
- post = ""
- indent.times do
- pre << "<#{elem}><li>"
- post << "</li></#{elem}>"
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def post_replace(content)
- content.gsub!(%r{</[uo]l>\n?<[uo]l>}, '')
- content.gsub!(%r{</ol>(\n|(<br ?/?>))?<ol>}, '')
- content.gsub!(%r{</ul>(\n|(<br ?/?>))?<ul>}, '')
- content.gsub!(%r{<li><([uo]l)>}, '<\1>')
- content.gsub!(%r{</([uo]l)></li>}, '</\1>')
- content
- end
- end
-
- # Produces block quotes.
- class Blockquotes < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(:+)\s+(.*)$}
- end
-
- def replace
- content = @match[2]
- indent = @match[1].count(":")
-
- pre = ""
- post = ""
- indent.times do
- pre << "<blockquote>"
- post << "</blockquote>"
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def post_replace(content)
- content.gsub!(%r{</blockquote>(\n|<br ?/?>)?<blockquote>}, '')
- content
- end
- end
-
- # Produces definition lists. Does not completely work correctly.
- class Definitions < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(;+)\s+([^:]+)\s+:\s+(.*)}
- end
-
- def replace
- definition = @match[3]
- term = @match[2]
- indent = @match[1].count(';')
-
- pre = ""
- post = ""
- indent.times do
- pre << "<dl>"
- post << "</dl>"
- end
- "#{pre}<dt>#{term}</dt><dd>#{definition}</dd>#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def post_replace(content)
- content.gsub!(%r{</dl>(\n|<br ?/?>)?<dl>}, '')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/rubylists.rb b/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/rubylists.rb
deleted file mode 100644
index 39db408..0000000
--- a/ruwiki/tags/release-0.6.1/lib/ruwiki/wiki/tokens/rubylists.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Convert ruby-talk mailing list references (e.g., [ruby-talk:12345])
- # into named links.
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- # Convert ruby-core/ext/dev/list/math mailing list references (e.g.,
- # [ruby-core:12345]) into named links.
- class OtherRubyLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-(list|doc|core|dev|ext|math):(\d+)\]}
- end
-
- def replace
- ln, lm = @match.captures[0..1]
- %Q(<a class="rw_extlink" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-#{ln}/#{lm}">#{@match[0]}</a>)
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.1/ruwiki.cgi b/ruwiki/tags/release-0.6.1/ruwiki.cgi
deleted file mode 100644
index 2162090..0000000
--- a/ruwiki/tags/release-0.6.1/ruwiki.cgi
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.1
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-
- # Customize this if you put the RuWiki files in a different location.
-$LOAD_PATH.unshift("lib")
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-wiki.config.webmaster = "webmaster@domain.com"
-
-# wiki.config.debug = false
-# wiki.config.title = "Ruwiki"
-# wiki.config.default_page = "ProjectIndex"
-# wiki.config.default_project = "Default"
-# wiki.config.storage_type = :flatfiles
-# wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# wiki.config.storage_options[:flatfiles][:extension] = nil
-# wiki.config.template_path = "./templates/"
-# wiki.config.template_set = "default"
-# wiki.config.css = "ruwiki.css"
-
-wiki.run
diff --git a/ruwiki/tags/release-0.6.1/ruwiki_servlet.rb b/ruwiki/tags/release-0.6.1/ruwiki_servlet.rb
deleted file mode 100644
index fd1072a..0000000
--- a/ruwiki/tags/release-0.6.1/ruwiki_servlet.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.1
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-$LOAD_PATH.unshift("lib")
-
-require 'webrick'
-require 'getopts'
-require 'ruwiki'
-require 'ruwiki/servlet'
-
-getopts "", 'p:8808'
-
- # This is for the WEBrick version of Ruwiki. This has been abstracted to
- # accept a $config global variable to reconfigure Ruwiki after initial
- # creation.
-$config = Ruwiki::Config.new
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$config.webmaster = "webmaster@domain.com"
-
-# $config.debug = false
-# $config.title = "Ruwiki"
-# $config.default_page = "DefaultPage"
-# $config.default_project = "Default"
-# $config.storage_type = :flatfiles
-# $config.storage_options[:flatfiles][:data_path] = "./data/"
-# $config.storage_options[:flatfiles][:extension] = nil
-# $config.css = "ruwiki.css"
-# $config.template_file = nil
-
-s = WEBrick::HTTPServer.new :Port => $OPT_p.to_i, :StartThreads => 1,
- :Logger => WEBrick::Log::new($stderr, WEBrick::Log::DEBUG)
-
-s.mount("/", Ruwiki::Servlet)
-trap("INT") { s.shutdown; exit }
-s.start
diff --git a/ruwiki/tags/release-0.6.1/templates/default/body.tmpl b/ruwiki/tags/release-0.6.1/templates/default/body.tmpl
deleted file mode 100644
index 087a810..0000000
--- a/ruwiki/tags/release-0.6.1/templates/default/body.tmpl
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
- <head>
- <title>%wiki_title%</title>
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.6.1/templates/default/content.tmpl b/ruwiki/tags/release-0.6.1/templates/default/content.tmpl
deleted file mode 100644
index f15bf2f..0000000
--- a/ruwiki/tags/release-0.6.1/templates/default/content.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-!INCLUDE!
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.6.1/templates/default/controls.tmpl b/ruwiki/tags/release-0.6.1/templates/default/controls.tmpl
deleted file mode 100644
index b02e8af..0000000
--- a/ruwiki/tags/release-0.6.1/templates/default/controls.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="rw_nav">
- %home_link% |
- Topic: <b>%page_topic%</b> Project: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a> |
- <a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">Edit</a>
-</div>
diff --git a/ruwiki/tags/release-0.6.1/templates/default/edit.tmpl b/ruwiki/tags/release-0.6.1/templates/default/edit.tmpl
deleted file mode 100644
index c40ca1c..0000000
--- a/ruwiki/tags/release-0.6.1/templates/default/edit.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="rw_nav">%home_link% | <i>Editing</i> Topic: <b>%page_topic%</b> Project: <b>%page_project%</b></div><br />
-
-<form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button accesskey="S" type="submit" name="action" value="save"><u>S</u>ave</button>
- <button accesskey="C" type="submit" name="action" value="cancel" /><u>C</u>ancel</button>
-</form>
-<div class="rw_edit_raw"><h2>Raw Original Value</h2><pre>%pre_page_content%</pre></div>
-<div class="rw_edit_format"><h2>Formatted Version</h2>%unedited_page_content%</div>
diff --git a/ruwiki/tags/release-0.6.1/templates/default/error.tmpl b/ruwiki/tags/release-0.6.1/templates/default/error.tmpl
deleted file mode 100644
index 7c91995..0000000
--- a/ruwiki/tags/release-0.6.1/templates/default/error.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class="rw_nav">%home_link%</div>
-<h1>%name%</h1>
-<p>Send the webmaster a report by <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
-<p>%backtrace%</p>
diff --git a/ruwiki/tags/release-0.6.1/templates/default/ruwiki.css b/ruwiki/tags/release-0.6.1/templates/default/ruwiki.css
deleted file mode 100644
index 3e60491..0000000
--- a/ruwiki/tags/release-0.6.1/templates/default/ruwiki.css
+++ /dev/null
@@ -1,31 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #F2FFA7;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-pre { background-color: #FFFFA7; border: 1px solid black; }
-
-.rw_nav { background-color: #E9967A }
-.rw_edittext { border: 1px dotted blue }
-.rw_pagelink { }
-.rw_extlink { border: 1px solid red }
-.rw_projectxlink { }
-.rw_projectindex { }
-.rw_edit_form { }
-.rw_edit_raw {
- border: 2px solid green;
- float: left;
- max-width: 48%;
- overflow: scroll;
- clear: right;
-}
-.rw_edit_format {
- border: 2px solid blue;
- float: right;
- max-width: 48%;
- clear: none;
-}
diff --git a/ruwiki/tags/release-0.6.1/templates/default/save.tmpl b/ruwiki/tags/release-0.6.1/templates/default/save.tmpl
deleted file mode 100644
index c1ede91..0000000
--- a/ruwiki/tags/release-0.6.1/templates/default/save.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-!INCLUDE!
-Saved page <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic%</a><hr />
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.6.1/tests/harness.rb b/ruwiki/tags/release-0.6.1/tests/harness.rb
deleted file mode 100644
index 2cc233e..0000000
--- a/ruwiki/tags/release-0.6.1/tests/harness.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-$LOAD_PATH.unshift("../lib")
-
-ENV["REQUEST_METHOD"] = "HEAD"
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_options[:flatfiles][:data_path] = "../data"
-$wiki.config.template_path = "../templates/"
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.storage_options[:flatfiles][:extension] = nil
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.6.1/tests/tc_tokens.rb b/ruwiki/tags/release-0.6.1/tests/tc_tokens.rb
deleted file mode 100644
index 456de48..0000000
--- a/ruwiki/tags/release-0.6.1/tests/tc_tokens.rb
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.1
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-require 'test/unit'
-require 'harness'
-
-class TokenTestCases < Test::Unit::TestCase
- def setup
- @project = "Default"
- @tokens = []
- end
-
- def __tokenize(content, token)
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new($wiki, match, @project)
- @tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{@tokens.size - 1}"
- else
- "TOKEN_#{@tokens.size - 1}"
- end
- end
- content
- end
-
- def __replace(content)
- replaced = []
- s = true
- loop do
- break if replaced.size >= @tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].restore
- end
-
- s = content.gsub!(/TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].replace
- end
- end
- content
- end
-
- def __post_replace(content)
- 3.times do
- @tokens.reverse_each { |token| token.post_replace(content) }
- end
- content
- end
-
- def __process(token, content, tokenized, replaced, result)
- assert_equal(tokenized, content = __tokenize(content, token))
- assert_equal(replaced, content = __replace(content))
- assert_equal(result, content = __post_replace(content))
- end
-
- def __display(token, content)
- p tokenized = __tokenize(content.dup, token)
- p replaced = __replace(tokenized.dup)
- p result = __post_replace(replaced.dup)
- end
-
- def test_Paragraph
- token = Ruwiki::Wiki::Paragraph
- content = "\nABC\n\nabc\n"
- tkv = "TOKEN_0\nABC\nTOKEN_1\nabc\n"
- rpv = "<p>\nABC\n<p>\nabc\n"
- res = "<p>ABC</p><p>abc</p>"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Code
- content = " line 1\n line 2\nline3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_0\nTOKEN_1\nline3\n"
- rpv = "<pre> line 1</pre>\n<pre> line 2</pre>\nline3\n"
- res = "<pre> line 1\n line 2</pre>\nline3\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NumberedLinks
- token = Ruwiki::Wiki::NumberedLinks
- content = "[http://www.ruby-lang.org] \\[http://www.rubyforge.org]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
- res = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NamedLinks
- token = Ruwiki::Wiki::NamedLinks
- content = "[http://www.ruby-lang.org Ruby] \\[http://www.rubyforge.org RubyForge]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
- res = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ExternalLinks
- token = Ruwiki::Wiki::ExternalLinks
- content = "http://www.ruby-lang.org \\http://www.rubyforge.org"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
- res = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_HRule
- token = Ruwiki::Wiki::HRule
- content = "----\n\\----"
- tkv = "TOKEN_0\n\\TOKEN_1"
- rpv = "<hr />\n----"
- res = "<hr />\n----"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLink
- token = Ruwiki::Wiki::ProjectCrossLink
- content = "Ruwiki::ChangeLog \\Ruwiki::To_Do Ruwiki::NotExist \\Ruwiki::NotExist"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rw_edittext">Ruwiki::NotExist</span><a class="rw_pagelink" href="http://:/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
- res = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rw_edittext">Ruwiki::NotExist</span><a class="rw_pagelink" href="http://:/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLinkWikipedia
- token = Ruwiki::Wiki::ProjectCrossLinkWikipedia
- content = "Ruwiki::[[ChangeLog]] \\Ruwiki::[[To_Do]] Ruwiki::[[Does Not Exist]] \\Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 Ruwiki::[[_invalid]]"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rw_edittext">Ruwiki::Does Not Exist</span><a class="rw_pagelink" href="http://:/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
- res = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rw_edittext">Ruwiki::Does Not Exist</span><a class="rw_pagelink" href="http://:/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectIndex
- token = Ruwiki::Wiki::ProjectIndex
- content = "::Ruwiki \\::Ruwiki ::Newproject \\::Newproject"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rw_edittext">Newproject</span><a class="rw_pagelink" href="http://:/Newproject/_create">?</a> ::Newproject}
- res = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rw_edittext">Newproject</span><a class="rw_pagelink" href="http://:/Newproject/_create">?</a> ::Newproject}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikiLinks
- token = Ruwiki::Wiki::WikiLinks
- content = "ProjectIndex \\ProjectIndex AustinZiegler \\AustinZiegler Alan_Chen \\Alan_Chen"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rw_edittext">AustinZiegler</span><a class="rw_pagelink" href="http://:/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rw_edittext">Alan Chen</span><a class="rw_pagelink" href="http://:/Default/Alan_Chen/_edit">?</a> Alan_Chen}
- res = %Q{<a class="rw_pagelink" href="http://:/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rw_edittext">AustinZiegler</span><a class="rw_pagelink" href="http://:/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rw_edittext">Alan Chen</span><a class="rw_pagelink" href="http://:/Default/Alan_Chen/_edit">?</a> Alan_Chen}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikipediaLinks
- token = Ruwiki::Wiki::WikipediaLinks
- content = "[[ProjectIndex]] \\[[ProjectIndex]] [[Austin Ziegler]] \\[[Austin Ziegler]] [[_Alan Chen]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 [[_Alan Chen]]"
- rpv = %Q{<a class=\"rw_pagelink\" href=\"http://:/Default/ProjectIndex\">ProjectIndex</a> [[ProjectIndex]] <span class=\"rw_edittext\">Austin Ziegler</span><a class=\"rw_pagelink\" href=\"http://:/Default/Austin+Ziegler/_edit\">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
- res = %Q{<a class=\"rw_pagelink\" href=\"http://:/Default/ProjectIndex\">ProjectIndex</a> [[ProjectIndex]] <span class=\"rw_edittext\">Austin Ziegler</span><a class=\"rw_pagelink\" href=\"http://:/Default/Austin+Ziegler/_edit\">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Abbreviations
- token = Ruwiki::Wiki::Abbreviations
- content = "@{PM}\n@{}\n\\@{PM}"
- tkv = "TOKEN_0\nTOKEN_1\n\\TOKEN_2"
- rpv = "PocoMail\n<dl><dt>PM</dt><dd>PocoMail</dd></dl>\n@{PM}"
- res = "PocoMail\n<dl><dt>PM</dt><dd>PocoMail</dd></dl>\n@{PM}"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Headings
- token = Ruwiki::Wiki::Headings
- content = "= header 1\n== header 2\n=== header 3\n==== header 4\n===== header 5\n====== header 6\n======= header 7->6\n\\== noheader 2\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\nTOKEN_6\n\\TOKEN_7\n"
- rpv = "<h1>header 1</h1>\n<h2>header 2</h2>\n<h3>header 3</h3>\n<h4>header 4</h4>\n<h5>header 5</h5>\n<h6>header 6</h6>\n<h6>header 7->6</h6>\n== noheader 2\n"
- res = "<h1>header 1</h1>\n<h2>header 2</h2>\n<h3>header 3</h3>\n<h4>header 4</h4>\n<h5>header 5</h5>\n<h6>header 6</h6>\n<h6>header 7->6</h6>\n== noheader 2\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Lists
- content = "* level 1\n** level 2\n*** level 3\n* level 1, item 2\n\\* not an item\n"
- content << "# level 1\n## level 2\n### level 3\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\nTOKEN_5\nTOKEN_6\nTOKEN_7\nTOKEN_8\n\\TOKEN_9\n"
- rpv = "<ul><li>level 1</li></ul>\n<ul><li><ul><li>level 2</li></ul></li></ul>\n<ul><li><ul><li><ul><li>level 3</li></ul></li></ul></li></ul>\n<ul><li>level 1, item 2</li></ul>\n* not an item\n<ol><li>level 1</li></ol>\n<ol><li><ol><li>level 2</li></ol></li></ol>\n<ol><li><ol><li><ol><li>level 3</li></ol></li></ol></li></ol>\n<ol><li>level 1, item 2</li></ol>\n# not an item\n"
- res = "<ul><li>level 1</li><ul><li>level 2</li><ul><li>level 3</li></ul></ul><li>level 1, item 2</li></ul>\n* not an item\n<ol><li>level 1</li><ol><li>level 2</li><ol><li>level 3</li></ol></ol><li>level 1, item 2</li></ol>\n# not an item\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Blockquotes
- token = Ruwiki::Wiki::Blockquotes
- content = ": level 1\n:: level 2\n::: level 3\n: level 1, para 2\n\\: not a blockquote\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = "<blockquote>level 1</blockquote>\n<blockquote><blockquote>level 2</blockquote></blockquote>\n<blockquote><blockquote><blockquote>level 3</blockquote></blockquote></blockquote>\n<blockquote>level 1, para 2</blockquote>\n: not a blockquote\n"
- res = "<blockquote>level 1<blockquote>level 2<blockquote>level 3</blockquote></blockquote>level 1, para 2</blockquote>\n: not a blockquote\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Definitions
- content = "; word1 : val1\n;; word2 : val2\n;;; word3 : val3\n; word1/2 : val1/2\n\\; not-a-word : not-a-val\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = "<dl><dt>word1</dt><dd>val1</dd></dl>\n<dl><dl><dt>word2</dt><dd>val2</dd></dl></dl>\n<dl><dl><dl><dt>word3</dt><dd>val3</dd></dl></dl></dl>\n<dl><dt>word1/2</dt><dd>val1/2</dd></dl>\n; not-a-word : not-a-val\n"
- res = "<dl><dt>word1</dt><dd>val1</dd><dl><dt>word2</dt><dd>val2</dd><dl><dt>word3</dt><dd>val3</dd></dl></dl><dt>word1/2</dt><dd>val1/2</dd></dl>\n; not-a-word : not-a-val\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_RubyTalkLinks
- token = Ruwiki::Wiki::RubyTalkLinks
- content = "[ruby-talk:12345] \\[ruby-talk:12345]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = "<a class=\"rw_extlink\" href=\"http://www.ruby-talk.org/12345\">[ruby-talk:12345]</a> [ruby-talk:12345]"
- res = "<a class=\"rw_extlink\" href=\"http://www.ruby-talk.org/12345\">[ruby-talk:12345]</a> [ruby-talk:12345]"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_OtherRubyLinks
- token = Ruwiki::Wiki::OtherRubyLinks
- content = "[ruby-list:123] \\[ruby-list:123] [ruby-doc:123] \\[ruby-doc:123] [ruby-core:123] \\[ruby-core:123] [ruby-dev:123] \\[ruby-dev:123] [ruby-ext:123] \\[ruby-ext:123] [ruby-math:123] \\[ruby-math:123]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5 TOKEN_6 \\TOKEN_7 TOKEN_8 \\TOKEN_9 TOKEN_10 \\TOKEN_11"
- rpv = "<a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123\">[ruby-list:123]</a> [ruby-list:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123\">[ruby-doc:123]</a> [ruby-doc:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123\">[ruby-core:123]</a> [ruby-core:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123\">[ruby-dev:123]</a> [ruby-dev:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123\">[ruby-ext:123]</a> [ruby-ext:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123\">[ruby-math:123]</a> [ruby-math:123]"
- res = "<a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123\">[ruby-list:123]</a> [ruby-list:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123\">[ruby-doc:123]</a> [ruby-doc:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123\">[ruby-core:123]</a> [ruby-core:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123\">[ruby-dev:123]</a> [ruby-dev:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123\">[ruby-ext:123]</a> [ruby-ext:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123\">[ruby-math:123]</a> [ruby-math:123]"
-
- __process(token, content, tkv, rpv, res)
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/Default/ProjectIndex b/ruwiki/tags/release-0.6.2/Default/ProjectIndex
deleted file mode 100644
index aa44715..0000000
--- a/ruwiki/tags/release-0.6.2/Default/ProjectIndex
+++ /dev/null
@@ -1,21 +0,0 @@
-id: 0
-topic: ProjectIndex
-version: 1
-#EHDR
-= Ruwiki
-Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI and
-\WEBrick interfaces, templates, and CSS formatting. Additionally, it supports
-project namespaces, so that two pages can be named the same for differing
-projects without colliding or having to resort to odd naming conventions.
-Please see ::Ruwiki for more information.
-
-The current version is 0.6.2. German and Spanish translations have been added
-in this version. Note that the APIs for Ruwiki should not at this point be
-considered stable, but will be stable in 1.0.
-
-Projects:
-* ::Default
-* ::Ruwiki
-
-Please go to ::Ruwiki if you are unfamiliar with the concept of Wikis in
-general. If you want to play with \WikiFormatting, use the Ruwiki::SandBox.
diff --git a/ruwiki/tags/release-0.6.2/README b/ruwiki/tags/release-0.6.2/README
deleted file mode 100644
index bb7b0e0..0000000
--- a/ruwiki/tags/release-0.6.2/README
+++ /dev/null
@@ -1,56 +0,0 @@
-Ruwiki 0.6.2
-------------
-Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI and
-WEBrick interfaces, templates, and CSS formatting. Additionally, it supports
-project namespaces, so that two pages can be named the same for differing
-projects without colliding or having to resort to odd naming conventions.
-Please see ::Ruwiki in the running Wiki for more information. Ruwiki 0.6.2 now
-has German and Spanish translations available.
-
-Quick Install (CGI)
--------------------
-1. Place the Ruwiki directory in a place that your webserver can execute CGI
- programs. Ensure that ruwiki.cgi is executable on your webserver. You may
- wish to protect templates/, data/, and lib/ from casual access.
-2. Modify the following lines in ruwiki.cgi:
- wiki.config.webmaster = ...
- wiki.config.title = ...
-3. Point your web browser to the appropriate URL.
-
-Quick Install (WEBrick)
------------------------
-1. Modify the following lines in ruwiki_servlet.rb:
- $config.webmaster = ...
- $config.title = ...
-2. Run ruwiki_servlet.rb to start a WEBrick instance on localhost:8808 with
- ruwiki bound to the root path (e.g., http://localhost:8808/).
-3. Point your web browser to the appropriate URL.
-
-Use
----
-Ruwiki is able to be called with one of several URI forms:
-
- http://domain.com/ruwiki.cgi?PageName
- http://domain.com/ruwiki.cgi?PageName&project=Project
- http://domain.com/ruwiki.cgi/PageName
- http://domain.com/ruwiki.cgi/Project/
- http://domain.com/ruwiki.cgi/Project/PageName
-
-Copyright: Copyright © 2003 - 2003, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-* This software includes algorithm/diff by Lars Christensen, available for
- download from the RAA at: http://raa.ruby-lang.org/list.rhtml?name=diff
-* This software includes template.rb from Dave Thomas's rdoc system, available
- for download from SourceForge: http://rdoc.sourceforge.net
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen]
- on 2003.10.22. Note that the initial template translations (./templates/de/)
- were done via AltaVista Babelfish and should not be blamed on Christian.
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández]
- on 2003.10.22. Note that the initial template translations (./templates/es/)
- were done via AltaVista Babelfish and should not be blamed on Mauricio.
-
-$Id$
diff --git a/ruwiki/tags/release-0.6.2/Ruwiki/BugTracking b/ruwiki/tags/release-0.6.2/Ruwiki/BugTracking
deleted file mode 100644
index e3bd4d2..0000000
--- a/ruwiki/tags/release-0.6.2/Ruwiki/BugTracking
+++ /dev/null
@@ -1,19 +0,0 @@
-id: 0
-topic: BugTracking
-version: 1
-#EHDR
-= Ruwiki 0.6.2 Bug Tracking
-This page is for tracking bugs in the Ruwiki project. Because of the extensive
-nature of the changes between Ruwiki 0.3.0 and Ruwiki 0.5.0 (and 0.6.x), the
-previously listed bugs have been erased.
-
-You may also be interested in the Ruwiki::To_Do list.
-
-----
-== Closed Bugs
-* Projects aren't created appropriately. Fixed in 0.6.1.
-* Saving without editing (or repost) appears to cause problems. A fix has been applied to attempt to address this. Pages that have not been changed will not be saved.
-
-----
-== Open Bugs
-* Not all formatting is applied consistently. The token rankings may need adjusting.
diff --git a/ruwiki/tags/release-0.6.2/Ruwiki/ChangeLog b/ruwiki/tags/release-0.6.2/Ruwiki/ChangeLog
deleted file mode 100644
index 28250ab..0000000
--- a/ruwiki/tags/release-0.6.2/Ruwiki/ChangeLog
+++ /dev/null
@@ -1,41 +0,0 @@
-id: 0
-version: 1
-topic: ChangeLog
-#EHDR
-= Ruwiki 0.6.2 ChangeLog
-Uncompleted to-do items can be found in To_Do. Bugs in Ruwiki are tracked in
-BugTracking.
-
-== Version 0.6.2
-* Removed dependencies on Ruwiki from a number of classes (Ruwiki::Backend, Ruwiki::Backend::Flatfiles, Ruwiki::Page, Ruwiki::Wiki, Ruwiki::Wiki::Tokens, and various tokens).
-* Ruwiki now initializes a Ruwiki::BackendDelegator, which creates the requisite Ruwiki::Backend instance with Ruwiki::Config#storage_options.
-* Added German (Christian Neukirchen <cneukirchin@yahoo.de>) and Spanish translations (Mauricio Fernández <batsman.geo@yahoo.com>).
-
-== Version 0.6.1
-* Changed Config#data_path to Config#storage_options[:flatfiles][:data_path]. This represents a generalisation of storage type options so that the Config object is not polluted with storage type options. Config#storage_options keys should be the same Ruby Symbol as is used in Config#storage_type.
-* Added Config#storage_options[:flatfiles][:extension], based on a request by Chad Fowler. This allows you to have Project/\TopicFile actually stored as Project/\TopicFile.wiki if Config#storage_options[:flatfiles][:extension] is set to <tt>wiki</tt>. The default for Config#storage_options[:flatfiles][:extension] is <tt>nil</tt>.
-* Fixed incorrect references. I had been incorrectly attributing [http://sourceforge.net/projects/rdoc-wiki RDoc Wiki] to Dave Thomas. RDoc Wiki is by Michael Neumann. However, the project I pulled from <b>is</b> by Dave Thomas, but it's [http://sourceforge.net/projects/rublog RubLog]. Apologies to both developers.
-* Added RuwikiTemplatingLibrary documentation.
-* Internationalized messages, except for the templating library.
-* Added configuration API for future work surrounding features. The existing wiki is mostly feature complete. Additional features (such as access controls) will be added through the feature interface.
-* Fixed project creation.
-* Fixed problems with WikiWord links.
-* Added Wikipedia-style Wiki links (\[[list of words]]).
-* Fixed a potential problem with re-posted data or saving without editing.
-* Added the ability to put commands in the URL.
-
-== Version 0.6.0
-* Added Ruby mailing list reference support (e.g., \[ruby-talk:12345]).
-* Reorganised the code (again) to better support alternative frontends. Based, in part, on [http://sourceforge.net/projects/rublog RubLog] by Dave Thomas. (Reference corrected in 0.6.1.)
-* Added a [http://www.webrick.org WEBrick] servlet interface. Based, in part, on the WEBrick servlet interface provided with RubLog by Chad Fowler.
-* Added templates, using the [http://rdoc.sourceforge.net RDoc] template.rb library.
-* Changed the default topic to be \ProjectIndex instead of \DefaultProject.
-* Added a new \WikiWord format, \Wiki_Word_with_Spaces.
-* Completed lots of Ruwiki documentation.
-* Updated the save page.
-* Fixed a problem with the linking of project specific pages.
-
-== Version 0.5.0
-* Reorganized the code significantly to be easier to edit and extend.
-* Added abbreviation capabilities.
-* Cleaned up a lot of tokenizing code.
diff --git a/ruwiki/tags/release-0.6.2/Ruwiki/Configuring_Ruwiki b/ruwiki/tags/release-0.6.2/Ruwiki/Configuring_Ruwiki
deleted file mode 100644
index d1917e0..0000000
--- a/ruwiki/tags/release-0.6.2/Ruwiki/Configuring_Ruwiki
+++ /dev/null
@@ -1,178 +0,0 @@
-id: 0
-topic: Configuring_Ruwiki
-version: 1
-#EHDR
-= Configuring Ruwiki 0.6.2
-
-Ruwiki is configured similarly for both CGI and WEBrick modes. The biggest
-distinction is that because the Wiki is created after WEBrick server is
-created (during the dispatch to the servlet), it is necessary to configure the
-wiki with a global \Ruwiki::Config object, <i>$config</i>. Thus, in the
-examples below, replace <i>wiki.config</i> with <i>$config</i> where
-necessary.
-
-== wiki.config Options
-
-=== wiki.config.title
-
-This configuration option names the Wiki, by default this is <tt>Ruwiki</tt>.
-This affects the display of the home link and the &lt;title&gt; element of
-pages.
-
-=== wiki.config.webmaster
-
-The email address for the webmaster. This is used in generating error reports
-that can be emailed to the wiki's webmaster.
-
-=== wiki.config.default_page, wiki.config.default_project
-
-These options indicate what will happen when the wiki's URL is specified
-without any parameters (the default page in the default project is opened),
-when a topic is specified without a project (the topic is opened in the
-default project), and when a project is specified without a topic (the default
-page is opened in the project).
-
-=== wiki.config.storage_type, wiki.config.storage_options
-
-<tt>wiki.config.storage_type</tt> specifies the back-end storage mechanism as
-a Ruby Symbol. Currently, only <tt>:flatfiles</tt> is implemented. See
-Extending_Ruwiki for more information.
-
-<tt>wiki.config.storage_options</tt> is a hash of option hashes for each known
-storage type known to the Wiki. This must use the same Symbol as
-<tt>wiki.config.storage_type</tt> as the top-level hash key.
-
-==== ...storage_options[:flatfiles][:data_path]
-
-The directory in which the wiki files will be found. By default, this is
-<tt>"./data/"</tt>.
-
-==== ...storage_options[:flatfiles][:extension]
-
-The extension of the wiki files. By default, this is +nil+ (no extension).
-
-=== wiki.config.template_path
-This specifies the paths where the Wiki templates will be found. The process
-running the Wiki must have read access to the template_path.
-
-=== wiki.config.template_set, wiki.config.css
-These two options indicate which template set will be used. Only one template
-set is provided in the release package, "default". The only CSS file used
-initially is "ruwiki.css". Templates work such that they will be found in
-<i>template_path</i>/<i>template_set</i>. All CSS files are loaded from the
-template set directory and emitted as part of the output stream.
-
-: The bad news is that this means that the CSS never caches on the client side
-: as it would if it were a separate file. However, because the templates may
-: not be in a web-accessible directory, this is necessary.
-
-== Templates
-Templating is done with the RDoc template.rb library, included in the
-distribution of Ruwiki. The templating library allows for nested templates,
-and this is used extensively in Ruwiki. This library is documented in
-RuwikiTemplatingLibrary.
-
-There are four major templates: content, edit, save, and error. Each of these
-has a slightly different combination of template files used, and this means
-that there are different sets of variables available.
-
-The major templates are combined templates that are defined as follows:
-; content : body.tmpl, content.tmpl, controls.tmpl
-; edit : body.tmpl, edit.tmpl
-; save : body.tmpl, save.tmpl, controls.tmpl
-; error : body.tmpl, error.tmpl
-
-=== body.tmpl
-The body template knows two template keys (<tt>%wiki_title%</tt> and
-<tt>%css_link%</tt>) and includes one other template. The values for
-%wiki_title% key differs depending on context, but no other key should be
-used or expected in the body template.
-
- <html>
- <head>
- <title>%wiki_title%</title>
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
- </html>
-
-=== content.tmpl
-The content template knows one template key (<tt>%content%</tt>) and includes
-one other template. (This may change moving forward so that there's a footer
-as well as a control header.)
-
- !INCLUDE!
- <!-- topic content -->
- %content%
- <!-- topic content -->
-
-=== controls.tmpl
-The controls template offers a navigation bar. It knows four template keys:
-; %cgi_url% : The URL to the wiki, suitable for building further links from.
-; %home_link% : The root topic of the wiki.
-; %page_project% : The project for the current page topic.
-; %page_topic% : The topic of the current page.
-
- <div class="rw_nav">
- %home_link% |
- Topic: <b>%page_topic%</b> Project: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a> |
- <a href="%cgi_url%?action=edit&amp;project=%page_project%&amp;%page_topic%">Edit</a>
- </div>
-
-=== edit.tmpl
-The edit template is the most complex template with the most keys. Of
-necessity, it provides a restricted form of the navigation bar, the edit form,
-the raw body of the page, and the formatted body of the page.
-
-; %cgi_url% : The URL to the wiki, suitable for building further links from.
-; %home_link% : The root topic of the wiki.
-; %orig_page% : The unedited original page encoded as Base64.
-; %page_content% : The editable page content.
-; %page_old_version% : The old version number of the page.
-; %page_project% : The project for the current page topic being edited.
-; %page_topic% : The topic of the current page being edited.
-; %page_version% : The new version number of the page.
-; %pre_page_content% : The unedited original page content for display in a &lt;pre&gt; tagset.
-; %unedited_page_content% : The formatted unedited orignal page content.
-
- <div class="rw_nav">%home_link% | <i>Editing</i> Topic: <b>%page_topic%</b> Project: <b>%page_project%</b></div><br />
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <input type="submit" name="action" value="Save" />
- <input type="submit" name="action" value="Cancel" />
- </form>
- <div class="rw_edit_raw"><h2>Raw Original Value</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2>Formatted Version</h2>%unedited_page_content%</div>
-
-=== save.tmpl
-An alternative content page for use when a page is saved after editing. This
-knows <tt>%page_project%</tt>, <tt>%page_tolink%</tt> (used to link directly
-to the page), and <tt>%content%</tt>.
-
- !INCLUDE!
- Saved page %page_project%::%page_tolink%<hr />
- <!-- topic content -->
- %content%
- <!-- topic content -->
-
-=== error.tmpl
-This template is used for reporting errors to the user and offering an
-opportunity to the user to send a report to the wiki webmaster.
-
-; %backtrace% : The error backtrace.
-; %backtrace_email% : The error backtrace in a format suitable for email.
-; %home_link% : The root topic of the wiki.
-; %name% : The name of the error.
-; %webmaster% : The email address of the wiki webmaster.
-
- <div class="rw_nav">%home_link%</div>
- <h1>%name%</h1>
- <p>Send the webmaster a report by <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
- <p>%backtrace%</p>
diff --git a/ruwiki/tags/release-0.6.2/Ruwiki/Extending_Ruwiki b/ruwiki/tags/release-0.6.2/Ruwiki/Extending_Ruwiki
deleted file mode 100644
index 05cdc3d..0000000
--- a/ruwiki/tags/release-0.6.2/Ruwiki/Extending_Ruwiki
+++ /dev/null
@@ -1,226 +0,0 @@
-id: 0
-topic: Extending_Ruwiki
-version: 1
-#EHDR
-= Extending Ruwiki 0.6.2
-
-Ruwiki is relatively easily extended to support new features. There are three
-primary ways in which Ruwiki can be extended by the end user: markup,
-backends, and translating Ruwiki error messages.
-
-== Extending Ruwiki Markup
-
-Ruwiki's WikiMarkup can be extended by creating a new Ruwiki::Wiki::Token.
-Tokens will be automatically loaded if they are placed in
-<i>ruwiki/wiki/tokens</i>.
-
-It is recommended that new tokens be added to the test cases in
-<tt>tests/tc_tokens.rb</tt>.
-
-The following Ruwiki::Wiki::Token class will convert strings in the forms of
-\[ruby-talk:12345] to links.
-
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
-=== Known Instance Variables
-==== @match
-The match data for this token instance is is kept in @match. This is what will
-be used in #replace and #restore.
-
-==== @project
-The project being processed.
-
-==== @backend
-The Backend for the wiki. If you are using Ruwiki tokenizers outside of
-Ruwiki, this does not need to be a BackendDelegator, but can be the direct
-Backend (which expects less information).
-
-==== @script
-The URI to the script.
-
-=== Required Methods
-==== ::regexp
-
-Ruwiki tokens are matched only through regular expression matches. As shown in
-the example above, the regular expression for ruby-talk mailing list posts is
-<tt>%r{\[ruby-talk:(\d+)\]}</tt>. The purpose of the ::regexp method is to
-return the regexp for matching.
-
-For most inline matches, Ruwiki will ensure that the escape character (\)
-works automatically. For whole-line matches, it is necessary to match the
-escape character manually and provide a #restore method.
-
-As an example, the HRule class implements these methods.
-
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
-It may also be necessary to match escapes manually on inline matches that must
-be along word boundaries where the regular expression includes characters that
-normally match word boundaries. The project index match (e.g., \::Ruwiki)
-regular expression does this <tt>%r{(\B|\\)::([A-Z][a-z]+)}</tt>.
-
-==== #replace
-
-This returns the formatted token. In the \RubyTalkLinks class above, the
-matched regular expression will be replaced with a hyperlink. The text of the
-hyperlink will be the matched text; the target of the hyperlink will include
-the first captured value.
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
-
-=== Optional Methods
-==== ::rank
-
-By default, a token will be processed in the order created. Tokens may be
-given a specific rank to ensure that they are processed in a particular order.
-The default rank is <tt>9999</tt>.
-
-==== #restore
-
-Restores the token without replacement. Implements the results of the escape
-character. Each Token class is responsible for its own restoration. As noted
-in #regexp, whole-line tokens are most likely to need a #restore
-implementation.
-
-==== #post_replace
-
-Performs any necessary massaging of the data. The Lists token uses this to
-ensure that lists are collapsed together; the Paragraph token uses this to
-ensure that there are no empty paragraph tag pairs (&lt;p&gt;&lt;/p&gt;).
-
-== Extending Ruwiki Backends
-
-Ruwiki can support varying backends, as the backend interface has been
-abstracted completely from the data store. The backend <b>must</b>:
-
-# reside in <i>ruwiki/backends/</i> as <i>backend_name</i>.rb.
-# be registered by adding the <i>backend_name</i> as a symbol (e.g., :<i>backend_name</i>) to Ruwiki::KNOWN_BACKENDS.
-# inherit from Ruwiki::Backend.
-# exist as Ruwiki::Backend::<i>\Backend_name</i>.
-
-=== Required Methods
-==== #initialize(storage_options)
-
-The backend may only obtain its configuration information from the provided
-ruwiki instance (through Ruwiki#config) and must set @ruwiki (this can be
-achieved by calling <tt>super ruwiki</tt>).
-
-If a configuration error is detected during initialization, the backend should
-raise Ruwiki::Backend::BackendError. This would be done with:
-
- raise Ruwiki::Backend::BackendError.new([:message_symbol, [message_parameters]])
-
-Backend writers should add messages to the <i>lang/en.rb</i> at a minimum. The
-BackendDelegator will detect this and report the results appropriately.
-
-==== #load(topic, project)
-
-The backend will be provided the name of the topic and project and must return
-the selected page as an array, one row per line. If the backend you have
-chosen returns the page as a single text block, it will be necessary to do a
-String#split("\n") on it.
-
-==== #save(page)
-
-This method must store the provided page in the backend. Note that the return
-value of the Page#rawtext method must be stored. This method may call
-the private method Backend#make_diff to generate the differences hash.
-
- diff = {
- 'old_version' => page.old_version,
- 'new_version' => page.version,
- 'change_date' => Time.now,
- 'change_ip' => page.change_ip,
- 'change_id' => page.change_id,
- 'diff' => Diff.diff(oldpage, newpage)
- }
-
-===== Backend#make_diff(page, oldpage, newpage)
-
-This method expects the page object, the old page text, and the new page text.
-They must be Diffable. Backend::Flatfiles provides oldpage and newpage to
-Diff#diff as arrays (each line as a separate entry in the array).
-
-==== #obtain_lock(page, address = 'UKNOWN', timeout = 600)
-
-Obtains an exclusive lock on the page. The lock should have a timeout and
-permit access from the same IP address without restriction. This should
-<b>not</b> be a filesystem lock. The time stored for purposes of locking
-should include the timeout (e.g., Time.now.to_i + time).
-
-==== #release_lock(page, address = 'UNKNOWN')
-
-Releases the exclusive lock on the page. The lock should not be released
-unless the IP address on the lock is the same or the lock has expired.
-
-==== #project_exists?(project)
-
-Returns <tt>true</tt> if the project exists.
-
-==== #page_exists?(topic, project = 'Default')
-Returns <tt>true</tt> if the page exists within the specified project.
-
-=== Optional Methods
-
-Note that these methods are currently optional (they are not yet called from
-Ruwiki), but will become required moving forward as the functions are
-implemented in Ruwiki.
-
-==== #destroy(page)
-
-Removes the page from the wiki. This should <b>not</b> remove the change
-history of the topic (in the event that the page has been removed
-maliciously). There will be a separate method to remove the page history.
-
-==== #create_project(project)
-
-Attempts to create the project.
-
-==== #destroy_project(project)
-
-Attempts to destroy the project.
-
-== Translating Ruwiki Error Messages
-
-Ruwiki is internationalized. This method sets the Ruwiki error messages (and a
-few other messages) to the specified language Module. The language Module must
-have a constant Hash called <tt>Message</tt> containing a set of symbols and
-localized versions of the messages associated with them.
-
-If the file <i>ruwiki/lang/es.rb</i> contains the module
-<tt>Ruwiki::Lang::ES</tt>, the messages for RSS could be localized to
-Spanish thus:
-
- require 'ruwiki/lang/es'
- ...
- wiki.config.language = Ruwiki::Lang::ES
-
-Localization is per wiki instance. In a servlet environment, this may mean
-that only a single language is recognised.
-
-It is recommended that Message.default be set to a proc that reports unknown
-message keys.
-
- Message.default = proc { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
diff --git a/ruwiki/tags/release-0.6.2/Ruwiki/LicenseAndAuthorInfo b/ruwiki/tags/release-0.6.2/Ruwiki/LicenseAndAuthorInfo
deleted file mode 100644
index 88eccf1..0000000
--- a/ruwiki/tags/release-0.6.2/Ruwiki/LicenseAndAuthorInfo
+++ /dev/null
@@ -1,28 +0,0 @@
-id: 0
-topic: LicenseAndAuthorInfo
-version: 1
-#EHDR
-= Ruwiki Licence
-Ruwiki is copyright © 2002 - 2003 [mailto:alan@digikata.com Alan Chen] and
-[mailto:ruwiki@halostatue.ca Austin Ziegler].
-
-Ruwiki is provided free of use and without any warranty express or implied. You may use,
-distribute, or modify Ruwiki under the conditions of Ruby's licence or the
-[http://www.gnu.org/copyleft/gpl.html GNU General Public Licence].
-
-* Ruwiki includes algorithm/diff by Lars Christensen, available for download from the RAA at: http://raa.ruby-lang.org/list.rhtml?name=diff
-* Ruwiki includes template.rb from Dave Thomas's RDoc system, available for download from SourceForge: http://rdoc.sourceforge.net
-
-== Translations
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen] on 2003.10.22. Note that the initial template translations (./templates/de/) were done via AltaVista Babelfish and should not be blamed on Christian.
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández] on 2003.10.22. Note that the initial template translations (./templates/es/) were done via AltaVista Babelfish and should not be blamed on Mauricio.
-
-== Other Projects
-Austin has also released several other projects available on the RAA that you
-may be interested in:
-* [http://raa.ruby-lang.org/list.rhtml?name=mime-types MIME::Types]
-* [http://raa.ruby-lang.org/list.rhtml?name=pdf-writer PDF::Writer]
-* [http://raa.ruby-lang.org/list.rhtml?name=text-format Text::Format]
-* [http://raa.ruby-lang.org/list.rhtml?name=trans-simple Transaction::Simple]
-* [http://raa.ruby-lang.org/list.rhtml?name=uninheritable Uninheritable]
-
diff --git a/ruwiki/tags/release-0.6.2/Ruwiki/ProjectIndex b/ruwiki/tags/release-0.6.2/Ruwiki/ProjectIndex
deleted file mode 100644
index c8de386..0000000
--- a/ruwiki/tags/release-0.6.2/Ruwiki/ProjectIndex
+++ /dev/null
@@ -1,28 +0,0 @@
-id: 0
-topic: ProjectIndex
-version: 1
-#EHDR
-= Ruwiki 0.6.2
-This is the \ProjectIndex page for Ruwiki. For any given project, the
-\ProjectIndex topic will be the default topic for plain project links. As of
-Ruwiki 0.6.0, \ProjectIndex it is also the standard default page (not
-\DefaultPage).
-----
-== Features and Information
-* This wiki supports a variety of WikiFeatures that you may be interested in. The rules for WikiMarkup are similar to some other wikis, but there are a few unique markup capabilities in Ruwiki.
-* Configuring_Ruwiki is simple.
-* Extending_Ruwiki is almost as simple.
-* Who wrote Ruwiki? Look at the LicenseAndAuthorInfo.
-
-== Tracking Ruwiki Development
-The development progress of Ruwiki is kept in the wiki itself.
-* The BugTracking page in Ruwiki keeps track of open and closed bugs in Ruwiki.
-* The To_Do list keeps track of major development goals for Ruwiki.
-----
-== Different Features?
-If this wiki doesn't have the right combination of features, (or if it just
-doesn't feel right) try these other Ruby-based Wikis:
-
-* Amrita Wiki - http://www.walrus-ruby.org/amrita/cgi-bin/aswiki/aswiki.cgi
-* RWiki - http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=top
-* \MiniRubyWiki - http://www.xpsd.com/MiniRubyWiki
diff --git a/ruwiki/tags/release-0.6.2/Ruwiki/RuwikiTemplatingLibrary b/ruwiki/tags/release-0.6.2/Ruwiki/RuwikiTemplatingLibrary
deleted file mode 100644
index ff1a5b7..0000000
--- a/ruwiki/tags/release-0.6.2/Ruwiki/RuwikiTemplatingLibrary
+++ /dev/null
@@ -1,82 +0,0 @@
-id: 0
-topic: RuwikiTemplatingLibrary
-version: 1
-#EHDR
-= Ruwiki 0.6.2 Templating
-
-Ruwiki uses the RDoc templating system, described by its creator as:
-
- RDoc's cheap-n-cheerful HTML page template system.
-
-== Templates
-
-Templates in the templating system are essentially plain strings with
-particular references to templating keys or an include directive.
-
-=== Templating Keys
-
-The template interacts with a value hash provided by ruwiki. The keys known to
-the templates expected by Ruwiki are detailed in Configuring_Ruwiki. Nested
-key references are found from the inside-out. That is, the closest resolving
-key to the current level is found, not the furthest resolving key.
-
-==== Simple Templating Keys
-Ruwiki only uses the simplest form of RDoc templating at this point, which is
-the enclosing of variable names between percent signs (e.g.,
-<tt>%wiki_title%</tt>).
-
-==== Repeating Block Keys
-The RDoc templating library supports a block format:
-
- START:key
- ... stuff ...
- END:key
-
-The block between <tt>START:key</tt> and <tt>END:key</tt> will be repeated
-once for each hash entry found in the array at <tt>key</tt> in the main value
-hash. Blocks may be nested arbitrarily deeply.
-
-==== Conditional Block Keys
-
- IF:key
- ... stuff ...
- ENDIF:key
-
-The block between <tt>IF:key</tt> and <tt>ENDIF:key</tt> will be included in
-the output only if the corresponding key is set in the value hash.
-
-=== Including Other Templates
-
-Templates may include other templates to any arbitrary level by using the
-!INCLUDE! directive.
-
-== Example
-
-Given the set of templates T1, T2, and T3 (shown below), here's how we would
-use the templating system.
-
- values = { "name" => "Dave", "state" => "TX" }
- t = TemplatePage.new(T1, T2, T3)
- File.open(name, w) { |f| t.write_html_on(f, values) }
-
-or:
-
- values = { "name" => "Dave" }
- res = ""
- t.write_html_on(res, values)
-
-=== T1
-
- Templates can subsitute a wide variety of values.
- !INCLUDE!
-
-=== T2
-
- Name: %name% !INCLUDE!
-
-=== T3
-
- IF:state
- State: %state%
- ENDIF:state
-
diff --git a/ruwiki/tags/release-0.6.2/Ruwiki/SandBox b/ruwiki/tags/release-0.6.2/Ruwiki/SandBox
deleted file mode 100644
index 21e6a36..0000000
--- a/ruwiki/tags/release-0.6.2/Ruwiki/SandBox
+++ /dev/null
@@ -1,5 +0,0 @@
-id: 0
-topic: SandBox
-version: 1
-#EHDR
-This page is intended for users to play with freely to practice their \WikiFormatting.
diff --git a/ruwiki/tags/release-0.6.2/Ruwiki/To_Do b/ruwiki/tags/release-0.6.2/Ruwiki/To_Do
deleted file mode 100644
index 41c3bdd..0000000
--- a/ruwiki/tags/release-0.6.2/Ruwiki/To_Do
+++ /dev/null
@@ -1,42 +0,0 @@
-id: 0
-topic: To_Do
-version: 1
-#EHDR
-= Ruwiki 0.6.2 To Do Tracking
-Completed to-do items can be found in the ChangeLog. Bugs in Ruwiki are
-tracked in BugTracking.
-
-== Well-Defined To Do Items
-=== Ruwiki 0.7.0
-; Versioning : complete the change history. Change history is currently stored in a file <i>topic</i>.rdiff. There is no way to display the change history at this point.
-=== Ruwiki 0.8.0
-; In-project topic search : searches for mentions of the topic in the other topics for the project.
-; Project topic listing : provide a special link (perhaps Project::Project) that displays the list of topics known to that project.
-; Project listing : provide a special link (perhaps ::*) that displays the list of known projects.
-=== Ruwiki 0.9.0
-; Topic renaming : add the ability to rename a topic within a project. Topic change history should be maintained.
-; Topic moving : add the ability to move and/or rename a topic between projects. Topic change history should be maintained.
-; Complete documentation : Complete the documentation of Ruwiki.
-=== Ruwiki 1.0.0
-; Escape HTML Entities : HTML Entities such as &amp;, &lt;, and &gt; are not currently escaped. This may cause problems with some browsers and should be fixed <b>without</b> impairing the ability to add at least some raw HTML. Note that the current engine does not check raw HTML and thus could potentially be vulnerable to cross-site-scripting attacks.
-; Features : Ruwiki will be programmatically extensible with entirely new features: commands, ACLs, and more. This is planned for 1.0.0.
-
-== General To Do Items
-; Preview button : add a preview button to the save page.
-; Alternative templating systems : not as high priority now that there's a real templating system in place.
-; Project/topic security : allow certain projects to be restricted/authenticated for read/write based on user.
-; Track last <i>n</i> links/topics : ?
-; Write a markup debugger : ?
-; Validate topic formatting from cgi : ?
-; Validate project from cgi : ?
-; Project-based backend : Allow different projects to have different backends.
-; Hierachical project namespaces : ?
-
-== Future To Do Items
-; E-mail gateway : accept topic appends via e-mail.
-; alternative backends : access other wiki data storage, or other formats, e.g. e-mail boxes in mh or mbox formats
-; backend-to-backend storage format conversion : as noted
-; bug tracker backend : with alternate markup
-; add setup and user config methods : for backend plugin classes, then we can use them with an interactive or gui tool frontend to setup data storage backends. The user might have to run as root or other user with database create permissions.
-; add id="" to various markup elements (make id specific to topic) : Later we can allow users to tweak a page using uploaded css fragments which might get appended onto the standard css contents.
-; ruby action : upload a ruby code fragment to add a smart "action" to that wiki page. Need some sort of security + approval system to handle this safely.
diff --git a/ruwiki/tags/release-0.6.2/Ruwiki/WikiFeatures b/ruwiki/tags/release-0.6.2/Ruwiki/WikiFeatures
deleted file mode 100644
index 162c436..0000000
--- a/ruwiki/tags/release-0.6.2/Ruwiki/WikiFeatures
+++ /dev/null
@@ -1,13 +0,0 @@
-id: 0
-version: 1
-topic: WikiFeatures
-#EHDR
-Ruwiki is a [http://www.ruby-lang.org Ruby]-based wiki. It is ideal for
-personal or small team use.
-
-Ruwiki:
-* Uses the [http://www.ruby-lang.org Ruby] language.
-* Runs quickly and easily as a CGI or WEBrick servlet.
-* Uses a simple templating system and CSS for presentation.
-* Has flatfile storage with simple versioning.
-* Offers project namespaces. Different projects can have the same topic names and not collide. Thus, \Default::ReadMe and \Project::ReadMe are two different pages.
diff --git a/ruwiki/tags/release-0.6.2/Ruwiki/WikiMarkup b/ruwiki/tags/release-0.6.2/Ruwiki/WikiMarkup
deleted file mode 100644
index 111763a..0000000
--- a/ruwiki/tags/release-0.6.2/Ruwiki/WikiMarkup
+++ /dev/null
@@ -1,173 +0,0 @@
-id: 0
-topic: WikiMarkup
-version: 1
-#EHDR
-= Ruwiki Markup
-A [http://c2.com/cgi/wiki Wiki] obeys certain formatting rules to make it easy
-to format text without needing to know HTML. This Wiki obeys the following
-rules by default. Because Ruwiki is extensible, there may be additional
-formatting rules.
-
-== \WikiWords, \WikiProjects, Links, and Images
-While reading stuff on this Wiki, you will see some words mashed together with
-capitalisation (like \WikiWords). While this may seem odd at first, this
-feature allows internal links to be created across the Wiki.
-
-There are several allowable forms for \WikiWords.
-# Two or more words concatenated directly. Each word must begin with a capital letter and be followed by zero or more lowercase letters. Thus, \FooBar, \CPlusPlus, and \AbC are all valid \WikiWords, but ABC is not.
-# Two or more words concatenated with underscores. The first word must begin with a capital letter. This makes \Foo_Bar, \C_Plus_Plus, and \A_b_C valid \WikiWords. These \WikiWords will be displayed with spaces instead of underscores.\C_Plus_Plus will be displayed as "C Plus Plus".
-# One or more words contained in double square brackets. This the form supported by [http://wikipedia.com/ Wikipedia], and looks like \[[A Wiki Phrase]]. These links will be displayed exactly as entered between the brackets.
-
-If a \WikiWord is found that does not have a page defining the \WikiWord, then
-the word will be shown with a hyperlink question mark following it, allowing
-the \WikiWord to be created.
-
-=== \WikiProjects
-This Wiki supports "projects." Within each project, a given \WikiWord is
-unique. Thus, if you have a Default project and a Ruwiki project, you can have
-two pages called \ReadMe. Any given \WikiWord refers only to topics within its
-project. That is, if I have \WikiWord in the \ReadMe topic of the Default
-project, it will refer to the \WikiWord topic of the Default project. (Another
-term for this capability is "namespaces.")
-
-A cross-project link is composed of the project's name, two colons (::), and
-the \WikiWord desired. Thus, from \Default::ReadMe, I can have \Ruwiki::ReadMe
-as a link. The project index can be referred to with \::Project. This is the
-same as doing \Project::ProjectIndex. Thus, \::Ruwiki becomes ::Ruwiki, which
-is the same as \Ruwiki::ProjectIndex (Ruwiki::ProjectIndex).
-
-=== External Links and Resources
-URLs to external resources are automatically detected for web addresses, FTP
-addresses, newsgroups, and email links. They are automatically converted to
-clickable URLs.
-
-* \http://www.ruby-lang.org becomes http://www.ruby-lang.org
-
-URLs may be named with the [url name] syntax. If the name is omitted, the URL will be numbered.
-
-* \[http://www.rubygarden.org RubyGarden] becomes [http://www.rubygarden.org RubyGarden].
-* \[http://www.halostatue.ca] and \[http://www.halostatue.ca/ruby] become [http://www.halostatue.ca] and [http://www.halostatue.ca/ruby].
-
-=== Images
-If URLs are to JPEG (.jpg, .jpeg), PNG (.png), or GIF (.gif) resources, they will be rendered as inline images. This works with automatically converted URLs, named URLs, or numbered URLs. Named and numbered URLs affect the TITLE and ALT attribute of the image.
-
-* \http://www.halostatue.ca/graphics/maple_leaf.gif http://www.halostatue.ca/graphics/maple_leaf.gif
-* \[http://www.halostatue.ca/graphics/maple_leaf.gif Maple Leaf] [http://www.halostatue.ca/graphics/maple_leaf.gif Maple Leaf]
-* \[http://www.halostatue.ca/graphics/maple_leaf.gif] [http://www.halostatue.ca/graphics/maple_leaf.gif]
-
-=== Ruby Mailing Lists
-If a Ruby mailing list message tag is provided, it will be converted appropriately.
-
-* \[ruby-talk:12345] will become [ruby-talk:12345]
-* \[ruby-core:12345] will become [ruby-core:12345]
-* \[ruby-doc:12345] will become [ruby-doc:12345]
-
-== Headings and Lists
-=== Headings
-Use equals signs (=) for headings. Up to six equals signs can be used for HTML
-headings 1 - 6.
-
-\===== Heading five<br />
-\====== Heading six
-
-===== Heading five
-====== Heading six
-
-=== Lists
-==== Bulleted Lists
-Use asterisks (*) to create bulleted lists. More asterisks means more levels.
-
-\* level 1<br />
-\** level 2<br />
-\*** level 3
-
-* level 1
-** level 2
-*** level 3
-==== Numbered Lists
-Use hash marks (#) for numbered lists. More hash marks means deeper levels.
-
-\# level 1<br />
-\## level 2<br />
-\### level 3<br />
-\# level 1.2
-
-# level 1
-## level 2
-### level 3
-# level 1.2
-==== Definition Lists
-Definitions can be created similar to other lists. Unlike "standard" lists,
-though, definition lists have both the term and the definition. They are
-specified like so. As with other lists, repeating the first item (;) will
-increase the indentation level.
-
-\; term : definition<br />
-\;; term2 : definition<br />
-\;;; term3 : definition
-
-; term : definition
-;; term2 : definition
-;;; term3 : definition
-== Paragraph Formatting
-=== Rules
-Four or more dashes ("----") on a line by itself makes a horizontal rule, like
-so:
-
-\----
-----
-=== Paragraphs
-A blank line (it may have whitespace on it) marks a new paragraph. All other
-lines are joined together (excepting headers, lists, and rules).
-
-This line is a new paragraph.
-=== Block Indent Paragraphs
-Paragraphs can be indented by beginning the paragraph with one or more colons
-(:).
-
-\: Indent Level 1<br />
-\:: Indent Level 2<br />
-\::: Indent Level 3
-
-: Indent Level 1
-:: Indent Level 2
-::: Indent Level 3
-=== Code
-Text that is indented will be presented as formatted in a monospaced font. The
-only change is to escape HTML entities &lt; (<), &gt; (>), and &amp; (&).
-
- def replace
- content = @match[1]
- %Q{<pre>#{content}</pre>}
- end
-
-== Miscellaneous Formatting
-=== HTML
-The Ruwiki engine passes through HTML without changes. Thus,
-&lt;b&gt;bold&lt;/b&gt; would be shown as <b>bold</b>. <b><i>Note:</i></b>
-This capability could be very dangerous as it could expose the Wiki to
-cross-site scripting (XSS) vulnerabilities. This will be remedied prior to the
-1.0 release of Ruwiki.
-
-=== Abbreviations
-Certain abbreviations may be known to the Wiki. While there is not yet any way
-for a user to query what abbreviations are known, if the abbreviations are
-told to the users, they may be used. Abbreviations are presented with @{key},
-where <i>key</i> is the abbreviation desired. This Wiki, for example, knows
-that \@{PM} means @{PM}. The special form \@{} will produce the current list
-of known abbreviations. Unknown abbreviations will simply be put back into the
-data stream unchanged. Thus, \@{unknownkey} results in @{unknownkey}.
-
-==== Known Abbreviations
-@{}
-
-=== Preventing Formatting
-If you wish to prevent a word or sequence from being interpreted, put a
-backslash (\) in front of it. This works on all formatting options except
-paragraph positioning. Thus, if I want to prevent a \WikiWord from being
-turned into a hyperlink, I need to backslash it: \\WikiWord.
-
-=== Other Possible Considerations
-I'm looking at adding styles similar to what is shown on the Wiki below.
-
-* http://www.pmichaud.com/wiki/PmWiki/WikiStyles
diff --git a/ruwiki/tags/release-0.6.2/lib/algorithm/diff.rb b/ruwiki/tags/release-0.6.2/lib/algorithm/diff.rb
deleted file mode 100644
index af36214..0000000
--- a/ruwiki/tags/release-0.6.2/lib/algorithm/diff.rb
+++ /dev/null
@@ -1,220 +0,0 @@
-#
-# algorith/diff - a Ruby module to compute difference sets between two
-# objects. Copyright (c) 2001-2002 Lars Christensen.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
-
-module Diff
-
- VERSION = 0.4
-
- attr_reader :diffs
-
- def Diff.lcs(a, b)
- astart = 0
- bstart = 0
- afinish = a.length-1
- bfinish = b.length-1
- mvector = []
-
- # First we prune off any common elements at the beginning
- while (astart <= afinish && bstart <= afinish && a[astart] == b[bstart])
- mvector[astart] = bstart
- astart += 1
- bstart += 1
- end
-
- # now the end
- while (astart <= afinish && bstart <= bfinish && a[afinish] == b[bfinish])
- mvector[afinish] = bfinish
- afinish -= 1
- bfinish -= 1
- end
-
- bmatches = b.reverse_hash(bstart..bfinish)
- thresh = []
- links = []
-
- (astart..afinish).each { |aindex|
- aelem = a[aindex]
- next unless bmatches.has_key? aelem
- k = nil
- bmatches[aelem].reverse_each { |bindex|
- if k && (thresh[k] > bindex) && (thresh[k-1] < bindex)
- thresh[k] = bindex
- else
- k = thresh.replacenextlarger(bindex, k)
- end
- links[k] = [ k!=0 && links[k-1], aindex, bindex ] if k
- }
- }
-
- if !thresh.empty?
- link = links[thresh.length-1]
- while link
- mvector[link[1]] = link[2]
- link = link[0]
- end
- end
-
- return mvector
- end
-
- def Diff.makediff(a, b)
- mvector = Diff.lcs(a, b)
- ai = bi = 0
- while ai < mvector.length
- bline = mvector[ai]
- if bline
- while bi < bline
- yield :+, bi, b[bi]
- bi += 1
- end
- bi += 1
- else
- yield :-, ai, a[ai]
- end
- ai += 1
- end
- while ai < a.length
- yield :-, ai, a[ai]
- ai += 1
- end
- while bi < b.length
- yield :+, bi, b[bi]
- bi += 1
- end
- 1
- end
-
- def Diff.diff(a, b, &block)
- isstring = b.kind_of? String
- diffs = []
-
- block ||= proc { |action, index, element|
- prev = diffs[-1]
- if prev && prev[0] == action &&
- prev[1] + prev[2].length == index
- prev[2] << element
- else
- diffs.push [ action, index, isstring ? element.chr : [element] ]
- end
- }
-
- Diff.makediff(a, b, &block)
-
- return diffs
- end
-
-end
-
-module Diffable
- def diff(b)
- Diff.diff(self, b)
- end
-
- # Create a hash that maps elements of the array to arrays of indices
- # where the elements are found.
-
- def reverse_hash(range = (0...self.length))
- revmap = {}
- range.each { |i|
- elem = self[i]
- if revmap.has_key? elem
- revmap[elem].push i
- else
- revmap[elem] = [i]
- end
- }
- return revmap
- end
-
- # Replace the first element which is larger than value. Assumes that
- # the element indexed by high, if given is larger than value.
-
- def replacenextlarger(value, high = nil)
- high ||= length
- low = 0
- index = found = nil
- while low < high
- index = (high+low) >> 1
- found = self[index]
- if value > found # this first, most common case
- low = index + 1
- elsif value == found
- return nil
- else
- high = index
- end
- end
- self[low] = value
- return low
- end
-
- # Patches self with the given set of differences.
-
- def patch(diffs)
- newary = nil
- kindofstring = kind_of? String
- if kindofstring
- newary = self.class.new('')
- else
- newary = self.class.new
- end
- ai = 0
- bi = 0
- diffs.each { |action,position,elements|
- case action
- when :-
- while ai < position
- newary << self[ai]
- ai += 1
- bi += 1
- end
- ai += elements.length
- when :+
- while bi < position
- newary << self[ai]
- ai += 1
- bi += 1
- end
- if kindofstring
- newary << elements
- else
- newary.push *elements
- end
- bi += elements.length
- else
- raise "Unknown diff action"
- end
- }
- while ai < self.length
- newary << self[ai]
- ai += 1
- bi += 1
- end
- return newary
- end
-end
-
-class Array
- include Diffable
-end
-
-class String
- include Diffable
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki.rb
deleted file mode 100644
index e513ff6..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki.rb
+++ /dev/null
@@ -1,326 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-require 'digest/md5'
-require 'ruwiki/handler'
-require 'ruwiki/template'
-require 'ruwiki/lang/en' # Default to the English language.
-require 'ruwiki/config'
-require 'ruwiki/backend'
-require 'ruwiki/wiki'
-require 'ruwiki/page'
-
- # = Ruwiki
- # Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI
- # and WEBrick interfaces, templates, and CSS formatting. Additionally, it
- # supports project namespaces, so that two pages can be named the same for
- # differing projects without colliding or having to resort to odd naming
- # conventions. Please see ::Ruwiki in the running Wiki for more information.
- #
- # == Quick Install (CGI)
- # 1. Place the Ruwiki directory in a place that your webserver can execute
- # CGI programs. Ensure that ruwiki.cgi is executable on your webserver.
- # You may wish to protect templates/, data/, and lib/ from casual access.
- # 2. Modify the following lines in ruwiki.cgi:
- # wiki.config.webmaster = ...
- # wiki.config.title = ...
- # 3. Point your web browser to the appropriate URL.
- #
- # == Quick Install (WEBrick)
- # 1. Modify the following lines in ruwiki_servlet.rb:
- # $config.webmaster = ...
- # $config.title = ...
- # 2. Run ruwiki_servlet.rb to start a WEBrick instance on localhost:8808 with
- # ruwiki bound to the root path (e.g., http://localhost:8808/).
- # 3. Point your web browser to the appropriate URL.
- #
- # == Use
- # Ruwiki is able to be called with one of several URI forms:
- #
- # http://domain.com/ruwiki.cgi?PageName
- # http://domain.com/ruwiki.cgi?PageName&project=Project
- # http://domain.com/ruwiki.cgi?topic=PageName&project=Project
- # http://domain.com/ruwiki.cgi/PageName
- # http://domain.com/ruwiki.cgi/Project/
- # http://domain.com/ruwiki.cgi/Project/PageName
- #
- # Copyright:: Copyright © 2003 - 2003, Digikata and HaloStatue, Ltd.
- # Authors:: Alan Chen (alan@digikata.com)
- # Austin Ziegler (ruwiki@halostatue.ca)
- # Licence:: Ruby's
-class Ruwiki
- VERSION = '0.6.2.0'
-
- ALLOWED_ACTIONS = %w(edit create)
- EDIT_ACTIONS = %w(save cancel)
- EDIT_VARS = %w(newpage origpage topic project old_version version)
- RESERVED = ['action', EDIT_VARS].flatten
-
- # Returns the current configuration object.
- attr_reader :config
- # Returns the current Response object.
- attr_reader :response
- # Returns the current Request object.
- attr_reader :request
- # Returns the current Markup object.
- attr_reader :markup
- # Returns the current Backend object.
- attr_reader :backend
-
- # Sets the configuration object to a new configuration object.
- def config=(c)
- raise message()[:config_not_ruwiki_config] unless c.kind_of?(Ruwiki::Config)
- @config = c
- @markup.default_project = @config.default_project
- end
-
- # The message hash.
- def message
- @config.message
- end
-
- # Initializes Ruwiki.
- def initialize(handler)
- @request = handler.request
- @response = handler.response
-
- @config = Ruwiki::Config.new
-
- @path_info = @request.determine_request_path || ""
-
- @type = nil
- @error = {}
-
- @markup = Ruwiki::Wiki.new(@config.default_project,
- @request.script_url)
- end
-
- # Initializes the backend for Ruwiki.
- def set_backend
- @backend = BackendDelegator.new(self, @config.storage_type)
- @markup.backend = @backend
- end
-
- # Runs the steps to process the wiki.
- def run
- @config.verify
- set_backend
- set_page
- process_page
- render
- rescue Exception => e
- render(:error, e)
- ensure
- output
- end
-
- # Initializes current page for Ruwiki.
- def set_page
- path_info = @path_info.split(%r{/}, -1).map { |e| e.empty? ? nil : e }
-
- if path_info.size == 1 or (path_info.size > 1 and path_info[0])
- raise message()[:invalid_path_info_value] % [@path_info] unless path_info[0].nil?
- end
-
- # path_info[0] will ALWAYS be nil.
- path_info.shift
-
- case path_info.size
- when 0 # Safety check.
- nil
- when 1 # /PageTopic OR /_edit
- set_page_name_or_action(path_info[0])
- when 2 # /Project/ OR /Project/PageTopic OR /Project/_edit OR /Project/create
- @project = path_info.shift
- set_page_name_or_action(path_info[0])
- else # /Project/PageTopic/_edit OR /Project/diff/3,4 OR something else.
- @project = path_info.shift
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- else
- @topic = item
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- end
- end
- end
-
- @request.each_parameter do |key, val|
- next if RESERVED.include?(key)
- @topic = key
- end
-
- @project ||= @request.parameters['project']
- @project ||= @config.default_project
- @topic ||= @config.default_page
- end
-
- # Processes the page through the necessary steps. This is where the edit,
- # save, cancel, and display actions are present.
- def process_page
- content = nil
- page_init = @backend.retrieve(@topic, @project)
-
- page_init[:markup] = @markup
- page_init[:project] ||= @config.default_project
- page_init[:remote_host] = @request.environment['REMOTE_HOST']
- page_init[:remote_addr] = @request.environment['REMOTE_ADDR']
-
- @page = Ruwiki::Page.new(page_init)
-
- @type = :content
-
- # TODO Detect if @action has already been set.
- @action = @request.parameters['action'].downcase if @request.parameters['action']
-
- if @action
- case @action
- when 'edit', 'create'
- # Automatically create the project if it doesn't exist or if the
- # action is 'create'.
- @backend.create_project(@page.project) if @action == 'create'
- @backend.create_project(@page.project) unless @backend.project_exists?(@page.project)
- @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR'])
-
- content = nil
- @type = :edit
- when 'save'
- np = @request.parameters['newpage'].gsub(/\r/, "").chomp
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
-
- op = @request.parameters['origpage'].unpack("m*")[0]
-
- if np == op
- @page.content = op
- @type = :content
- else
- @page.content = np
- @page.old_version = @request.parameters['old_version'].to_i + 1
- @page.version = @request.parameters['version'].to_i + 1
- @type = :save
- @backend.store(@page)
- end
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
-
- content = @page.to_html
- when 'cancel'
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.content = @request.parameters['origpage'].unpack("m*")[0]
- @page.old_version = @request.parameters['old_version'].to_i
- @page.version = @request.parameters['version'].to_i
-
- content = @page.to_html
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- else
- # TODO Return a 501 Not Implemented error
- nil
- end
- else
- content = @page.to_html
- end
- rescue Exception => e
- @type = :error
- if e.kind_of?(Ruwiki::Backend::BackendError)
- @error[:name] = "#{message()[:error]}: #{e.to_s}"
- else
- @error[:name] = "#{message()[:complete_utter_failure]}: #{e.to_s}"
- end
- @error[:backtrace] = e.backtrace.join("<br />\n")
- content = nil
- ensure
- @content = content
- end
-
- # Renders the page.
- def render(*args)
- if args.empty?
- type = @type
- error = @error
- else
- raise ArgumentError, message()[:render_arguments] unless args.size == 2
- type = args[0]
- error = {}
- error[:name] = args[1].inspect.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;')
- error[:backtrace] = args[1].backtrace.join("<br />\n")
- end
-
- @rendered_page = ""
- values = { "css_link" => @config.css_link,
- "home_link" => %Q(<a href="#{@request.script_url}">#{@config.title}</a>),
- "encoding" => @config.message[:encoding]
- }
-
- case type
- when :content, :save
- values["wiki_title"] = "#{message()[:error]} - #{@config.title}" if @page.nil?
- values["wiki_title"] ||= "#{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_topic"] = CGI.unescape(@page.topic)
- values["page_raw_topic"] = @page.topic
- values["page_project"] = @page.project
- values["cgi_url"] = @request.script_url
- values["content"] = @content
- if type == :content
- template = TemplatePage.new(@config.template(:body), @config.template(:content), @config.template(:controls))
- else
- template = TemplatePage.new(@config.template(:body), @config.template(:save), @config.template(:controls))
- end
- when :edit
- template = TemplatePage.new(@config.template(:body), @config.template(:edit))
- values["wiki_title"] = "#{message()[:editing]}: #{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_topic"] = CGI.unescape(@page.topic)
- values["page_raw_topic"] = @page.topic
- values["page_project"] = @page.project
- values["cgi_url"] = @request.script_url
- values["page_content"] = @page.content
- values["orig_page"] = [@page.content].pack("m*")
- values["page_old_version"] = @page.old_version.to_s
- values["page_version"] = @page.version.to_s
- values["unedited_page_content"] = @page.to_html
- values["pre_page_content"] = CGI.escapeHTML(@page.content)
- when :error
- template = TemplatePage.new(@config.template(:body), @config.template(:error))
- values["wiki_title"] = "#{message()[:error]} - #{@config.title}"
- values["name"] = error[:name]
- values["backtrace"] = error[:backtrace]
- values["backtrace_email"] = error[:backtrace].gsub(/<br \/>/, '')
- values["webmaster"] = @config.webmaster
- end
-
- template.write_html_on(@rendered_page, values)
- end
-
- # Outputs the page.
- def output
- @response.add_header("Content-type", "text/html")
- @response.write_headers
- @response << @rendered_page
- end
-
-private
- RE_ACTION = %r{^_([[:lower:]]+)$}
-
- def set_page_name_or_action(item)
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- else
- @topic = item
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/backend.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/backend.rb
deleted file mode 100644
index e9df3f7..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/backend.rb
+++ /dev/null
@@ -1,161 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'algorithm/diff'
-
-class Ruwiki
- # The list of known backends.
- KNOWN_BACKENDS = [:flatfiles]
-
- # The Ruwiki backend delegator. Ruwiki will always instantiate a version
- # of this class which delegates the actual method execution to the Backend
- # class. Error handling is handled by capturing (and possibly forwarding)
- # exceptions raised by the delegate class.
- class BackendDelegator
- def initialize(ruwiki, backend)
- @message = ruwiki.config.message
- options = ruwiki.config.storage_options
-
- raise RuntimeError, @message[:backend_unknown] % [backend] unless Ruwiki::KNOWN_BACKENDS.include?(backend)
- beconst = (befile = backend.id2name).capitalize
-
- require "ruwiki/backend/#{befile}"
-
- @delegate = Ruwiki::Backend.const_get(beconst).new(options)
- rescue Ruwiki::Backend::BackendError => e
- if e.kind_of?(Array)
- raise Ruwiki::Backend::BackendError.new(nil), @message[e.reason[0]] % e.reason[1]
- else
- raise
- end
- end
-
- # Retrieve the specified topic and project page. Calls Backend#load
- # after verifying that the project exists.
- def retrieve(topic, project = 'Default')
- unless page_exists?(topic, project)
- if project_exists?(project)
- return { :content => "", :topic => topic, :project => project }
- else
- return { :content => @message[:project_does_not_exist] % [project],
- :topic => topic, :project => project }
- end
- end
-
- buffer = @delegate.load(topic, project)
- return { :rawtext => buffer.join(""), :project => project, :topic => topic }
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_read_topic] % [project, topic]
- rescue Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_retrieve_topic] % p
- end
-
- # Stores the specified topic and project page.
- def store(page)
- @delegate.store(page)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_store_topic] % [page.project, page.topic]
- rescue Exception => e
- p = [page.project, page.topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_store_topic] % p
- end
-
- # Destroys the specified topic and project page.
- def destroy(page)
- @delegate.destroy(page)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_destroy_topic] % [page.project, page.topic]
- rescue Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_destroy_topic] % p
- end
-
- # Releases the lock on the page.
- def release_lock(page, address = 'UNKNOWN')
- @delegate.release_lock(page, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_release_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:error_releasing_lock] % p
- end
-
- # Attempts to obtain a lock on the page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- @delegate.obtain_lock(page, address, timeout)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_obtain_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:error_creating_lock] % p
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- @delegate.project_exists?(project)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- @delegate.page_exists?(topic, project)
- end
-
- # Attempts to create the project.
- def create_project(project)
- @delegate.create_project(project)
- rescue Ruwiki::Backend::ProjectExists => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:project_already_exists] % [project]
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_create_project] % [project]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_create_project] % p
- end
-
- # Attempts to destroy the project.
- def destroy_project(project)
- @delegate.destroy_project(project)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_destroy_project] % [project]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_destroy_project] % p
- end
- end
-
- # The Ruwiki backend abstract class and factory.
- class Backend
- class ProjectExists < StandardError #:nodoc:
- end
- class BackendError < StandardError #:nodoc:
- attr_reader :reason
-
- def initialize(reason, *args)
- @reason = reason
- end
- end
- def initialize(storage_options)
- end
-
- private
- # Creates the current diff object.
- def make_diff(page, oldpage, newpage)
- {
- 'old_version' => page.old_version,
- 'new_version' => page.version,
- 'change_date' => Time.now,
- 'change_ip' => page.change_ip,
- 'change_id' => page.change_id,
- 'diff' => Diff.diff(oldpage, newpage)
- }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/backend/flatfiles.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/backend/flatfiles.rb
deleted file mode 100644
index 84069e9..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/backend/flatfiles.rb
+++ /dev/null
@@ -1,156 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Backend
- # Stores Ruwiki pages as flatfiles.
- class Flatfiles < Ruwiki::Backend
- # Initializes the flatfile backend. This will read
- # storage_options[:flatfiles] to determine the options set by the
- # user. The following options are known for <tt>:flatfiles</tt>:
- #
- # :data_path:: The directory in which the wiki files will be found.
- # By default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+.
- def initialize(storage_options)
- options = storage_options[:flatfiles]
- options[:data_path] ||= "./data/"
- @data_path = options[:data_path]
- @extension = options[:extension]
- if not (File.exists?(@data_path) and File.directory?(@data_path))
- raise Ruwiki::Backend::BackendError.new([:flatfiles_no_data_directory, [@data_path]])
- end
- super options
- end
-
- # Loads the topic page from disk.
- def load(topic, project)
- pagefile = page_file(topic, project)
- buffer = File.readlines(pagefile)
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pf = page_file(page.topic, page.project)
- cf = "#{pf}.rdiff"
-
- oldfile = File.readlines(pf) rescue []
- oldfile.collect! { |e| e.chomp }
- newfile = page.rawtext.split(/\n/)
-
- diff = make_diff(page, oldfile, newfile)
- diffs = []
- File.open(cf, 'rb') { |f| diffs = Marshal.load(f) } if File.exists?(cf)
- diffs << diff
- changes = Marshal.dump(diffs)
-
- File.open(cf, 'wb') { |cfh| cfh.print changes }
- File.open(pf, 'wb') { |pfh| pfh.puts page.rawtext }
- end
-
- # Destroys the topic page.
- def destroy(page)
- pf = page_file(page.topic, page.project)
- File.unlink(pf) if File.exists?(pf)
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- pd = project_directory(project)
- File.exists?(pd) and File.directory?(pd)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- pf = page_file(topic, project)
- project_exists?(project) and File.exists?(pf)
- end
-
- # Tries to create the project.
- def create_project(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::ProjectExists if File.exists?(pd)
- Dir.mkdir(pd)
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
- time = Time.now.to_i
-
- lock_okay = false
- # See if we have the lock already.
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, we don't care how old it
- # is. Thus, release it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lock_okay = true
- end
-
- if lock_okay
- open(lf, 'w') { |lfh| lfh.puts "#{address}\n#{time + timeout}" }
- else
- raise Ruwiki::Backend::BackendError(nil)
- end
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
- time = Time.now.to_i
-
- lock_okay = false
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, then we can safely remove
- # it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lock_okay = true
- end
-
- if lock_okay
- File.unlink(lf) if File.exists?(lf)
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- end
-
- private
- def project_directory(project)
- File.join(@data_path, project)
- end
-
- def page_file(topic, project = 'Default')
- if @extension.nil?
- File.join(project_directory(project), topic)
- else
- File.join(project_directory(project), "#{topic}.#{@extension}")
- end
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/config.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/config.rb
deleted file mode 100644
index 5f059b5..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/config.rb
+++ /dev/null
@@ -1,134 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Features known to Ruwiki.
- KNOWN_FEATURES = [ ]
-
- # Ruwiki configuration.
- class Config
- # Templates known to Ruwiki.
- TEMPLATES = [ :body, :content, :error, :edit, :controls, :save ]
-
- # Adds additional information to the (rare) error reports. Defaults to
- # +false+.
- attr_accessor :debug
- # The default page for display when Ruwiki is called without any
- # arguments. Defaults to +ProjectIndex+
- attr_accessor :default_page
- # The default project for display when Ruwiki is called without any
- # arguments or a project specification. Defaults to +Default+
- attr_accessor :default_project
- # The storage type as a Symbol. Corresponds to a filename that will be
- # found in ruwiki/backend. In this version of Ruwiki, only flatfiles.rb
- # (e.g., :flatfiles) is defined. Defaults to <tt>:flatfiles</tt>.
- attr_accessor :storage_type
- # The options for the specified storage type. This is a hash of hashes
- # with auto-vifification. See the storage type for available options.
- attr_reader :storage_options
- # The options for the specified feature. This is a hash of hashes with
- # auto-vifification. See #features for more information.
- attr_reader :feature_options
- # The path for templates. Defaults to <tt>./templates/</tt>.
- attr_accessor :template_path
- # The name of the Wiki. Defaults to <tt>ruwiki</tt>
- attr_accessor :title
- # The email address of the webmaster for the Wiki. Defaults to +nil+.
- attr_accessor :webmaster
- # The name of the Ruwiki CSS file. Defaults to <tt>ruwiki.css</tt>.
- attr_accessor :css
- # The template set. Templates are always named as
- # <template_path>/<template_set>/<template_kind>.
- #Template filename. Must be reachable by File#read.
- attr_accessor :template_set
- # Ruwiki is internationalized. This method sets the Ruwiki error
- # messages (and a few other messages) )to the specified language Module.
- # The language Module must have a constant Hash called +Message+
- # containing a set of symbols and localized versions of the messages
- # associated with them.
- #
- # If the file 'ruwiki/lang/es.rb' contains the module
- # <tt>Ruwiki::Lang::ES</tt>, the error messages for RSS could be
- # localized to Español thus:
- #
- # require 'ruwiki/lang/es'
- # ...
- # wiki.config.language = Ruwiki::Lang::ES
- #
- # Localization is per wiki instance. In a servlet environment, this may
- # mean that only a single language is recognised.
- #
- # See Ruwiki::Lang::EN for more information.
- attr_accessor :language
- # The message hash.
- attr_reader :message
-
- def language=(l) #:nodoc:
- @language = l
- @message = l::Message
- @message.default = l::Message.default
- end
-
- # Returns the template string
- def template(kind = :body)
- raise ConfigError, message[:no_template_found] % [kind.inspect, @template_set] unless TEMPLATES.include?(kind)
- File.read(File.join(@template_path, @template_set, "#{kind.to_s}.tmpl"))
- end
-
- # Returns a copy of the list of features supported by this Wiki.
- def features
- @features.dup
- end
-
- # Adds a new feature to the Wiki.
- def add_feature(feature)
- raise ConfigError, message[:unknown_feature] % [feature.inspect] unless KNOWN_FEATURES.include?(feature)
- @features << feature
- end
-
- # Returns the CSS stylesheet content for the Wiki. This previously
- # returned the <link> to the stylesheet, but instead returns a <style>
- # block in the head so that the CSS is kept with the template set, which
- # may be kept outside of the HTML area.
- def css_link
- %Q[<style>#{File.read(File.join(@template_path, @template_set, @css))}</style>]
- end
-
- # Creates a new configuration object.
- def initialize
- @debug = false
- @default_project = "Default"
- @default_page = "ProjectIndex"
- @storage_type = :flatfiles
- @storage_options = Hash.new { |h, k| h[k] = {} }
- @template_path = "./templates/"
- @template_set = "default"
- @css = "ruwiki.css"
- @webmaster = nil
- @title = "Ruwiki"
- @features = []
- @feature_options = Hash.new { |h, k| h[k] = {} }
-
- self.language = Ruwiki::Lang::EN
- end
-
- # Verifies that required configuration options are actually set. Right
- # now, it only checks the values that are defaulted to +nil+.
- def verify
- raise ConfigError, message[:no_webmaster_defined] if @webmaster.nil?
- raise ConfigError, message[:invalid_template_dir] % [@template_path] unless File.exists?(@template_path) and File.directory?(@template_path)
- t = File.join(@template_path, @template_set)
- raise ConfigError, message[:no_template_set] % [@template_set] unless File.exists?(t) and File.directory?(t)
- end
-
- class ConfigError < StandardError #:nodoc:
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/handler.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/handler.rb
deleted file mode 100644
index 2bf24a5..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/handler.rb
+++ /dev/null
@@ -1,207 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Handler
- class << self
- # Generate a new Handler pair from a CGI request.
- def from_cgi(cgi, output_stream = $stdout)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::CGIRequest.new(cgi)
- o.response = Ruwiki::Handler::CGIResponse.new(cgi, output_stream)
- end
- end
-
- # Generate a new Handler pair from a WEBrick request.
- def from_webrick(req, res)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::WEBrickRequest.new(req)
- o.response = Ruwiki::Handler::WEBrickResponse.new(res)
- end
- end
- end
-
- # Returns the handler's request object.
- attr_accessor :request
- # Returns the handler's response object.
- attr_accessor :response
-
- # Creates the handler pair.
- def initialize(&block) #:yields: self
- @request = nil
- @response = nil
- yield self if block_given?
- end
-
- # REpresents an abstract incoming request. This insulates the rest of
- # the code from knowing whether parameters are passed as part of the
- # path, as parameters in the URL, or in some other fashion.
- class AbstractRequest
- def initialize(*args)
- end
- end
-
- # Handles all requests from web applications.
- #
- # Subclasses should provide:
- # @parameters:: Hash-like object that responds to #[] and #hash_key?]
- # @environment:: Hash-like object that responds to #[]
- class AbstractWebRequest < AbstractRequest
- # The parameters provided via the web request.
- attr_reader :parameters
- # The environment provided to the web request.
- attr_reader :environment
- # The request path.
- attr_reader :path
-
- # Yields each parameter key in succession.
- def each_parameter #:yields: key, value
- @parameters.each { |k, v| yield k, v }
- end
-
- def each_environment #:yields: key, value
- @environment.each { |k, v| yield k, v }
- end
-
- # Return the URL of our server.
- def server_url
- res = "http://" # should detect whether we're in secure server mode.
- if @environment['HTTP_HOST']
- res << @environment['HTTP_HOST']
- else
- res << "#{@environment['SERVER_NAME']}:#{@environment['SERVER_PORT']}"
- end
- end
-
- # Return the URL of this script.
- def script_url
- server_url << @environment['SCRIPT_NAME'].to_s
- end
-
- # Return the URL of this request.
- def request_url
- res = script_url
- res << @environment['PATH_INFO'] if @environment['PATH_INFO']
- query = @environment['QUERY_STRING']
- res << "?#{@environment['QUERY_STRING']}" if query && !query.empty?
- res
- end
-
- # Convert a file path into a URL
- def make_url(project, path)
- "#{server_url}/#{project}/#{path}"
- end
-
- def determine_request_path
- @path = ""
- return @path if @environment['PATH_INFO'].nil?
- @path = @environment['PATH_INFO'].dup
- end
- end
-
- # Request for CGI-based activity to ruwiki.
- class CGIRequest < AbstractWebRequest
- def initialize(cgi, output_stream = $stdout)
- @environment = ENV
- @cgi = cgi
- @parameters = {}
- cgi.params.each { |k, v| @parameters[k] = v[0] }
- super
- end
- end
-
- # Request for WEBrick based servlet activity to ruwiki.
- class WEBrickRequest < AbstractWebRequest
- def initialize(req)
- @environment = req.meta_vars
- @parameters = req.query
- super
- end
- end
-
- # Used to write responses in different execution environments such as
- # CGI and Webrick.
- #
- # If you want to create a new response object, you'll need to implement
- # #add_header, #write_headers, and #<<.
- #
- # The Response object is instantiated with an output stream which must
- # supply +<<+ and +puts+ methods.
- class AbstractResponse
- # Add to the list of headers to be sent back to the client.
- def add_header(key, value)
- raise "Not implemented"
- end
-
- # Write the accumulated headers back to the client.
- def write_headers
- raise "Not implemented"
- end
-
- # Write the string to the client.
- def <<(string)
- raise "Not implemented"
- end
-
- # output_stream must respond to #<< and #puts.
- def initialize(output_stream = $stdout)
- @headers = {}
- @output_stream = output_stream
- end
- end
-
- # CGIResponse is the response object for CGI mode.
- class CGIResponse < AbstractResponse
- # output_stream must respond to #<< and #puts.
- def initialize(cgi, output_stream = $stdout)
- @cgi = cgi
- super(output_stream)
- end
-
- # Add the header pair for later output as a CGI header.
- def add_header(key, value)
- @headers[key] = value
- end
-
- # Write the headers to the stream. The headers can only be written
- # once.
- def write_headers
- return if @written
- @headers.each { |key, value| @output_stream.puts "#{key}: #{value}\r\n" }
- @output_stream.puts
- @written = true
- end
-
- # Output the string to the stream provided.
- def <<(string)
- @output_stream << string
- end
- end
-
- # WEBrickResponse is the response object for WEBrick servlet mode.
- class WEBrickResponse < AbstractResponse
- def initialize(webrick_response)
- @response = webrick_response
- end
-
- def add_header(key,value)
- @response[key] = value
- end
-
- def write_headers
- # Webrick will take care of this on its own.
- end
-
- def <<(string)
- @response.body << string
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/lang/de.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/lang/de.rb
deleted file mode 100644
index e860054..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/lang/de.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Translation by Christian Neukirchen (chneukirchen@yahoo.de) on 22oct2003
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- module Lang
- # Ruwiki::Lang::DE is the German-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module DE
- Message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :encoding => "iso-8859-1",
- # Backend-related messages.
- :backend_unknown => "Unbekanntes Backend %s.",
- :cannot_create_project => "Kann %s nicht erstellen: %s",
- :cannot_destroy_project => "Kann %s nicht zerstören: %s",
- :cannot_destroy_topic => "Kann %s::%s nicht zerstören: %s",
- :cannot_obtain_lock => "Kann keine Sperre für %s::%s erhalten. Bitte in Kürze nochmal versuchen.",
- :cannot_release_lock => "Kann die Sperre für %s::%s nicht lösen. Bitte später nochmal versuchen.",
- :cannot_retrieve_topic => "Kann auf %s::%s nicht zugreifen: %s",
- :cannot_store_topic => "Kann %s::%s nicht speichern: %s",
- :error_creating_lock => "Fehler beim Erzeugen der Sperre von %s::%s: %s",
- :error_releasing_lock => "Fehler beim Lösen der Sperre von %s::%s: %s",
- :flatfiles_no_data_directory => "Das Daten-Verzeichnis (%s) existiert nicht.",
- :no_access_to_create_project => "Keine Berechtigung um das Projekt (%s) zu erstellen.",
- :no_access_to_destroy_project => "Keine Berechtigung um das Projekt (%s) zu zerstören.",
- :no_access_to_destroy_topic => "Kann %s::%s nicht zerstören: %s.",
- :no_access_to_read_topic => "Kann auf %s::%s nicht zugreifen: %s.",
- :no_access_to_store_topic => "Kann %s::%s nicht speichern: %s.",
- :project_already_exists => "Das Projekt %s existiert bereits.",
- :project_does_not_exist => "Das Projekt %s existiert nicht.",
- # Config-related messages.
- :config_not_ruwiki_config => "Die Konfiguration muss von Typ der Klasse Ruwiki::Config sein.",
- :invalid_template_dir => "Der angegebene Pfad für Schablonen (%s) existiert nicht oder ist kein Verzeichnis.",
- :no_template_found => "Keine Schablone %s im Schablonen-Set '%s' gefunden.",
- :no_template_set => "Es gibt kein Schablonen-Set '%s' im Schablonen-Pfad.",
- :no_webmaster_defined => "Konfigurations-Fehler: Webmaster nicht definiert.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fataler Fehler",
- :editing => "Editieren",
- :error => "Fehler",
- :invalid_path_info_value => "Fataler Fehler in der Web-Umgebung. PATH_INFO = %s",
- # Should this really get translated? --chris
- :render_arguments => "Ruwiki#render muss mit zwei oder mehr Argumenten aufgerufen werden.",
- :unknown_feature => "Unbekanntes Feature %s."
- }
- Message.default = proc { |h, k| "Sprachdatei-FEHLER: Unbekannter Nachrichten-Typ #{k.inspect}." }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/lang/en.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/lang/en.rb
deleted file mode 100644
index 00712df..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/lang/en.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- module Lang
- # Ruwiki::Lang::EN is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module EN
- Message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :encoding => "iso-8859-1",
- # Backend-related messages.
- :backend_unknown => "Backend %s is unknown.",
- :cannot_create_project => "Cannot create project %s: %s",
- :cannot_destroy_project => "Cannot destroy project %s: %s",
- :cannot_destroy_topic => "Cannot destroy %s::%s: %s",
- :cannot_obtain_lock => "Unable to obtain a lock on %s::%s. Try again shortly.",
- :cannot_release_lock => "Unable to release the lock on %s::%s. Try again shortly.",
- :cannot_retrieve_topic => "Cannot retrieve %s::%s: %s",
- :cannot_store_topic => "Cannot store project %s::%s: %s",
- :error_creating_lock => "Error creating lock on %s::%s: %s",
- :error_releasing_lock => "Error releasing lock on %s::%s: %s",
- :flatfiles_no_data_directory => "The data directory (%s) does not exist.",
- :no_access_to_create_project => "No permission to create project %s.",
- :no_access_to_destroy_project => "No permission to destroy project %s::%s.",
- :no_access_to_destroy_topic => "No permission to destroy topic %s::%s.",
- :no_access_to_read_topic => "No permission to retrieve the %s::%s.",
- :no_access_to_store_topic => "No permission to store the %s::%s.",
- :project_already_exists => "Project %s already exists.",
- :project_does_not_exist => "Project %s does not exist.",
- # Config-related messages.
- :config_not_ruwiki_config => "Configuration must be of class Ruwiki::Config.",
- :invalid_template_dir => "The specified path for templates (%s) does not exist or is not a directory.",
- :no_template_found => "No template of %s found in template set %s.",
- :no_template_set => "There is no template set '%s' in the template path.",
- :no_webmaster_defined => "Configuration error: Webmaster is unset.",
- # Miscellaneous messages.
- :complete_utter_failure => "Complete and Utter Failure",
- :editing => "Editing",
- :error => "Error",
- :invalid_path_info_value => "Something has gone seriously wrong with the web environment. PATH_INFO = %s",
- :render_arguments => "Ruwiki#render must be called with zero or two arguments.",
- :unknown_feature => "Unknown feature %s."
- }
- Message.default = proc { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/lang/es.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/lang/es.rb
deleted file mode 100644
index 9ef29ce..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/lang/es.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Mauricio Julio Fernández Pradierández Pradier (batsman.geo@yahoo.com)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- module Lang
- # Ruwiki::Lang::ES is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module ES
- Message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :encoding => "iso-8859-1",
- # Backend-related messages.
- :backend_unknown => "Clase Backend desconocida: %s.",
- :cannot_create_project => "No puede crearse el proyecto %s: %s",
- :cannot_destroy_project => "No puede borrarse el proyecto %s: %s",
- :cannot_destroy_topic => "No puede borrarse %s::%s: %s",
- :cannot_obtain_lock => "Imposible obtener acceso exclusivo sobre %s::%s. Reinténtelo en breve.",
- :cannot_release_lock => "Imposible liberar acceso exclusivo sobre %s::%s. Reinténtelo en breve.",
- :cannot_retrieve_topic => "No puede leerse %s::%s: %s",
- :cannot_store_topic => "No puede archivarse %s::%s: %s",
- :error_creating_lock => "Error al crear el cerrojo sobre %s::%s: %s",
- :error_releasing_lock => "Error al liberar el cerrojo sobre %s::%s: %s",
- :flatfiles_no_data_directory => "El directorio de datos (%s) no existe.",
- :no_access_to_create_project => "Permiso denegado al crear el proyecto %s.",
- :no_access_to_destroy_project => "Permiso denegado al borrar el proyecto %s::%s.",
- :no_access_to_destroy_topic => "Permiso denegado al borrar el nodo %s::%s.",
- :no_access_to_read_topic => "Permiso denegado al leer el nodo %s::%s.",
- :no_access_to_store_topic => "Permiso denegado al salvar el nodo %s::%s.",
- :project_already_exists => "El proyecto %s ya existe.",
- :project_does_not_exist => "El proyecto %s no existe.",
- # Config-related messages.
- :config_not_ruwiki_config => "La configuración debe ser de clase Ruwiki::Config.",
- :invalid_template_dir => "El path especificado para plantillas (%s) no existe o no es un directorio.",
- :no_template_found => "No se encontró ninguna plantilla para %s en el conjunto %s.",
- :no_template_set => "No hay ningún juego de plantillas '%s' en el path.",
- :no_webmaster_defined => "Error de configuración: Webmaster no está definido.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fallo total y absoluto.",
- :editing => "Editando",
- :error => "Error",
- :invalid_path_info_value => "Algo huele a podrido en su entorno Web. PATH_INFO = %s",
- :render_arguments => "Ruwiki#render debe ser llamado con cero o dos argumentos.",
- :unknown_feature => "Clase Feature desconocida: %s."
- }
- Message.default = proc { |h, k| "ERROR De la Lengua: Llave desconocida del mensaje #{k.inspect}." }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/page.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/page.rb
deleted file mode 100644
index c0727c2..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/page.rb
+++ /dev/null
@@ -1,131 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # A generic page for Ruwiki.
- class Page
- # The page ID.
- attr_accessor :page_id
- # The current version of the page.
- attr_accessor :version
- # The previous version of the page.
- attr_accessor :old_version
- # The page topic (the name of the page).
- attr_accessor :topic
- # The project of the page.
- attr_accessor :project
- # Unformatted page text.
- attr_reader :content
- # Formatted page text.
- attr_accessor :formatted
-
- # The IP address of the person who made the last change.
- def change_ip
- %Q(#{@remote_host} #{@remote_addr})
- end
-
- # The ID, if present, of the person who made the last change. Not yet
- # implemented.
- def change_id
- nil
- end
-
- # Creates a Ruwiki page.
- def initialize(init = {})
- @markup = init[:markup]
- @script = init[:script]
-
- @remote_host = init[:remote_host]
- @remote_addr = init[:remote_addr]
-
- @project = init[:project] || "Default"
- @topic = init[:topic] || "NewTopic"
- @content = init[:content] || ""
- @page_id = init[:page_id] || 0
- @version = init[:version] || 0
- @old_version = @version - 1
-
- if init.has_key?(:rawtext)
- @rawtext = init[:rawtext].dup
- @content = parse_header(@rawtext.dup)
- @formatted = parse_content(@content, @project)
- elsif not @content.empty?
- @formatted = parse_content(@content.dup, @project)
- else
- @formatted = ""
- end
- @content.gsub!(/\r/, "")
- end
-
- # The content of the page.
- def content=(content)
- @content = content.gsub(/\r/, "")
- @formatted = parse_content(content, @project)
- end
-
- # Output raw header and raw page context for saving.
- def rawtext
- return <<-EOS
-id: #{@page_id}
-topic: #{@topic}
-version: #{@version}
-#EHDR
-#{@content}
- EOS
- end
-
- # Outputs the HTML version of the page.
- def to_html
- @formatted
- end
-
- private
- HEADER_RE = /^([a-z]+)\s*:\s*(.*)$/
- HEADER_END_RE = /^#EHDR$/
-
- # Parse the header.
- def parse_header(rawtext)
- rawbuf = rawtext.split("\n")
-
- loop do
- break if rawbuf.nil? or rawbuf.empty?
-
- if rawbuf[0] =~ HEADER_END_RE
- rawbuf.shift
- break
- end
-
- match = HEADER_RE.match(rawbuf[0])
-
- if match
- case match[1].intern
- when :id
- @page_id = match[2].to_i
- when :topic
- @topic = match[2]
- when :version
- @version = match[2].to_i
- @old_version = @version - 1
- end
- rawbuf.shift
- end
- end
-
- rawbuf.join("\n")
- end
-
- # Parse the content.
- def parse_content(content, project)
- parsed = @markup.parse(content, project)
-
- parsed
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/servlet.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/servlet.rb
deleted file mode 100644
index 3144b23..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/servlet.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'webrick'
-
-class Ruwiki
- class Servlet < WEBrick::HTTPServlet::AbstractServlet
- def initialize(config)
- @config = config
- end
-
- # Converts a POST into a GET.
- def do_POST(req, res)
- do_GET(req, res)
- end
-
- def do_GET(req, res)
- # Generate the reponse handlers for Ruwiki from the request and response
- # objects provided.
- wiki = Ruwiki.new(Ruwiki::Handler.from_webrick(req, res))
-
- # Configuration defaults to certain values. This overrides the defaults.
- wiki.config = $config unless $config.nil?
- wiki.run
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/template.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/template.rb
deleted file mode 100644
index a285eed..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/template.rb
+++ /dev/null
@@ -1,223 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file is originally from rdoc by Dave Thomas (dave@pragprog.com).
-#
-# $Id$
-#++
-class Ruwiki
- # RDoc's cheap-n-cheerful HTML page template system. You create a template
- # containing:
- #
- # * variable names between percent signs (<tt>%fred%</tt>)
- # * blocks of repeating stuff:
- # START:key
- # ... stuff
- # END:key
- #
- # You feed the code a hash. For simple variables, the values are resolved
- # directly from the hash. For blocks, the hash entry corresponding to +key+
- # will be an array of hashes. The block will be generated once for each
- # entry. Blocks can be nested arbitrarily deeply.
- #
- # The template may also contain:
- # IF:key
- # ... stuff
- # ENDIF:key
- #
- # _stuff_ will only be included in the output if the corresponding key is
- # set in the value hash.
- #
- # Usage: Given a set of templates <tt>T1, T2,</tt> etc
- # values = { "name" => "Dave", state => "TX" }
- # t = TemplatePage.new(T1, T2, T3)
- # File.open(name, "w") {|f| t.write_html_on(f, values)}
- # or
- # res = ''
- # t.write_html_on(res, values)
- #
- class TemplatePage
-
- # A context holds a stack of key/value pairs (like a symbol table). When
- # asked to resolve a key, it first searches the top of the stack, then
- # the next level, and so on until it finds a match (or runs out of
- # entries).
- class Context
- def initialize
- @stack = []
- end
-
- def push(hash)
- @stack.push(hash)
- end
-
- def pop
- @stack.pop
- end
-
- # Find a scalar value, throwing an exception if not found. This method
- # is used when substituting the %xxx% constructs
- def find_scalar(key)
- @stack.reverse_each do |level|
- if val = level[key]
- return val unless val.kind_of? Array
- end
- end
- raise "Template error: can't find variable '#{key}'"
- end
-
- # Lookup any key in the stack of hashes
- def lookup(key)
- @stack.reverse_each do |level|
- val = level[key]
- return val if val
- end
- nil
- end
- end
-
- # Simple class to read lines out of a string
- class LineReader
- # we're initialized with an array of lines
- def initialize(lines)
- @lines = lines
- end
-
- # read the next line
- def read
- @lines.shift
- end
-
- # Return a list of lines up to the line that matches a pattern. That
- # last line is discarded.
- def read_up_to(pattern)
- res = []
- while line = read
- if pattern.match(line)
- return LineReader.new(res)
- else
- res << line
- end
- end
- raise "Missing end tag in template: #{pattern.source}"
- end
-
- # Return a copy of ourselves that can be modified without affecting us
- def dup
- LineReader.new(@lines.dup)
- end
- end
-
- # +templates+ is an array of strings containing the templates. We start at
- # the first, and substitute in subsequent ones where the string
- # <tt>!INCLUDE!</tt> occurs. For example, we could have the overall page
- # template containing
- #
- # <html><body>
- # <h1>Master</h1>
- # !INCLUDE!
- # </bost></html>
- #
- # and substitute subpages in to it by passing [master, sub_page]. This
- # gives us a cheap way of framing pages
- def initialize(*templates)
- result = "!INCLUDE!"
- templates.each do |content|
- result.sub!(/!INCLUDE!/, content)
- end
- @lines = LineReader.new(result.split($/))
- end
-
- # Render the templates into HTML, storing the result on +op+ using the
- # method <tt><<</tt>. The <tt>value_hash</tt> contains key/value pairs
- # used to drive the substitution (as described above)
- def write_html_on(op, value_hash)
- @context = Context.new
- op << substitute_into(@lines, value_hash).tr("\000", '\\')
- end
-
- # Substitute a set of key/value pairs into the given template. Keys with
- # scalar values have them substituted directly into the page. Those with
- # array values invoke <tt>substitute_array</tt> (below), which examples a
- # block of the template once for each row in the array.
- #
- # This routine also copes with the <tt>IF:</tt>_key_ directive, removing
- # chunks of the template if the corresponding key does not appear in the
- # hash, and the START: directive, which loops its contents for each value
- # in an array
- def substitute_into(lines, values)
- @context.push(values)
- skip_to = nil
- result = []
-
- while line = lines.read
-
- case line
-
- when /^IF:(\w+)/
- lines.read_up_to(/^ENDIF:#$1/) unless @context.lookup($1)
-
- when /^IFNOT:(\w+)/
- lines.read_up_to(/^ENDIF:#$1/) if @context.lookup($1)
-
- when /^ENDIF:/
- ;
-
- when /^START:(\w+)/
- tag = $1
- body = lines.read_up_to(/^END:#{tag}/)
- inner_values = @context.lookup(tag)
- raise "unknown tag: #{tag}" unless inner_values
- raise "not array: #{tag}" unless inner_values.kind_of?(Array)
- inner_values.each do |vals|
- result << substitute_into(body.dup, vals)
- end
- else
- result << expand_line(line.dup)
- end
- end
-
- @context.pop
-
- result.join("\n")
- end
-
- # Given an individual line, we look for %xxx% constructs and
- # HREF:ref:name: constructs, substituting for each.
- def expand_line(line)
- # Generate a cross reference if a reference is given,
- # otherwise just fill in the name part
-
- line.gsub!(/HREF:(\w+?):(\w+?):/) do
- ref = @context.lookup($1)
- name = @context.find_scalar($2)
-
- if ref and !ref.kind_of?(Array)
- "<a href=\"#{ref}\">#{name}</a>"
- else
- name
- end
- end
-
- # Substitute in values for %xxx% constructs. This is made complex
- # because the replacement string may contain characters that are
- # meaningful to the regexp (like \1)
-
- line = line.gsub(/%([a-zA-Z]\w*)%/) do
- val = @context.find_scalar($1)
- val.tr('\\', "\000")
- end
-
- line
- rescue Exception => e
- $stderr.puts "Error in template: #{e}"
- $stderr.puts "Original line: #{line}"
- exit
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki.rb
deleted file mode 100644
index f922505..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Ruwiki's Wiki markup class. This will convert the Wiki markup known by
- # Ruwiki (defined by Token classes). The algorithm is as follows:
- #
- # 1. For each known Token class, match each instance of it in the content
- # stream. Replace each instance in the content stream with a Token
- # marker: TOKEN_x or \TOKEN_x, where x is a digit representing the
- # Token. (\TOKEN_x is a special case of token matching. See
- # Ruwiki::Markup::Token for more information.) Store the Token for
- # later processing.
- # 2. Go back through the content, replacing each instance of \TOKEN_x
- # with the Token's defined restore value (which should be the same
- # value as was originally matched).
- # 3. Go through the content, replacing each instance of TOKEN_x with the
- # Token's defined replacement value.
- # 4. Go through the tokens, in reverse, and execute the post replacement
- # routine defined by the Token. (This may be necessary to collapse
- # consecutive HTML structures.)
- # 5. Return the parsed content and the collected metadata.
- #
- # == Tokens
- # Look at Ruwiki::Markup::Token describes how to create Token objects.
- class Wiki
- def parse(content, project)
- content = content.dup
- tokens = []
- project ||= @default_project
-
- Token.tokenlist.each do |token|
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, project, @backend, @script)
- tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{tokens.size - 1}"
- else
- "TOKEN_#{tokens.size - 1}"
- end
- end
- end
-
- replaced = []
- s = true
- loop do
- break if replaced.size >= tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].restore
- }
-
- s = content.gsub!(/TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].replace
- }
- end
-
- 3.times do
- tokens.reverse_each { |token| token.post_replace(content) }
- end
-
- content
- end
-
- attr_accessor :default_project
- attr_accessor :script
- attr_accessor :backend
-
- # Creates the markup class.
- def initialize(default_project, script)
- @default_project = default_project
- @script = script
- end
- end
-end
-
-require 'ruwiki/wiki/tokens'
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens.rb
deleted file mode 100644
index d41fe27..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens.rb
+++ /dev/null
@@ -1,131 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # The base Token class. All Token classes must inherit from Token and
- # *must* implement the following methods:
- #
- # [self.regexp] The regular expression that the Token will be
- # replacing.
- # [replace] The mechanism for replacing the Token with the desired
- # results.
- #
- # Token classes <i>should</i> implement the following method:
- # [self.rank] Default: <tt>5000</tt>. Affects the sort order. Must
- # return an integer.
- #
- # Token classes <i>may</i> implement the following methods:
- # [restore] Restores the token without replacement. Implements the
- # results of the escape character. NOTE: each Token
- # class is responsible for its own restore. Tokens that
- # are anchored to the beginning of a line are the most
- # likely to need to reimplement this.
- # [post_replace] Performs any necessary massaging of the data. See the
- # implementation of Ruwiki::Wiki::Lists for more
- # information.
- class Token
- @@tokenlist = []
- @@sorted = false
-
- class << self
- # Tokens should define rank if they must be first or last in
- # processing. Otherwise, they are sorted in the order defined.
- def rank
- 5000
- end
-
- # The Wiki parsing routine uses Token.tokenlist to determine the
- # tokens that are processed, and the order in which they are
- # processed. See Token.rank for more information.
- def tokenlist
- unless @@sorted
- head = @@tokenlist.shift
- @@tokenlist.sort! { |a, b| a.rank <=> b.rank }
- @@tokenlist.unshift(head)
- sorted = true
- end
- @@tokenlist
- end
-
- def inherited(child_class) #:nodoc:
- @@tokenlist << Token if @@tokenlist.empty?
-
- # Make the child class post_replace a blank function because we
- # don't want to propogate the currently defined post_replace.
- # The current post_replace is specific to Token_Base only.
- class << child_class
- def post_replace(content)
- content
- end
- end
-
- @@tokenlist << child_class
- @@sorted = false
- end
-
- # The replacement regular expression.
- def regexp
- /TOKEN_(\d*)/
- end
- end
-
- # All Token classes must match this header signature if they define
- # #initialize.
- #
- # [match] The MatchData object for this Token.
- # [project] The project being processed.
- # [backend] The backend for the wiki. This is used to determine if
- # the page or project exists. The object passed must
- # respond to #project_exists?(project) and
- # #page_exists?(page, project).
- # [script] The URI to the script.
- def initialize(match, project, backend, script)
- @match = match
- @project = project
- @backend = backend
- @script = script
- end
-
- # The replacement method. Uses @match to replace the token with the
- # appropriate values.
- def replace
- "TOKEN_#{@match[1]}"
- end
-
- # Restores the token without replacement. By default, replaces
- # "dangerous" HTML characters.
- def restore
- @match[0].gsub(/&/, "&amp;").gsub(/</, "&lt;").gsub(/>/, "&gt;")
- end
-
- # The content may need massaging after processing.
- def post_replace(content)
- content
- end
- end
- end
-end
-
- # Load the tokens from the ruwiki/wiki/tokens directory.
-tokens_dir = 'ruwiki/wiki/tokens'
-
-$LOAD_PATH.each do |path|
- target = "#{path}/#{tokens_dir}"
- if File.exists?(target) and File.directory?(target)
- Dir::glob("#{target}/*.rb") do |token|
- begin
- require token
- rescue LoadError
- nil
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/00default.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/00default.rb
deleted file mode 100644
index ef8e157..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/00default.rb
+++ /dev/null
@@ -1,174 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-class Ruwiki
- class Wiki
- # The Paragraph Token class changes blank lines to <p> tags. This class,
- # under the current implementation, should be *first* in the Token list
- # after Token.
- class Paragraph < Ruwiki::Wiki::Token
- # This Token is #rank 0, because it should be first in the Token list.
- def self.rank
- 0
- end
-
- # Matches blank lines. %r{^\s*$}
- def self.regexp
- %r{(^\s*$)}
- end
-
- # Replaces with "<p>"
- def replace
- "<p>"
- end
-
- # Ensures that <p> won't be surrounded by <br> tags.
- def post_replace(content)
- content.gsub!(%r{\n$}, '</p>')
- content.gsub!(%r{(\n|<br ?/?>)?<p>(\n|<br ?/?>)?}, '<p>')
- content.gsub!(%r{<p>}, '</p><p>')
- content.gsub!(%r{</p>(</p>)+}, '</p>')
- content.gsub!(%r{<body></p>}, '<body>')
- content.gsub!(%r{</body>}, '</p></body>')
- content.gsub!(%r{<p></p>}, '')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content.gsub!(%r{^</p>}, '')
- content
- end
- end
-
- # The Code Token class converts indented text to "unformatted" (<pre>)
- # text. This class should be *second* in the Token list.
- class Code < Ruwiki::Wiki::Token
- # This Token is #rank 1, because it should be second in the Token list.
- def self.rank
- 1
- end
-
- # Matches indented text. %r{^(\s+\S.*)$}
- def self.regexp
- %r{^(\s+\S.*)$}
- end
-
- # Replaces the text to <pre>content</pre>.
- def replace
- content = @match[1].gsub(/&/) { "&amp;" }.gsub(/</) { "&lt;" }.gsub(/>/) { "&gt;" }
- %Q{<pre>#{content}</pre>}
- end
-
- # Converts cases of %r{</pre>(\n|<br ?/?>)<pre>} to \1.
- def post_replace(content)
- content.gsub!(%r{</pre>(\n|<br ?/?>)?<pre>}, '\1')
- content.gsub!(%r{<p><pre>}, '<pre>')
- content.gsub!(%r{</pre></p>}, '</pre>')
- content
- end
- end
-
- RE_URI_SCHEME = %r{[\w.]+?:}
- RE_URI_PATH = %r{[^\s<>\]]}
- RE_URI_TEXT = %r{[^\]]*}
- RE_IMAGE = /(jpg|jpeg|png|gif)$/
-
- # Converts URLs in the form of [url] to numbered links.
- class NumberedLinks < Ruwiki::Wiki::Token
- class << self
- attr_accessor :count
- end
-
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\]}
- end
-
- def replace
- extlink = @match.captures[0]
-
- NumberedLinks.count ||= 0
- NumberedLinks.count += 1
- name = "[#{NumberedLinks.count}]"
-
- if extlink =~ RE_IMAGE
- %Q{<img src="#{extlink}" title="#{name}" alt="#{name}" />}
- else
- %Q{<a class="rw_extlink" href="#{extlink}">#{name}</a>}
- end
- end
- end
-
- # Converts URLs in the form of [url name] to named links.
- class NamedLinks < Ruwiki::Wiki::Token
- def self.rank
- 3
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\s+(#{RE_URI_TEXT})\]}
- end
-
- def replace
- extlink = @match.captures[0]
- name = @match.captures[1]
-
- if extlink =~ RE_IMAGE
- %Q{<img src="#{extlink}" title="#{name}" alt="#{name}" />}
- else
- %Q{<a class="rw_extlink" href="#{extlink}">#{name}</a>}
- end
- end
- end
-
- # Converts URLs to links where the "name" of the link is the URL itself.
- class ExternalLinks < Ruwiki::Wiki::Token
- def self.rank
- 504
- end
-
- def self.regexp
- %r{\b(#{RE_URI_SCHEME}#{RE_URI_PATH}+)}
- end
-
- def replace
- extlink = @match[1]
-
- if extlink =~ RE_IMAGE
- %Q{<img src="#{extlink}" title="Image at: #{extlink}" alt="Image at: #{extlink}" />}
- else
- %Q{<a class="rw_extlink" href="#{extlink}">#{extlink}</a>}
- end
- end
- end
-
- # Creates a horizontal rule.
- class HRule < Ruwiki::Wiki::Token
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def replace
- "<hr />"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def post_replace(content)
- content.gsub!(%r{<hr ?/?>\n<br ?/?>}, "<hr />")
- content.gsub!(%r{(\n|<br ?/?>)?<hr>(\n|<br ?/?>)?}, "<hr />")
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/01wikilinks.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/01wikilinks.rb
deleted file mode 100644
index f4610bf..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/01wikilinks.rb
+++ /dev/null
@@ -1,161 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki
- class Wiki
- # This provides the basic WikiWord match. This supports WikiWord,
- # CPlusPlus, ThisIsALink, and C_Plus_Plus.
- RE_WIKI_WORDS = %r{[[:upper:]][\w_]*(?:[[:lower:]]+[[:upper:]_]|[[:upper:]_]+[[:lower:]])[\w_]*}
- # This provides wikipedia format matches, e.g., [[wikipedia links]]. The
- # only restriction on words in this format is that they must NOT begin
- # with an underscore ('_').
- RE_WIKIPEDIA_WORDS = %r{\[\[([^_].*?)\]\]}
- # This provides the basic Wiki Project match.
- RE_PROJECT_WORD = %r{[[:upper:]][[:lower:]]+}
-
- # This provides the Wiki view link format:
- VIEW_LINK = %Q[<a class="rw_pagelink" href="%s">%s</a>]
- EDIT_LINK = %Q[<span class="rw_edittext">%s</span><a class="rw_pagelink" href="%s">?</a>]
-
- # Creates a crosslink for a Project::WikiPage.
- class ProjectCrossLink < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::(#{RE_WIKI_WORDS})}
- end
-
- def replace
- captures = @match.captures
- project = captures[0]
- topic = captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic.gsub(/_/, ' ')}"]
- else
- EDIT_LINK % ["#{project}::#{topic.gsub(/_/, ' ')}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a crosslink for a Project::WikiPage using a Wikipedia link
- # format.
- class ProjectCrossLinkWikipedia < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::#{RE_WIKIPEDIA_WORDS}}
- end
-
- def replace
- captures = @match.captures
- project = captures[0]
- link = CGI.escape(captures[1])
- topic = captures[1]
-
- if @backend.page_exists?(topic, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic}"]
- else
- EDIT_LINK % ["#{project}::#{topic}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to the project index from ::Project.
- class ProjectIndex < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{(\B|\\)::(#{RE_PROJECT_WORD})}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- project = @match.captures[1]
-
- if @backend.page_exists?('ProjectIndex', project)
- VIEW_LINK % ["#{@script}/#{project}/ProjectIndex", project]
- else
- if @backend.project_exists?(project)
- EDIT_LINK % [project, "#{@script}/#{project}/ProjectIndex/_edit"]
- else
- EDIT_LINK % [project, "#{@script}/#{project}/_create"]
- end
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project.
- class WikiLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\b|\\)(#{RE_WIKI_WORDS})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic.gsub(/_/, ' ')]
- else
- EDIT_LINK % [topic.gsub(/_/, ' '), "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project using a Wikipedia
- # link format.
- class WikipediaLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\B|\\)#{RE_WIKIPEDIA_WORDS}\B}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- captures = @match.captures
- link = CGI.escape(captures[1])
- topic = captures[1]
-
- if @backend.page_exists?(topic, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic]
- else
- EDIT_LINK % [topic, "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/abbreviations.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/abbreviations.rb
deleted file mode 100644
index fbac715..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/abbreviations.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts abbreviations.
- class Abbreviations < Ruwiki::Wiki::Token
- ABBREVIATIONS = {
- "PM" => "PocoMail"
- }
-
- def self.regexp
- %r!@{([^}]*)}!
- end
-
- def replace
- k = @match[1]
- if k.nil? or k.empty?
- data = "<dl>"
- ABBREVIATIONS.each do |k, v|
- data << "<dt>#{k}</dt><dd>#{v}</dd>"
- end
- data << "</dl>"
- else
- if ABBREVIATIONS.has_key?(k)
- data = ABBREVIATIONS[k]
- else
- data = @match[0]
- end
- end
- data
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/headings.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/headings.rb
deleted file mode 100644
index 21da302..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/headings.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts headings.
- class Headings < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{^\\?(=+)\s+(.*)}
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def replace
- level = @match[1].count("=")
- content = @match[2]
- level = 6 if level > 6
- "<h#{level}>#{content}</h#{level}>"
- end
-
- def post_replace(content)
- content.gsub!(%r{<p>(<h\d>)}, '\1')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/lists.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/lists.rb
deleted file mode 100644
index 11769b5..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/lists.rb
+++ /dev/null
@@ -1,114 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces Lists
- class Lists < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((\*)+|(#)+)\s+(.*)}
- end
-
- def replace
- content = @match[4]
-
- if @match[3].nil?
- char = '*'
- elem = 'ul'
- else
- char = '#'
- elem = 'ol'
- end
-
- indent = @match[1].count(char)
-
- pre = ""
- post = ""
- indent.times do
- pre << "<#{elem}><li>"
- post << "</li></#{elem}>"
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def post_replace(content)
- content.gsub!(%r{</[uo]l>\n?<[uo]l>}, '')
- content.gsub!(%r{</ol>(\n|(<br ?/?>))?<ol>}, '')
- content.gsub!(%r{</ul>(\n|(<br ?/?>))?<ul>}, '')
- content.gsub!(%r{<li><([uo]l)>}, '<\1>')
- content.gsub!(%r{</([uo]l)></li>}, '</\1>')
- content
- end
- end
-
- # Produces block quotes.
- class Blockquotes < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(:+)\s+(.*)$}
- end
-
- def replace
- content = @match[2]
- indent = @match[1].count(":")
-
- pre = ""
- post = ""
- indent.times do
- pre << "<blockquote>"
- post << "</blockquote>"
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def post_replace(content)
- content.gsub!(%r{</blockquote>(\n|<br ?/?>)?<blockquote>}, '')
- content
- end
- end
-
- # Produces definition lists. Does not completely work correctly.
- class Definitions < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(;+)\s+([^:]+)\s+:\s+(.*)}
- end
-
- def replace
- definition = @match[3]
- term = @match[2]
- indent = @match[1].count(';')
-
- pre = ""
- post = ""
- indent.times do
- pre << "<dl>"
- post << "</dl>"
- end
- "#{pre}<dt>#{term}</dt><dd>#{definition}</dd>#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def post_replace(content)
- content.gsub!(%r{</dl>(\n|<br ?/?>)?<dl>}, '')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/rubylists.rb b/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/rubylists.rb
deleted file mode 100644
index 39db408..0000000
--- a/ruwiki/tags/release-0.6.2/lib/ruwiki/wiki/tokens/rubylists.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Convert ruby-talk mailing list references (e.g., [ruby-talk:12345])
- # into named links.
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- # Convert ruby-core/ext/dev/list/math mailing list references (e.g.,
- # [ruby-core:12345]) into named links.
- class OtherRubyLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-(list|doc|core|dev|ext|math):(\d+)\]}
- end
-
- def replace
- ln, lm = @match.captures[0..1]
- %Q(<a class="rw_extlink" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-#{ln}/#{lm}">#{@match[0]}</a>)
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6.2/ruwiki.cgi b/ruwiki/tags/release-0.6.2/ruwiki.cgi
deleted file mode 100644
index 2162090..0000000
--- a/ruwiki/tags/release-0.6.2/ruwiki.cgi
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.1
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-
- # Customize this if you put the RuWiki files in a different location.
-$LOAD_PATH.unshift("lib")
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-wiki.config.webmaster = "webmaster@domain.com"
-
-# wiki.config.debug = false
-# wiki.config.title = "Ruwiki"
-# wiki.config.default_page = "ProjectIndex"
-# wiki.config.default_project = "Default"
-# wiki.config.storage_type = :flatfiles
-# wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# wiki.config.storage_options[:flatfiles][:extension] = nil
-# wiki.config.template_path = "./templates/"
-# wiki.config.template_set = "default"
-# wiki.config.css = "ruwiki.css"
-
-wiki.run
diff --git a/ruwiki/tags/release-0.6.2/ruwiki_servlet.rb b/ruwiki/tags/release-0.6.2/ruwiki_servlet.rb
deleted file mode 100644
index fd1072a..0000000
--- a/ruwiki/tags/release-0.6.2/ruwiki_servlet.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.1
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-$LOAD_PATH.unshift("lib")
-
-require 'webrick'
-require 'getopts'
-require 'ruwiki'
-require 'ruwiki/servlet'
-
-getopts "", 'p:8808'
-
- # This is for the WEBrick version of Ruwiki. This has been abstracted to
- # accept a $config global variable to reconfigure Ruwiki after initial
- # creation.
-$config = Ruwiki::Config.new
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$config.webmaster = "webmaster@domain.com"
-
-# $config.debug = false
-# $config.title = "Ruwiki"
-# $config.default_page = "DefaultPage"
-# $config.default_project = "Default"
-# $config.storage_type = :flatfiles
-# $config.storage_options[:flatfiles][:data_path] = "./data/"
-# $config.storage_options[:flatfiles][:extension] = nil
-# $config.css = "ruwiki.css"
-# $config.template_file = nil
-
-s = WEBrick::HTTPServer.new :Port => $OPT_p.to_i, :StartThreads => 1,
- :Logger => WEBrick::Log::new($stderr, WEBrick::Log::DEBUG)
-
-s.mount("/", Ruwiki::Servlet)
-trap("INT") { s.shutdown; exit }
-s.start
diff --git a/ruwiki/tags/release-0.6.2/templates/de/body.tmpl b/ruwiki/tags/release-0.6.2/templates/de/body.tmpl
deleted file mode 100644
index 6e7c44b..0000000
--- a/ruwiki/tags/release-0.6.2/templates/de/body.tmpl
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhmtl1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=%encoding%" />
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.6.2/templates/de/content.tmpl b/ruwiki/tags/release-0.6.2/templates/de/content.tmpl
deleted file mode 100644
index f15bf2f..0000000
--- a/ruwiki/tags/release-0.6.2/templates/de/content.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-!INCLUDE!
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.6.2/templates/de/controls.tmpl b/ruwiki/tags/release-0.6.2/templates/de/controls.tmpl
deleted file mode 100644
index 58c7ea1..0000000
--- a/ruwiki/tags/release-0.6.2/templates/de/controls.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="rw_nav">
- %home_link% |
- Thema: <b>%page_topic%</b> Projekt: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a> |
- <a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">Edit</a>
-</div>
diff --git a/ruwiki/tags/release-0.6.2/templates/de/edit.tmpl b/ruwiki/tags/release-0.6.2/templates/de/edit.tmpl
deleted file mode 100644
index 5d78e78..0000000
--- a/ruwiki/tags/release-0.6.2/templates/de/edit.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="rw_nav">%home_link% | <i>Editieren</i> Thema: <b>%page_topic%</b> Projekt: <b>%page_project%</b></div><br />
-
-<form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button accesskey="A" type="submit" name="action" value="save"><u>A</u>ußer</button>
- <button accesskey="L" type="submit" name="action" value="cancel" /><u>L</u>öschen</button>
-</form>
-<div class="rw_edit_raw"><h2>Formatfreie Ursprüngliche Version</h2><pre>%pre_page_content%</pre></div>
-<div class="rw_edit_format"><h2>Formatierte Version</h2>%unedited_page_content%</div>
diff --git a/ruwiki/tags/release-0.6.2/templates/de/error.tmpl b/ruwiki/tags/release-0.6.2/templates/de/error.tmpl
deleted file mode 100644
index 0fdbf00..0000000
--- a/ruwiki/tags/release-0.6.2/templates/de/error.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class="rw_nav">%home_link%</div>
-<h1>%name%</h1>
-<p>Schicken Sie dem webmaster einen Report durch <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
-<p>%backtrace%</p>
diff --git a/ruwiki/tags/release-0.6.2/templates/de/ruwiki.css b/ruwiki/tags/release-0.6.2/templates/de/ruwiki.css
deleted file mode 100644
index 3e60491..0000000
--- a/ruwiki/tags/release-0.6.2/templates/de/ruwiki.css
+++ /dev/null
@@ -1,31 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #F2FFA7;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-pre { background-color: #FFFFA7; border: 1px solid black; }
-
-.rw_nav { background-color: #E9967A }
-.rw_edittext { border: 1px dotted blue }
-.rw_pagelink { }
-.rw_extlink { border: 1px solid red }
-.rw_projectxlink { }
-.rw_projectindex { }
-.rw_edit_form { }
-.rw_edit_raw {
- border: 2px solid green;
- float: left;
- max-width: 48%;
- overflow: scroll;
- clear: right;
-}
-.rw_edit_format {
- border: 2px solid blue;
- float: right;
- max-width: 48%;
- clear: none;
-}
diff --git a/ruwiki/tags/release-0.6.2/templates/de/save.tmpl b/ruwiki/tags/release-0.6.2/templates/de/save.tmpl
deleted file mode 100644
index 569c134..0000000
--- a/ruwiki/tags/release-0.6.2/templates/de/save.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-!INCLUDE!
-Gespeicherte Seite <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic%</a><hr />
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.6.2/templates/default/body.tmpl b/ruwiki/tags/release-0.6.2/templates/default/body.tmpl
deleted file mode 100644
index 413e2e5..0000000
--- a/ruwiki/tags/release-0.6.2/templates/default/body.tmpl
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhmtl1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=%encoding%" />
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.6.2/templates/default/content.tmpl b/ruwiki/tags/release-0.6.2/templates/default/content.tmpl
deleted file mode 100644
index f15bf2f..0000000
--- a/ruwiki/tags/release-0.6.2/templates/default/content.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-!INCLUDE!
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.6.2/templates/default/controls.tmpl b/ruwiki/tags/release-0.6.2/templates/default/controls.tmpl
deleted file mode 100644
index b02e8af..0000000
--- a/ruwiki/tags/release-0.6.2/templates/default/controls.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="rw_nav">
- %home_link% |
- Topic: <b>%page_topic%</b> Project: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a> |
- <a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">Edit</a>
-</div>
diff --git a/ruwiki/tags/release-0.6.2/templates/default/edit.tmpl b/ruwiki/tags/release-0.6.2/templates/default/edit.tmpl
deleted file mode 100644
index c40ca1c..0000000
--- a/ruwiki/tags/release-0.6.2/templates/default/edit.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="rw_nav">%home_link% | <i>Editing</i> Topic: <b>%page_topic%</b> Project: <b>%page_project%</b></div><br />
-
-<form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button accesskey="S" type="submit" name="action" value="save"><u>S</u>ave</button>
- <button accesskey="C" type="submit" name="action" value="cancel" /><u>C</u>ancel</button>
-</form>
-<div class="rw_edit_raw"><h2>Raw Original Value</h2><pre>%pre_page_content%</pre></div>
-<div class="rw_edit_format"><h2>Formatted Version</h2>%unedited_page_content%</div>
diff --git a/ruwiki/tags/release-0.6.2/templates/default/error.tmpl b/ruwiki/tags/release-0.6.2/templates/default/error.tmpl
deleted file mode 100644
index 7c91995..0000000
--- a/ruwiki/tags/release-0.6.2/templates/default/error.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class="rw_nav">%home_link%</div>
-<h1>%name%</h1>
-<p>Send the webmaster a report by <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
-<p>%backtrace%</p>
diff --git a/ruwiki/tags/release-0.6.2/templates/default/ruwiki.css b/ruwiki/tags/release-0.6.2/templates/default/ruwiki.css
deleted file mode 100644
index 3e60491..0000000
--- a/ruwiki/tags/release-0.6.2/templates/default/ruwiki.css
+++ /dev/null
@@ -1,31 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #F2FFA7;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-pre { background-color: #FFFFA7; border: 1px solid black; }
-
-.rw_nav { background-color: #E9967A }
-.rw_edittext { border: 1px dotted blue }
-.rw_pagelink { }
-.rw_extlink { border: 1px solid red }
-.rw_projectxlink { }
-.rw_projectindex { }
-.rw_edit_form { }
-.rw_edit_raw {
- border: 2px solid green;
- float: left;
- max-width: 48%;
- overflow: scroll;
- clear: right;
-}
-.rw_edit_format {
- border: 2px solid blue;
- float: right;
- max-width: 48%;
- clear: none;
-}
diff --git a/ruwiki/tags/release-0.6.2/templates/default/save.tmpl b/ruwiki/tags/release-0.6.2/templates/default/save.tmpl
deleted file mode 100644
index c1ede91..0000000
--- a/ruwiki/tags/release-0.6.2/templates/default/save.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-!INCLUDE!
-Saved page <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic%</a><hr />
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.6.2/templates/es/body.tmpl b/ruwiki/tags/release-0.6.2/templates/es/body.tmpl
deleted file mode 100644
index 6c039be..0000000
--- a/ruwiki/tags/release-0.6.2/templates/es/body.tmpl
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhmtl1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=%encoding%" />
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.6.2/templates/es/content.tmpl b/ruwiki/tags/release-0.6.2/templates/es/content.tmpl
deleted file mode 100644
index f15bf2f..0000000
--- a/ruwiki/tags/release-0.6.2/templates/es/content.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-!INCLUDE!
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.6.2/templates/es/controls.tmpl b/ruwiki/tags/release-0.6.2/templates/es/controls.tmpl
deleted file mode 100644
index 865aa5d..0000000
--- a/ruwiki/tags/release-0.6.2/templates/es/controls.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="rw_nav">
- %home_link% |
- Nodo: <b>%page_topic%</b> Proyecto: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a> |
- <a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">Edit</a>
-</div>
diff --git a/ruwiki/tags/release-0.6.2/templates/es/edit.tmpl b/ruwiki/tags/release-0.6.2/templates/es/edit.tmpl
deleted file mode 100644
index 747ffb3..0000000
--- a/ruwiki/tags/release-0.6.2/templates/es/edit.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="rw_nav">%home_link% | <i>Editando</i> Nodo: <b>%page_topic%</b> Proyecto: <b>%page_project%</b></div><br />
-
-<form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button accesskey="E" type="submit" name="action" value="save"><u>E</u>xcepto</button>
- <button accesskey="C" type="submit" name="action" value="cancel" /><u>C</u>ancelación</button>
-</form>
-<div class="rw_edit_raw"><h2>Valor Original Sin formato</h2><pre>%pre_page_content%</pre></div>
-<div class="rw_edit_format"><h2>Versión Ajustada a formato</h2>%unedited_page_content%</div>
diff --git a/ruwiki/tags/release-0.6.2/templates/es/error.tmpl b/ruwiki/tags/release-0.6.2/templates/es/error.tmpl
deleted file mode 100644
index 73084e9..0000000
--- a/ruwiki/tags/release-0.6.2/templates/es/error.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class="rw_nav">%home_link%</div>
-<h1>%name%</h1>
-<p>Envíe el webmaster un informe por el <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
-<p>%backtrace%</p>
diff --git a/ruwiki/tags/release-0.6.2/templates/es/ruwiki.css b/ruwiki/tags/release-0.6.2/templates/es/ruwiki.css
deleted file mode 100644
index 3e60491..0000000
--- a/ruwiki/tags/release-0.6.2/templates/es/ruwiki.css
+++ /dev/null
@@ -1,31 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #F2FFA7;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-pre { background-color: #FFFFA7; border: 1px solid black; }
-
-.rw_nav { background-color: #E9967A }
-.rw_edittext { border: 1px dotted blue }
-.rw_pagelink { }
-.rw_extlink { border: 1px solid red }
-.rw_projectxlink { }
-.rw_projectindex { }
-.rw_edit_form { }
-.rw_edit_raw {
- border: 2px solid green;
- float: left;
- max-width: 48%;
- overflow: scroll;
- clear: right;
-}
-.rw_edit_format {
- border: 2px solid blue;
- float: right;
- max-width: 48%;
- clear: none;
-}
diff --git a/ruwiki/tags/release-0.6.2/templates/es/save.tmpl b/ruwiki/tags/release-0.6.2/templates/es/save.tmpl
deleted file mode 100644
index ff4d91b..0000000
--- a/ruwiki/tags/release-0.6.2/templates/es/save.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-!INCLUDE!
-Página ahorrada <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic%</a><hr />
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.6.2/tests/harness.rb b/ruwiki/tags/release-0.6.2/tests/harness.rb
deleted file mode 100644
index 2cc233e..0000000
--- a/ruwiki/tags/release-0.6.2/tests/harness.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-$LOAD_PATH.unshift("../lib")
-
-ENV["REQUEST_METHOD"] = "HEAD"
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_options[:flatfiles][:data_path] = "../data"
-$wiki.config.template_path = "../templates/"
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.storage_options[:flatfiles][:extension] = nil
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.6.2/tests/tc_tokens.rb b/ruwiki/tags/release-0.6.2/tests/tc_tokens.rb
deleted file mode 100644
index 10ea60c..0000000
--- a/ruwiki/tags/release-0.6.2/tests/tc_tokens.rb
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.1
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-require 'test/unit'
-require 'harness'
-
-class TokenTestCases < Test::Unit::TestCase
- def setup
- @project = "Default"
- @tokens = []
- end
-
- def __tokenize(content, token)
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, @project, $wiki.backend, $wiki.request.script_url)
- @tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{@tokens.size - 1}"
- else
- "TOKEN_#{@tokens.size - 1}"
- end
- end
- content
- end
-
- def __replace(content)
- replaced = []
- s = true
- loop do
- break if replaced.size >= @tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].restore
- end
-
- s = content.gsub!(/TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].replace
- end
- end
- content
- end
-
- def __post_replace(content)
- 3.times do
- @tokens.reverse_each { |token| token.post_replace(content) }
- end
- content
- end
-
- def __process(token, content, tokenized, replaced, result)
- assert_equal(tokenized, content = __tokenize(content, token))
- assert_equal(replaced, content = __replace(content))
- assert_equal(result, content = __post_replace(content))
- end
-
- def __display(token, content)
- p tokenized = __tokenize(content.dup, token)
- p replaced = __replace(tokenized.dup)
- p result = __post_replace(replaced.dup)
- end
-
- def test_Paragraph
- token = Ruwiki::Wiki::Paragraph
- content = "\nABC\n\nabc\n"
- tkv = "TOKEN_0\nABC\nTOKEN_1\nabc\n"
- rpv = "<p>\nABC\n<p>\nabc\n"
- res = "<p>ABC</p><p>abc</p>"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Code
- content = " line 1\n line 2\nline3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_0\nTOKEN_1\nline3\n"
- rpv = "<pre> line 1</pre>\n<pre> line 2</pre>\nline3\n"
- res = "<pre> line 1\n line 2</pre>\nline3\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NumberedLinks
- token = Ruwiki::Wiki::NumberedLinks
- content = "[http://www.ruby-lang.org] \\[http://www.rubyforge.org]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
- res = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NamedLinks
- token = Ruwiki::Wiki::NamedLinks
- content = "[http://www.ruby-lang.org Ruby] \\[http://www.rubyforge.org RubyForge]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
- res = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ExternalLinks
- token = Ruwiki::Wiki::ExternalLinks
- content = "http://www.ruby-lang.org \\http://www.rubyforge.org"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
- res = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_HRule
- token = Ruwiki::Wiki::HRule
- content = "----\n\\----"
- tkv = "TOKEN_0\n\\TOKEN_1"
- rpv = "<hr />\n----"
- res = "<hr />\n----"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLink
- token = Ruwiki::Wiki::ProjectCrossLink
- content = "Ruwiki::ChangeLog \\Ruwiki::To_Do Ruwiki::NotExist \\Ruwiki::NotExist"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rw_edittext">Ruwiki::NotExist</span><a class="rw_pagelink" href="http://:/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
- res = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rw_edittext">Ruwiki::NotExist</span><a class="rw_pagelink" href="http://:/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLinkWikipedia
- token = Ruwiki::Wiki::ProjectCrossLinkWikipedia
- content = "Ruwiki::[[ChangeLog]] \\Ruwiki::[[To_Do]] Ruwiki::[[Does Not Exist]] \\Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 Ruwiki::[[_invalid]]"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rw_edittext">Ruwiki::Does Not Exist</span><a class="rw_pagelink" href="http://:/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
- res = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rw_edittext">Ruwiki::Does Not Exist</span><a class="rw_pagelink" href="http://:/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectIndex
- token = Ruwiki::Wiki::ProjectIndex
- content = "::Ruwiki \\::Ruwiki ::Newproject \\::Newproject"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rw_edittext">Newproject</span><a class="rw_pagelink" href="http://:/Newproject/_create">?</a> ::Newproject}
- res = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rw_edittext">Newproject</span><a class="rw_pagelink" href="http://:/Newproject/_create">?</a> ::Newproject}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikiLinks
- token = Ruwiki::Wiki::WikiLinks
- content = "ProjectIndex \\ProjectIndex AustinZiegler \\AustinZiegler Alan_Chen \\Alan_Chen"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rw_edittext">AustinZiegler</span><a class="rw_pagelink" href="http://:/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rw_edittext">Alan Chen</span><a class="rw_pagelink" href="http://:/Default/Alan_Chen/_edit">?</a> Alan_Chen}
- res = %Q{<a class="rw_pagelink" href="http://:/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rw_edittext">AustinZiegler</span><a class="rw_pagelink" href="http://:/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rw_edittext">Alan Chen</span><a class="rw_pagelink" href="http://:/Default/Alan_Chen/_edit">?</a> Alan_Chen}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikipediaLinks
- token = Ruwiki::Wiki::WikipediaLinks
- content = "[[ProjectIndex]] \\[[ProjectIndex]] [[Austin Ziegler]] \\[[Austin Ziegler]] [[_Alan Chen]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 [[_Alan Chen]]"
- rpv = %Q{<a class=\"rw_pagelink\" href=\"http://:/Default/ProjectIndex\">ProjectIndex</a> [[ProjectIndex]] <span class=\"rw_edittext\">Austin Ziegler</span><a class=\"rw_pagelink\" href=\"http://:/Default/Austin+Ziegler/_edit\">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
- res = %Q{<a class=\"rw_pagelink\" href=\"http://:/Default/ProjectIndex\">ProjectIndex</a> [[ProjectIndex]] <span class=\"rw_edittext\">Austin Ziegler</span><a class=\"rw_pagelink\" href=\"http://:/Default/Austin+Ziegler/_edit\">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Abbreviations
- token = Ruwiki::Wiki::Abbreviations
- content = "@{PM}\n@{}\n\\@{PM}"
- tkv = "TOKEN_0\nTOKEN_1\n\\TOKEN_2"
- rpv = "PocoMail\n<dl><dt>PM</dt><dd>PocoMail</dd></dl>\n@{PM}"
- res = "PocoMail\n<dl><dt>PM</dt><dd>PocoMail</dd></dl>\n@{PM}"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Headings
- token = Ruwiki::Wiki::Headings
- content = "= header 1\n== header 2\n=== header 3\n==== header 4\n===== header 5\n====== header 6\n======= header 7->6\n\\== noheader 2\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\nTOKEN_6\n\\TOKEN_7\n"
- rpv = "<h1>header 1</h1>\n<h2>header 2</h2>\n<h3>header 3</h3>\n<h4>header 4</h4>\n<h5>header 5</h5>\n<h6>header 6</h6>\n<h6>header 7->6</h6>\n== noheader 2\n"
- res = "<h1>header 1</h1>\n<h2>header 2</h2>\n<h3>header 3</h3>\n<h4>header 4</h4>\n<h5>header 5</h5>\n<h6>header 6</h6>\n<h6>header 7->6</h6>\n== noheader 2\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Lists
- content = "* level 1\n** level 2\n*** level 3\n* level 1, item 2\n\\* not an item\n"
- content << "# level 1\n## level 2\n### level 3\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\nTOKEN_5\nTOKEN_6\nTOKEN_7\nTOKEN_8\n\\TOKEN_9\n"
- rpv = "<ul><li>level 1</li></ul>\n<ul><li><ul><li>level 2</li></ul></li></ul>\n<ul><li><ul><li><ul><li>level 3</li></ul></li></ul></li></ul>\n<ul><li>level 1, item 2</li></ul>\n* not an item\n<ol><li>level 1</li></ol>\n<ol><li><ol><li>level 2</li></ol></li></ol>\n<ol><li><ol><li><ol><li>level 3</li></ol></li></ol></li></ol>\n<ol><li>level 1, item 2</li></ol>\n# not an item\n"
- res = "<ul><li>level 1</li><ul><li>level 2</li><ul><li>level 3</li></ul></ul><li>level 1, item 2</li></ul>\n* not an item\n<ol><li>level 1</li><ol><li>level 2</li><ol><li>level 3</li></ol></ol><li>level 1, item 2</li></ol>\n# not an item\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Blockquotes
- token = Ruwiki::Wiki::Blockquotes
- content = ": level 1\n:: level 2\n::: level 3\n: level 1, para 2\n\\: not a blockquote\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = "<blockquote>level 1</blockquote>\n<blockquote><blockquote>level 2</blockquote></blockquote>\n<blockquote><blockquote><blockquote>level 3</blockquote></blockquote></blockquote>\n<blockquote>level 1, para 2</blockquote>\n: not a blockquote\n"
- res = "<blockquote>level 1<blockquote>level 2<blockquote>level 3</blockquote></blockquote>level 1, para 2</blockquote>\n: not a blockquote\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Definitions
- content = "; word1 : val1\n;; word2 : val2\n;;; word3 : val3\n; word1/2 : val1/2\n\\; not-a-word : not-a-val\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = "<dl><dt>word1</dt><dd>val1</dd></dl>\n<dl><dl><dt>word2</dt><dd>val2</dd></dl></dl>\n<dl><dl><dl><dt>word3</dt><dd>val3</dd></dl></dl></dl>\n<dl><dt>word1/2</dt><dd>val1/2</dd></dl>\n; not-a-word : not-a-val\n"
- res = "<dl><dt>word1</dt><dd>val1</dd><dl><dt>word2</dt><dd>val2</dd><dl><dt>word3</dt><dd>val3</dd></dl></dl><dt>word1/2</dt><dd>val1/2</dd></dl>\n; not-a-word : not-a-val\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_RubyTalkLinks
- token = Ruwiki::Wiki::RubyTalkLinks
- content = "[ruby-talk:12345] \\[ruby-talk:12345]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = "<a class=\"rw_extlink\" href=\"http://www.ruby-talk.org/12345\">[ruby-talk:12345]</a> [ruby-talk:12345]"
- res = "<a class=\"rw_extlink\" href=\"http://www.ruby-talk.org/12345\">[ruby-talk:12345]</a> [ruby-talk:12345]"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_OtherRubyLinks
- token = Ruwiki::Wiki::OtherRubyLinks
- content = "[ruby-list:123] \\[ruby-list:123] [ruby-doc:123] \\[ruby-doc:123] [ruby-core:123] \\[ruby-core:123] [ruby-dev:123] \\[ruby-dev:123] [ruby-ext:123] \\[ruby-ext:123] [ruby-math:123] \\[ruby-math:123]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5 TOKEN_6 \\TOKEN_7 TOKEN_8 \\TOKEN_9 TOKEN_10 \\TOKEN_11"
- rpv = "<a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123\">[ruby-list:123]</a> [ruby-list:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123\">[ruby-doc:123]</a> [ruby-doc:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123\">[ruby-core:123]</a> [ruby-core:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123\">[ruby-dev:123]</a> [ruby-dev:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123\">[ruby-ext:123]</a> [ruby-ext:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123\">[ruby-math:123]</a> [ruby-math:123]"
- res = "<a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123\">[ruby-list:123]</a> [ruby-list:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123\">[ruby-doc:123]</a> [ruby-doc:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123\">[ruby-core:123]</a> [ruby-core:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123\">[ruby-dev:123]</a> [ruby-dev:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123\">[ruby-ext:123]</a> [ruby-ext:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123\">[ruby-math:123]</a> [ruby-math:123]"
-
- __process(token, content, tkv, rpv, res)
- end
-end
diff --git a/ruwiki/tags/release-0.6/Default/ProjectIndex b/ruwiki/tags/release-0.6/Default/ProjectIndex
deleted file mode 100644
index f25bc36..0000000
--- a/ruwiki/tags/release-0.6/Default/ProjectIndex
+++ /dev/null
@@ -1,17 +0,0 @@
-id: 0
-topic: ProjectIndex
-version: 0
-#EHDR
-= Ruwiki
-Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI and
-WEBrick interfaces, templates, and CSS formatting. Additionally, it supports project namespaces, so that two pages can be named the same for differing projects without
-colliding or having to resort to odd naming conventions. Please see ::Ruwiki for
-more information.
-
-The current version is 0.6.
-
-Projects:
-* ::Default
-* ::Ruwiki
-
-Please go to ::Ruwiki if you are unfamiliar with the concept of Wikis in general. If you want to play with \WikiFormatting, use the Ruwiki::SandBox.
diff --git a/ruwiki/tags/release-0.6/README b/ruwiki/tags/release-0.6/README
deleted file mode 100644
index 696d2dd..0000000
--- a/ruwiki/tags/release-0.6/README
+++ /dev/null
@@ -1,48 +0,0 @@
-Ruwiki 0.6.0
-------------
-Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI and
-WEBrick interfaces, templates, and CSS formatting. Additionally, it supports
-project namespaces, so that two pages can be named the same for differing
-projects without colliding or having to resort to odd naming conventions.
-Please see ::Ruwiki in the running Wiki for more information.
-
-Quick Install (CGI)
--------------------
-1. Place the Ruwiki directory in a place that your webserver can execute CGI
- programs. Ensure that ruwiki.cgi is executable on your webserver. You may
- wish to protect templates/, data/, and lib/ from casual access.
-2. Modify the following lines in ruwiki.cgi:
- wiki.config.webmaster = ...
- wiki.config.title = ...
-3. Point your web browser to the appropriate URL.
-
-Quick Install (WEBrick)
------------------------
-1. Modify the following lines in ruwiki_servlet.rb:
- $config.webmaster = ...
- $config.title = ...
-2. Run ruwiki_servlet.rb to start a WEBrick instance on localhost:8808 with
- ruwiki bound to the root path (e.g., http://localhost:8808/).
-3. Point your web browser to the appropriate URL.
-
-Use
----
-Ruwiki is able to be called with one of several URI forms:
-
- http://domain.com/ruwiki.cgi?PageName
- http://domain.com/ruwiki.cgi?PageName&project=Project
- http://domain.com/ruwiki.cgi/PageName
- http://domain.com/ruwiki.cgi/Project/
- http://domain.com/ruwiki.cgi/Project/PageName
-
-Copyright: Copyright © 2003 - 2003, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-* This software includes algorithm/diff by Lars Christensen, available for
- download from the RAA at: http://raa.ruby-lang.org/list.rhtml?name=diff
-* This software includes template.rb from Dave Thomas's rdoc system, available
- for download from SourceForge: http://rdoc.sourceforge.net
-
-$Id$
diff --git a/ruwiki/tags/release-0.6/Ruwiki/BugTracking b/ruwiki/tags/release-0.6/Ruwiki/BugTracking
deleted file mode 100644
index 6c3a337..0000000
--- a/ruwiki/tags/release-0.6/Ruwiki/BugTracking
+++ /dev/null
@@ -1,17 +0,0 @@
-id: 0
-topic: BugTracking
-version: 1
-#EHDR
-= Ruwiki 0.6.0 Bug Tracking
-This page is for tracking bugs in the Ruwiki project. Because of the extensive
-nature of the changes between Ruwiki 0.3.0 and Ruwiki 0.5.0 (and 0.6.0), the
-previously listed bugs have been erased.
-
-You may also be interested in the Ruwiki::To_Do list.
-
-----
-== Closed Bugs
-
-----
-== Open Bugs
-* Not all formatting is applied consistently. The token rankings may need adjusting.
diff --git a/ruwiki/tags/release-0.6/Ruwiki/ChangeLog b/ruwiki/tags/release-0.6/Ruwiki/ChangeLog
deleted file mode 100644
index 8bb604b..0000000
--- a/ruwiki/tags/release-0.6/Ruwiki/ChangeLog
+++ /dev/null
@@ -1,23 +0,0 @@
-id: 0
-version: 1
-topic: ChangeLog
-#EHDR
-= Ruwiki 0.6.0 ChangeLog
-Uncompleted to-do items can be found in To_Do. Bugs in Ruwiki are tracked in
-BugTracking.
-
-== Version 0.6.0
-* Added Ruby mailing list support (e.g., \[ruby-talk:12345]).
-* Reorganised the code (again) to better support alternative frontends. Based, in part, on [http://sourceforge.net/projects/rdoc-wiki RDoc Wiki] by Dave Thomas.
-* Added a [http://www.webrick.org WEBrick] servlet interface. Based, in part, on the WEBrick servlet interface provided with RDoc Wiki by Chad Fowler.
-* Added templates, using the [http://rdoc.sourceforge.net RDoc] template.rb library.
-* Changed the default topic to be \ProjectIndex instead of \DefaultProject.
-* Added a new \WikiWord format, \Wiki_Word_with_Spaces.
-* Completed lots of Ruwiki documentation.
-* Updated the save page.
-* Fixed a problem with the linking of project specific pages.
-
-== Version 0.5.0
-* Reorganized the code significantly to be easier to edit and extend.
-* Added abbreviation capabilities.
-* Cleaned up a lot of tokenizing code.
diff --git a/ruwiki/tags/release-0.6/Ruwiki/Configuring_Ruwiki b/ruwiki/tags/release-0.6/Ruwiki/Configuring_Ruwiki
deleted file mode 100644
index 0bd93e1..0000000
--- a/ruwiki/tags/release-0.6/Ruwiki/Configuring_Ruwiki
+++ /dev/null
@@ -1,161 +0,0 @@
-id: 0
-topic: Configuring_Ruwiki
-version: 1
-#EHDR
-= Configuring Ruwiki 0.6.0
-Ruwiki is configured similarly for both CGI and WEBrick modes. The biggest
-distinction is that because the Wiki is created after WEBrick server is
-created (during the dispatch to the servlet), it is necessary to configure the
-wiki with a global \Ruwiki::Config object, <i>$config</i>. Thus, in the
-examples below, replace <i>wiki.config</i> with <i>$config</i> where
-necessary.
-
-== wiki.config Options
-
-=== wiki.config.title
-This configuration option names the Wiki, by default this is <tt>Ruwiki</tt>.
-This affects the display of the home link and the &lt;title&gt; element of
-pages.
-
-=== wiki.config.webmaster
-The email address for the webmaster. This is used in generating error reports
-that can be emailed to the wiki's webmaster.
-
-=== wiki.config.default_page, wiki.config.default_project
-These options indicate what will happen when the wiki's URL is specified
-without any parameters (the default page in the default project is opened),
-when a topic is specified without a project (the topic is opened in the
-default project), and when a project is specified without a topic (the default
-page is opened in the project).
-
-=== wiki.config.storage_type
-This specifies the back-end storage mechanism as a Ruby Symbol. Currently,
-only <tt>:flatfiles</tt> is implemented. See Extending_Ruwiki for more
-information.
-
-=== wiki.config.data_path, wiki.config.template_path
-These specify the paths where Wiki data and templates will be found. The
-process running the Wiki must have read/write acccess to the data_path and
-read access to the template_path.
-
-=== wiki.config.template_set, wiki.config.css
-These two options indicate which template set will be used. Only one template
-set is provided in the release package, "default". The only CSS file used
-initially is "ruwiki.css". Templates work such that they will be found in
-<i>template_path</i>/<i>template_set</i>. All CSS files are loaded from the
-template set directory and emitted as part of the output stream.
-
-: The bad news is that this means that the CSS never caches on the client side
-: as it would if it were a separate file. However, because the templates may
-: not be in a web-accessible directory, this is necessary.
-
-== Templates
-Templating is done with the RDoc template.rb library, included in the
-distribution of Ruwiki. The templating library allows for nested templates,
-and this is used extensively in Ruwiki. This library is documented in
-RuwikiTemplatingLibrary.
-
-There are four major templates: content, edit, save, and error. Each of these
-has a slightly different combination of template files used, and this means
-that there are different sets of variables available.
-
-The major templates are combined templates that are defined as follows:
-; content : body.tmpl, content.tmpl, controls.tmpl
-; edit : body.tmpl, edit.tmpl
-; save : body.tmpl, save.tmpl, controls.tmpl
-; error : body.tmpl, error.tmpl
-
-=== body.tmpl
-The body template knows two template keys (<tt>%wiki_title%</tt> and
-<tt>%css_link%</tt>) and includes one other template. The values for
-%wiki_title% key differs depending on context, but no other key should be
-used or expected in the body template.
-
- <html>
- <head>
- <title>%wiki_title%</title>
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
- </html>
-
-=== content.tmpl
-The content template knows one template key (<tt>%content%</tt>) and includes
-one other template. (This may change moving forward so that there's a footer
-as well as a control header.)
-
- !INCLUDE!
- <!-- topic content -->
- %content%
- <!-- topic content -->
-
-=== controls.tmpl
-The controls template offers a navigation bar. It knows four template keys:
-; %cgi_url% : The URL to the wiki, suitable for building further links from.
-; %home_link% : The root topic of the wiki.
-; %page_project% : The project for the current page topic.
-; %page_topic% : The topic of the current page.
-
- <div class="rw_nav">
- %home_link% |
- Topic: <b>%page_topic%</b> Project: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a> |
- <a href="%cgi_url%?action=edit&amp;project=%page_project%&amp;%page_topic%">Edit</a>
- </div>
-
-=== edit.tmpl
-The edit template is the most complex template with the most keys. Of
-necessity, it provides a restricted form of the navigation bar, the edit form,
-the raw body of the page, and the formatted body of the page.
-
-; %cgi_url% : The URL to the wiki, suitable for building further links from.
-; %home_link% : The root topic of the wiki.
-; %orig_page% : The unedited original page encoded as Base64.
-; %page_content% : The editable page content.
-; %page_old_version% : The old version number of the page.
-; %page_project% : The project for the current page topic being edited.
-; %page_topic% : The topic of the current page being edited.
-; %page_version% : The new version number of the page.
-; %pre_page_content% : The unedited original page content for display in a &lt;pre&gt; tagset.
-; %unedited_page_content% : The formatted unedited orignal page content.
-
- <div class="rw_nav">%home_link% | <i>Editing</i> Topic: <b>%page_topic%</b> Project: <b>%page_project%</b></div><br />
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <input type="submit" name="action" value="Save" />
- <input type="submit" name="action" value="Cancel" />
- </form>
- <div class="rw_edit_raw"><h2>Raw Original Value</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2>Formatted Version</h2>%unedited_page_content%</div>
-
-=== save.tmpl
-An alternative content page for use when a page is saved after editing. This
-knows <tt>%page_project%</tt>, <tt>%page_tolink%</tt> (used to link directly
-to the page), and <tt>%content%</tt>.
-
- !INCLUDE!
- Saved page %page_project%::%page_tolink%<hr />
- <!-- topic content -->
- %content%
- <!-- topic content -->
-
-=== error.tmpl
-This template is used for reporting errors to the user and offering an
-opportunity to the user to send a report to the wiki webmaster.
-
-; %backtrace% : The error backtrace.
-; %backtrace_email% : The error backtrace in a format suitable for email.
-; %home_link% : The root topic of the wiki.
-; %name% : The name of the error.
-; %webmaster% : The email address of the wiki webmaster.
-
- <div class="rw_nav">%home_link%</div>
- <h1>%name%</h1>
- <p>Send the webmaster a report by <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
- <p>%backtrace%</p>
diff --git a/ruwiki/tags/release-0.6/Ruwiki/Extending_Ruwiki b/ruwiki/tags/release-0.6/Ruwiki/Extending_Ruwiki
deleted file mode 100644
index 8c1a57d..0000000
--- a/ruwiki/tags/release-0.6/Ruwiki/Extending_Ruwiki
+++ /dev/null
@@ -1,171 +0,0 @@
-id: 0
-topic: Extending_Ruwiki
-version: 1
-#EHDR
-= Extending Ruwiki 0.6.0
-
-Ruwiki is relatively easily extended to support new features. There are two
-primary ways in which Ruwiki can be extended by the end user: markup and
-backends.
-
-== Extending Ruwiki Markup
-
-Ruwiki's WikiMarkup can be extended by creating a new Ruwiki::Wiki::Token.
-Tokens will be automatically loaded if they are placed in
-<i>ruwiki/wiki/tokens</i>.
-
-The
-following Ruwiki::Wiki::Token class will convert strings in the forms of
-\[ruby-talk:12345] to links.
-
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
-=== Required Methods
-==== ::regexp
-
-Ruwiki tokens are matched only through regular expression matches. As shown in
-the example above, the regular expression for ruby-talk mailing list posts is
-<tt>%r{\[ruby-talk:(\d+)\]}</tt>. The purpose of the ::regexp method is to
-return the regexp for matching.
-
-For most inline matches, Ruwiki will ensure that the escape character (\)
-works automatically. For whole-line matches, it is necessary to match the
-escape character manually and provide a #restore method.
-
-As an example, the HRule class implements these methods.
-
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
-It may also be necessary to match escapes manually on inline matches that must
-be along word boundaries where the regular expression includes characters that
-normally match word boundaries. The project index match (e.g., \::Ruwiki)
-regular expression does this <tt>%r{(\B|\\)::([A-Z][a-z]+)}</tt>.
-
-==== #replace
-
-This returns the formatted token. In the \RubyTalkLinks class above, the
-matched regular expression will be replaced with a hyperlink. The text of the
-hyperlink will be the matched text; the target of the hyperlink will include
-the first captured value.
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
-
-=== Optional Methods
-==== ::rank
-
-By default, a token will be processed in the order created. Tokens may be
-given a specific rank to ensure that they are processed in a particular order.
-The default rank is <tt>9999</tt>.
-
-==== #restore
-
-Restores the token without replacement. Implements the results of the escape
-character. Each Token class is responsible for its own restoration. As noted
-in #regexp, whole-line tokens are most likely to need a #restore
-implementation.
-
-==== #post_replace
-
-Performs any necessary massaging of the data. The Lists token uses this to
-ensure that lists are collapsed together; the Paragraph token uses this to
-ensure that there are no empty paragraph tag pairs (&lt;p&gt;&lt;/p&gt;).
-
-== Extending Ruwiki Backends
-
-Ruwiki can support varying backends, as the backend interface has been
-abstracted completely from the data store. The backend <b>must</b>:
-
-# reside in <i>ruwiki/backends/</i> as <i>backend_name</i>.rb.
-# be registered by adding the <i>backend_name</i> as a symbol (e.g., :<i>backend_name</i>) to Ruwiki::Backend::BACKENDS.
-# inherit from Ruwiki::Backend.
-# exist as Ruwiki::Backend::<i>\Backend_name</i>.
-
-=== Required Methods
-==== #initialize(ruwiki)
-
-The backend may only obtain its configuration information from the provided
-ruwiki instance (through Ruwiki#config) and must set @ruwiki (this can be
-achieved by calling <tt>super ruwiki</tt>).
-
-==== #load(topic, project)
-
-The backend will be provided the name of the topic and project and must return
-the selected page as an array, one row per line. If the backend you have
-chosen returns the page as a single text block, it will be necessary to do a
-String#split("\n") on it.
-
-==== #save(page)
-
-This method must store the provided page in the backend. Note that the return
-value of the Page#rawtext method must be stored. This method may call
-Backend#make_diff to generate the differences hash.
-
- diff = {
- 'old_version' => page.old_version,
- 'new_version' => page.version,
- 'change_date' => Time.now,
- 'change_ip' => page.change_ip,
- 'change_id' => page.change_id,
- 'diff' => Diff.diff(oldpage, newpage)
- }
-
-==== #obtain_lock(page)
-
-Obtains an exclusive lock on the page. The lock should have a ten minute (600
-second) timeout and permit access from the same IP address without
-restriction. This should <b>not</b> be a filesystem lock.
-
-==== #release_lock(page)
-
-Releases the exclusive lock on the page. The lock should not be released
-unless the IP address on the lock is the same or the lock has expired (600
-seconds).
-
-==== #project_exists?(project)
-
-Returns <tt>true</tt> if the project exists.
-
-==== #page_exists?(topic, project = 'Default')
-Returns <tt>true</tt> if the page exists within the specified project.
-
-=== Optional Methods
-
-Note that these methods are currently optional (they are not yet called from
-Ruwiki), but will become required moving forward as the functions are
-implemented in Ruwiki.
-
-==== #destroy(page)
-
-Removes the page from the wiki. This should <b>not</b> remove the change
-history of the topic (in the event that the page has been removed
-maliciously). There will be a separate method to remove the page history.
-
-==== #create_project(project)
-
-Attempts to create the project.
-
-==== #destroy_project(project)
-
-Attempts to destroy the project.
diff --git a/ruwiki/tags/release-0.6/Ruwiki/LicenseAndAuthorInfo b/ruwiki/tags/release-0.6/Ruwiki/LicenseAndAuthorInfo
deleted file mode 100644
index 8cfb9fc..0000000
--- a/ruwiki/tags/release-0.6/Ruwiki/LicenseAndAuthorInfo
+++ /dev/null
@@ -1,21 +0,0 @@
-id: 0
-topic: LicenseAndAuthorInfo
-version: 1
-#EHDR
-Ruwiki is copyright © 2002 - 2003 [mailto:alan@digikata.com Alan Chen] and
-[mailto:ruwiki@halostatue.ca Austin Ziegler].
-
-Ruwiki is provided free of use and without any warranty express or implied. You may use,
-distribute, or modify Ruwiki under the conditions of Ruby's licence or the
-[http://www.gnu.org/copyleft/gpl.html GNU General Public Licence].
-
-* Ruwiki includes algorithm/diff by Lars Christensen, available for download from the RAA at: http://raa.ruby-lang.org/list.rhtml?name=diff
-* Ruwiki includes template.rb from Dave Thomas's RDoc system, available for download from SourceForge: http://rdoc.sourceforge.net
-
-Austin has also released several other projects available on the RAA that you
-may be interested in:
-* [http://raa.ruby-lang.org/list.rhtml?name=mime-types MIME::Types]
-* [http://raa.ruby-lang.org/list.rhtml?name=pdf-writer PDF::Writer]
-* [http://raa.ruby-lang.org/list.rhtml?name=text-format Text::Format]
-* [http://raa.ruby-lang.org/list.rhtml?name=trans-simple Transaction::Simple]
-* [http://raa.ruby-lang.org/list.rhtml?name=uninheritable Uninheritable]
diff --git a/ruwiki/tags/release-0.6/Ruwiki/ProjectIndex b/ruwiki/tags/release-0.6/Ruwiki/ProjectIndex
deleted file mode 100644
index 2d02ecf..0000000
--- a/ruwiki/tags/release-0.6/Ruwiki/ProjectIndex
+++ /dev/null
@@ -1,28 +0,0 @@
-id: 0
-topic: ProjectIndex
-version: 1
-#EHDR
-= Ruwiki 0.6.0
-This is the \ProjectIndex page for Ruwiki. For any given project, the
-\ProjectIndex topic will be the default topic for plain project links. As of
-Ruwiki 0.6.0, \ProjectIndex it is also the standard default page (not
-\DefaultPage).
-----
-== Features and Information
-* This wiki supports a variety of WikiFeatures that you may be interested in. The rules for WikiMarkup are similar to some other wikis, but there are a few unique markup capabilities in Ruwiki.
-* Configuring_Ruwiki is simple.
-* Extending_Ruwiki is almost as simple.
-* Who wrote Ruwiki? Look at the LicenseAndAuthorInfo.
-
-== Tracking Ruwiki Development
-The development progress of Ruwiki is kept in the wiki itself.
-* The BugTracking page in Ruwiki keeps track of open and closed bugs in Ruwiki.
-* The To_Do list keeps track of major development goals for Ruwiki.
-----
-== Different Features?
-If this wiki doesn't have the right combination of features, (or if it just
-doesn't feel right) try these other Ruby-based Wikis:
-
-* Amrita Wiki - http://www.walrus-ruby.org/amrita/cgi-bin/aswiki/aswiki.cgi
-* RWiki - http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=top
-* \MiniRubyWiki - http://www.xpsd.com/MiniRubyWiki
diff --git a/ruwiki/tags/release-0.6/Ruwiki/RuwikiTemplatingLibrary b/ruwiki/tags/release-0.6/Ruwiki/RuwikiTemplatingLibrary
deleted file mode 100644
index 14506d9..0000000
--- a/ruwiki/tags/release-0.6/Ruwiki/RuwikiTemplatingLibrary
+++ /dev/null
@@ -1,5 +0,0 @@
-id: 0
-topic: RuwikiTemplatingLibrary
-version: 1
-#EHDR
-s
diff --git a/ruwiki/tags/release-0.6/Ruwiki/SandBox b/ruwiki/tags/release-0.6/Ruwiki/SandBox
deleted file mode 100644
index 21e6a36..0000000
--- a/ruwiki/tags/release-0.6/Ruwiki/SandBox
+++ /dev/null
@@ -1,5 +0,0 @@
-id: 0
-topic: SandBox
-version: 1
-#EHDR
-This page is intended for users to play with freely to practice their \WikiFormatting.
diff --git a/ruwiki/tags/release-0.6/Ruwiki/To_Do b/ruwiki/tags/release-0.6/Ruwiki/To_Do
deleted file mode 100644
index 9f8c0f9..0000000
--- a/ruwiki/tags/release-0.6/Ruwiki/To_Do
+++ /dev/null
@@ -1,37 +0,0 @@
-id: 0
-topic: To_Do
-version: 1
-#EHDR
-= Ruwiki 0.6.0 To Do Tracking
-Completed to-do items can be found in the ChangeLog. Bugs in Ruwiki are
-tracked in BugTracking.
-
-== Well-Defined To Do Items
-; Topic renaming : add the ability to rename a topic within a project. Topic change history should be maintained.
-; Topic moving : add the ability to move and/or rename a topic between projects. Topic change history should be maintained.
-; Preview button : add a preview button to the save page.
-; Complete documentation : Complete the documentation of Ruwiki.
-; Versioning : complete the change history. Change history is currently stored in a file <i>topic</i>.rdiff. There is no way to display the change history at this point.
-; Escape HTML Entities : HTML Entities such as &amp;, &lt;, and &gt; are not currently escaped. This may cause problems with some browsers and should be fixed <b>without</b> impairing the ability to add at least some raw HTML. Note that the current engine does not check raw HTML and thus could potentially be vulnerable to cross-site-scripting attacks.
-
-== General To Do Items
-; Alternative templating systems : not as high priority now that there's a real templating system in place.
-; In-project topic search : searches for mentions of the topic in the other topics for the project.
-; Project topic listing : provide a special link (perhaps Project::Project) that displays the list of topics known to that project.
-; Project listing : provide a special link (perhaps ::*) that displays the list of known projects.
-; Project/topic security : allow certain projects to be restricted/authenticated for read/write based on user.
-; Track last <i>n</i> links/topics : ?
-; Write a markup debugger : ?
-; Validate topic formatting from cgi : ?
-; Validate project from cgi : ?
-; Project-based backend : Allow different projects to have different backends.
-; Hierachical project namespaces : ?
-
-== Future To Do Items
-; E-mail gateway : accept topic appends via e-mail.
-; alternative backends : access other wiki data storage, or other formats, e.g. e-mail boxes in mh or mbox formats
-; backend-to-backend storage format conversion : as noted
-; bug tracker backend : with alternate markup
-; add setup and user config methods : for backend plugin classes, then we can use them with an interactive or gui tool frontend to setup data storage backends. The user might have to run as root or other user with database create permissions.
-; add id="" to various markup elements (make id specific to topic) : Later we can allow users to tweak a page using uploaded css fragments which might get appended onto the standard css contents.
-; ruby action : upload a ruby code fragment to add a smart "action" to that wiki page. Need some sort of security + approval system to handle this safely.
diff --git a/ruwiki/tags/release-0.6/Ruwiki/WikiFeatures b/ruwiki/tags/release-0.6/Ruwiki/WikiFeatures
deleted file mode 100644
index 162c436..0000000
--- a/ruwiki/tags/release-0.6/Ruwiki/WikiFeatures
+++ /dev/null
@@ -1,13 +0,0 @@
-id: 0
-version: 1
-topic: WikiFeatures
-#EHDR
-Ruwiki is a [http://www.ruby-lang.org Ruby]-based wiki. It is ideal for
-personal or small team use.
-
-Ruwiki:
-* Uses the [http://www.ruby-lang.org Ruby] language.
-* Runs quickly and easily as a CGI or WEBrick servlet.
-* Uses a simple templating system and CSS for presentation.
-* Has flatfile storage with simple versioning.
-* Offers project namespaces. Different projects can have the same topic names and not collide. Thus, \Default::ReadMe and \Project::ReadMe are two different pages.
diff --git a/ruwiki/tags/release-0.6/Ruwiki/WikiMarkup b/ruwiki/tags/release-0.6/Ruwiki/WikiMarkup
deleted file mode 100644
index a9ddb49..0000000
--- a/ruwiki/tags/release-0.6/Ruwiki/WikiMarkup
+++ /dev/null
@@ -1,179 +0,0 @@
-id: 0
-topic: WikiMarkup
-version: 3
-#EHDR
-= Wiki Markup
-A [http://c2.com/cgi/wiki Wiki] obeys certain formatting rules to make it easy
-to format text without needing to know HTML. This Wiki obeys the following
-rules by default. Because Ruwiki is extensible, there may be additional
-formatting rules.
-
-== \WikiWords, \WikiProjects, Links, and Images
-While reading stuff on this Wiki, you will see some words mashed together with
-capitalisation (like \WikiWords). While this may seem odd at first, this
-feature allows internal links to be created across the Wiki.
-
-There are two allowable forms for \WikiWords. The first form has two or more words
-concatenated; each word must begin with a capital letter and be followed by
-one or more lowercase letters. Thus, \FooBar is a valid \WikiWord, while
-CPlusPlus is not. The second form has two or more words separated by
-underscores. This would make \Wiki_Phrases a valid \WikiWord. \WikiWords that
-are separated by underscores will be shown separated with spaces instead of
-underscores. That is, \Wiki_Phrases will be displayed as "Wiki Phrases".
-\WikiWords match the following regular expression:
-
- %r{\b([A-Z][a-z]+([A-Z][a-z]+|_[A-Z]?[a-z]+)+)\b}
-
-If a \WikiWord is found that does not have a page defining the \WikiWord, then
-the word will be shown with a hyperlink question mark following it, allowing
-the \WikiWord to be created.
-
-=== \WikiProjects
-This Wiki supports "projects." Within each project, a given \WikiWord is
-unique. Thus, if you have a Default project and a Ruwiki project, you can have
-two pages called \ReadMe. Any given \WikiWord refers only to topics within its
-project. That is, if I have \WikiWord in the \ReadMe topic of the Default
-project, it will refer to the \WikiWord topic of the Default project. (Another
-term for this capability is "namespaces.")
-
-A cross-project link is composed of the project's name, two colons (::), and
-the \WikiWord desired. Thus, from \Default::ReadMe, I can have \Ruwiki::ReadMe
-as a link. The project index can be referred to with \::Project. This is the
-same as doing \Project::ProjectIndex. Thus, \::Ruwiki becomes ::Ruwiki, which
-is the same as \Ruwiki::ProjectIndex (Ruwiki::ProjectIndex).
-
-=== External Links and Resources
-URLs to external resources are automatically detected for web addresses, FTP
-addresses, newsgroups, and email links. They are automatically converted to
-clickable URLs.
-
-* \http://www.ruby-lang.org becomes http://www.ruby-lang.org
-
-URLs may be named with the [url name] syntax. If the name is omitted, the URL will be numbered.
-
-* \[http://www.rubygarden.org RubyGarden] becomes [http://www.rubygarden.org RubyGarden].
-* \[http://www.halostatue.ca] and \[http://www.halostatue.ca/ruby] become [http://www.halostatue.ca] and [http://www.halostatue.ca/ruby].
-
-=== Images
-If URLs are to JPEG (.jpg, .jpeg), PNG (.png), or GIF (.gif) resources, they will be rendered as inline images. This works with automatically converted URLs, named URLs, or numbered URLs. Named and numbered URLs affect the TITLE and ALT attribute of the image.
-
-* \http://www.halostatue.ca/graphics/maple_leaf.gif http://www.halostatue.ca/graphics/maple_leaf.gif
-* \[http://www.halostatue.ca/graphics/maple_leaf.gif Maple Leaf] [http://www.halostatue.ca/graphics/maple_leaf.gif Maple Leaf]
-* \[http://www.halostatue.ca/graphics/maple_leaf.gif] [http://www.halostatue.ca/graphics/maple_leaf.gif]
-
-=== Ruby Mailing Lists
-If a Ruby mailing list message tag is provided, it will be converted appropriately.
-
-* \[ruby-talk:12345] will become [ruby-talk:12345]
-* \[ruby-core:12345] will become [ruby-core:12345]
-* \[ruby-doc:12345] will become [ruby-doc:12345]
-
-== Headings and Lists
-=== Headings
-Use equals signs (=) for headings. Up to six equals signs can be used for HTML
-headings 1 - 6.
-
-\===== Heading five<br />
-\====== Heading six
-
-===== Heading five
-====== Heading six
-
-=== Lists
-==== Bulleted Lists
-Use asterisks (*) to create bulleted lists. More asterisks means more levels.
-
-\* level 1<br />
-\** level 2<br />
-\*** level 3
-
-* level 1
-** level 2
-*** level 3
-==== Numbered Lists
-Use hash marks (#) for numbered lists. More hash marks means deeper levels.
-
-\# level 1<br />
-\## level 2<br />
-\### level 3<br />
-\# level 1.2
-
-# level 1
-## level 2
-### level 3
-# level 1.2
-==== Definition Lists
-Definitions can be created similar to other lists. Unlike "standard" lists,
-though, definition lists have both the term and the definition. They are
-specified like so. As with other lists, repeating the first item (;) will
-increase the indentation level.
-
-\; term : definition<br />
-\;; term2 : definition<br />
-\;;; term3 : definition
-
-; term : definition
-;; term2 : definition
-;;; term3 : definition
-== Paragraph Formatting
-=== Rules
-Four or more dashes ("----") on a line by itself makes a horizontal rule, like
-so:
-
-\----
-----
-=== Paragraphs
-A blank line (it may have whitespace on it) marks a new paragraph. All other
-lines are joined together (excepting headers, lists, and rules).
-
-This line is a new paragraph.
-=== Block Indent Paragraphs
-Paragraphs can be indented by beginning the paragraph with one or more colons
-(:).
-
-\: Indent Level 1<br />
-\:: Indent Level 2<br />
-\::: Indent Level 3
-
-: Indent Level 1
-:: Indent Level 2
-::: Indent Level 3
-=== Code
-Text that is indented will be presented as formatted in a monospaced font. The
-only change is to escape HTML entities &lt; (<), &gt; (>), and &amp; (&).
-
- def replace
- content = @match[1]
- %Q{<pre>#{content}</pre>}
- end
-
-== Miscellaneous Formatting
-=== HTML
-The Ruwiki engine passes through HTML without changes. Thus,
-&lt;b&gt;bold&lt;/b&gt; would be shown as <b>bold</b>. <b><i>Note:</i></b>
-This capability could be very dangerous as it could expose the Wiki to
-cross-site scripting (XSS) vulnerabilities. This will be remedied prior to the
-1.0 release of Ruwiki.
-
-=== Abbreviations
-Certain abbreviations may be known to the Wiki. While there is not yet any way
-for a user to query what abbreviations are known, if the abbreviations are
-told to the users, they may be used. Abbreviations are presented with @{key},
-where <i>key</i> is the abbreviation desired. This Wiki, for example, knows
-that \@{PM} means @{PM}. The special form \@{} will produce the current list
-of known abbreviations. Unknown abbreviations will simply be put back into the
-data stream unchanged. Thus, \@{unknownkey} results in @{unknownkey}.
-
-==== Known Abbreviations
-@{}
-
-=== Preventing Formatting
-If you wish to prevent a word or sequence from being interpreted, put a
-backslash (\) in front of it. This works on all formatting options except
-paragraph positioning. Thus, if I want to prevent a \WikiWord from being
-turned into a hyperlink, I need to backslash it: \\WikiWord.
-
-=== Other Possible Considerations
-I'm looking at adding styles similar to what is shown on the Wiki below.
-
-* http://www.pmichaud.com/wiki/PmWiki/WikiStyles
diff --git a/ruwiki/tags/release-0.6/lib/algorithm/diff.rb b/ruwiki/tags/release-0.6/lib/algorithm/diff.rb
deleted file mode 100644
index af36214..0000000
--- a/ruwiki/tags/release-0.6/lib/algorithm/diff.rb
+++ /dev/null
@@ -1,220 +0,0 @@
-#
-# algorith/diff - a Ruby module to compute difference sets between two
-# objects. Copyright (c) 2001-2002 Lars Christensen.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
-
-module Diff
-
- VERSION = 0.4
-
- attr_reader :diffs
-
- def Diff.lcs(a, b)
- astart = 0
- bstart = 0
- afinish = a.length-1
- bfinish = b.length-1
- mvector = []
-
- # First we prune off any common elements at the beginning
- while (astart <= afinish && bstart <= afinish && a[astart] == b[bstart])
- mvector[astart] = bstart
- astart += 1
- bstart += 1
- end
-
- # now the end
- while (astart <= afinish && bstart <= bfinish && a[afinish] == b[bfinish])
- mvector[afinish] = bfinish
- afinish -= 1
- bfinish -= 1
- end
-
- bmatches = b.reverse_hash(bstart..bfinish)
- thresh = []
- links = []
-
- (astart..afinish).each { |aindex|
- aelem = a[aindex]
- next unless bmatches.has_key? aelem
- k = nil
- bmatches[aelem].reverse_each { |bindex|
- if k && (thresh[k] > bindex) && (thresh[k-1] < bindex)
- thresh[k] = bindex
- else
- k = thresh.replacenextlarger(bindex, k)
- end
- links[k] = [ k!=0 && links[k-1], aindex, bindex ] if k
- }
- }
-
- if !thresh.empty?
- link = links[thresh.length-1]
- while link
- mvector[link[1]] = link[2]
- link = link[0]
- end
- end
-
- return mvector
- end
-
- def Diff.makediff(a, b)
- mvector = Diff.lcs(a, b)
- ai = bi = 0
- while ai < mvector.length
- bline = mvector[ai]
- if bline
- while bi < bline
- yield :+, bi, b[bi]
- bi += 1
- end
- bi += 1
- else
- yield :-, ai, a[ai]
- end
- ai += 1
- end
- while ai < a.length
- yield :-, ai, a[ai]
- ai += 1
- end
- while bi < b.length
- yield :+, bi, b[bi]
- bi += 1
- end
- 1
- end
-
- def Diff.diff(a, b, &block)
- isstring = b.kind_of? String
- diffs = []
-
- block ||= proc { |action, index, element|
- prev = diffs[-1]
- if prev && prev[0] == action &&
- prev[1] + prev[2].length == index
- prev[2] << element
- else
- diffs.push [ action, index, isstring ? element.chr : [element] ]
- end
- }
-
- Diff.makediff(a, b, &block)
-
- return diffs
- end
-
-end
-
-module Diffable
- def diff(b)
- Diff.diff(self, b)
- end
-
- # Create a hash that maps elements of the array to arrays of indices
- # where the elements are found.
-
- def reverse_hash(range = (0...self.length))
- revmap = {}
- range.each { |i|
- elem = self[i]
- if revmap.has_key? elem
- revmap[elem].push i
- else
- revmap[elem] = [i]
- end
- }
- return revmap
- end
-
- # Replace the first element which is larger than value. Assumes that
- # the element indexed by high, if given is larger than value.
-
- def replacenextlarger(value, high = nil)
- high ||= length
- low = 0
- index = found = nil
- while low < high
- index = (high+low) >> 1
- found = self[index]
- if value > found # this first, most common case
- low = index + 1
- elsif value == found
- return nil
- else
- high = index
- end
- end
- self[low] = value
- return low
- end
-
- # Patches self with the given set of differences.
-
- def patch(diffs)
- newary = nil
- kindofstring = kind_of? String
- if kindofstring
- newary = self.class.new('')
- else
- newary = self.class.new
- end
- ai = 0
- bi = 0
- diffs.each { |action,position,elements|
- case action
- when :-
- while ai < position
- newary << self[ai]
- ai += 1
- bi += 1
- end
- ai += elements.length
- when :+
- while bi < position
- newary << self[ai]
- ai += 1
- bi += 1
- end
- if kindofstring
- newary << elements
- else
- newary.push *elements
- end
- bi += elements.length
- else
- raise "Unknown diff action"
- end
- }
- while ai < self.length
- newary << self[ai]
- ai += 1
- bi += 1
- end
- return newary
- end
-end
-
-class Array
- include Diffable
-end
-
-class String
- include Diffable
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki.rb b/ruwiki/tags/release-0.6/lib/ruwiki.rb
deleted file mode 100644
index 91d9566..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki.rb
+++ /dev/null
@@ -1,263 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-require 'ruwiki/handler'
-require 'ruwiki/template'
-require 'ruwiki/config'
-require 'ruwiki/backend'
-require 'ruwiki/wiki'
-require 'ruwiki/page'
-require 'ruwiki/abbreviations'
-
- # = Ruwiki
- # Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI
- # and WEBrick interfaces, templates, and CSS formatting. Additionally, it
- # supports project namespaces, so that two pages can be named the same for
- # differing projects without colliding or having to resort to odd naming
- # conventions. Please see ::Ruwiki in the running Wiki for more information.
- #
- # == Quick Install (CGI)
- # 1. Place the Ruwiki directory in a place that your webserver can execute
- # CGI programs. Ensure that ruwiki.cgi is executable on your webserver.
- # You may wish to protect templates/, data/, and lib/ from casual access.
- # 2. Modify the following lines in ruwiki.cgi:
- # wiki.config.webmaster = ...
- # wiki.config.title = ...
- # 3. Point your web browser to the appropriate URL.
- #
- # == Quick Install (WEBrick)
- # 1. Modify the following lines in ruwiki_servlet.rb:
- # $config.webmaster = ...
- # $config.title = ...
- # 2. Run ruwiki_servlet.rb to start a WEBrick instance on localhost:8808 with
- # ruwiki bound to the root path (e.g., http://localhost:8808/).
- # 3. Point your web browser to the appropriate URL.
- #
- # == Use
- # Ruwiki is able to be called with one of several URI forms:
- #
- # http://domain.com/ruwiki.cgi?PageName
- # http://domain.com/ruwiki.cgi?PageName&project=Project
- # http://domain.com/ruwiki.cgi/PageName
- # http://domain.com/ruwiki.cgi/Project/
- # http://domain.com/ruwiki.cgi/Project/PageName
- #
- # Copyright:: Copyright © 2003 - 2003, Digikata and HaloStatue, Ltd.
- # Authors:: Alan Chen (alan@digikata.com)
- # Austin Ziegler (ruwiki@halostatue.ca)
- # Licence:: Ruby's
-class Ruwiki
- VERSION = '0.6.0.0'
-
- ALLOWED_ACTIONS = ['edit', 'save', 'cancel']
- POST_VARS = ['newpage', 'pagename', 'project']
- RESERVED = ['action', ALLOWED_ACTIONS, POST_VARS].flatten
-
- # Returns the known abbreviations.
- attr_accessor :abbr
- # Returns the current configuration object.
- attr_reader :config
- # Returns the current Response object.
- attr_reader :response
- # Returns the current Request object.
- attr_reader :request
- # Returns the current Markup object.
- attr_reader :markup
- # Returns the current Backend object.
- attr_reader :backend
-
- # Sets the configuration object to a new configuration object.
- def config=(c)
- raise "Configuration must be of class Ruwiki::Config." unless c.kind_of?(Ruwiki::Config)
- @config = c
- end
-
- # Initializes Ruwiki.
- def initialize(handler)
- @request = handler.request
- @response = handler.response
-
- @config = Ruwiki::Config.new
- @abbr = Ruwiki::ABBREVIATIONS
- @request = request
- @response = response
- @path_info = @request.determine_request_path
-
- @type = nil
- @error = {}
-
- @markup = Ruwiki::Wiki.new(self)
- end
-
- # Initializes the backend for Ruwiki.
- def set_backend
- @backend = Backend[@config.storage_type, self]
- end
-
- # Runs the steps to process the wiki.
- def run
- @config.verify
- set_backend
- set_page
- process_page
- render
- rescue Exception => e
- render(:error, e)
- ensure
- output
- end
-
- # Initializes current page for Ruwiki.
- def set_page
- if @path_info.nil? or @path_info.empty? or @path_info == "/"
- @request.each_parameter do |key, val|
- next if RESERVED.include?(key)
- @page_name = key
- end
- @project_name = @request.parameters['project']
- @project_name ||= @config.default_project
- @page_name ||= @config.default_page
- else
- pi = @path_info.split("/", -1)
- case pi.size
- when 1
- @page_name = @config.default_page
- @project_name = @config.default_project
- when 2
- if pi[1].nil? or pi[1].empty?
- @page_name = @config.default_page
- else
- @page_name = pi[1]
- end
- @project_name = @config.default_project
- else
- if pi[2].nil? or pi[2].empty?
- @page_name = @config.default_page
- @project_name = pi[1]
- else
- @page_name = pi[2]
- @project_name = pi[1]
- end
- end
- end
- end
-
- # Processes the page through the necessary steps. This is where the edit,
- # save, cancel, and display actions are present.
- def process_page
- content = nil
- @page = @backend.retrieve(@page_name, @project_name)
- @type = :content
-
- if @request.parameters['action']
- case @request.parameters['action'].downcase.intern
- when :edit
- @backend.obtain_lock(@page)
- content = nil
- @type = :edit
- when :save
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.content = @request.parameters['newpage']
- @page.old_version = @request.parameters['old_version'].to_i + 1
- @page.version = @request.parameters['version'].to_i + 1
-
- content = @page.to_html
- @backend.store(@page)
- @backend.release_lock(@page)
- @type = :save
- when :cancel
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.content = @request.parameters['origpage'].unpack("m*")[0]
- @page.old_version = @request.parameters['old_version'].to_i
- @page.version = @request.parameters['version'].to_i
- content = @page.to_html
- @backend.release_lock(@page)
- end
- else
- content = @page.to_html
- end
- rescue Exception => e
- @type = :error
- if e.kind_of?(Ruwiki::Backend::BackendError)
- @error[:name] = "Error: #{e.to_s}"
- else
- @error[:name] = "Complete and Utter Failure: #{e.to_s}"
- end
- @error[:backtrace] = e.backtrace.join
- content = nil
- ensure
- @content = content
- end
-
- # Renders the page.
- def render(*args)
- if args.empty?
- type = @type
- error = @error
- else
- raise ArgumentError, "#render must be called with zero or two arguments." unless args.size == 2
- type = args[0]
- error = {}
- error[:name] = args[1].inspect.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;')
- error[:backtrace] = args[1].backtrace.join("<br />\n")
- end
-
- @rendered_page = ""
- values = { "css_link" => @config.css_link,
- "home_link" => %Q(<a href="#{@request.script_url}">#{@config.title}</a>) }
-
- case type
- when :content, :save
- values["wiki_title"] = "Error - #{@config.title}" if @page.nil?
- values["wiki_title"] ||= "#{@page.project}::#{@page.topic} - #{@config.title}"
- values["page_tolink"] = @page.to_link
- values["page_topic"] = @page.topic
- values["page_project"] = @page.project
- values["cgi_url"] = @request.script_url
- values["content"] = @content
- if type == :content
- template = TemplatePage.new(@config.template(:body), @config.template(:content), @config.template(:controls))
- else
- template = TemplatePage.new(@config.template(:body), @config.template(:save), @config.template(:controls))
- end
- when :edit
- template = TemplatePage.new(@config.template(:body), @config.template(:edit))
- values["wiki_title"] = "Editing: #{@page.project}::#{@page.topic} - #{@config.title}"
- values["page_topic"] = @page.topic
- values["page_project"] = @page.project
- values["cgi_url"] = @request.script_url
- values["page_content"] = @page.content
- values["orig_page"] = [@page.content].pack("m*")
- values["page_old_version"] = @page.old_version.to_s
- values["page_version"] = @page.version.to_s
- values["unedited_page_content"] = @page.to_html
- values["pre_page_content"] = CGI.escapeHTML(@page.content)
- when :error
- template = TemplatePage.new(@config.template(:body), @config.template(:error))
- values["wiki_title"] = "Error - #{@config.title}"
- values["name"] = error[:name]
- values["backtrace"] = error[:backtrace]
- values["backtrace_email"] = error[:backtrace].gsub(/<br \/>/, '')
- values["webmaster"] = @config.webmaster
- end
-
- template.write_html_on(@rendered_page, values)
- end
-
- # Outputs the page.
- def output
- @response.add_header("Content-type", "text/html")
- @response.write_headers
- @response << @rendered_page
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/abbreviations.rb b/ruwiki/tags/release-0.6/lib/ruwiki/abbreviations.rb
deleted file mode 100644
index b57acac..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/abbreviations.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Default abbreviations
- ABBREVIATIONS = {
- "PM" => "PocoMail"
- }
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/backend.rb b/ruwiki/tags/release-0.6/lib/ruwiki/backend.rb
deleted file mode 100644
index 35ba201..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/backend.rb
+++ /dev/null
@@ -1,126 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'algorithm/diff'
-
-class Ruwiki
- # The Ruwiki backend abstract class and factory.
- class Backend
- BACKENDS = [:flatfiles] # :postgresql, :mysql, :odbc]
-
- STORE_ERROR = "No access to store topic.<br />\nThis is probably a RuWiki configuration error."
-
- class ProjectExists < StandardError #:nodoc:
- end
- class BackendError < StandardError #:nodoc:
- end
-
- # The default initializer for backend classes.
- def initialize(ruwiki)
- @ruwiki = ruwiki
- end
-
- # The Backend Factory. Requires and initializes the backend requested.
- def self.[](backend, ruwiki)
- raise RuntimeError, "Unknown Backend #{backend}" unless BACKENDS.include?(backend)
- befile = backend.to_s
- beconst = befile.capitalize
-
- require "ruwiki/backend/#{befile}"
-
- be = eval("Ruwiki::Backend::#{beconst}")
- be.new(ruwiki)
- end
-
- # Retrieve the specified topic and project page. Calls Backend#load
- # after verifying that the project exists.
- def retrieve(topic, project = 'Default')
- unless page_exists?(topic, project)
- if project_exists?(project)
- return Ruwiki::Page.new(@ruwiki,
- :content => "",
- :topic => topic,
- :project => project)
- else
- return Ruwiki::Page.new(@ruwiki,
- :content => "Project #{project} doesn't exist",
- :topic => topic,
- :project => project)
- end
- end
-
- buffer = load(topic, project)
- Ruwiki::Page.new(@ruwiki,
- :rawtext => buffer.join(''),
- :project => project,
- :topic => topic)
- end
-
- # Creates the current diff object.
- def make_diff(page, oldpage, newpage)
- {
- 'old_version' => page.old_version,
- 'new_version' => page.version,
- 'change_date' => Time.now,
- 'change_ip' => page.change_ip,
- 'change_id' => page.change_id,
- 'diff' => Diff.diff(oldpage, newpage)
- }
- end
-
- # Stores the specified topic and project page. Calls Backend#save.
- def store(page)
- save(page)
- end
-
- # Destroies the specified topic and project page.
- def destroy(page)
- raise
- end
-
- # Releases the lock on the page.
- def release_lock(page)
- raise
- end
-
- # Attempts to obtain a lock on the page.
- def obtain_lock(page)
- raise
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- raise
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- raise
- end
-
- # Attempts to create the project.
- def create_project(project)
- raise
- end
-
- # Attempts to destroy the project.
- def destroy_project(project)
- raise
- end
-
- def load(topic, project) #:nodoc:
- raise
- end
-
- def save(page) #:nodoc
- raise
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/backend/flatfiles.rb b/ruwiki/tags/release-0.6/lib/ruwiki/backend/flatfiles.rb
deleted file mode 100644
index b8da32f..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/backend/flatfiles.rb
+++ /dev/null
@@ -1,175 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'algorithm/diff'
-
-class Ruwiki
- class Backend
- # Stores Ruwiki pages as flatfiles.
- class Flatfiles < Ruwiki::Backend
- # Initializes the flatfile backend.
- def initialize(ruwiki)
- ruwiki.config.data_path << "/" unless (ruwiki.config.data_path[-1] == ?/)
- raise Ruwiki::Backend::StandardError,
- "data directory #{ruwiki.config.data_path} does not exist." unless File.exists?(ruwiki.config.data_path)
- @data_path = ruwiki.config.data_path
- super ruwiki
- end
-
- # Loads the topic page from disk.
- def load(topic, project)
- pagefile = page_file(topic, project)
- buffer = File.readlines(pagefile)
- rescue Errno::EACCES
- raise Ruwiki::Backend::BackendError,
- "No access to retrieve the topic."
- rescue Exception => e
- raise Ruwiki::Backend::BackendError,
- "Cannot retrieve project [#{project}] topic [#{topic}] (file #{pf}): #{e}"
- end
-
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def save(page)
- pf = page_file(page.topic, page.project)
- cf = "#{pf}.rdiff"
-
- oldfile = File.readlines(pf) rescue []
- oldfile.collect! { |e| e.chomp }
- newfile = page.rawtext.split("\n")
-
- diff = make_diff(page, oldfile, newfile)
- diffs = []
- File.open(cf, 'rb') { |f| diffs = Marshal.load(f) } if File.exists?(cf)
- diffs << diff
- changes = Marshal.dump(diffs)
-
- File.open(cf, 'wb') { |cfh| cfh.print changes }
- File.open(pf, 'wb') { |pfh| pfh.puts page.rawtext }
- rescue Errno::EACCES
- raise BackendError, Ruwiki::Backend::STORE_ERROR
- rescue Exception => e
- raise BackendError, "Error storing page project [#{page.project}] topic [#{page.topic}]: #{e}<br />#{e.backtrace.join("<br />")}"
- end
-
- # Destroys the topic page.
- def destroy(page)
- pf = page_file(page.topic, page.project)
- File.unlink(pf) if File.exists?(pf)
- rescue Errno::EACCES
- raise BackendError, "No access to destroy topic."
- rescue Exception => e
- raise BackendError, "Unable to destroy project [#{project}] topic [#{topic}]: #{e}"
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- pd = project_directory(project)
- File.exists?(pd) and File.directory?(pd)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- pf = page_file(topic, project)
- project_exists?(project) and File.exists?(pf)
- end
-
- # Tries to create the project.
- def create_project(project)
- pd = project_directory(project)
- raise ProjectExists, "Project #{project} already exists." if File.exists?(pd)
- Dir.mkdir(pd)
- rescue Errno::EACCES
- raise BackendError, "No access to create project."
- rescue Exception => e
- raise BackendError, "Unable to create project [#{project}]: #{e}"
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- rescue Errno::EACCES
- raise BackendError, "No access to destroy project."
- rescue Exception => e
- raise BackendError, "Unable to destroy project [#{project}]: #{e}"
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page)
- lf = "#{page_file(page.topic, page.project)}.lock"
-
- lock_okay = false
- # See if we have the lock already.
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, we don't care how old it
- # is. Thus, release it.
- lock_okay ||= (data[0].chomp == @ruwiki.request.environment['REMOTE_ADDR'])
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= ((data[1].to_i + 600) < Time.now.to_i)
- else
- lock_okay = true
- end
-
- if lock_okay
- open(lf, 'w') { |lfh| lfh.puts "#{@ruwiki.request.environment['REMOTE_ADDR']}\n#{Time.now.to_i + 600}" }
- else
- raise BackendError, "Unable to obtain a lock on page project [#{page.project}] topic [#{page.topic}]. Try again in ten minutes."
- end
- rescue Errno::EACCES
- raise BackendError, "unable to create lock on page project [#{page.project}] topic [#{page.topic}]."
- rescue BackendError
- raise
- rescue Exception => e
- raise BackendError, "Error storing page project [#{page.project}] topic [#{page.topic}]: #{e}"
- end
-
- # Releases the lock on the topic page.
- def release_lock(page)
- lf = "#{page_file(page.topic, page.project)}.lock"
-
- lock_okay = false
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, then we can safely remove
- # it.
- lock_okay ||= (data[0].chomp == @ruwiki.request.environment['REMOTE_ADDR'])
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < Time.now.to_i)
- else
- lock_okay = true
- end
-
- if lock_okay
- File.unlink(lf) if File.exists?(lf)
- else
- raise BackendError, "Unable to release the lock on page project [#{page.project}] topic [#{page.topic}]. Try again in ten minutes."
- end
- rescue Errno::EACCES
- raise BackendError, "unable to create lock on page [#{page.project}] topic [#{page.topic}]."
- rescue BackendError
- raise
- rescue Exception => e
- raise BackendError, "Error storing page project [#{page.project}] topic [#{page.topic}]: #{e}"
- end
-
- private
- def project_directory(project)
- "#{@data_path}#{project}"
- end
-
- def page_file(topic, project = 'Default')
- "#{project_directory(project)}/#{topic}"
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/config.rb b/ruwiki/tags/release-0.6/lib/ruwiki/config.rb
deleted file mode 100644
index c2d66c4..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/config.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Ruwiki configuration.
- class Config
- TEMPLATES = [ :body, :content, :error, :edit, :controls, :save ]
-
- # Adds additional information to the (rare) error reports. Defaults to
- # +false+.
- attr_accessor :debug
- # The default page for display when Ruwiki is called without any
- # arguments. Defaults to +ProjectIndex+
- attr_accessor :default_page
- # The default project for display when Ruwiki is called without any
- # arguments or a project specification. Defaults to +Default+
- attr_accessor :default_project
- # The storage type as a Symbol. Corresponds to a filename that will be
- # found in ruwiki/backend. In this version of Ruwiki, only flatfiles.rb
- # (e.g., :flatfiles) is defined. Defaults to <tt>:flatfiles</tt>.
- attr_accessor :storage_type
- # The path for flatfile storage. Defaults to <tt>./data/</tt>.
- attr_accessor :data_path
- # The path for templates. Defaults to <tt>./templates/</tt>.
- attr_accessor :template_path
- # The name of the Wiki. Defaults to <tt>ruwiki</tt>
- attr_accessor :title
- # The email address of the webmaster for the Wiki. Defaults to +nil+.
- attr_accessor :webmaster
- # The name of the Ruwiki CSS file. Defaults to <tt>ruwiki.css</tt>.
- attr_accessor :css
- # The template set. Templates are always named as
- # <template_path>/<template_set>/<template_kind>.
- #Template filename. Must be reachable by File#read.
- attr_accessor :template_set
-
- # Returns the template string
- def template(kind = :body)
- raise ConfigError, "No template for #{kind.inspect} in template set #{@template_set}" unless TEMPLATES.include?(kind)
- File.read(File.join(@template_path, @template_set, "#{kind.to_s}.tmpl"))
- end
-
- # Returns the CSS stylesheet content for the Wiki. This previously
- # returned the <link> to the stylesheet, but instead returns a <style>
- # block in the head so that the CSS is kept with the template set, which
- # may be kept outside of the HTML area.
- def css_link
- %Q[<style>#{File.read(File.join(@template_path, @template_set, @css))}</style>]
- end
-
- # Creates a new configuration object.
- def initialize
- @debug = false
- @default_project = "Default"
- @default_page = "ProjectIndex"
- @storage_type = :flatfiles
- @data_path = "./data/"
- @template_path = "./templates/"
- @template_set = "default"
- @css = "ruwiki.css"
- @webmaster = nil
- @title = "Ruwiki"
- end
-
- # Verifies that required configuration options are actually set. Right
- # now, it only checks the values that are defaulted to +nil+.
- def verify
- raise ConfigError, "Configuration error: Webmaster is unset." if @webmaster.nil?
- end
-
- class ConfigError < StandardError #:nodoc:
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/handler.rb b/ruwiki/tags/release-0.6/lib/ruwiki/handler.rb
deleted file mode 100644
index 2bf24a5..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/handler.rb
+++ /dev/null
@@ -1,207 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Handler
- class << self
- # Generate a new Handler pair from a CGI request.
- def from_cgi(cgi, output_stream = $stdout)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::CGIRequest.new(cgi)
- o.response = Ruwiki::Handler::CGIResponse.new(cgi, output_stream)
- end
- end
-
- # Generate a new Handler pair from a WEBrick request.
- def from_webrick(req, res)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::WEBrickRequest.new(req)
- o.response = Ruwiki::Handler::WEBrickResponse.new(res)
- end
- end
- end
-
- # Returns the handler's request object.
- attr_accessor :request
- # Returns the handler's response object.
- attr_accessor :response
-
- # Creates the handler pair.
- def initialize(&block) #:yields: self
- @request = nil
- @response = nil
- yield self if block_given?
- end
-
- # REpresents an abstract incoming request. This insulates the rest of
- # the code from knowing whether parameters are passed as part of the
- # path, as parameters in the URL, or in some other fashion.
- class AbstractRequest
- def initialize(*args)
- end
- end
-
- # Handles all requests from web applications.
- #
- # Subclasses should provide:
- # @parameters:: Hash-like object that responds to #[] and #hash_key?]
- # @environment:: Hash-like object that responds to #[]
- class AbstractWebRequest < AbstractRequest
- # The parameters provided via the web request.
- attr_reader :parameters
- # The environment provided to the web request.
- attr_reader :environment
- # The request path.
- attr_reader :path
-
- # Yields each parameter key in succession.
- def each_parameter #:yields: key, value
- @parameters.each { |k, v| yield k, v }
- end
-
- def each_environment #:yields: key, value
- @environment.each { |k, v| yield k, v }
- end
-
- # Return the URL of our server.
- def server_url
- res = "http://" # should detect whether we're in secure server mode.
- if @environment['HTTP_HOST']
- res << @environment['HTTP_HOST']
- else
- res << "#{@environment['SERVER_NAME']}:#{@environment['SERVER_PORT']}"
- end
- end
-
- # Return the URL of this script.
- def script_url
- server_url << @environment['SCRIPT_NAME'].to_s
- end
-
- # Return the URL of this request.
- def request_url
- res = script_url
- res << @environment['PATH_INFO'] if @environment['PATH_INFO']
- query = @environment['QUERY_STRING']
- res << "?#{@environment['QUERY_STRING']}" if query && !query.empty?
- res
- end
-
- # Convert a file path into a URL
- def make_url(project, path)
- "#{server_url}/#{project}/#{path}"
- end
-
- def determine_request_path
- @path = ""
- return @path if @environment['PATH_INFO'].nil?
- @path = @environment['PATH_INFO'].dup
- end
- end
-
- # Request for CGI-based activity to ruwiki.
- class CGIRequest < AbstractWebRequest
- def initialize(cgi, output_stream = $stdout)
- @environment = ENV
- @cgi = cgi
- @parameters = {}
- cgi.params.each { |k, v| @parameters[k] = v[0] }
- super
- end
- end
-
- # Request for WEBrick based servlet activity to ruwiki.
- class WEBrickRequest < AbstractWebRequest
- def initialize(req)
- @environment = req.meta_vars
- @parameters = req.query
- super
- end
- end
-
- # Used to write responses in different execution environments such as
- # CGI and Webrick.
- #
- # If you want to create a new response object, you'll need to implement
- # #add_header, #write_headers, and #<<.
- #
- # The Response object is instantiated with an output stream which must
- # supply +<<+ and +puts+ methods.
- class AbstractResponse
- # Add to the list of headers to be sent back to the client.
- def add_header(key, value)
- raise "Not implemented"
- end
-
- # Write the accumulated headers back to the client.
- def write_headers
- raise "Not implemented"
- end
-
- # Write the string to the client.
- def <<(string)
- raise "Not implemented"
- end
-
- # output_stream must respond to #<< and #puts.
- def initialize(output_stream = $stdout)
- @headers = {}
- @output_stream = output_stream
- end
- end
-
- # CGIResponse is the response object for CGI mode.
- class CGIResponse < AbstractResponse
- # output_stream must respond to #<< and #puts.
- def initialize(cgi, output_stream = $stdout)
- @cgi = cgi
- super(output_stream)
- end
-
- # Add the header pair for later output as a CGI header.
- def add_header(key, value)
- @headers[key] = value
- end
-
- # Write the headers to the stream. The headers can only be written
- # once.
- def write_headers
- return if @written
- @headers.each { |key, value| @output_stream.puts "#{key}: #{value}\r\n" }
- @output_stream.puts
- @written = true
- end
-
- # Output the string to the stream provided.
- def <<(string)
- @output_stream << string
- end
- end
-
- # WEBrickResponse is the response object for WEBrick servlet mode.
- class WEBrickResponse < AbstractResponse
- def initialize(webrick_response)
- @response = webrick_response
- end
-
- def add_header(key,value)
- @response[key] = value
- end
-
- def write_headers
- # Webrick will take care of this on its own.
- end
-
- def <<(string)
- @response.body << string
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/markup.rb b/ruwiki/tags/release-0.6/lib/ruwiki/markup.rb
deleted file mode 100644
index c572d8e..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/markup.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/markup/meta'
-
-class Ruwiki
- # The abstract markup class. Probably unnecessary.
- class Markup
- # Creates the markup class.
- def initialize(ruwiki)
- @ruwiki = ruwiki
- end
-
- # Returns a topic/projec combination as a viewable link.
- def view_link(topic, project, content = nil)
- content = topic if content.nil?
- project = (project == @ruwiki.config.default_project) ? "" : "#{project}/"
- %Q{<a class="rw_pagelink" href="#{@ruwiki.request.script_url}/#{project}#{topic}">#{content.gsub(/_/, ' ')}</a>}
- end
-
- # Returns a topic/projec combination as an edit link.
- def edit_link(topic, project, content = nil)
- content = topic if content.nil?
- project = (project == @ruwiki.config.default_project) ? "" : "project=#{project}&amp;"
- %Q{<span class="rw_edittext">#{content.gsub(/_/, ' ')}</span><a class="rw_pagelink" href="#{@ruwiki.request.script_url}?action=edit&amp;#{project}#{topic}">?</a>}
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/markup/meta.rb b/ruwiki/tags/release-0.6/lib/ruwiki/markup/meta.rb
deleted file mode 100644
index 3438fcd..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/markup/meta.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Markup
- # Stores metadata generated during the parsing process.
- class Meta
- # links to external sites
- attr_reader :external
- # links to internal sites
- attr_reader :internal
-
- # Initializes the metadata object.
- def initialize(ruwiki)
- @ruwiki = ruwiki
- @internal = []
- @external = []
- end
-
- # Adds a link to the appropriate bucket in the metadata.
- def add_link(link, style = :internal)
- if style == :internal
- @internal << link unless @internal.include?(link)
- elsif style == :external
- @external << link unless @external.include?(link)
- end
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/page.rb b/ruwiki/tags/release-0.6/lib/ruwiki/page.rb
deleted file mode 100644
index 3b3d846..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/page.rb
+++ /dev/null
@@ -1,144 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # A generic page for Ruwiki.
- class Page
- # The page ID.
- attr_accessor :page_id
- # The current version of the page.
- attr_accessor :version
- # The previous version of the page.
- attr_accessor :old_version
- # The page topic (the name of the page).
- attr_accessor :topic
- # The project of the page.
- attr_accessor :project
- # Unformatted page text.
- attr_reader :content
- # Formatted page text.
- attr_accessor :formatted
-
- # The internal links known to the page.
- attr_accessor :internal
- # The external links known to the page.
- attr_accessor :external
-
- # The IP address of the person who made the last change.
- def change_ip
- %Q<#{@ruwiki.request.environment['REMOTE_HOST']} (#{@ruwiki.request.environment['REMOTE_ADDR']})>
- end
-
- # The ID, if present, of the person who made the last change. Not yet
- # implemented.
- def change_id
- nil
- end
-
- # Creates a Ruwiki page.
- def initialize(ruwiki, init = {})
- @ruwiki = ruwiki
- @internal = []
- @external = []
-
- @project = init[:project] || @ruwiki.config.default_project
- @topic = init[:topic] || "NewTopic"
- @content = init[:content] || ""
- @page_id = init[:page_id] || 0
- @version = init[:version] || 0
- @old_version = @version - 1
-
- if init.has_key?(:rawtext)
- @rawtext = init[:rawtext].dup
- @content = parse_header(@rawtext.dup)
- @formatted = parse_content(@content, @project)
- elsif not @content.empty?
- @formatted = parse_content(@content.dup, @project)
- else
- @formatted = ""
- end
- @content.gsub!(/\r/, "")
- end
-
- # The content of the page.
- def content=(content)
- @content = content.gsub(/\r/, "")
- @formatted = parse_content(content, @project)
- end
-
- # Output raw header and raw page context for saving.
- def rawtext
- return <<-EOS
-id: #{@page_id}
-topic: #{@topic}
-version: #{@version}
-#EHDR
-#{@content}
- EOS
- end
-
- # Outputs the HTML version of the page.
- def to_html
- @formatted
- end
-
- # Produces a link to the current page.
- def to_link(css_class = "rw_pagelink")
- css_class = %Q{class="#{css_class} "} unless css_class.nil?
- project = (@project == @ruwiki.config.default_project) ? "" : "#{@project}/"
- %Q{<a #{css_class}href="#{@ruwiki.request.script_url}/#{project}#{@topic}">#{@topic}</a>}
- end
-
- private
- HEADER_RE = /^([a-z]+)\s*:\s*(.*)$/
- HEADER_END_RE = /^#EHDR$/
-
- # Parse the header.
- def parse_header(rawtext)
- rawbuf = rawtext.split("\n")
-
- loop do
- break if rawbuf.nil? or rawbuf.empty?
-
- if rawbuf[0] =~ HEADER_END_RE
- rawbuf.shift
- break
- end
-
- match = HEADER_RE.match(rawbuf[0])
-
- if match
- case match[1].intern
- when :id
- @page_id = match[2].to_i
- when :topic
- @topic = match[2]
- when :version
- @version = match[2].to_i
- @old_version = @version - 1
- end
- rawbuf.shift
- end
- end
-
- rawbuf.join("\n")
- end
-
- # Parse the content.
- def parse_content(content, project)
- parsed, meta = @ruwiki.markup.parse(content, project)
-
- @internal = meta.internal
- @external = meta.external
-
- parsed
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/servlet.rb b/ruwiki/tags/release-0.6/lib/ruwiki/servlet.rb
deleted file mode 100644
index 3144b23..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/servlet.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'webrick'
-
-class Ruwiki
- class Servlet < WEBrick::HTTPServlet::AbstractServlet
- def initialize(config)
- @config = config
- end
-
- # Converts a POST into a GET.
- def do_POST(req, res)
- do_GET(req, res)
- end
-
- def do_GET(req, res)
- # Generate the reponse handlers for Ruwiki from the request and response
- # objects provided.
- wiki = Ruwiki.new(Ruwiki::Handler.from_webrick(req, res))
-
- # Configuration defaults to certain values. This overrides the defaults.
- wiki.config = $config unless $config.nil?
- wiki.run
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/template.rb b/ruwiki/tags/release-0.6/lib/ruwiki/template.rb
deleted file mode 100644
index a285eed..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/template.rb
+++ /dev/null
@@ -1,223 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file is originally from rdoc by Dave Thomas (dave@pragprog.com).
-#
-# $Id$
-#++
-class Ruwiki
- # RDoc's cheap-n-cheerful HTML page template system. You create a template
- # containing:
- #
- # * variable names between percent signs (<tt>%fred%</tt>)
- # * blocks of repeating stuff:
- # START:key
- # ... stuff
- # END:key
- #
- # You feed the code a hash. For simple variables, the values are resolved
- # directly from the hash. For blocks, the hash entry corresponding to +key+
- # will be an array of hashes. The block will be generated once for each
- # entry. Blocks can be nested arbitrarily deeply.
- #
- # The template may also contain:
- # IF:key
- # ... stuff
- # ENDIF:key
- #
- # _stuff_ will only be included in the output if the corresponding key is
- # set in the value hash.
- #
- # Usage: Given a set of templates <tt>T1, T2,</tt> etc
- # values = { "name" => "Dave", state => "TX" }
- # t = TemplatePage.new(T1, T2, T3)
- # File.open(name, "w") {|f| t.write_html_on(f, values)}
- # or
- # res = ''
- # t.write_html_on(res, values)
- #
- class TemplatePage
-
- # A context holds a stack of key/value pairs (like a symbol table). When
- # asked to resolve a key, it first searches the top of the stack, then
- # the next level, and so on until it finds a match (or runs out of
- # entries).
- class Context
- def initialize
- @stack = []
- end
-
- def push(hash)
- @stack.push(hash)
- end
-
- def pop
- @stack.pop
- end
-
- # Find a scalar value, throwing an exception if not found. This method
- # is used when substituting the %xxx% constructs
- def find_scalar(key)
- @stack.reverse_each do |level|
- if val = level[key]
- return val unless val.kind_of? Array
- end
- end
- raise "Template error: can't find variable '#{key}'"
- end
-
- # Lookup any key in the stack of hashes
- def lookup(key)
- @stack.reverse_each do |level|
- val = level[key]
- return val if val
- end
- nil
- end
- end
-
- # Simple class to read lines out of a string
- class LineReader
- # we're initialized with an array of lines
- def initialize(lines)
- @lines = lines
- end
-
- # read the next line
- def read
- @lines.shift
- end
-
- # Return a list of lines up to the line that matches a pattern. That
- # last line is discarded.
- def read_up_to(pattern)
- res = []
- while line = read
- if pattern.match(line)
- return LineReader.new(res)
- else
- res << line
- end
- end
- raise "Missing end tag in template: #{pattern.source}"
- end
-
- # Return a copy of ourselves that can be modified without affecting us
- def dup
- LineReader.new(@lines.dup)
- end
- end
-
- # +templates+ is an array of strings containing the templates. We start at
- # the first, and substitute in subsequent ones where the string
- # <tt>!INCLUDE!</tt> occurs. For example, we could have the overall page
- # template containing
- #
- # <html><body>
- # <h1>Master</h1>
- # !INCLUDE!
- # </bost></html>
- #
- # and substitute subpages in to it by passing [master, sub_page]. This
- # gives us a cheap way of framing pages
- def initialize(*templates)
- result = "!INCLUDE!"
- templates.each do |content|
- result.sub!(/!INCLUDE!/, content)
- end
- @lines = LineReader.new(result.split($/))
- end
-
- # Render the templates into HTML, storing the result on +op+ using the
- # method <tt><<</tt>. The <tt>value_hash</tt> contains key/value pairs
- # used to drive the substitution (as described above)
- def write_html_on(op, value_hash)
- @context = Context.new
- op << substitute_into(@lines, value_hash).tr("\000", '\\')
- end
-
- # Substitute a set of key/value pairs into the given template. Keys with
- # scalar values have them substituted directly into the page. Those with
- # array values invoke <tt>substitute_array</tt> (below), which examples a
- # block of the template once for each row in the array.
- #
- # This routine also copes with the <tt>IF:</tt>_key_ directive, removing
- # chunks of the template if the corresponding key does not appear in the
- # hash, and the START: directive, which loops its contents for each value
- # in an array
- def substitute_into(lines, values)
- @context.push(values)
- skip_to = nil
- result = []
-
- while line = lines.read
-
- case line
-
- when /^IF:(\w+)/
- lines.read_up_to(/^ENDIF:#$1/) unless @context.lookup($1)
-
- when /^IFNOT:(\w+)/
- lines.read_up_to(/^ENDIF:#$1/) if @context.lookup($1)
-
- when /^ENDIF:/
- ;
-
- when /^START:(\w+)/
- tag = $1
- body = lines.read_up_to(/^END:#{tag}/)
- inner_values = @context.lookup(tag)
- raise "unknown tag: #{tag}" unless inner_values
- raise "not array: #{tag}" unless inner_values.kind_of?(Array)
- inner_values.each do |vals|
- result << substitute_into(body.dup, vals)
- end
- else
- result << expand_line(line.dup)
- end
- end
-
- @context.pop
-
- result.join("\n")
- end
-
- # Given an individual line, we look for %xxx% constructs and
- # HREF:ref:name: constructs, substituting for each.
- def expand_line(line)
- # Generate a cross reference if a reference is given,
- # otherwise just fill in the name part
-
- line.gsub!(/HREF:(\w+?):(\w+?):/) do
- ref = @context.lookup($1)
- name = @context.find_scalar($2)
-
- if ref and !ref.kind_of?(Array)
- "<a href=\"#{ref}\">#{name}</a>"
- else
- name
- end
- end
-
- # Substitute in values for %xxx% constructs. This is made complex
- # because the replacement string may contain characters that are
- # meaningful to the regexp (like \1)
-
- line = line.gsub(/%([a-zA-Z]\w*)%/) do
- val = @context.find_scalar($1)
- val.tr('\\', "\000")
- end
-
- line
- rescue Exception => e
- $stderr.puts "Error in template: #{e}"
- $stderr.puts "Original line: #{line}"
- exit
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/wiki.rb b/ruwiki/tags/release-0.6/lib/ruwiki/wiki.rb
deleted file mode 100644
index e54d88c..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/wiki.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/markup'
-
-class Ruwiki
- # Ruwiki's Wiki markup class. This will convert the Wiki markup known by
- # Ruwiki (defined by Token classes). The algorithm is as follows:
- #
- # 1. For each known Token class, match each instance of it in the content
- # stream. Replace each instance in the content stream with a Token
- # marker: TOKEN_x or \TOKEN_x, where x is a digit representing the
- # Token. (\TOKEN_x is a special case of token matching. See
- # Ruwiki::Markup::Token for more information.) Store the Token for
- # later processing.
- # 2. Go back through the content, replacing each instance of \TOKEN_x
- # with the Token's defined restore value (which should be the same
- # value as was originally matched).
- # 3. Go through the content, replacing each instance of TOKEN_x with the
- # Token's defined replacement value.
- # 4. Go through the tokens, in reverse, and execute the post replacement
- # routine defined by the Token. (This may be necessary to collapse
- # consecutive HTML structures.)
- # 5. Return the parsed content and the collected metadata.
- #
- # == Tokens
- # Look at Ruwiki::Markup::Token describes how to create Token objects.
- class Wiki < Ruwiki::Markup
- def parse(content, project = nil)
- content = content.dup
- meta = Ruwiki::Markup::Meta.new(@ruwiki)
- tokens = []
- project ||= @ruwiki.config.default_project
-
- Token.tokenlist.each do |token|
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(@ruwiki, match, meta, project)
- tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{tokens.size - 1}"
- else
- "TOKEN_#{tokens.size - 1}"
- end
- end
- end
-
- replaced = []
- s = true
- loop do
- break if replaced.size >= tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].restore
- }
-
- s = content.gsub!(/TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].replace
- }
- end
-
- 3.times do
- tokens.reverse_each { |token| token.post_replace(content) }
- end
-
- [content, meta]
- end
- end
-end
-
-require 'ruwiki/wiki/tokens'
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens.rb b/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens.rb
deleted file mode 100644
index 189a8a3..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens.rb
+++ /dev/null
@@ -1,128 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # The base Token class. All Token classes must inherit from Token and
- # *must* implement the following methods:
- #
- # [self.regexp] The regular expression that the Token will be
- # replacing.
- # [replace] The mechanism for replacing the Token with the desired
- # results.
- #
- # Token classes <i>should</i> implement the following method:
- # [self.rank] Default: <tt>5000</tt>. Affects the sort order. Must
- # return an integer.
- #
- # Token classes <i>may</i> implement the following methods:
- # [restore] Restores the token without replacement. Implements the
- # results of the escape character. NOTE: each Token
- # class is responsible for its own restore. Tokens that
- # are anchored to the beginning of a line are the most
- # likely to need to reimplement this.
- # [post_replace] Performs any necessary massaging of the data. See the
- # implementation of Ruwiki::Wiki::Lists for more
- # information.
- class Token
- @@tokenlist = []
- @@sorted = false
-
- class << self
- # Tokens should define rank if they must be first or last in
- # processing. Otherwise, they are sorted in the order defined.
- def rank
- 5000
- end
-
- # The Wiki parsing routine uses Token.tokenlist to determine the
- # tokens that are processed, and the order in which they are
- # processed. See Token.rank for more information.
- def tokenlist
- unless @@sorted
- head = @@tokenlist.shift
- @@tokenlist.sort! { |a, b| a.rank <=> b.rank }
- @@tokenlist.unshift(head)
- sorted = true
- end
- @@tokenlist
- end
-
- def inherited(child_class) #:nodoc:
- @@tokenlist << Token if @@tokenlist.empty?
-
- # Make the child class post_replace a blank function because we
- # don't want to propogate the currently defined post_replace.
- # The current post_replace is specific to Token_Base only.
- class << child_class
- def post_replace(content)
- content
- end
- end
-
- @@tokenlist << child_class
- @@sorted = false
- end
-
- # The replacement regular expression.
- def regexp
- /TOKEN_(\d*)/
- end
- end
-
- # All Token classes must match this header signature if they define
- # #initialize.
- #
- # [ruwiki] The owner Ruwiki object.
- # [match] The MatchData object for this Token.
- # [meta] The metadata that may be stored by the Token.
- # [project] The project being processed.
- def initialize(ruwiki, match, meta, project = nil)
- @ruwiki = ruwiki
- @match = match
- @meta = meta
- @project = project || @ruwiki.config.default_project
- end
-
- # The replacement method. Uses @match to replace the token with the
- # appropriate values.
- def replace
- "TOKEN_#{@match[1]}"
- end
-
- # Restores the token without replacement. By default, replaces
- # "dangerous" HTML characters.
- def restore
- @match[0].gsub(/&/, "&amp;").gsub(/</, "&lt;").gsub(/>/, "&gt;")
- end
-
- # The content may need massaging after processing.
- def post_replace(content)
- content
- end
- end
- end
-end
-
- # Load the tokens from the ruwiki/wiki/tokens directory.
-tokens_dir = 'ruwiki/wiki/tokens'
-
-$LOAD_PATH.each do |path|
- target = "#{path}/#{tokens_dir}"
- if File.exists?(target) and File.directory?(target)
- Dir::glob("#{target}/*.rb") do |token|
- begin
- require token
- rescue LoadError
- nil
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/00default.rb b/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/00default.rb
deleted file mode 100644
index a6a6479..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/00default.rb
+++ /dev/null
@@ -1,239 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # The Paragraph Token class changes blank lines to <p> tags. This class,
- # under the current implementation, should be *first* in the Token list
- # after Token.
- class Paragraph < Ruwiki::Wiki::Token
- # This Token is #rank 0, because it should be first in the Token list.
- def self.rank
- 0
- end
-
- # Matches blank lines. %r{^\s*$}
- def self.regexp
- %r{^\s*$}
- end
-
- # Replaces with "<p>"
- def replace
- "<p>"
- end
-
- # Ensures that <p> won't be surrounded by <br> tags.
- def post_replace(content)
- content.gsub!(%r{(\n|<br ?/?>)?<p>(\n|<br ?/?>)?}, '<p>')
- content.gsub!(%r{<p>}, '</p><p>')
- content.gsub!(%r{</p>(</p>)+}, '</p>')
- content.gsub!(%r{<body></p>}, '<body>')
- content.gsub!(%r{</body>}, '</p></body>')
- content.gsub!(%r{<p></p>}, '')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
-
- # The Code Token class converts indented text to "unformatted" (<pre>)
- # text. This class should be *second* in the Token list.
- class Code < Ruwiki::Wiki::Token
- # This Token is #rank 1, because it should be second in the Token list.
- def self.rank
- 1
- end
-
- # Matches indented text. %r{^(\s+\S.*)$}
- def self.regexp
- %r{^(\s+\S.*)$}
- end
-
- # Replaces the text to <pre>content</pre>.
- def replace
- content = @match[1].gsub(/&/) { "&amp;" }.gsub(/</) { "&lt;" }.gsub(/>/) { "&gt;" }
- %Q{<pre>#{content}</pre>}
- end
-
- # Converts cases of %r{</pre>(\n|<br ?/?>)<pre>} to \1.
- def post_replace(content)
- content.gsub!(%r{</pre>(\n|<br ?/?>)?<pre>}, '\1')
- content.gsub!(%r{<p><pre>}, '<pre>')
- content.gsub!(%r{</pre></p>}, '</pre>')
- content
- end
- end
-
- # Converts URLs in the form of [url] to numbered links.
- class NumberedLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def initialize(ruwiki, match, parse, project = nil)
- super
- @@count = 0
- end
-
- def self.regexp
- %r{\[((https?|ftp|mailto|news):[^\s<>\]]*?)\]}
- end
-
- IMAGE_RE = /(jpg|jpeg|png|gif)$/
-
- def replace
- extlink = @match[1]
-
- @@count += 1
- name = "[#{@@count}]"
-
- if extlink =~ IMAGE_RE
- %Q{<img src="#{extlink}" title="#{name}" alt="#{name}" />}
- else
- @meta.add_link(extlink, :external)
- %Q{<a class="rw_extlink" href="#{extlink}">#{name}</a>}
- end
- end
- end
-
- # Converts URLs in the form of [url name] to named links.
- class NamedLinks < Ruwiki::Wiki::Token
- def self.rank
- 3
- end
-
- def self.regexp
- %r{\[(((https?)|(ftp)|(mailto)|(news)):[^\s<>]*)\s+([^\]]*)\]}
- end
-
- IMAGE_RE = /(jpg|jpeg|png|gif)$/
-
- def replace
- extlink = @match[1]
- name = @match[7]
-
- if extlink =~ IMAGE_RE
- %Q{<img src="#{extlink}" title="#{name}" alt="#{name}" />}
- else
- @meta.add_link(extlink, :external)
- %Q{<a class="rw_extlink" href="#{extlink}">#{name}</a>}
- end
- end
- end
-
- # Converts URLs to links where the "name" of the link is the URL itself.
- class ExternalLinks < Ruwiki::Wiki::Token
- def self.rank
- 4
- end
-
- def self.regexp
- %r{\b((https?|ftp|mailto|news):[^\s<>]*)}
- end
-
- IMAGE_RE = /(jpg|jpeg|png|gif)$/
-
- def replace
- extlink = @match[1]
-
- if extlink =~ IMAGE_RE
- %Q{<img src="#{extlink}" title="Image at: #{extlink}" alt="Image at: #{extlink}" />}
- else
- @meta.add_link(extlink, :external)
- %Q{<a class="rw_extlink" href="#{extlink}">#{extlink}</a>}
- end
- end
- end
-
- # Creates a crosslink for a Project::WikiPage.
- class ProjectCrossLink < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{([A-Z][a-z]+)::([A-Z][a-z]+([A-Z][a-z]+)+)}
- end
-
- def replace
- project = @match[1]
- topic = @match[2]
-
- return @ruwiki.markup.edit_link(topic, project, "#{project}::#{topic}") unless @ruwiki.backend.page_exists?(topic, project)
- @ruwiki.markup.view_link(topic, project, "#{project}::#{topic}")
- end
- end
-
- # Creates a link to the project index from ::Project.
- class ProjectIndex < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{(\B|\\)::([A-Z][a-z]+)}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- pn = @match.captures[1]
- %Q(<a class="rw_projectindex" href="#{@ruwiki.request.script_url}/#{pn}/ProjectIndex">#{pn}</a>)
- end
- end
-
- # Creates a link to a WikiPage in the current project.
- class WikiLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\b|\\)([A-Z][a-z]+([A-Z][a-z]+|_[A-Z]?[a-z]+)+)\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- topic = @match.captures[1]
- @meta.add_link(topic)
- if @ruwiki.backend.page_exists?(topic, @project)
- @ruwiki.markup.view_link(topic, @project)
- else
- @ruwiki.markup.edit_link(topic, @project)
- end
- end
- end
-
- # Creates a horizontal rule.
- class HRule < Ruwiki::Wiki::Token
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def replace
- "<hr />"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def post_replace(content)
- content.gsub!(%r{<hr ?/?>\n<br ?/?>}, "<hr />")
- content.gsub!(%r{(\n|<br ?/?>)?<hr>(\n|<br ?/?>)?}, "<hr />")
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/abbreviations.rb b/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/abbreviations.rb
deleted file mode 100644
index d65489c..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/abbreviations.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts abbreviations.
- class Abbreviations < Ruwiki::Wiki::Token
- def self.regexp
- %r!@{([^}]*)}!
- end
-
- def replace
- k = @match[1]
- if k.nil? or k.empty?
- data = "<dl>"
- @ruwiki.abbr.each do |k, v|
- data << "<dt>#{k}</dt><dd>#{v}</dd>"
- end
- data << "</dl>"
- else
- if @ruwiki.abbr.has_key?(k)
- data = @ruwiki.abbr[k]
- else
- data = @match[0]
- end
- end
- data
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/headings.rb b/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/headings.rb
deleted file mode 100644
index 21da302..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/headings.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts headings.
- class Headings < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{^\\?(=+)\s+(.*)}
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def replace
- level = @match[1].count("=")
- content = @match[2]
- level = 6 if level > 6
- "<h#{level}>#{content}</h#{level}>"
- end
-
- def post_replace(content)
- content.gsub!(%r{<p>(<h\d>)}, '\1')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/lists.rb b/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/lists.rb
deleted file mode 100644
index 11769b5..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/lists.rb
+++ /dev/null
@@ -1,114 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces Lists
- class Lists < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((\*)+|(#)+)\s+(.*)}
- end
-
- def replace
- content = @match[4]
-
- if @match[3].nil?
- char = '*'
- elem = 'ul'
- else
- char = '#'
- elem = 'ol'
- end
-
- indent = @match[1].count(char)
-
- pre = ""
- post = ""
- indent.times do
- pre << "<#{elem}><li>"
- post << "</li></#{elem}>"
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def post_replace(content)
- content.gsub!(%r{</[uo]l>\n?<[uo]l>}, '')
- content.gsub!(%r{</ol>(\n|(<br ?/?>))?<ol>}, '')
- content.gsub!(%r{</ul>(\n|(<br ?/?>))?<ul>}, '')
- content.gsub!(%r{<li><([uo]l)>}, '<\1>')
- content.gsub!(%r{</([uo]l)></li>}, '</\1>')
- content
- end
- end
-
- # Produces block quotes.
- class Blockquotes < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(:+)\s+(.*)$}
- end
-
- def replace
- content = @match[2]
- indent = @match[1].count(":")
-
- pre = ""
- post = ""
- indent.times do
- pre << "<blockquote>"
- post << "</blockquote>"
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def post_replace(content)
- content.gsub!(%r{</blockquote>(\n|<br ?/?>)?<blockquote>}, '')
- content
- end
- end
-
- # Produces definition lists. Does not completely work correctly.
- class Definitions < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(;+)\s+([^:]+)\s+:\s+(.*)}
- end
-
- def replace
- definition = @match[3]
- term = @match[2]
- indent = @match[1].count(';')
-
- pre = ""
- post = ""
- indent.times do
- pre << "<dl>"
- post << "</dl>"
- end
- "#{pre}<dt>#{term}</dt><dd>#{definition}</dd>#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def post_replace(content)
- content.gsub!(%r{</dl>(\n|<br ?/?>)?<dl>}, '')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/rubylists.rb b/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/rubylists.rb
deleted file mode 100644
index 39db408..0000000
--- a/ruwiki/tags/release-0.6/lib/ruwiki/wiki/tokens/rubylists.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Convert ruby-talk mailing list references (e.g., [ruby-talk:12345])
- # into named links.
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- # Convert ruby-core/ext/dev/list/math mailing list references (e.g.,
- # [ruby-core:12345]) into named links.
- class OtherRubyLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-(list|doc|core|dev|ext|math):(\d+)\]}
- end
-
- def replace
- ln, lm = @match.captures[0..1]
- %Q(<a class="rw_extlink" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-#{ln}/#{lm}">#{@match[0]}</a>)
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/ruwiki.cgi b/ruwiki/tags/release-0.6/ruwiki.cgi
deleted file mode 100644
index d6a93c4..0000000
--- a/ruwiki/tags/release-0.6/ruwiki.cgi
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.0
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-
- # Customize this if you put the RuWiki files in a different location.
-$LOAD_PATH.unshift("lib")
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-wiki.config.webmaster = "webmaster@domain.com"
-
-# wiki.config.debug = false
-# wiki.config.title = "Ruwiki"
-# wiki.config.default_page = "ProjectIndex"
-# wiki.config.default_project = "Default"
-# wiki.config.storage_type = :flatfiles
-# wiki.config.data_path = "./data/"
-# wiki.config.template_path = "./templates/"
-# wiki.config.template_set = "default"
-# wiki.config.css = "ruwiki.css"
-
-wiki.run
diff --git a/ruwiki/tags/release-0.6/ruwiki_servlet.rb b/ruwiki/tags/release-0.6/ruwiki_servlet.rb
deleted file mode 100644
index 8db398d..0000000
--- a/ruwiki/tags/release-0.6/ruwiki_servlet.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env ruby
-#
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-$LOAD_PATH.unshift("lib")
-
-require 'webrick'
-require 'getopts'
-require 'ruwiki'
-require 'ruwiki/servlet'
-
-getopts "", 'p:8808'
-
- # This is for the WEBrick version of Ruwiki. This has been abstracted to
- # accept a $config global variable to reconfigure Ruwiki after initial
- # creation.
-$config = Ruwiki::Config.new
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$config.webmaster = "webmaster@domain.com"
-
-# $config.debug = false
-# $config.title = "Ruwiki"
-# $config.default_page = "DefaultPage"
-# $config.default_project = "Default"
-# $config.storage_type = :flatfiles
-# $config.data_path = "./data/"
-# $config.css = "ruwiki.css"
-# $config.template_file = nil
-
-s = WEBrick::HTTPServer.new(
- :Port => $OPT_p.to_i,
- :StartThreads => 1,
- :Logger => WEBrick::Log::new($stderr, WEBrick::Log::DEBUG))
-s.mount("/", Ruwiki::Servlet)
-trap("INT") { s.shutdown; exit }
-s.start
diff --git a/ruwiki/tags/release-0.6/templates/default/body.tmpl b/ruwiki/tags/release-0.6/templates/default/body.tmpl
deleted file mode 100644
index 087a810..0000000
--- a/ruwiki/tags/release-0.6/templates/default/body.tmpl
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
- <head>
- <title>%wiki_title%</title>
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.6/templates/default/content.tmpl b/ruwiki/tags/release-0.6/templates/default/content.tmpl
deleted file mode 100644
index f15bf2f..0000000
--- a/ruwiki/tags/release-0.6/templates/default/content.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-!INCLUDE!
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.6/templates/default/controls.tmpl b/ruwiki/tags/release-0.6/templates/default/controls.tmpl
deleted file mode 100644
index 2e50002..0000000
--- a/ruwiki/tags/release-0.6/templates/default/controls.tmpl
+++ /dev/null
@@ -1,3 +0,0 @@
-<div class="rw_nav">
- %home_link% | Topic: <b>%page_topic%</b> Project: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a> | <a href="%cgi_url%?action=edit&amp;project=%page_project%&amp;%page_topic%">Edit</a>
-</div>
diff --git a/ruwiki/tags/release-0.6/templates/default/edit.tmpl b/ruwiki/tags/release-0.6/templates/default/edit.tmpl
deleted file mode 100644
index c8cf91a..0000000
--- a/ruwiki/tags/release-0.6/templates/default/edit.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="rw_nav">%home_link% | <i>Editing</i> Topic: <b>%page_topic%</b> Project: <b>%page_project%</b></div><br />
-
-<form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <input type="submit" name="action" value="Save" />
- <input type="submit" name="action" value="Cancel" />
-</form>
-<div class="rw_edit_raw"><h2>Raw Original Value</h2><pre>%pre_page_content%</pre></div>
-<div class="rw_edit_format"><h2>Formatted Version</h2>%unedited_page_content%</div>
diff --git a/ruwiki/tags/release-0.6/templates/default/error.tmpl b/ruwiki/tags/release-0.6/templates/default/error.tmpl
deleted file mode 100644
index 7c91995..0000000
--- a/ruwiki/tags/release-0.6/templates/default/error.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class="rw_nav">%home_link%</div>
-<h1>%name%</h1>
-<p>Send the webmaster a report by <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
-<p>%backtrace%</p>
diff --git a/ruwiki/tags/release-0.6/templates/default/ruwiki.css b/ruwiki/tags/release-0.6/templates/default/ruwiki.css
deleted file mode 100644
index 3e60491..0000000
--- a/ruwiki/tags/release-0.6/templates/default/ruwiki.css
+++ /dev/null
@@ -1,31 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #F2FFA7;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-pre { background-color: #FFFFA7; border: 1px solid black; }
-
-.rw_nav { background-color: #E9967A }
-.rw_edittext { border: 1px dotted blue }
-.rw_pagelink { }
-.rw_extlink { border: 1px solid red }
-.rw_projectxlink { }
-.rw_projectindex { }
-.rw_edit_form { }
-.rw_edit_raw {
- border: 2px solid green;
- float: left;
- max-width: 48%;
- overflow: scroll;
- clear: right;
-}
-.rw_edit_format {
- border: 2px solid blue;
- float: right;
- max-width: 48%;
- clear: none;
-}
diff --git a/ruwiki/tags/release-0.6/templates/default/save.tmpl b/ruwiki/tags/release-0.6/templates/default/save.tmpl
deleted file mode 100644
index 8ce9f8c..0000000
--- a/ruwiki/tags/release-0.6/templates/default/save.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-!INCLUDE!
-Saved page %page_project%::%page_tolink%<hr />
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.6/tests/debugger.rb b/ruwiki/tags/release-0.6/tests/debugger.rb
deleted file mode 100644
index 3efba37..0000000
--- a/ruwiki/tags/release-0.6/tests/debugger.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'ruwiki/config'
-
-require 'rw_config.rb'
-
-module Markup_Debug
- def projectlist
- end
-
- def pagelist
- end
-
- def parse(in_pagecontent,project=$rw_default_project)
- pagecontent = in_pagecontent.dup
- pd = Parse_Data.new
- tokens = Array.new
-
- # pass 1 scan and replace
- Token_Base.tokenlist.each do |token_class|
- pagecontent.gsub!(token_class.regexp) { |match|
- md = Regexp.last_match
- tc = token_class.new(md,pd,project)
- tokens.push( tc )
- "TOKEN_#{tokens.size - 1}"
- }
- end
-
- # pass 2 fill in token replaces
- pagecontent.gsub!(/TOKEN_(\d*)/) { |match|
- md = Regexp.last_match
- itoken = md[1].to_i
- tokens[itoken].replace
- }
-
- # pass 3 run fixups for each token type
- tokens.reverse_each { |token|
- token.post_replace(pagecontent)
- }
-
- return [pagecontent, pd]
- end
-end
diff --git a/ruwiki/tags/release-0.6/tests/tc_backend.rb b/ruwiki/tags/release-0.6/tests/tc_backend.rb
deleted file mode 100644
index 6cc0bf1..0000000
--- a/ruwiki/tags/release-0.6/tests/tc_backend.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-# Copyright (c)2002, Digikata
-# Author: Alan Chen (alan@digikata.com)
-#
-# $Id$
-# License: same as ruby
-
-require 'test/unit'
-require 'test_utils.rb'
-require 'rw_config.rb'
-
-class Test_Backend_Text < Test::Unit::TestCase
- include Test_Utils
-
- def set_up
- # The $backend variable should be setup now
- @page_topic = 'TestPageBackend'
- @page_proj = 'Default'
-
- page_rawtext = "id: 0
-topic: #{@page_topic}
-#EHDR
-Test page for unit test.
-"
-
- testing_page(:set_up, @page_topic, page_rawtext)
- Backend.setup(:flatfiles)
-
- but = '../data/Backend_Unit_Test'
- Dir.rmdir(but) if FileTest.exist?(but)
-
- file = '../data/Default/NoTopic'
- File.unlink(file) if FileTest.exist?(file)
-
- @txtback = Backend::Back_Flatfile.new($rw_paths.data)
- end
-
- def tear_down
- testing_page(:tear_down, @page_topic)
- end
-
- # check retreive (somewhat redundant, tc_page does this more extensively)
- def test_01
- page = @txtback.retreive(@page_topic, @page_proj)
-
- assert_equal(@page_topic, page.topic)
- assert_equal(@page_proj, page.project)
- assert_instance_of(Ruwiki::Page,page)
- end
-
- # check exist?
- def test_02
- assert_equal("/var/www/dev/ruwiki/data/#{@page_proj}/#{@page_topic}",
- @txtback.pagefile(@page_topic,@page_proj))
-
- assert(@txtback.project_exists?(@page_proj))
- assert(@txtback.page_exists?(@page_topic, @page_proj))
- assert(!@txtback.page_exists?('ShouldNotExist', @page_proj))
- end
-
- # check project create and destroy
- def test_03
- but = 'Backend_Unit_Test'
- assert_equal(false, @txtback.project_exists?(but))
- @txtback.create_project(but)
- assert(@txtback.project_exists?(but))
- @txtback.destroy_project(but)
- assert_equal(false, @txtback.project_exists?(but))
- end
-
- # page create and destroy
- def test_04
- topic = 'NoTopic'
- project = 'Default'
-
- assert_equal(false, @txtback.page_exists?(topic,project))
-
- page = Ruwiki::Page.new(:topic => topic,
- :content => 'none',
- :pg_id => 1000,
- :project => project)
-
- @txtback.store(page)
- assert(@txtback.page_exists?(topic,project))
- assert(@txtback.page_exists?(page.topic,page.project))
-
- @txtback.destroy(page)
- assert_equal(false, @txtback.page_exists?(topic,project))
- assert_equal(false, @txtback.page_exists?(page.topic,page.project))
- end
-
-
- # retreive a non-existent page
- def test_05
- topic = 'NonExistent'
- project = 'Default'
-
- # prereq - page shouldn't exist yet
- assert_equal(false, @txtback.page_exists?(topic,project))
-
- page = @txtback.retreive(topic,project)
- assert_equal(false, @txtback.page_exists?(topic,project))
- @txtback.store(page)
- assert_equal(true, @txtback.page_exists?(topic,project))
- @txtback.destroy(page)
- assert_equal(false, @txtback.page_exists?(topic,project))
- end
-
-
- # page rename
- # list projects
-end
-
diff --git a/ruwiki/tags/release-0.6/tests/tc_markup.rb b/ruwiki/tags/release-0.6/tests/tc_markup.rb
deleted file mode 100644
index 7b221c1..0000000
--- a/ruwiki/tags/release-0.6/tests/tc_markup.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/ruby
-#
-# look at c2t.rb for test scaffolding
-# $LOAD_PATH.unshift('') # place code into load path
-#
-require 'test/unit'
-require 'rw_config.rb'
-
-class Test_Wiki_Markup < Test::Unit::TestCase
-
- def set_up
- $backend = Backend::Back_Flatfile.new($rw_paths.data)
- @mw = Markup::Wiki.new($backend)
- @sample_page01 = "This is a sample page
-SampleLink
-External link http://digikata.com
-"
- @sample_page01_links = ['SampleLink']
- @sample_page01_elinks = ['http://digikata.com']
- end
-
- def tear_down
- @mw = nil
- end
-
- def test__misc_fragments
- fragments = [
- ['* listitem', '<ul><li>listitem</li></ul>'],
- ['# listitem', '<ol><li>listitem</li></ol>'],
- ["\n \nHallo", "<p>Hallo"],
- ['----', "<hr>"],
- ['11\11\2002', '11\11\2002'],
- ['TestPage', %Q(TestPage<a class="rw_pagelink" href="ruwiki.cgi?action=edit&TestPage">?</a>)]
- ]
-
- fragments.each { |frag|
- rawtext, extransformed, exparsedata = frag
- transformed, parsedata = @mw.parse(rawtext)
- assert_equal(extransformed, transformed)
- assert_equal(exparsedata, parsedata) if( exparsedata != nil )
- }
- end
-
- def test__ordered_list_concat
- content = "* item1\n* item2"
- tfm, pd = @mw.parse(content)
- assert_equal(%Q(<ul><li>item1</li><li>item2</li></ul>), tfm)
- end
-
- def test_01
- content = "TestPage"
- expected = %Q(TestPage<a class="rw_pagelink" href="ruwiki.cgi?action=edit&TestPage">?</a>)
- newcontent, parsedata = @mw.parse(content)
- assert_equal(expected, newcontent)
- assert_equal(['TestPage'], parsedata.links)
- end
-
- def test_02
- extlink = 'http://127.0.0.1/hallo/TestPage'
- content = <<ECON
-#{extlink}
-TestPage
-SampleLink
-ECON
-
- expected = %Q(<a class="rw_extlink" href="#{extlink}">#{extlink}</a>
-TestPage<a class="rw_pagelink" href="ruwiki.cgi?action=edit&TestPage">?</a>
-SampleLink<a class="rw_pagelink" href="ruwiki.cgi?action=edit&SampleLink">?</a>
-)
-
- newcontent, parsedata = @mw.parse(content)
- assert_equal(expected, newcontent)
- assert_equal([extlink], parsedata.elinks)
- assert_equal(['TestPage','SampleLink'], parsedata.links )
- end
-
- def test_03
- newcontent, parsedata = @mw.parse(@sample_page01)
- assert_equal(@sample_page01_links, parsedata.links)
- assert_equal(@sample_page01_elinks, parsedata.elinks)
- end
-
-
-end
diff --git a/ruwiki/tags/release-0.6/tests/tc_page.rb b/ruwiki/tags/release-0.6/tests/tc_page.rb
deleted file mode 100644
index e39f3ac..0000000
--- a/ruwiki/tags/release-0.6/tests/tc_page.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/ruby
-#
-# look at c2t.rb for test scaffolding
-# $LOAD_PATH.unshift('') # place code into load path
-#
-require 'test/unit'
-require 'test_utils.rb'
-require 'rw_config.rb'
-
-class Test_Page < Test::Unit::TestCase
- include Test_Utils
-
- def set_up
- @sample_page01 = "id: 1
-topic: SamplePage
-#EHDR
-This is a sample page
-SampleLink
-External link http://digikata.com
-"
- testing_page(:set_up)
- end
-
- def tear_down
- testing_page(:tear_down)
- end
-
- def test_01
- page = Ruwiki.process(@sample_page01)
-
- assert_equal(Ruwiki::Page, page.class)
- assert_equal(1, page.pg_id)
- assert_equal('SamplePage', page.topic)
- assert_equal(['SampleLink'], page.links)
- assert_equal(['http://digikata.com'], page.ext_links)
- end
-
- def test_02
- page = Ruwiki::Page.new
- page.topic = 'NewTopic'
- page.pg_id = '1000'
- page.content = 'none'
-
- assert_equal("id: 1000
-topic: NewTopic
-#EHDR
-none", page.to_s)
- end
-
- def test_03
- page = $backend.retreive('TestPage','Default')
- assert_equal(0, page.pg_id)
- end
-
- def test_04
- page = Ruwiki::Page.new
- page.topic = 'TestPage1'
- page.pg_id = 1000
- page.content = 'none'
- page.project = 'Default'
- $backend.store(page)
-
- goodname = '../data/Default/TestPage1'
- assert(FileTest.exist?(goodname))
- File.unlink(goodname)
- end
-end
diff --git a/ruwiki/tags/release-0.6/tests/tc_ruwiki.rb b/ruwiki/tags/release-0.6/tests/tc_ruwiki.rb
deleted file mode 100644
index 745c8cd..0000000
--- a/ruwiki/tags/release-0.6/tests/tc_ruwiki.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-$LOAD_PATH.unshift("../lib")
-
-require 'ruwiki'
-require 'test/unit'
-
-class Test_Backend_Flat
-end
-
-
-begin
- rw = Ruwiki.new
- # Configuration defaults to certain values. This overrides the defaults.
-
- # Configure the URL to the Wiki.
- rw.config.url = "http://domain.com/"
- # The webmaster.
- rw.config.webmaster = "webmaster@domain.com"
-
- # This should ensure that the CGI is always appropriately named
- rw.config.cgi = __FILE__
-
-# rw.config.debug = false
-# rw.config.title = "Ruwiki"
-# rw.config.default_page = "DefaultPage"
-# rw.config.default_project = "Default"
-# rw.config.storage_type = :flatfiles
-# rw.config.data_path = "./data/"
-# rw.config.css = "ruwiki.css"
-
- rw.config.verify
-
- rw.set_backend
- rw.set_page
- rw.process_page
- rw.output
-rescue => e
- rw.cgi.out do
- rw.cgi.html do
- "\n" +
- rw.cgi.head do
- [ "", rw.cgi.title { "Error - #{rw.config.title}" }, rw.config.css_link, "" ].join("\n")
- end + "\n" +
- rw.cgi.body { "<h1>#{e}</h1><p>#{e.backtrace.join("\n")}" }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.6/tests/test_utils.rb b/ruwiki/tags/release-0.6/tests/test_utils.rb
deleted file mode 100644
index b05ec18..0000000
--- a/ruwiki/tags/release-0.6/tests/test_utils.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-content =
-
-module Test_Utils
- TEST_UTILS_DEFAULT_CONTENT = "id: 0
-topic: TestPage
-#EHDR
-Test page for unit test.
-"
-
- # create and delete a test page file, used for testing
- def testing_page(op, topic='TestPage', content=TEST_UTILS_DEFAULT_CONTENT)
- testdir = '../data/Default'
- testpage = testdir + '/' + topic
- case op
- when :set_up
- unless FileTest.exist?(testdir)
- raise StandardError, "Error #{testdir} doesn't exist"
- end
- if FileTest.exist?(testpage)
- raise StandardError, "Error #{testpage} already exists"
- end
- open(testpage, 'w') { |tph| tph.print content }
-
- when :tear_down
- File.unlink(testpage)
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/Default/ProjectIndex b/ruwiki/tags/release-0.7/Default/ProjectIndex
deleted file mode 100644
index 67ebf73..0000000
--- a/ruwiki/tags/release-0.7/Default/ProjectIndex
+++ /dev/null
@@ -1,27 +0,0 @@
-id: 0
-topic: ProjectIndex
-version: 1
-#EHDR
-= Ruwiki
-Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI and
-\WEBrick interfaces, templates, and CSS formatting. Additionally, it supports
-project namespaces, so that two pages can be named the same for differing
-projects without colliding or having to resort to odd naming conventions.
-Please see ::Ruwiki for more information.
-
-The current version is 0.7.0. Several fixes have been made to text
-preservation, an API change to plugins has been made (please read
-Ruwiki::Extending_Ruwiki for details), and a calendar plugin has been added
-(please read Ruwiki::WikiMarkup for details).
-
-The \APIs for Ruwiki should not at this point be considered stable; a large
-number of \APIs will be changing explicitly in 0.8.0 leading up to Ruwiki 1.0.
-
-Known Projects:
-* ::Default
-* ::Ruwiki
-
-Please go to ::Ruwiki if you are unfamiliar with the concept of Wikis in
-general. If you want to play with \WikiFormatting, use the Ruwiki::SandBox.
-
-$Id$
diff --git a/ruwiki/tags/release-0.7/README b/ruwiki/tags/release-0.7/README
deleted file mode 100644
index ce07647..0000000
--- a/ruwiki/tags/release-0.7/README
+++ /dev/null
@@ -1,46 +0,0 @@
-Ruwiki 0.7.0
-------------
-Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI and
-WEBrick interfaces, templates, and CSS formatting. Additionally, it supports
-project namespaces, so that two pages can be named the same for differing
-projects without colliding or having to resort to odd naming conventions.
-Please see the ::Ruwiki project in the running Wiki for more information.
-Ruwiki 0.7.0 has German and Spanish translations available.
-
-Quick Start (CGI)
------------------
-1. Place the Ruwiki directory in a place that your webserver can execute CGI
- programs and ensure that ruwiki.cgi is executable on your webserver.
-2. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
-2. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of Ruwiki
-without editing the servlet; use ruwiki_servlet --help for more information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-* This software includes algorithm/diff by Lars Christensen, available for
- download from the RAA at: http://raa.ruby-lang.org/list.rhtml?name=diff
-* This software includes template.rb from Dave Thomas's rdoc system, available
- for download from SourceForge: http://rdoc.sourceforge.net
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen]
- on 2003.10.22. Note that the initial template translations (./templates/de/)
- were done via AltaVista Babelfish and should not be blamed on Christian.
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández]
- on 2003.10.22. Note that the initial template translations (./templates/es/)
- were done via AltaVista Babelfish and should not be blamed on Mauricio.
-
-$Id$
diff --git a/ruwiki/tags/release-0.7/Ruwiki/BugTracking b/ruwiki/tags/release-0.7/Ruwiki/BugTracking
deleted file mode 100644
index 7881730..0000000
--- a/ruwiki/tags/release-0.7/Ruwiki/BugTracking
+++ /dev/null
@@ -1,28 +0,0 @@
-id: 0
-topic: BugTracking
-version: 1
-#EHDR
-= Ruwiki 0.7.0 Bug Tracking
-This page is for tracking bugs in Ruwiki. Only bugs from recent distributions
-are tracked. In addition to this source-based bug tracking, there is the
-[http://rubyforge.org RubyForge]
-[http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug tracker]
-for Ruwiki.
-
-Those interested in Ruwiki development may also find the Ruwiki::To_Do list
-useful.
-
-----
-== Open Bugs
-* 0.6.2: Not all formatting is applied consistently. The token rankings may need adjusting. Eivind Eklund has suggested a scheme that may help with this, but it will require architectural adjustment and will probably slow things down.
-
-----
-== Closed Bugs
-* 0.7.0: Fixed a link detection problem in \[wikiword] format. Thanks to [mailto:eivind@FreeBSD.org Eivind Eklund] for the patch.
-* 0.7.0: Fixed a problem with &lt;pre&gt; paragraph detection and generation.
-* 0.7.0: Fixed a problem with &lt;p&gt; generation.
-* 0.7.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=197&group_id=84&atid=407 Run-away ruby on some links in default distribution]. This may be related to a runaway header problem that was reported to me on IRC some time back that I believe has been fixed. Please advise.
-* 0.6.1: Projects aren't created appropriately.
-* 0.6.1: Saving without editing (or repost) appears to cause problems. A fix has been applied to attempt to address this. Pages that have not been changed will not be saved.
-
-$Id$
diff --git a/ruwiki/tags/release-0.7/Ruwiki/ChangeLog b/ruwiki/tags/release-0.7/Ruwiki/ChangeLog
deleted file mode 100644
index 12c9437..0000000
--- a/ruwiki/tags/release-0.7/Ruwiki/ChangeLog
+++ /dev/null
@@ -1,49 +0,0 @@
-id: 0
-version: 1
-topic: ChangeLog
-#EHDR
-= Ruwiki 0.7.0 ChangeLog
-Uncompleted to-do items can be found in To_Do. Bugs in Ruwiki are tracked in
-BugTracking.
-
-== Version 0.7.0
-* Changed the tokenization API so that the #post_replace call is made at the Token class level instead of the instance level.
-* Improved HTML code generation.
-* Added servlet runner batch files for Windows. They <strong>will</strong> require modification to run properly.
-* Added %calendar(...) support. See Ruwiki::WikiMarkup for more information.
-
-== Version 0.6.2
-* Removed dependencies on Ruwiki from a number of classes (\Ruwiki::Backend, \Ruwiki::Backend::Flatfiles, \Ruwiki::Page, \Ruwiki::Wiki, \Ruwiki::Wiki::Tokens, and various tokens).
-* Ruwiki now initializes a \Ruwiki::BackendDelegator, which creates the requisite \Ruwiki::Backend instance with \Ruwiki::Config#storage_options.
-* Added German (Christian Neukirchen <cneukirchin@yahoo.de>) and Spanish translations (Mauricio Fernández <batsman.geo@yahoo.com>).
-
-== Version 0.6.1
-* Changed Config#data_path to Config#storage_options[:flatfiles][:data_path]. This represents a generalisation of storage type options so that the Config object is not polluted with storage type options. Config#storage_options keys should be the same Ruby Symbol as is used in Config#storage_type.
-* Added Config#storage_options[:flatfiles][:extension], based on a request by Chad Fowler. This allows you to have Project/\TopicFile actually stored as Project/\TopicFile.wiki if Config#storage_options[:flatfiles][:extension] is set to <tt>wiki</tt>. The default for Config#storage_options[:flatfiles][:extension] is <tt>nil</tt>.
-* Fixed incorrect references. I had been incorrectly attributing [http://sourceforge.net/projects/rdoc-wiki RDoc Wiki] to Dave Thomas. \RDoc Wiki is by Michael Neumann. However, the project I pulled from <strong>is</strong> by Dave Thomas, but it's [http://sourceforge.net/projects/rublog RubLog]. Apologies to both developers.
-* Added RuwikiTemplatingLibrary documentation.
-* Internationalized messages, except for the templating library.
-* Added configuration API for future work surrounding features. The existing wiki is mostly feature complete. Additional features (such as access controls) will be added through the feature interface.
-* Fixed project creation.
-* Fixed problems with \WikiWord links.
-* Added Wikipedia-style Wiki links (\[[list of words]]).
-* Fixed a potential problem with re-posted data or saving without editing.
-* Added the ability to put commands in the URL.
-
-== Version 0.6.0
-* Added Ruby mailing list reference support (e.g., \[ruby-talk:12345]).
-* Reorganised the code (again) to better support alternative frontends. Based, in part, on [http://sourceforge.net/projects/rublog RubLog] by Dave Thomas. (Reference corrected in 0.6.1.)
-* Added a [http://www.webrick.org WEBrick] servlet interface. Based, in part, on the WEBrick servlet interface provided with RubLog by Chad Fowler.
-* Added templates, using the [http://rdoc.sourceforge.net RDoc] template.rb library.
-* Changed the default topic to be \ProjectIndex instead of \DefaultProject.
-* Added a new \WikiWord format, \Wiki_Word_with_Spaces.
-* Completed lots of Ruwiki documentation.
-* Updated the save page.
-* Fixed a problem with the linking of project specific pages.
-
-== Version 0.5.0
-* Reorganized the code significantly to be easier to edit and extend.
-* Added abbreviation capabilities.
-* Cleaned up a lot of tokenizing code.
-
-$Id$
diff --git a/ruwiki/tags/release-0.7/Ruwiki/Configuring_Ruwiki b/ruwiki/tags/release-0.7/Ruwiki/Configuring_Ruwiki
deleted file mode 100644
index fb039e5..0000000
--- a/ruwiki/tags/release-0.7/Ruwiki/Configuring_Ruwiki
+++ /dev/null
@@ -1,188 +0,0 @@
-id: 0
-topic: Configuring_Ruwiki
-version: 1
-#EHDR
-= Configuring Ruwiki 0.7.0
-
-Ruwiki is configured similarly for both CGI and \WEBrick. The biggest
-distinction is that because the Wiki servlet is created after the \WEBrick
-server is created (during the dispatch to the servlet), it is necessary to
-configure the wiki with a global \Ruwiki::Config object, <em>$config</em>.
-Thus, in the examples below, replace <em>wiki.config</em> with
-<em>$config</em> where necessary.
-
-: This will probably be changed in a future version prior to 1.8.
-
-== wiki.config Options
-
-=== wiki.config.title
-
-This configuration option names the Wiki, by default this is <tt>Ruwiki</tt>.
-This affects the display of the home link and the &lt;title&gt; element of
-pages.
-
-=== wiki.config.webmaster
-
-The email address for the webmaster. This is used in generating error reports
-that can be emailed to the wiki's webmaster.
-
-=== wiki.config.default_page, wiki.config.default_project
-
-These options indicate what will happen when the wiki's URL is specified
-without any parameters (the default page in the default project is opened),
-when a topic is specified without a project (the topic is opened in the
-default project), and when a project is specified without a topic (the default
-page is opened in the project).
-
-=== wiki.config.storage_type, wiki.config.storage_options
-
-<tt>wiki.config.storage_type</tt> specifies the back-end storage mechanism as
-a Ruby Symbol. Currently, only <tt>:flatfiles</tt> is implemented. See
-Extending_Ruwiki for more information.
-
-<tt>wiki.config.storage_options</tt> is a hash of option hashes for each known
-storage type known to the Wiki. This must use the same Symbol as
-<tt>wiki.config.storage_type</tt> as the top-level hash key.
-
-==== ...storage_options[:flatfiles][:data_path]
-
-The directory in which the wiki files will be found. By default, this is
-<tt>"./data/"</tt>.
-
-==== ...storage_options[:flatfiles][:extension]
-
-The extension of the wiki files. By default, this is +nil+ (no extension).
-
-=== wiki.config.template_path
-This specifies the paths where the Wiki templates will be found. The process
-running the Wiki must have read access to the template_path.
-
-=== wiki.config.template_set, wiki.config.css
-These two options indicate which template set will be used. Three template
-sets are provided in the release package, "default", "es", and "de". The only
-CSS file used initially is "ruwiki.css". Templates work such that they will be
-found in <em>template_path</em>/<em>template_set</em>. All CSS files are
-loaded from the template set directory and emitted as part of the output
-stream.
-
-: The bad news is that this means that the CSS never caches on the client side
-: as it would if it were a separate file. However, because the templates may
-: not be in a web-accessible directory, this is necessary.
-
-> Template paths will be modified in the future to be based on the template
-> set name and the language, e.g., "default/en", "default/es", and
-> "default/de".
-
-== Templates
-Templating is done with the \RDoc template.rb library, included in the
-distribution of Ruwiki. The templating library allows for nested templates,
-and this is used extensively in Ruwiki. This library is documented in
-RuwikiTemplatingLibrary.
-
-There are four major templates: content, edit, save, and error. Each of these
-has a slightly different combination of template files used, and this means
-that there are different sets of variables available.
-
-The major templates are combined templates that are defined as follows:
-; content : body.tmpl, content.tmpl, controls.tmpl
-; edit : body.tmpl, edit.tmpl
-; save : body.tmpl, save.tmpl, controls.tmpl
-; error : body.tmpl, error.tmpl
-
-=== body.tmpl
-The body template knows two template keys (<tt>%wiki_title%</tt> and
-<tt>%css_link%</tt>) and includes one other template. The values for
-%wiki_title% key differs depending on context, but no other key should be used
-or expected in the body template.
-
- <html>
- <head>
- <title>%wiki_title%</title>
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
- </html>
-
-=== content.tmpl
-The content template knows one template key (<tt>%content%</tt>) and includes
-one other template. (This may change moving forward so that there's a footer
-as well as a control header.)
-
- !INCLUDE!
- <!-- topic content -->
- %content%
- <!-- topic content -->
-
-=== controls.tmpl
-The controls template offers a navigation bar. It knows four template keys:
-
-; %cgi_url% : The URL to the wiki, suitable for building further links from.
-; %home_link% : The root topic of the wiki.
-; %page_project% : The project for the current page topic.
-; %page_topic% : The topic of the current page.
-
- <div class="rw_nav">
- %home_link% |
- Topic: <strong>%page_topic%</strong> Project: <a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a> |
- <a href="%cgi_url%?action=edit&amp;project=%page_project%&amp;%page_topic%">Edit</a>
- </div>
-
-=== edit.tmpl
-The edit template is the most complex template with the most keys. Of
-necessity, it provides a restricted form of the navigation bar, the edit form,
-the raw body of the page, and the formatted body of the page.
-
-; %cgi_url% : The URL to the wiki, suitable for building further links from.
-; %home_link% : The root topic of the wiki.
-; %orig_page% : The unedited original page encoded as Base64.
-; %page_content% : The editable page content.
-; %page_old_version% : The old version number of the page.
-; %page_project% : The project for the current page topic being edited.
-; %page_topic% : The topic of the current page being edited.
-; %page_version% : The new version number of the page.
-; %pre_page_content% : The unedited original page content for display in a &lt;pre&gt; tagset.
-; %unedited_page_content% : The formatted unedited orignal page content.
-
- <div class="rw_nav">%home_link% | <em>Editing</em> Topic: <strong>%page_topic%</strong> Project: <strong>%page_project%</strong></div><br />
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <input type="submit" name="action" value="Save" />
- <input type="submit" name="action" value="Cancel" />
- </form>
- <div class="rw_edit_raw"><h2>Raw Original Value</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2>Formatted Version</h2>%unedited_page_content%</div>
-
-=== save.tmpl
-An alternative content page for use when a page is saved after editing. This
-knows <tt>%page_project%</tt>, <tt>%page_tolink%</tt> (used to link directly
-to the page), and <tt>%content%</tt>.
-
- !INCLUDE!
- Saved page %page_project%::%page_tolink%<hr />
- <!-- topic content -->
- %content%
- <!-- topic content -->
-
-=== error.tmpl
-This template is used for reporting errors to the user and offering an
-opportunity to the user to send a report to the wiki webmaster.
-
-; %backtrace% : The error backtrace.
-; %backtrace_email% : The error backtrace in a format suitable for email.
-; %home_link% : The root topic of the wiki.
-; %name% : The name of the error.
-; %webmaster% : The email address of the wiki webmaster.
-
- <div class="rw_nav">%home_link%</div>
- <h1>%name%</h1>
- <p>Send the webmaster a report by <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
- <p>%backtrace%</p>
-
-$Id$
diff --git a/ruwiki/tags/release-0.7/Ruwiki/Extending_Ruwiki b/ruwiki/tags/release-0.7/Ruwiki/Extending_Ruwiki
deleted file mode 100644
index a977868..0000000
--- a/ruwiki/tags/release-0.7/Ruwiki/Extending_Ruwiki
+++ /dev/null
@@ -1,226 +0,0 @@
-id: 0
-topic: Extending_Ruwiki
-version: 1
-#EHDR
-= Extending Ruwiki 0.7.0
-Ruwiki is relatively easily extended to support new features. There are three
-primary ways in which Ruwiki can be extended by the end user: markup,
-backends, and translating Ruwiki error messages.
-
-: <strong>WARNING:</strong> These \APIs are likely to change moving forward,
-: and new \APIs may be added as well. (There are definite changes in 0.8.0.
-: You have been warned.)
-
-== Extending Ruwiki Markup
-Ruwiki's WikiMarkup can be extended by creating a new \Ruwiki::Wiki::Token.
-Tokens will be automatically loaded if they are placed in
-<em>ruwiki/wiki/tokens</em>.
-
-It is recommended that new tokens be added to the test cases in
-<tt>tests/tc_tokens.rb</tt>.
-
-The following \Ruwiki::Wiki::Token class will convert strings in the forms of
-\[ruby-talk:12345] to links.
-
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
-=== Known Instance Variables
-==== @match
-The match data for this token instance is is kept in @match. This is what will
-be used in #replace and #restore.
-
-==== @project
-The project being processed.
-
-==== @backend
-The Backend for the wiki. If you are using Ruwiki tokenizers outside of
-Ruwiki, this does not need to be a \BackendDelegator, but can be the direct
-Backend (which expects less information).
-
-==== @script
-The URI to the script.
-
-=== Required Methods
-==== ::regexp
-Ruwiki tokens are matched only through regular expression matches. As shown in
-the example above, the regular expression for ruby-talk mailing list posts is
-<tt>%r{\[ruby-\talk:(\d+)\]}</tt>. The purpose of the ::regexp method is to
-return the regexp for matching.
-
-For most inline matches, Ruwiki will ensure that the escape character (\)
-works automatically. For whole-line matches, it is necessary to match the
-escape character manually and provide a #restore method.
-
-As an example, the \HRule class implements these methods.
-
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
-It may also be necessary to match escapes manually on inline matches that must
-be along word boundaries where the regular expression includes characters that
-normally match word boundaries. The project index match (e.g., \::Ruwiki)
-regular expression does this <tt>%r{(\B|\\)::([A-Z][a-z]+)}</tt>.
-
-==== #replace
-This returns the formatted token. In the \RubyTalkLinks class above, the
-matched regular expression will be replaced with a hyperlink. The text of the
-hyperlink will be the matched text; the target of the hyperlink will include
-the first captured value.
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
-
-=== Optional Methods
-==== ::rank
-By default, a token will be processed in the order created. Tokens may be
-given a specific rank to ensure that they are processed in a particular order.
-The default rank is <tt>9999</tt>.
-
-==== #restore
-Restores the token without replacement. Implements the results of the escape
-character. Each Token class is responsible for its own restoration. As noted
-in #regexp, whole-line tokens are most likely to need a #restore
-implementation.
-
-==== ::post_replace
-Performs any necessary massaging of the data. The Lists token uses this to
-ensure that lists are collapsed together; the Paragraph token uses this to
-ensure that there are no empty paragraph tag pairs (&lt;p&gt;&lt;/p&gt;).
-
-: <strong>Note:</strong> This has been changed from Ruwiki 0.6.x. Plugins
-: written for the Ruwiki 0.6.x Token API will need to be modified so that this
-: is defined as:
-
- def self.post_replace
- ...
- end
-
-: as opposed to:
-
- def post_replace
- ...
- end
-
-== Extending Ruwiki Backends
-Ruwiki can support varying backends, as the backend interface has been
-abstracted completely from the data store. The backend <strong>must</strong>:
-
-# reside in <em>ruwiki/backends/</em> as <em>backend_name</em>.rb.
-# be registered by adding the <em>backend_name</em> as a symbol (e.g., :<em>backend_name</em>) to \Ruwiki::KNOWN_BACKENDS.
-# inherit from \Ruwiki::Backend.
-# exist as \Ruwiki::Backend::<em>\Backend_name</em>.
-
-=== Required Methods
-==== #initialize(storage_options)
-The backend may only obtain its configuration information from the provided
-ruwiki instance (through Ruwiki#config) and must set @ruwiki (this can be
-achieved by calling <tt>super ruwiki</tt>).
-
-If a configuration error is detected during initialization, the backend should
-raise the \Ruwiki::Backend exception class \BackendError. This would be done with:
-
- raise Ruwiki::Backend::BackendError.new([:message_symbol, [message_parameters]])
-
-Backend writers should add messages to the <em>lang/en.rb</em> at a minimum. The
-\BackendDelegator will detect this and report the results appropriately.
-
-==== #load(topic, project)
-The backend will be provided the name of the topic and project and must return
-the selected page as an array, one row per line. If the backend you have
-chosen returns the page as a single text block, it will be necessary to do a
-String#split("\n") on it.
-
-==== #save(page)
-This method must store the provided page in the backend. Note that the return
-value of the Page#rawtext method must be stored. This method may call the
-private method Backend#make_diff to generate the differences hash.
-
- diff = {
- 'old_version' => page.old_version,
- 'new_version' => page.version,
- 'change_date' => Time.now,
- 'change_ip' => page.change_ip,
- 'change_id' => page.change_id,
- 'diff' => Diff.diff(oldpage, newpage)
- }
-
-===== Backend#make_diff(page, oldpage, newpage)
-This method expects the page object, the old page text, and the new page text.
-They must be Diffable. \Ruwiki::Backend::Flatfiles provides oldpage and newpage to
-Diff#diff as arrays (each line as a separate entry in the array).
-
-==== #obtain_lock(page, address = 'UKNOWN', timeout = 600)
-Obtains an exclusive lock on the page. The lock should have a timeout and
-permit access from the same IP address without restriction. This should
-<strong>not</strong> be a filesystem lock. The time stored for purposes of locking
-should include the timeout (e.g., Time.now.to_i + time).
-
-==== #release_lock(page, address = 'UNKNOWN')
-Releases the exclusive lock on the page. The lock should not be released
-unless the IP address on the lock is the same or the lock has expired.
-
-==== #project_exists?(project)
-Returns <tt>true</tt> if the project exists.
-
-==== #page_exists?(topic, project = 'Default')
-Returns <tt>true</tt> if the page exists within the specified project.
-
-=== Optional Methods
-Note that these methods are currently optional (they are not yet called from
-Ruwiki), but will become required moving forward as the functions are
-implemented in Ruwiki.
-
-==== #destroy(page)
-Removes the page from the wiki. This should <strong>not</strong> remove the change
-history of the topic (in the event that the page has been removed
-maliciously). There will be a separate method to remove the page history.
-
-==== #create_project(project)
-Attempts to create the project.
-
-==== #destroy_project(project)
-Attempts to destroy the project.
-
-== Translating Ruwiki Error Messages
-Ruwiki is internationalized. This method sets the Ruwiki error messages (and a
-few other messages) to the specified language Module. The language Module must
-have a constant Hash called <tt>Message</tt> containing a set of symbols and
-localized versions of the messages associated with them.
-
-If the file <em>ruwiki/lang/es.rb</em> contains the module
-<tt>\Ruwiki::Lang::ES</tt>, the messages for RSS could be localized to Spanish
-thus:
-
- require 'ruwiki/lang/es'
- ...
- wiki.config.language = Ruwiki::Lang::ES
-
-Localization is per wiki instance. In a servlet environment, this may mean
-that only a single language is recognised.
-
-It is recommended that Message.default be set to a proc that reports unknown
-message keys.
-
- Message.default = proc { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
-
-$Id$
diff --git a/ruwiki/tags/release-0.7/Ruwiki/LicenseAndAuthorInfo b/ruwiki/tags/release-0.7/Ruwiki/LicenseAndAuthorInfo
deleted file mode 100644
index e90fd7f..0000000
--- a/ruwiki/tags/release-0.7/Ruwiki/LicenseAndAuthorInfo
+++ /dev/null
@@ -1,30 +0,0 @@
-id: 0
-topic: LicenseAndAuthorInfo
-version: 1
-#EHDR
-= Ruwiki Licence
-Ruwiki is copyright © 2002 - 2004 [mailto:alan@digikata.com Alan Chen] and
-[mailto:ruwiki@halostatue.ca Austin Ziegler].
-
-Ruwiki is provided free of use and without any warranty express or implied.
-You may use, distribute, or modify Ruwiki under the conditions of Ruby's
-licence or the [http://www.gnu.org/copyleft/gpl.html GNU General Public
-Licence].
-
-* Ruwiki includes algorithm/diff by Lars Christensen, available for download from the RAA at: http://raa.ruby-lang.org/list.rhtml?name=diff
-* Ruwiki includes template.rb from Dave Thomas's \RDoc system, included as part of the standard Ruby distribution since Ruby 1.8.
-
-== Translations
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen] on 2003.10.22. Note that the initial template translations (./templates/de/) were done via \AltaVista Babelfish and should not be blamed on Christian.
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández] on 2003.10.22. Note that the initial template translations (./templates/es/) were done via \AltaVista Babelfish and should not be blamed on Mauricio.
-
-
-== Other Projects
-Austin has also released several other projects available on the RAA that you may be interested in:
-* [http://raa.ruby-lang.org/list.rhtml?name=mime-types MIME::Types]
-* [http://raa.ruby-lang.org/list.rhtml?name=pdf-writer PDF::Writer]
-* [http://raa.ruby-lang.org/list.rhtml?name=text-format Text::Format]
-* [http://raa.ruby-lang.org/list.rhtml?name=trans-simple Transaction::Simple]
-* [http://raa.ruby-lang.org/list.rhtml?name=uninheritable Uninheritable]
-
-$Id$
diff --git a/ruwiki/tags/release-0.7/Ruwiki/ProjectIndex b/ruwiki/tags/release-0.7/Ruwiki/ProjectIndex
deleted file mode 100644
index d1ef6e7..0000000
--- a/ruwiki/tags/release-0.7/Ruwiki/ProjectIndex
+++ /dev/null
@@ -1,33 +0,0 @@
-id: 0
-topic: ProjectIndex
-version: 1
-#EHDR
-= Ruwiki 0.7.0
-This is the \ProjectIndex page for Ruwiki. For any given project, the
-\ProjectIndex topic will be the default topic for plain project links.
-
-----
-
-== Features and Information
-* This wiki supports a variety of WikiFeatures that you may be interested in. The rules for WikiMarkup are similar to some other wikis, but there are a few unique markup capabilities in Ruwiki.
-* Configuring_Ruwiki is simple.
-* Extending_Ruwiki is almost as simple.
-* Who wrote Ruwiki? Look at the LicenseAndAuthorInfo.
-
-== Tracking Ruwiki Development
-The development progress of Ruwiki is kept in the wiki itself.
-* The BugTracking page in Ruwiki keeps track of open and closed bugs in Ruwiki.
-* The To_Do list keeps track of major development goals for Ruwiki.
-
-----
-
-== Different Features?
-If this wiki doesn't have the right combination of features, (or if it just
-doesn't feel right) try these other Ruby-based Wikis:
-
-* Amrita Wiki - http://www.walrus-ruby.org/amrita/cgi-bin/aswiki/aswiki.cgi
-* \RWiki - http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=top
-* \MiniRubyWiki - http://www.xpsd.com/MiniRubyWiki
-* Instiki - http://instiki.rubyforge.org/
-
-$Id$
diff --git a/ruwiki/tags/release-0.7/Ruwiki/RuwikiTemplatingLibrary b/ruwiki/tags/release-0.7/Ruwiki/RuwikiTemplatingLibrary
deleted file mode 100644
index 68bef53..0000000
--- a/ruwiki/tags/release-0.7/Ruwiki/RuwikiTemplatingLibrary
+++ /dev/null
@@ -1,74 +0,0 @@
-id: 0
-topic: RuwikiTemplatingLibrary
-version: 1
-#EHDR
-= Ruwiki 0.7.0 Templating
-Ruwiki uses the \RDoc templating system, described by its creator as:
-
-> \RDoc's cheap-n-cheerful HTML page template system.
-
-== Templates
-Templates in the templating system are essentially plain strings with
-particular references to templating keys or an include directive.
-
-=== Templating Keys
-The template interacts with a value hash provided by ruwiki. The keys known to
-the templates expected by Ruwiki are detailed in Configuring_Ruwiki. Nested
-key references are found from the inside-out. That is, the closest resolving
-key to the current level is found, not the furthest resolving key.
-
-==== Simple Templating Keys
-Ruwiki only uses the simplest form of \RDoc templating at this point, which is
-the enclosing of variable names between percent signs (e.g.,
-<tt>%wiki_title%</tt>).
-
-==== Repeating Block Keys
-The \RDoc templating library supports a block format:
-
- START:key
- ... stuff ...
- END:key
-
-The block between <tt>\START:key</tt> and <tt>\END:key</tt> will be repeated
-once for each hash entry found in the array at <tt>key</tt> in the main value
-hash. Blocks may be nested arbitrarily deeply.
-
-==== Conditional Block Keys
- IF:key
- ... stuff ...
- ENDIF:key
-
-The block between <tt>\IF:key</tt> and <tt>\ENDIF:key</tt> will be included in
-the output only if the corresponding key is set in the value hash.
-
-=== Including Other Templates
-Templates may include other templates to any arbitrary level by using the
-!INCLUDE! directive.
-
-== Example
-Given the set of templates T1, T2, and T3 (shown below), here's how we would
-use the templating system.
-
- values = { "name" => "Dave", "state" => "TX" }
- t = TemplatePage.new(T1, T2, T3)
- File.open(name, w) { |f| t.write_html_on(f, values) }
-
-or:
-
- values = { "name" => "Dave" }
- res = ""
- t.write_html_on(res, values)
-
-=== T1
- Templates can subsitute a wide variety of values.
- !INCLUDE!
-
-=== T2
- Name: %name% !INCLUDE!
-
-=== T3
- IF:state
- State: %state%
- ENDIF:state
-
-$Id$
diff --git a/ruwiki/tags/release-0.7/Ruwiki/SandBox b/ruwiki/tags/release-0.7/Ruwiki/SandBox
deleted file mode 100644
index 64d42ef..0000000
--- a/ruwiki/tags/release-0.7/Ruwiki/SandBox
+++ /dev/null
@@ -1,8 +0,0 @@
-id: 0
-topic: SandBox
-version: 1
-#EHDR
-This page is intended for users to play with freely to practice their
-\WikiFormatting.
-
-$Id$
diff --git a/ruwiki/tags/release-0.7/Ruwiki/To_Do b/ruwiki/tags/release-0.7/Ruwiki/To_Do
deleted file mode 100644
index d13c154..0000000
--- a/ruwiki/tags/release-0.7/Ruwiki/To_Do
+++ /dev/null
@@ -1,61 +0,0 @@
-id: 0
-topic: To_Do
-version: 1
-#EHDR
-= Ruwiki 0.7.0 To Do Tracking
-Completed to-do items can be found in the ChangeLog. Bugs in Ruwiki are
-tracked in BugTracking.
-
-Note that Ruwiki 0.7.0 was originally supposed to be 0.6.3, but the
-Tokenization API change demanded a full version change instead. Thus, there
-are still three planned API-changing releases between now and 1.0.
-
-== Well-Defined To Do Items
-=== Ruwiki 0.8.0
-; Versioning : complete the change history. Change history is currently stored in a file <em>topic</em>.rdiff. There is no way to display the change history at this point.
-; \Ruwiki::Wiki::Handler : Change the way that Tokens get their configuration information to be its own class.
-; Rename \Ruwiki::Handler to \Ruwiki::NetworkHandler to reduce confusion with the new Network Handler.
-; YAML : Convert the page, header, and diff formats to YAML from custom and Marshal formats.
-; Frozen content : make it so that frozen content can be provided on a per-page or Wiki basis. Will provide both headers and footers. <strong>Note:</strong> Ruwiki 0.7.0 will only provide the ability to present the information, not create it.
-; Frozen pages : provide the ability to freeze content in place; the page is no longer "wiki" editable and is effectively a plain HTML page.
-; Function tokens : generalize the %<function-name>[(<args>)] calling method so that function tokens can be created without having to create a custom regular expression.
-=== Ruwiki 0.9.0
-; Full Text search : searches for user specified text on a per-project or whole-Wiki basis.
-; Topic backlink search : searches for mentions of the topic in the other topics for the project.
-; Versioning : complete the change history. Change history is currently stored in a file <em>topic</em>.rdiff. There is no way to display the change history at this point.
-; Recent changes list : displays the list of recent changes to on a per-project or whole-Wiki basis.
-=== Ruwiki 0.10.0
-; Project topic listing : provide a special link (perhaps \Project::Project) that displays the list of topics known to that project.
-; Project listing : provide a special link (perhaps ::*) that displays the list of known projects.
-; Authentication : allow user creation and authentication.
-=== Ruwiki 0.11.0
-; Topic renaming : add the ability to rename a topic within a project. Topic change history should be maintained.
-; Topic moving : add the ability to move and/or rename a topic between projects. Topic change history should be maintained.
-; Complete documentation : Complete the documentation of Ruwiki.
-=== Ruwiki 1.0.0
-; Escape HTML Entities : HTML Entities such as &amp;, &lt;, and &gt; are not currently escaped. This may cause problems with some browsers and should be fixed <strong>without</strong> impairing the ability to add at least some raw HTML. Note that the current engine does not check raw HTML and thus could potentially be vulnerable to cross-site-scripting attacks.
-; Features : Ruwiki will be programmatically extensible with entirely new features: commands, \ACLs, and more. This is planned for 1.0.0.
-
-== General To Do Items
-; Preview button : add a preview button to the save page.
-; Alternative templating systems : not as high priority now that there's a real templating system in place.
-; Alternative markup systems : potentially allow \RedCloth (Textile) and/or \BlueCloth (Markdown) to be processed for a page. This could be implemented as a %function.
-; Project/topic security : allow certain projects to be restricted/authenticated for read/write based on user.
-; RSS Feed :
-; Track last <em>n</em> links/topics : ?
-; Write a markup debugger : ?
-; Validate topic formatting from cgi : ?
-; Validate project from cgi : ?
-; Project-based backend : Allow different projects to have different backends.
-; Hierachical project namespaces : ?
-
-== Future To Do Items
-; E-mail gateway : accept topic appends via e-mail.
-; alternative backends : access other wiki data storage, or other formats, e.g. e-mail boxes in mh or mbox formats
-; backend-to-backend storage format conversion : as noted
-; bug tracker backend : with alternate markup
-; add setup and user config methods : for backend plugin classes, then we can use them with an interactive or gui tool frontend to setup data storage backends. The user might have to run as root or other user with database create permissions.
-; add id="" to various markup elements (make id specific to topic) : Later we can allow users to tweak a page using uploaded css fragments which might get appended onto the standard css contents.
-; ruby action : upload a ruby code fragment to add a smart "action" to that wiki page. Need some sort of security + approval system to handle this safely.
-
-$Id$
diff --git a/ruwiki/tags/release-0.7/Ruwiki/WikiFeatures b/ruwiki/tags/release-0.7/Ruwiki/WikiFeatures
deleted file mode 100644
index 13d4c0f..0000000
--- a/ruwiki/tags/release-0.7/Ruwiki/WikiFeatures
+++ /dev/null
@@ -1,16 +0,0 @@
-id: 0
-version: 1
-topic: WikiFeatures
-#EHDR
-Ruwiki is a [http://www.ruby-lang.org Ruby]-based wiki. It is ideal for
-personal or small team use.
-
-Ruwiki:
-* Uses the [http://www.ruby-lang.org Ruby] language.
-* Runs quickly and easily as a CGI or \WEBrick servlet.
-* Uses a simple templating system and CSS for presentation.
-* Has flatfile storage with simple versioning.
-* Offers project namespaces. Different projects can have the same topic names and not collide. Thus, \Default::ReadMe and \Project::ReadMe are two different pages.
-* Offers a calendar for date-based collaborative editing.
-
-$Id$
diff --git a/ruwiki/tags/release-0.7/Ruwiki/WikiMarkup b/ruwiki/tags/release-0.7/Ruwiki/WikiMarkup
deleted file mode 100644
index 8258492..0000000
--- a/ruwiki/tags/release-0.7/Ruwiki/WikiMarkup
+++ /dev/null
@@ -1,214 +0,0 @@
-id: 0
-topic: WikiMarkup
-version: 1
-#EHDR
-= Ruwiki Markup
-A [http://c2.com/cgi/wiki Wiki] obeys certain formatting rules to make it easy
-to format text without needing to know HTML. This Wiki obeys the following
-rules by default. Because Ruwiki is extensible, there may be additional
-formatting rules. These rules are those rules that apply as of Ruwiki 0.7.0.
-
-== \WikiWords, \WikiProjects, Calendars, and External Resources
-While reading stuff on this Wiki, you will see some words mashed together with
-capitalisation (like \WikiWords). While this may seem odd at first, this
-feature allows internal links to be created across the Wiki.
-
-There are several allowable forms for \WikiWords.
-# Two or more words concatenated directly. Each word must begin with a capital letter and be followed by zero or more lowercase letters. Thus, \FooBar, \CPlusPlus, and \AbC are all valid \WikiWords, but ABC is not.
-# Two or more words concatenated with underscores. The first word must begin with a capital letter. This makes \Foo_Bar, \C_Plus_Plus, and \A_b_C valid \WikiWords. These \WikiWords will be displayed with spaces instead of underscores.\C_Plus_Plus will be displayed as "C Plus Plus".
-# One or more words contained in double square brackets. This the form supported by [http://wikipedia.com/ Wikipedia], and looks like \[[A Wiki Phrase]]. These links will be displayed exactly as entered between the brackets.
-# One or more words contained in double square brackets with display text separated by a vertical bar. These \WikiWords look like \[[A Wiki Phrase|but show this text]]. The link will be to the page "A Wiki Phrase" and "but show this text" will be the hyperlink.
-
-If a \WikiWord is found that does not have a page defining the \WikiWord, then
-the word will be shown with a hyperlink question mark following it, allowing
-the \WikiWord to be created.
-
-=== \WikiProjects
-This Wiki supports "projects." Within each project, a given \WikiWord is
-unique. Thus, if you have a Default project and a Ruwiki project, you can have
-two pages called \ReadMe. Any given \WikiWord refers only to topics within its
-project. That is, if I have \WikiWord in the \ReadMe topic of the Default
-project, it will refer to the \WikiWord topic of the Default project. (Another
-term for this capability is "namespaces.")
-
-A cross-project link is composed of the project's name, two colons (::), and
-the \WikiWord desired. Thus, from \Default::ReadMe, I can have \Ruwiki::ReadMe
-as a link. The project index can be referred to with \::Project. This is the
-same as doing \Project::ProjectIndex. Thus, \::Ruwiki becomes ::Ruwiki, which
-is the same as \Ruwiki::ProjectIndex (Ruwiki::ProjectIndex).
-
-=== Calendars
-: <strong>New to Ruwiki 0.7.0!</strong>
-
-Ruwiki now has a calendar. It is possible to tell Ruwiki to generate a
-calendar for a particular month with %calendar. The format of %calendar is:
-
- %calendar(<year>, <month>[, <project>])
- %calendar(today[, <project>])
-
-%calendar accepts either the English word "today" (displaying the calendar for
-the current month and year) or a specific month and year for display. A
-calendar for the specified month will be generated where each date in the
-month is treated as a \WikiWord (as are the links to the current month, the
-previous month, and the next month) ready for display or editing. As with all
-other \WikiWord links in Ruwiki, a project may be specified in %calendar,
-making "%calendar(today, Ruwiki)" different from "%calendar(today, Default)".
-
-%calendar(today)
-%calendar(1999, 08, Default)
-
-=== External Resources
-Ruwiki behaves intelligently about resources external to the Wiki itself.
-
-==== External Links
-\URLs to external resources are automatically detected for web addresses, FTP
-addresses, newsgroups, and email links. They are automatically converted to
-clickable \URLs. Be aware that some things that look like URL schemas may be
-make clickable but are not really \URLs.
-
-* \http://www.ruby-lang.org becomes http://www.ruby-lang.org
-
-\URLs may be named with the [url name] syntax. If the name is omitted, the URL
-will be numbered. Numbering is contained to within the page.
-
-* \[http://www.rubygarden.org RubyGarden] becomes [http://www.rubygarden.org RubyGarden].
-* \[http://www.halostatue.ca] and \[http://www.halostatue.ca/ruby] become [http://www.halostatue.ca] and [http://www.halostatue.ca/ruby].
-
-==== Images
-If \URLs are to JPEG (.jpg, .jpeg), PNG (.png), or GIF (.gif) resources, they
-will be rendered as inline images. This works with automatically converted
-\URLs, named \URLs, or numbered \URLs. Named and numbered \URLs affect the
-TITLE and ALT attribute of the image.
-
-* \http://www.halostatue.ca/graphics/maple_leaf.gif http://www.halostatue.ca/graphics/maple_leaf.gif
-* \[http://www.halostatue.ca/graphics/maple_leaf.gif Maple Leaf] [http://www.halostatue.ca/graphics/maple_leaf.gif Maple Leaf]
-* \[http://www.halostatue.ca/graphics/maple_leaf.gif] [http://www.halostatue.ca/graphics/maple_leaf.gif]
-
-==== Ruby Mailing Lists
-If a Ruby mailing list message tag is provided, it will be converted appropriately.
-
-* \[ruby-talk:12345] will become [ruby-talk:12345]
-* \[ruby-core:12345] will become [ruby-core:12345]
-* \[ruby-doc:12345] will become [ruby-doc:12345]
-
-== Headings and Lists
-=== Headings
-Use equals signs (=) for headings. Up to six equals signs can be used for HTML headings 1 - 6.
-
-\===== Heading five<br />
-\====== Heading six
-===== Heading five
-====== Heading six
-
-=== Lists
-==== Bulleted Lists
-Use asterisks (*) to create bulleted lists. More asterisks means more levels.
-
-\* level 1<br />
-\** level 2<br />
-\*** level 3
-
-* level 1
-** level 2
-*** level 3
-==== Numbered Lists
-Use hash marks (#) for numbered lists. More hash marks means deeper levels.
-
-\# level 1<br />
-\## level 2<br />
-\### level 3<br />
-\# level 1.2
-
-# level 1
-## level 2
-### level 3
-# level 1.2
-==== Definition Lists
-Definitions can be created similar to other lists. Unlike "standard" lists,
-though, definition lists have both the term and the definition. They are
-specified like so. As with other lists, repeating the first item (;) will
-increase the indentation level.
-
-\; term : definition<br />
-\;; term2 : definition<br />
-\;;; term3 : definition
-
-; term : definition
-;; term2 : definition
-;;; term3 : definition
-== Paragraph Formatting
-=== Rules
-Four or more dashes ("----") on a line by itself makes a horizontal rule, like
-so:
-
-\----
-----
-=== Paragraphs
-A blank line (it may have whitespace on it) marks a new paragraph. All other
-lines are joined together (excepting headers, lists, and rules).
-
-This line is a new paragraph.
-=== Block Indent Paragraphs
-Paragraphs can be indented by beginning the paragraph with one or more colons
-(:).
-
-\: Indent Level 1<br />
-\:: Indent Level 2<br />
-\::: Indent Level 3
-
-: Indent Level 1
-:: Indent Level 2
-::: Indent Level 3
-
-Paragraphs may be indented as "cites" by using one or more greater-than signs
-(>) at the beginning of the line.
-
-\> Indent Level 1<br />
-\>> Indent Level 2<br />
-\>>> Indent Level 3
-
-> Indent Level 1
->> Indent Level 2
->>> Indent Level 3
-=== Code
-Text that is indented will be presented as formatted in a monospaced font. The
-only change is to escape HTML entities &lt; (&amp;lt;), &gt; (&amp;gt;), and
-&amp; (&amp;amp;).
-
- def replace
- content = @match[1]
- %Q{<pre>#{content}</pre>}
- end
-
-== Miscellaneous Formatting
-=== HTML
-The Ruwiki engine currently passes through HTML without changes. Thus,
-&lt;strong&gt;strong&lt;/strong&gt; would be shown as <strong>strong</strong>.
-<strong><em>Note:</em></strong> This capability could be very dangerous as it
-could expose the Wiki to cross-site scripting (XSS) vulnerabilities. This will
-be remedied prior to the 1.0 release of Ruwiki.
-
-=== Abbreviations
-Certain abbreviations may be known to the Wiki. While there is not yet any way
-for a user to query what abbreviations are known, if the abbreviations are
-told to the users, they may be used. Abbreviations are presented with @{key},
-where <em>key</em> is the abbreviation desired. This Wiki, for example, knows
-that \@{PM} means @{PM}. The special form \@{} will produce the current list
-of known abbreviations. Unknown abbreviations will simply be put back into the
-data stream unchanged. Thus, \@{unknownkey} results in @{unknownkey}.
-
-==== Known Abbreviations
-@{}
-
-=== Preventing Formatting
-If you wish to prevent a word or sequence from being interpreted, put a
-backslash (\) in front of it. This works on all formatting options except
-paragraph positioning. Thus, if I want to prevent a \WikiWord from being
-turned into a hyperlink, I need to backslash it: \\WikiWord.
-
-=== Other Possible Considerations
-I'm looking at adding styles similar to what is shown on the Wiki below.
-
-* http://www.pmichaud.com/wiki/PmWiki/WikiStyles
-
-$Id$
diff --git a/ruwiki/tags/release-0.7/lib/algorithm/diff.rb b/ruwiki/tags/release-0.7/lib/algorithm/diff.rb
deleted file mode 100644
index af36214..0000000
--- a/ruwiki/tags/release-0.7/lib/algorithm/diff.rb
+++ /dev/null
@@ -1,220 +0,0 @@
-#
-# algorith/diff - a Ruby module to compute difference sets between two
-# objects. Copyright (c) 2001-2002 Lars Christensen.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
-
-module Diff
-
- VERSION = 0.4
-
- attr_reader :diffs
-
- def Diff.lcs(a, b)
- astart = 0
- bstart = 0
- afinish = a.length-1
- bfinish = b.length-1
- mvector = []
-
- # First we prune off any common elements at the beginning
- while (astart <= afinish && bstart <= afinish && a[astart] == b[bstart])
- mvector[astart] = bstart
- astart += 1
- bstart += 1
- end
-
- # now the end
- while (astart <= afinish && bstart <= bfinish && a[afinish] == b[bfinish])
- mvector[afinish] = bfinish
- afinish -= 1
- bfinish -= 1
- end
-
- bmatches = b.reverse_hash(bstart..bfinish)
- thresh = []
- links = []
-
- (astart..afinish).each { |aindex|
- aelem = a[aindex]
- next unless bmatches.has_key? aelem
- k = nil
- bmatches[aelem].reverse_each { |bindex|
- if k && (thresh[k] > bindex) && (thresh[k-1] < bindex)
- thresh[k] = bindex
- else
- k = thresh.replacenextlarger(bindex, k)
- end
- links[k] = [ k!=0 && links[k-1], aindex, bindex ] if k
- }
- }
-
- if !thresh.empty?
- link = links[thresh.length-1]
- while link
- mvector[link[1]] = link[2]
- link = link[0]
- end
- end
-
- return mvector
- end
-
- def Diff.makediff(a, b)
- mvector = Diff.lcs(a, b)
- ai = bi = 0
- while ai < mvector.length
- bline = mvector[ai]
- if bline
- while bi < bline
- yield :+, bi, b[bi]
- bi += 1
- end
- bi += 1
- else
- yield :-, ai, a[ai]
- end
- ai += 1
- end
- while ai < a.length
- yield :-, ai, a[ai]
- ai += 1
- end
- while bi < b.length
- yield :+, bi, b[bi]
- bi += 1
- end
- 1
- end
-
- def Diff.diff(a, b, &block)
- isstring = b.kind_of? String
- diffs = []
-
- block ||= proc { |action, index, element|
- prev = diffs[-1]
- if prev && prev[0] == action &&
- prev[1] + prev[2].length == index
- prev[2] << element
- else
- diffs.push [ action, index, isstring ? element.chr : [element] ]
- end
- }
-
- Diff.makediff(a, b, &block)
-
- return diffs
- end
-
-end
-
-module Diffable
- def diff(b)
- Diff.diff(self, b)
- end
-
- # Create a hash that maps elements of the array to arrays of indices
- # where the elements are found.
-
- def reverse_hash(range = (0...self.length))
- revmap = {}
- range.each { |i|
- elem = self[i]
- if revmap.has_key? elem
- revmap[elem].push i
- else
- revmap[elem] = [i]
- end
- }
- return revmap
- end
-
- # Replace the first element which is larger than value. Assumes that
- # the element indexed by high, if given is larger than value.
-
- def replacenextlarger(value, high = nil)
- high ||= length
- low = 0
- index = found = nil
- while low < high
- index = (high+low) >> 1
- found = self[index]
- if value > found # this first, most common case
- low = index + 1
- elsif value == found
- return nil
- else
- high = index
- end
- end
- self[low] = value
- return low
- end
-
- # Patches self with the given set of differences.
-
- def patch(diffs)
- newary = nil
- kindofstring = kind_of? String
- if kindofstring
- newary = self.class.new('')
- else
- newary = self.class.new
- end
- ai = 0
- bi = 0
- diffs.each { |action,position,elements|
- case action
- when :-
- while ai < position
- newary << self[ai]
- ai += 1
- bi += 1
- end
- ai += elements.length
- when :+
- while bi < position
- newary << self[ai]
- ai += 1
- bi += 1
- end
- if kindofstring
- newary << elements
- else
- newary.push *elements
- end
- bi += elements.length
- else
- raise "Unknown diff action"
- end
- }
- while ai < self.length
- newary << self[ai]
- ai += 1
- bi += 1
- end
- return newary
- end
-end
-
-class Array
- include Diffable
-end
-
-class String
- include Diffable
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki.rb b/ruwiki/tags/release-0.7/lib/ruwiki.rb
deleted file mode 100644
index 07e2aa6..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki.rb
+++ /dev/null
@@ -1,319 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-require 'digest/md5'
-require 'ruwiki/handler'
-require 'ruwiki/template'
-require 'ruwiki/lang/en' # Default to the English language.
-require 'ruwiki/config'
-require 'ruwiki/backend'
-require 'ruwiki/wiki'
-require 'ruwiki/page'
-
- # = Ruwiki
- # Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI
- # and WEBrick interfaces, templates, and CSS formatting. Additionally, it
- # supports project namespaces, so that two pages can be named the same for
- # differing projects without colliding or having to resort to odd naming
- # conventions. Please see the ::Ruwiki project in the running Wiki for more
- # information. Ruwiki 0.7.0 has German and Spanish translations available.
- #
- # == Quick Start (CGI)
- # 1. Place the Ruwiki directory in a place that your webserver can execute
- # CGI programs and ensure that ruwiki.cgi is executable on your webserver.
- # 2. Point your web browser to the appropriate URL.
- #
- # == Quick Start (WEBrick)
- # 1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
- # 2. Point your web browser to <http://localhost:8808/>.
- #
- # == Configuration
- # There are extensive configuration options available. The Ruwiki WEBrick
- # servlet offers command-line options that simplify the configuration of
- # Ruwiki without editing the servlet; use ruwiki_servlet --help for more
- # information.
- #
- # == Copyright
- # Copyright:: Copyright © 2002 - 2004, Digikata and HaloStatue, Ltd.
- # Authors:: Alan Chen (alan@digikata.com)
- # Austin Ziegler (ruwiki@halostatue.ca)
- # Licence:: Ruby's
-class Ruwiki
- VERSION = '0.7'
-
- ALLOWED_ACTIONS = %w(edit create)
- EDIT_ACTIONS = %w(save cancel)
- EDIT_VARS = %w(newpage origpage topic project old_version version)
- RESERVED = ['action', EDIT_VARS].flatten
-
- # Returns the current configuration object.
- attr_reader :config
- # Returns the current Response object.
- attr_reader :response
- # Returns the current Request object.
- attr_reader :request
- # Returns the current Markup object.
- attr_reader :markup
- # Returns the current Backend object.
- attr_reader :backend
-
- # Sets the configuration object to a new configuration object.
- def config=(c)
- raise message()[:config_not_ruwiki_config] unless c.kind_of?(Ruwiki::Config)
- @config = c
- @markup.default_project = @config.default_project
- end
-
- # The message hash.
- def message
- @config.message
- end
-
- # Initializes Ruwiki.
- def initialize(handler)
- @request = handler.request
- @response = handler.response
-
- @config = Ruwiki::Config.new
-
- @path_info = @request.determine_request_path || ""
-
- @type = nil
- @error = {}
-
- @markup = Ruwiki::Wiki.new(@config.default_project,
- @request.script_url)
- end
-
- # Initializes the backend for Ruwiki.
- def set_backend
- @backend = BackendDelegator.new(self, @config.storage_type)
- @markup.backend = @backend
- end
-
- # Runs the steps to process the wiki.
- def run
- @config.verify
- set_backend
- set_page
- process_page
- render
- rescue Exception => e
- render(:error, e)
- ensure
- output
- end
-
- # Initializes current page for Ruwiki.
- def set_page
- path_info = @path_info.split(%r{/}, -1).map { |e| e.empty? ? nil : e }
-
- if path_info.size == 1 or (path_info.size > 1 and path_info[0])
- raise message()[:invalid_path_info_value] % [@path_info] unless path_info[0].nil?
- end
-
- # path_info[0] will ALWAYS be nil.
- path_info.shift
-
- case path_info.size
- when 0 # Safety check.
- nil
- when 1 # /PageTopic OR /_edit
- set_page_name_or_action(path_info[0])
- when 2 # /Project/ OR /Project/PageTopic OR /Project/_edit OR /Project/create
- @project = path_info.shift
- set_page_name_or_action(path_info[0])
- else # /Project/PageTopic/_edit OR /Project/diff/3,4 OR something else.
- @project = path_info.shift
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- else
- @topic = item
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- end
- end
- end
-
-#@request.each_parameter { |key, val| puts "#{key} :: #{val.class}" }
-
- @request.each_parameter do |key, val|
- next if RESERVED.include?(key)
- @topic = key
- end
-
- @project ||= @request.parameters['project']
- @project ||= @config.default_project
- @topic ||= @config.default_page
- end
-
- # Processes the page through the necessary steps. This is where the edit,
- # save, cancel, and display actions are present.
- def process_page
- content = nil
- page_init = @backend.retrieve(@topic, @project)
-
- page_init[:markup] = @markup
- page_init[:project] ||= @config.default_project
- page_init[:remote_host] = @request.environment['REMOTE_HOST']
- page_init[:remote_addr] = @request.environment['REMOTE_ADDR']
-
- @page = Ruwiki::Page.new(page_init)
-
- @type = :content
-
- # TODO Detect if @action has already been set.
- @action = @request.parameters['action'].downcase if @request.parameters['action']
-
- if @action
- case @action
- when 'edit', 'create'
- # Automatically create the project if it doesn't exist or if the
- # action is 'create'.
- @backend.create_project(@page.project) if @action == 'create'
- @backend.create_project(@page.project) unless @backend.project_exists?(@page.project)
- @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR'])
-
- content = nil
- @type = :edit
- when 'save'
- np = @request.parameters['newpage'].gsub(/\r/, "").chomp
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
-
- op = @request.parameters['origpage'].unpack("m*")[0]
-
- if np == op
- @page.content = op
- @type = :content
- else
- @page.content = np
- @page.old_version = @request.parameters['old_version'].to_i + 1
- @page.version = @request.parameters['version'].to_i + 1
- @type = :save
- @backend.store(@page)
- end
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
-
- content = @page.to_html
- when 'cancel'
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.content = @request.parameters['origpage'].unpack("m*")[0]
- @page.old_version = @request.parameters['old_version'].to_i
- @page.version = @request.parameters['version'].to_i
-
- content = @page.to_html
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- else
- # TODO Return a 501 Not Implemented error
- nil
- end
- else
- content = @page.to_html
- end
- rescue Exception => e
- @type = :error
- if e.kind_of?(Ruwiki::Backend::BackendError)
- @error[:name] = "#{message()[:error]}: #{e.to_s}"
- else
- @error[:name] = "#{message()[:complete_utter_failure]}: #{e.to_s}"
- end
- @error[:backtrace] = e.backtrace.join("<br />\n")
- content = nil
- ensure
- @content = content
- end
-
- # Renders the page.
- def render(*args)
- if args.empty?
- type = @type
- error = @error
- else
- raise ArgumentError, message()[:render_arguments] unless args.size == 2
- type = args[0]
- error = {}
- error[:name] = args[1].inspect.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;')
- error[:backtrace] = args[1].backtrace.join("<br />\n")
- end
-
- @rendered_page = ""
- values = { "css_link" => @config.css_link,
- "home_link" => %Q(<a href="#{@request.script_url}">#{@config.title}</a>),
- "encoding" => @config.message[:encoding]
- }
-
- case type
- when :content, :save
- values["wiki_title"] = "#{message()[:error]} - #{@config.title}" if @page.nil?
- values["wiki_title"] ||= "#{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_topic"] = CGI.unescape(@page.topic)
- values["page_raw_topic"] = @page.topic
- values["page_project"] = @page.project
- values["cgi_url"] = @request.script_url
- values["content"] = @content
- if type == :content
- template = TemplatePage.new(@config.template(:body), @config.template(:content), @config.template(:controls))
- else
- template = TemplatePage.new(@config.template(:body), @config.template(:save), @config.template(:controls))
- end
- when :edit
- template = TemplatePage.new(@config.template(:body), @config.template(:edit))
- values["wiki_title"] = "#{message()[:editing]}: #{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_topic"] = CGI.unescape(@page.topic)
- values["page_raw_topic"] = @page.topic
- values["page_project"] = @page.project
- values["cgi_url"] = @request.script_url
- values["page_content"] = @page.content
- values["orig_page"] = [@page.content].pack("m*")
- values["page_old_version"] = @page.old_version.to_s
- values["page_version"] = @page.version.to_s
- values["unedited_page_content"] = @page.to_html
- values["pre_page_content"] = CGI.escapeHTML(@page.content)
- when :error
- template = TemplatePage.new(@config.template(:body), @config.template(:error))
- values["wiki_title"] = "#{message()[:error]} - #{@config.title}"
- values["name"] = error[:name]
- values["backtrace"] = error[:backtrace]
- values["backtrace_email"] = error[:backtrace].gsub(/<br \/>/, '')
- values["webmaster"] = @config.webmaster
- end
-
- template.write_html_on(@rendered_page, values)
- end
-
- # Outputs the page.
- def output
- @response.add_header("Content-type", "text/html")
- @response.add_header("Cache-Control", "max_age=0")
- @response.write_headers
- @response << @rendered_page
- end
-
-private
- RE_ACTION = %r{^_([[:lower:]]+)$}
-
- def set_page_name_or_action(item)
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- else
- @topic = item
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/backend.rb b/ruwiki/tags/release-0.7/lib/ruwiki/backend.rb
deleted file mode 100644
index e0d4178..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/backend.rb
+++ /dev/null
@@ -1,165 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'algorithm/diff'
-
-class Ruwiki
- # The list of known backends.
- KNOWN_BACKENDS = [:flatfiles]
-
- # The Ruwiki backend delegator. Ruwiki will always instantiate a version
- # of this class which delegates the actual method execution to the Backend
- # class. Error handling is handled by capturing (and possibly forwarding)
- # exceptions raised by the delegate class.
- class BackendDelegator
- def initialize(ruwiki, backend)
- @message = ruwiki.config.message
- options = ruwiki.config.storage_options
-
- unless Ruwiki::KNOWN_BACKENDS.include?(backend)
- raise RuntimeError, @message[:backend_unknown] % [backend]
- end
-
- beconst = (befile = backend.id2name).capitalize
-
- require "ruwiki/backend/#{befile}"
-
- beoptions = options[backend]
- @delegate = Ruwiki::Backend.const_get(beconst).new(beoptions)
- rescue Ruwiki::Backend::BackendError => e
- if e.kind_of?(Array)
- raise Ruwiki::Backend::BackendError.new(nil), @message[e.reason[0]] % e.reason[1]
- else
- raise
- end
- end
-
- # Retrieve the specified topic and project page. Calls Backend#load
- # after verifying that the project exists.
- def retrieve(topic, project = 'Default')
- unless page_exists?(topic, project)
- if project_exists?(project)
- return { :content => "", :topic => topic, :project => project }
- else
- return { :content => @message[:project_does_not_exist] % [project],
- :topic => topic, :project => project }
- end
- end
-
- buffer = @delegate.load(topic, project)
- return { :rawtext => buffer.join(""), :project => project, :topic => topic }
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_read_topic] % [project, topic]
- rescue Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_retrieve_topic] % p
- end
-
- # Stores the specified topic and project page.
- def store(page)
- @delegate.store(page)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_store_topic] % [page.project, page.topic]
- rescue Exception => e
- p = [page.project, page.topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_store_topic] % p
- end
-
- # Destroys the specified topic and project page.
- def destroy(page)
- @delegate.destroy(page)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_destroy_topic] % [page.project, page.topic]
- rescue Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_destroy_topic] % p
- end
-
- # Releases the lock on the page.
- def release_lock(page, address = 'UNKNOWN')
- @delegate.release_lock(page, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_release_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:error_releasing_lock] % p
- end
-
- # Attempts to obtain a lock on the page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- @delegate.obtain_lock(page, address, timeout)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_obtain_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:error_creating_lock] % p
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- @delegate.project_exists?(project)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- @delegate.page_exists?(topic, project)
- end
-
- # Attempts to create the project.
- def create_project(project)
- @delegate.create_project(project)
- rescue Ruwiki::Backend::ProjectExists => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:project_already_exists] % [project]
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_create_project] % [project]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_create_project] % p
- end
-
- # Attempts to destroy the project.
- def destroy_project(project)
- @delegate.destroy_project(project)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_destroy_project] % [project]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_destroy_project] % p
- end
- end
-
- # The Ruwiki backend abstract class and factory.
- class Backend
- class ProjectExists < StandardError #:nodoc:
- end
- class BackendError < StandardError #:nodoc:
- attr_reader :reason
-
- def initialize(reason, *args)
- @reason = reason
- end
- end
- def initialize(storage_options)
- end
-
- private
- # Creates the current diff object.
- def make_diff(page, oldpage, newpage)
- {
- 'old_version' => page.old_version,
- 'new_version' => page.version,
- 'change_date' => Time.now,
- 'change_ip' => page.change_ip,
- 'change_id' => page.change_id,
- 'diff' => Diff.diff(oldpage, newpage)
- }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/backend/flatfiles.rb b/ruwiki/tags/release-0.7/lib/ruwiki/backend/flatfiles.rb
deleted file mode 100644
index e00c5c2..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/backend/flatfiles.rb
+++ /dev/null
@@ -1,155 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Backend
- # Stores Ruwiki pages as flatfiles.
- class Flatfiles < Ruwiki::Backend
- # Initializes the flatfile backend. This will read
- # storage_options[:flatfiles] to determine the options set by the
- # user. The following options are known for <tt>:flatfiles</tt>:
- #
- # :data_path:: The directory in which the wiki files will be found.
- # By default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+.
- def initialize(options)
- options[:data_path] ||= "./data/"
- @data_path = options[:data_path]
- @extension = options[:extension]
- if not (File.exists?(@data_path) and File.directory?(@data_path))
- raise Ruwiki::Backend::BackendError.new([:flatfiles_no_data_directory, [@data_path]])
- end
- super options
- end
-
- # Loads the topic page from disk.
- def load(topic, project)
- pagefile = page_file(topic, project)
- buffer = File.readlines(pagefile)
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pf = page_file(page.topic, page.project)
- cf = "#{pf}.rdiff"
-
- oldfile = File.readlines(pf) rescue []
- oldfile.collect! { |e| e.chomp }
- newfile = page.rawtext.split(/\n/)
-
- diff = make_diff(page, oldfile, newfile)
- diffs = []
- File.open(cf, 'rb') { |f| diffs = Marshal.load(f) } if File.exists?(cf)
- diffs << diff
- changes = Marshal.dump(diffs)
-
- File.open(cf, 'wb') { |cfh| cfh.print changes }
- File.open(pf, 'wb') { |pfh| pfh.puts page.rawtext }
- end
-
- # Destroys the topic page.
- def destroy(page)
- pf = page_file(page.topic, page.project)
- File.unlink(pf) if File.exists?(pf)
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- pd = project_directory(project)
- File.exists?(pd) and File.directory?(pd)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- pf = page_file(topic, project)
- project_exists?(project) and File.exists?(pf)
- end
-
- # Tries to create the project.
- def create_project(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::ProjectExists if File.exists?(pd)
- Dir.mkdir(pd)
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
- time = Time.now.to_i
-
- lock_okay = false
- # See if we have the lock already.
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, we don't care how old it
- # is. Thus, release it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lock_okay = true
- end
-
- if lock_okay
- open(lf, 'w') { |lfh| lfh.puts "#{address}\n#{time + timeout}" }
- else
- raise Ruwiki::Backend::BackendError(nil)
- end
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
- time = Time.now.to_i
-
- lock_okay = false
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, then we can safely remove
- # it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lock_okay = true
- end
-
- if lock_okay
- File.unlink(lf) if File.exists?(lf)
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- end
-
- private
- def project_directory(project)
- File.join(@data_path, project)
- end
-
- def page_file(topic, project = 'Default')
- if @extension.nil?
- File.join(project_directory(project), topic)
- else
- File.join(project_directory(project), "#{topic}.#{@extension}")
- end
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/config.rb b/ruwiki/tags/release-0.7/lib/ruwiki/config.rb
deleted file mode 100644
index ba3acea..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/config.rb
+++ /dev/null
@@ -1,134 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Features known to Ruwiki.
- KNOWN_FEATURES = [ ]
-
- # Ruwiki configuration.
- class Config
- # Templates known to Ruwiki.
- TEMPLATES = [ :body, :content, :error, :edit, :controls, :save ]
-
- # Adds additional information to the (rare) error reports. Defaults to
- # +false+.
- attr_accessor :debug
- # The default page for display when Ruwiki is called without any
- # arguments. Defaults to +ProjectIndex+
- attr_accessor :default_page
- # The default project for display when Ruwiki is called without any
- # arguments or a project specification. Defaults to +Default+
- attr_accessor :default_project
- # The storage type as a Symbol. Corresponds to a filename that will be
- # found in ruwiki/backend. In this version of Ruwiki, only flatfiles.rb
- # (e.g., :flatfiles) is defined. Defaults to <tt>:flatfiles</tt>.
- attr_accessor :storage_type
- # The options for the specified storage type. This is a hash of hashes
- # with auto-vifification. See the storage type for available options.
- attr_reader :storage_options
- # The options for the specified feature. This is a hash of hashes with
- # auto-vifification. See #features for more information.
- attr_reader :feature_options
- # The path for templates. Defaults to <tt>./templates/</tt>.
- attr_accessor :template_path
- # The name of the Wiki. Defaults to <tt>ruwiki</tt>
- attr_accessor :title
- # The email address of the webmaster for the Wiki. Defaults to +nil+.
- attr_accessor :webmaster
- # The name of the Ruwiki CSS file. Defaults to <tt>ruwiki.css</tt>.
- attr_accessor :css
- # The template set. Templates are always named as
- # <template_path>/<template_set>/<template_kind>.
- #Template filename. Must be reachable by File#read.
- attr_accessor :template_set
- # Ruwiki is internationalized. This method sets the Ruwiki error
- # messages (and a few other messages) )to the specified language Module.
- # The language Module must have a constant Hash called +Message+
- # containing a set of symbols and localized versions of the messages
- # associated with them.
- #
- # If the file 'ruwiki/lang/es.rb' contains the module
- # <tt>Ruwiki::Lang::ES</tt>, the error messages for RSS could be
- # localized to Español thus:
- #
- # require 'ruwiki/lang/es'
- # ...
- # wiki.config.language = Ruwiki::Lang::ES
- #
- # Localization is per wiki instance. In a servlet environment, this may
- # mean that only a single language is recognised.
- #
- # See Ruwiki::Lang::EN for more information.
- attr_accessor :language
- # The message hash.
- attr_reader :message
-
- def language=(l) #:nodoc:
- @language = l
- @message = l::Message
- @message.default = l::Message.default
- end
-
- # Returns the template string
- def template(kind = :body)
- raise ConfigError, message[:no_template_found] % [kind.inspect, @template_set] unless TEMPLATES.include?(kind)
- File.read(File.join(@template_path, @template_set, "#{kind.to_s}.tmpl"))
- end
-
- # Returns a copy of the list of features supported by this Wiki.
- def features
- @features.dup
- end
-
- # Adds a new feature to the Wiki.
- def add_feature(feature)
- raise ConfigError, message[:unknown_feature] % [feature.inspect] unless KNOWN_FEATURES.include?(feature)
- @features << feature
- end
-
- # Returns the CSS stylesheet content for the Wiki. This previously
- # returned the <link> to the stylesheet, but instead returns a <style>
- # block in the head so that the CSS is kept with the template set, which
- # may be kept outside of the HTML area.
- def css_link
- %Q[<style>#{File.read(File.join(@template_path, @template_set, @css))}</style>]
- end
-
- # Creates a new configuration object.
- def initialize
- @debug = false
- @default_project = "Default"
- @default_page = "ProjectIndex"
- @storage_type = :flatfiles
- @storage_options = Hash.new { |h, k| h[k] = {} }
- @template_path = "./templates/"
- @template_set = "default"
- @css = "ruwiki.css"
- @webmaster = nil
- @title = "Ruwiki"
- @features = []
- @feature_options = Hash.new { |h, k| h[k] = {} }
-
- self.language = Ruwiki::Lang::EN
- end
-
- # Verifies that required configuration options are actually set. Right
- # now, it only checks the values that are defaulted to +nil+.
- def verify
- raise ConfigError, message[:no_webmaster_defined] if @webmaster.nil?
- raise ConfigError, message[:invalid_template_dir] % [@template_path] unless File.exists?(@template_path) and File.directory?(@template_path)
- t = File.join(@template_path, @template_set)
- raise ConfigError, message[:no_template_set] % [@template_set] unless File.exists?(t) and File.directory?(t)
- end
-
- class ConfigError < StandardError #:nodoc:
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/handler.rb b/ruwiki/tags/release-0.7/lib/ruwiki/handler.rb
deleted file mode 100644
index e31bbc1..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/handler.rb
+++ /dev/null
@@ -1,207 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Handler
- class << self
- # Generate a new Handler pair from a CGI request.
- def from_cgi(cgi, output_stream = $stdout)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::CGIRequest.new(cgi)
- o.response = Ruwiki::Handler::CGIResponse.new(cgi, output_stream)
- end
- end
-
- # Generate a new Handler pair from a WEBrick request.
- def from_webrick(req, res)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::WEBrickRequest.new(req)
- o.response = Ruwiki::Handler::WEBrickResponse.new(res)
- end
- end
- end
-
- # Returns the handler's request object.
- attr_accessor :request
- # Returns the handler's response object.
- attr_accessor :response
-
- # Creates the handler pair.
- def initialize(&block) #:yields: self
- @request = nil
- @response = nil
- yield self if block_given?
- end
-
- # REpresents an abstract incoming request. This insulates the rest of
- # the code from knowing whether parameters are passed as part of the
- # path, as parameters in the URL, or in some other fashion.
- class AbstractRequest
- def initialize(*args)
- end
- end
-
- # Handles all requests from web applications.
- #
- # Subclasses should provide:
- # @parameters:: Hash-like object that responds to #[] and #hash_key?]
- # @environment:: Hash-like object that responds to #[]
- class AbstractWebRequest < AbstractRequest
- # The parameters provided via the web request.
- attr_reader :parameters
- # The environment provided to the web request.
- attr_reader :environment
- # The request path.
- attr_reader :path
-
- # Yields each parameter key in succession.
- def each_parameter #:yields: key, value
- @parameters.each { |k, v| yield k, v }
- end
-
- def each_environment #:yields: key, value
- @environment.each { |k, v| yield k, v }
- end
-
- # Return the URL of our server.
- def server_url
- res = "http://" # should detect whether we're in secure server mode.
- if @environment['HTTP_HOST']
- res << @environment['HTTP_HOST']
- else
- res << "#{@environment['SERVER_NAME']}:#{@environment['SERVER_PORT']}"
- end
- end
-
- # Return the URL of this script.
- def script_url
- server_url << @environment['SCRIPT_NAME'].to_s
- end
-
- # Return the URL of this request.
- def request_url
- res = script_url
- res << @environment['PATH_INFO'] if @environment['PATH_INFO']
- query = @environment['QUERY_STRING']
- res << "?#{@environment['QUERY_STRING']}" if query && !query.empty?
- res
- end
-
- # Convert a file path into a URL
- def make_url(project, path)
- "#{server_url}/#{project}/#{path}"
- end
-
- def determine_request_path
- @path = ""
- return @path if @environment['PATH_INFO'].nil?
- @path = @environment['PATH_INFO'].dup
- end
- end
-
- # Request for CGI-based activity to ruwiki.
- class CGIRequest < AbstractWebRequest
- def initialize(cgi, output_stream = $stdout)
- @environment = ENV
- @cgi = cgi
- @parameters = {}
- cgi.params.each { |k, v| @parameters[k] = v[0] }
- super
- end
- end
-
- # Request for WEBrick based servlet activity to ruwiki.
- class WEBrickRequest < AbstractWebRequest
- def initialize(req)
- @environment = req.meta_vars
- @parameters = req.query
- super
- end
- end
-
- # Used to write responses in different execution environments such as
- # CGI and Webrick.
- #
- # If you want to create a new response object, you'll need to implement
- # #add_header, #write_headers, and #<<.
- #
- # The Response object is instantiated with an output stream which must
- # supply +<<+ and +puts+ methods.
- class AbstractResponse
- # Add to the list of headers to be sent back to the client.
- def add_header(key, value)
- raise "Not implemented"
- end
-
- # Write the accumulated headers back to the client.
- def write_headers
- raise "Not implemented"
- end
-
- # Write the string to the client.
- def <<(string)
- raise "Not implemented"
- end
-
- # output_stream must respond to #<< and #puts.
- def initialize(output_stream = $stdout)
- @headers = {}
- @output_stream = output_stream
- end
- end
-
- # CGIResponse is the response object for CGI mode.
- class CGIResponse < AbstractResponse
- # output_stream must respond to #<< and #puts.
- def initialize(cgi, output_stream = $stdout)
- @cgi = cgi
- super(output_stream)
- end
-
- # Add the header pair for later output as a CGI header.
- def add_header(key, value)
- @headers[key] = value
- end
-
- # Write the headers to the stream. The headers can only be written
- # once.
- def write_headers
- return if @written
- @headers.each { |key, value| @output_stream.puts "#{key}: #{value}\r\n" }
- @output_stream.puts
- @written = true
- end
-
- # Output the string to the stream provided.
- def <<(string)
- @output_stream << string
- end
- end
-
- # WEBrickResponse is the response object for WEBrick servlet mode.
- class WEBrickResponse < AbstractResponse
- def initialize(webrick_response)
- @response = webrick_response
- end
-
- def add_header(key,value)
- @response[key] = value
- end
-
- def write_headers
- # Webrick will take care of this on its own.
- end
-
- def <<(string)
- @response.body << string
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/lang/de.rb b/ruwiki/tags/release-0.7/lib/ruwiki/lang/de.rb
deleted file mode 100644
index 721c44a..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/lang/de.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Translation by Christian Neukirchen (chneukirchen@yahoo.de) on 22oct2003
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- module Lang
- # Ruwiki::Lang::DE is the German-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module DE
- Message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :encoding => "iso-8859-1",
- # Backend-related messages.
- :backend_unknown => "Unbekanntes Backend %s.",
- :cannot_create_project => "Kann %s nicht erstellen: %s",
- :cannot_destroy_project => "Kann %s nicht zerstören: %s",
- :cannot_destroy_topic => "Kann %s::%s nicht zerstören: %s",
- :cannot_obtain_lock => "Kann keine Sperre für %s::%s erhalten. Bitte in Kürze nochmal versuchen.",
- :cannot_release_lock => "Kann die Sperre für %s::%s nicht lösen. Bitte später nochmal versuchen.",
- :cannot_retrieve_topic => "Kann auf %s::%s nicht zugreifen: %s",
- :cannot_store_topic => "Kann %s::%s nicht speichern: %s",
- :error_creating_lock => "Fehler beim Erzeugen der Sperre von %s::%s: %s",
- :error_releasing_lock => "Fehler beim Lösen der Sperre von %s::%s: %s",
- :flatfiles_no_data_directory => "Das Daten-Verzeichnis (%s) existiert nicht.",
- :no_access_to_create_project => "Keine Berechtigung um das Projekt (%s) zu erstellen.",
- :no_access_to_destroy_project => "Keine Berechtigung um das Projekt (%s) zu zerstören.",
- :no_access_to_destroy_topic => "Kann %s::%s nicht zerstören: %s.",
- :no_access_to_read_topic => "Kann auf %s::%s nicht zugreifen: %s.",
- :no_access_to_store_topic => "Kann %s::%s nicht speichern: %s.",
- :project_already_exists => "Das Projekt %s existiert bereits.",
- :project_does_not_exist => "Das Projekt %s existiert nicht.",
- # Config-related messages.
- :config_not_ruwiki_config => "Die Konfiguration muss von Typ der Klasse Ruwiki::Config sein.",
- :invalid_template_dir => "Der angegebene Pfad für Schablonen (%s) existiert nicht oder ist kein Verzeichnis.",
- :no_template_found => "Keine Schablone %s im Schablonen-Set '%s' gefunden.",
- :no_template_set => "Es gibt kein Schablonen-Set '%s' im Schablonen-Pfad.",
- :no_webmaster_defined => "Konfigurations-Fehler: Webmaster nicht definiert.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fataler Fehler",
- :editing => "Editieren",
- :error => "Fehler",
- :invalid_path_info_value => "Fataler Fehler in der Web-Umgebung. PATH_INFO = %s",
- # Should this really get translated? --chris
- :render_arguments => "Ruwiki#render muss mit zwei oder mehr Argumenten aufgerufen werden.",
- :unknown_feature => "Unbekanntes Feature %s."
- }
- Message.default = proc { |h, k| "Sprachdatei-FEHLER: Unbekannter Nachrichten-Typ #{k.inspect}." }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/lang/en.rb b/ruwiki/tags/release-0.7/lib/ruwiki/lang/en.rb
deleted file mode 100644
index 6a15a3a..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/lang/en.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- module Lang
- # Ruwiki::Lang::EN is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module EN
- Message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :encoding => "iso-8859-1",
- # Backend-related messages.
- :backend_unknown => "Backend %s is unknown.",
- :cannot_create_project => "Cannot create project %s: %s",
- :cannot_destroy_project => "Cannot destroy project %s: %s",
- :cannot_destroy_topic => "Cannot destroy %s::%s: %s",
- :cannot_obtain_lock => "Unable to obtain a lock on %s::%s. Try again shortly.",
- :cannot_release_lock => "Unable to release the lock on %s::%s. Try again shortly.",
- :cannot_retrieve_topic => "Cannot retrieve %s::%s: %s",
- :cannot_store_topic => "Cannot store project %s::%s: %s",
- :error_creating_lock => "Error creating lock on %s::%s: %s",
- :error_releasing_lock => "Error releasing lock on %s::%s: %s",
- :flatfiles_no_data_directory => "The data directory (%s) does not exist.",
- :no_access_to_create_project => "No permission to create project %s.",
- :no_access_to_destroy_project => "No permission to destroy project %s::%s.",
- :no_access_to_destroy_topic => "No permission to destroy topic %s::%s.",
- :no_access_to_read_topic => "No permission to retrieve the %s::%s.",
- :no_access_to_store_topic => "No permission to store the %s::%s.",
- :project_already_exists => "Project %s already exists.",
- :project_does_not_exist => "Project %s does not exist.",
- # Config-related messages.
- :config_not_ruwiki_config => "Configuration must be of class Ruwiki::Config.",
- :invalid_template_dir => "The specified path for templates (%s) does not exist or is not a directory.",
- :no_template_found => "No template of %s found in template set %s.",
- :no_template_set => "There is no template set '%s' in the template path.",
- :no_webmaster_defined => "Configuration error: Webmaster is unset.",
- # Miscellaneous messages.
- :complete_utter_failure => "Complete and Utter Failure",
- :editing => "Editing",
- :error => "Error",
- :invalid_path_info_value => "Something has gone seriously wrong with the web environment. PATH_INFO = %s",
- :render_arguments => "Ruwiki#render must be called with zero or two arguments.",
- :unknown_feature => "Unknown feature %s."
- }
- Message.default = proc { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/lang/es.rb b/ruwiki/tags/release-0.7/lib/ruwiki/lang/es.rb
deleted file mode 100644
index 345392a..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/lang/es.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Mauricio Julio Fernández Pradier (batsman.geo@yahoo.com)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- module Lang
- # Ruwiki::Lang::ES is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module ES
- Message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :encoding => "iso-8859-1",
- # Backend-related messages.
- :backend_unknown => "Clase Backend desconocida: %s.",
- :cannot_create_project => "No puede crearse el proyecto %s: %s",
- :cannot_destroy_project => "No puede borrarse el proyecto %s: %s",
- :cannot_destroy_topic => "No puede borrarse %s::%s: %s",
- :cannot_obtain_lock => "Imposible obtener acceso exclusivo sobre %s::%s. Reinténtelo en breve.",
- :cannot_release_lock => "Imposible liberar acceso exclusivo sobre %s::%s. Reinténtelo en breve.",
- :cannot_retrieve_topic => "No puede leerse %s::%s: %s",
- :cannot_store_topic => "No puede archivarse %s::%s: %s",
- :error_creating_lock => "Error al crear el cerrojo sobre %s::%s: %s",
- :error_releasing_lock => "Error al liberar el cerrojo sobre %s::%s: %s",
- :flatfiles_no_data_directory => "El directorio de datos (%s) no existe.",
- :no_access_to_create_project => "Permiso denegado al crear el proyecto %s.",
- :no_access_to_destroy_project => "Permiso denegado al borrar el proyecto %s::%s.",
- :no_access_to_destroy_topic => "Permiso denegado al borrar el nodo %s::%s.",
- :no_access_to_read_topic => "Permiso denegado al leer el nodo %s::%s.",
- :no_access_to_store_topic => "Permiso denegado al salvar el nodo %s::%s.",
- :project_already_exists => "El proyecto %s ya existe.",
- :project_does_not_exist => "El proyecto %s no existe.",
- # Config-related messages.
- :config_not_ruwiki_config => "La configuración debe ser de clase Ruwiki::Config.",
- :invalid_template_dir => "El path especificado para plantillas (%s) no existe o no es un directorio.",
- :no_template_found => "No se encontró ninguna plantilla para %s en el conjunto %s.",
- :no_template_set => "No hay ningún juego de plantillas '%s' en el path.",
- :no_webmaster_defined => "Error de configuración: Webmaster no está definido.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fallo total y absoluto.",
- :editing => "Editando",
- :error => "Error",
- :invalid_path_info_value => "Algo huele a podrido en su entorno Web. PATH_INFO = %s",
- :render_arguments => "Ruwiki#render debe ser llamado con cero o dos argumentos.",
- :unknown_feature => "Clase Feature desconocida: %s."
- }
- Message.default = proc { |h, k| "ERROR De la Lengua: Llave desconocida del mensaje #{k.inspect}." }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/page.rb b/ruwiki/tags/release-0.7/lib/ruwiki/page.rb
deleted file mode 100644
index 72f9d95..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/page.rb
+++ /dev/null
@@ -1,131 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # A generic page for Ruwiki.
- class Page
- # The page ID.
- attr_accessor :page_id
- # The current version of the page.
- attr_accessor :version
- # The previous version of the page.
- attr_accessor :old_version
- # The page topic (the name of the page).
- attr_accessor :topic
- # The project of the page.
- attr_accessor :project
- # Unformatted page text.
- attr_reader :content
- # Formatted page text.
- attr_accessor :formatted
-
- # The IP address of the person who made the last change.
- def change_ip
- %Q(#{@remote_host} #{@remote_addr})
- end
-
- # The ID, if present, of the person who made the last change. Not yet
- # implemented.
- def change_id
- nil
- end
-
- # Creates a Ruwiki page.
- def initialize(init = {})
- @markup = init[:markup]
- @script = init[:script]
-
- @remote_host = init[:remote_host]
- @remote_addr = init[:remote_addr]
-
- @project = init[:project] || "Default"
- @topic = init[:topic] || "NewTopic"
- @content = init[:content] || ""
- @page_id = init[:page_id] || 0
- @version = init[:version] || 0
- @old_version = @version - 1
-
- if init.has_key?(:rawtext)
- @rawtext = init[:rawtext].dup
- @content = parse_header(@rawtext.dup)
- @formatted = parse_content(@content, @project)
- elsif not @content.empty?
- @formatted = parse_content(@content.dup, @project)
- else
- @formatted = ""
- end
- @content.gsub!(/\r/, "")
- end
-
- # The content of the page.
- def content=(content)
- @content = content.gsub(/\r/, "")
- @formatted = parse_content(content, @project)
- end
-
- # Output raw header and raw page context for saving.
- def rawtext
- return <<-EOS
-id: #{@page_id}
-topic: #{@topic}
-version: #{@version}
-#EHDR
-#{@content}
- EOS
- end
-
- # Outputs the HTML version of the page.
- def to_html
- @formatted
- end
-
- private
- HEADER_RE = /^([a-z]+)\s*:\s*(.*)$/
- HEADER_END_RE = /^#EHDR$/
-
- # Parse the header.
- def parse_header(rawtext)
- rawbuf = rawtext.split("\n")
-
- loop do
- break if rawbuf.nil? or rawbuf.empty?
-
- if rawbuf[0] =~ HEADER_END_RE
- rawbuf.shift
- break
- end
-
- match = HEADER_RE.match(rawbuf[0])
-
- if match
- case match[1].intern
- when :id
- @page_id = match[2].to_i
- when :topic
- @topic = match[2]
- when :version
- @version = match[2].to_i
- @old_version = @version - 1
- end
- rawbuf.shift
- end
- end
-
- rawbuf.join("\n")
- end
-
- # Parse the content.
- def parse_content(content, project)
- parsed = @markup.parse(content, project)
-
- parsed
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/servlet.rb b/ruwiki/tags/release-0.7/lib/ruwiki/servlet.rb
deleted file mode 100644
index d687539..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/servlet.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'webrick'
-
-class Ruwiki
- class Servlet < WEBrick::HTTPServlet::AbstractServlet
- def initialize(config)
- @config = config
- end
-
- # Converts a POST into a GET.
- def do_POST(req, res)
- do_GET(req, res)
- end
-
- def do_GET(req, res)
- # Generate the reponse handlers for Ruwiki from the request and response
- # objects provided.
- wiki = Ruwiki.new(Ruwiki::Handler.from_webrick(req, res))
-
- # Configuration defaults to certain values. This overrides the defaults.
- wiki.config = $config unless $config.nil?
- wiki.run
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/template.rb b/ruwiki/tags/release-0.7/lib/ruwiki/template.rb
deleted file mode 100644
index 9655f21..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/template.rb
+++ /dev/null
@@ -1,223 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file is originally from rdoc by Dave Thomas (dave@pragprog.com).
-#
-# $Id$
-#++
-class Ruwiki
- # RDoc's cheap-n-cheerful HTML page template system. You create a template
- # containing:
- #
- # * variable names between percent signs (<tt>%fred%</tt>)
- # * blocks of repeating stuff:
- # START:key
- # ... stuff
- # END:key
- #
- # You feed the code a hash. For simple variables, the values are resolved
- # directly from the hash. For blocks, the hash entry corresponding to +key+
- # will be an array of hashes. The block will be generated once for each
- # entry. Blocks can be nested arbitrarily deeply.
- #
- # The template may also contain:
- # IF:key
- # ... stuff
- # ENDIF:key
- #
- # _stuff_ will only be included in the output if the corresponding key is
- # set in the value hash.
- #
- # Usage: Given a set of templates <tt>T1, T2,</tt> etc
- # values = { "name" => "Dave", state => "TX" }
- # t = TemplatePage.new(T1, T2, T3)
- # File.open(name, "w") {|f| t.write_html_on(f, values)}
- # or
- # res = ''
- # t.write_html_on(res, values)
- #
- class TemplatePage
-
- # A context holds a stack of key/value pairs (like a symbol table). When
- # asked to resolve a key, it first searches the top of the stack, then
- # the next level, and so on until it finds a match (or runs out of
- # entries).
- class Context
- def initialize
- @stack = []
- end
-
- def push(hash)
- @stack.push(hash)
- end
-
- def pop
- @stack.pop
- end
-
- # Find a scalar value, throwing an exception if not found. This method
- # is used when substituting the %xxx% constructs
- def find_scalar(key)
- @stack.reverse_each do |level|
- if val = level[key]
- return val unless val.kind_of? Array
- end
- end
- raise "Template error: can't find variable '#{key}'"
- end
-
- # Lookup any key in the stack of hashes
- def lookup(key)
- @stack.reverse_each do |level|
- val = level[key]
- return val if val
- end
- nil
- end
- end
-
- # Simple class to read lines out of a string
- class LineReader
- # we're initialized with an array of lines
- def initialize(lines)
- @lines = lines
- end
-
- # read the next line
- def read
- @lines.shift
- end
-
- # Return a list of lines up to the line that matches a pattern. That
- # last line is discarded.
- def read_up_to(pattern)
- res = []
- while line = read
- if pattern.match(line)
- return LineReader.new(res)
- else
- res << line
- end
- end
- raise "Missing end tag in template: #{pattern.source}"
- end
-
- # Return a copy of ourselves that can be modified without affecting us
- def dup
- LineReader.new(@lines.dup)
- end
- end
-
- # +templates+ is an array of strings containing the templates. We start at
- # the first, and substitute in subsequent ones where the string
- # <tt>!INCLUDE!</tt> occurs. For example, we could have the overall page
- # template containing
- #
- # <html><body>
- # <h1>Master</h1>
- # !INCLUDE!
- # </bost></html>
- #
- # and substitute subpages in to it by passing [master, sub_page]. This
- # gives us a cheap way of framing pages
- def initialize(*templates)
- result = "!INCLUDE!"
- templates.each do |content|
- result.sub!(/!INCLUDE!/, content)
- end
- @lines = LineReader.new(result.split($/))
- end
-
- # Render the templates into HTML, storing the result on +op+ using the
- # method <tt><<</tt>. The <tt>value_hash</tt> contains key/value pairs
- # used to drive the substitution (as described above)
- def write_html_on(op, value_hash)
- @context = Context.new
- op << substitute_into(@lines, value_hash).tr("\000", '\\')
- end
-
- # Substitute a set of key/value pairs into the given template. Keys with
- # scalar values have them substituted directly into the page. Those with
- # array values invoke <tt>substitute_array</tt> (below), which examples a
- # block of the template once for each row in the array.
- #
- # This routine also copes with the <tt>IF:</tt>_key_ directive, removing
- # chunks of the template if the corresponding key does not appear in the
- # hash, and the START: directive, which loops its contents for each value
- # in an array
- def substitute_into(lines, values)
- @context.push(values)
- skip_to = nil
- result = []
-
- while line = lines.read
-
- case line
-
- when /^IF:(\w+)/
- lines.read_up_to(/^ENDIF:#$1/) unless @context.lookup($1)
-
- when /^IFNOT:(\w+)/
- lines.read_up_to(/^ENDIF:#$1/) if @context.lookup($1)
-
- when /^ENDIF:/
- ;
-
- when /^START:(\w+)/
- tag = $1
- body = lines.read_up_to(/^END:#{tag}/)
- inner_values = @context.lookup(tag)
- raise "unknown tag: #{tag}" unless inner_values
- raise "not array: #{tag}" unless inner_values.kind_of?(Array)
- inner_values.each do |vals|
- result << substitute_into(body.dup, vals)
- end
- else
- result << expand_line(line.dup)
- end
- end
-
- @context.pop
-
- result.join("\n")
- end
-
- # Given an individual line, we look for %xxx% constructs and
- # HREF:ref:name: constructs, substituting for each.
- def expand_line(line)
- # Generate a cross reference if a reference is given,
- # otherwise just fill in the name part
-
- line.gsub!(/HREF:(\w+?):(\w+?):/) do
- ref = @context.lookup($1)
- name = @context.find_scalar($2)
-
- if ref and !ref.kind_of?(Array)
- "<a href=\"#{ref}\">#{name}</a>"
- else
- name
- end
- end
-
- # Substitute in values for %xxx% constructs. This is made complex
- # because the replacement string may contain characters that are
- # meaningful to the regexp (like \1)
-
- line = line.gsub(/%([a-zA-Z]\w*)%/) do
- val = @context.find_scalar($1)
- val.tr('\\', "\000")
- end
-
- line
- rescue Exception => e
- $stderr.puts "Error in template: #{e}"
- $stderr.puts "Original line: #{line}"
- exit
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/wiki.rb b/ruwiki/tags/release-0.7/lib/ruwiki/wiki.rb
deleted file mode 100644
index d315357..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/wiki.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Ruwiki's Wiki markup class. This will convert the Wiki markup known by
- # Ruwiki (defined by Token classes). The algorithm is as follows:
- #
- # 1. For each known Token class, match each instance of it in the content
- # stream. Replace each instance in the content stream with a Token
- # marker: TOKEN_x or \TOKEN_x, where x is a digit representing the
- # Token. (\TOKEN_x is a special case of token matching. See
- # Ruwiki::Markup::Token for more information.) Store the Token for
- # later processing.
- # 2. Go back through the content, replacing each instance of \TOKEN_x
- # with the Token's defined restore value (which should be the same
- # value as was originally matched).
- # 3. Go through the content, replacing each instance of TOKEN_x with the
- # Token's defined replacement value.
- # 4. Go through the tokens, in reverse, and execute the post replacement
- # routine defined by the Token. (This may be necessary to collapse
- # consecutive HTML structures.)
- # 5. Return the parsed content and the collected metadata.
- #
- # == Tokens
- # Look at Ruwiki::Markup::Token describes how to create Token objects.
- class Wiki
- def parse(content, project)
- content = content.dup
- tokens = []
- project ||= @default_project
-
- Token.tokenlist.each do |token|
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, project, @backend, @script)
- tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{tokens.size - 1}"
- else
- "TOKEN_#{tokens.size - 1}"
- end
- end
- end
-
- replaced = []
- s = true
- loop do
- break if replaced.size >= tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].restore
- }
-
- s = content.gsub!(/TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].replace
- }
- end
-
- token_classes = tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
-
- content
- end
-
- attr_accessor :default_project
- attr_accessor :script
- attr_accessor :backend
-
- # Creates the markup class.
- def initialize(default_project, script)
- @default_project = default_project
- @script = script
- end
- end
-end
-
-require 'ruwiki/wiki/tokens'
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens.rb b/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens.rb
deleted file mode 100644
index c7ff6c7..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens.rb
+++ /dev/null
@@ -1,132 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # The base Token class. All Token classes must inherit from Token and
- # *must* implement the following methods:
- #
- # [self.regexp] The regular expression that the Token will be
- # replacing.
- # [replace] The mechanism for replacing the Token with the desired
- # results.
- #
- # Token classes <i>should</i> implement the following method:
- # [self.rank] Default: <tt>5000</tt>. Affects the sort order.
- # Must return an integer.
- #
- # Token classes <i>may</i> implement the following methods:
- # [restore] Restores the token without replacement.
- # Implements the results of the escape character.
- # NOTE: each Token class is responsible for its own
- # restore. Tokens that are anchored to the
- # beginning of a line are the most likely to need
- # to reimplement this.
- # [self.post_replace] Performs any necessary massaging of the data. See
- # the implementation of Ruwiki::Wiki::Lists for
- # more information.
- class Token
- @@tokenlist = []
- @@sorted = false
-
- class << self
- # Tokens should define rank if they must be first or last in
- # processing. Otherwise, they are sorted in the order defined.
- def rank
- 5000
- end
-
- # The Wiki parsing routine uses Token.tokenlist to determine the
- # tokens that are processed, and the order in which they are
- # processed. See Token.rank for more information.
- def tokenlist
- unless @@sorted
- head = @@tokenlist.shift
- @@tokenlist.sort! { |a, b| a.rank <=> b.rank }
- @@tokenlist.unshift(head)
- sorted = true
- end
- @@tokenlist
- end
-
- def inherited(child_class) #:nodoc:
- @@tokenlist << Token if @@tokenlist.empty?
-
- # Make the child class post_replace a blank function because we
- # don't want to propogate the currently defined post_replace.
- # The current post_replace is specific to Token_Base only.
- class << child_class
- def self.post_replace(content)
- content
- end
- end
-
- @@tokenlist << child_class
- @@sorted = false
- end
-
- # The replacement regular expression.
- def regexp
- /TOKEN_(\d*)/
- end
- end
-
- # All Token classes must match this header signature if they define
- # #initialize.
- #
- # [match] The MatchData object for this Token.
- # [project] The project being processed.
- # [backend] The backend for the wiki. This is used to determine if
- # the page or project exists. The object passed must
- # respond to #project_exists?(project) and
- # #page_exists?(page, project).
- # [script] The URI to the script.
- def initialize(match, project, backend, script)
- @match = match
- @project = project
- @backend = backend
- @script = script
- end
-
- # The replacement method. Uses @match to replace the token with the
- # appropriate values.
- def replace
- "TOKEN_#{@match[1]}"
- end
-
- # Restores the token without replacement. By default, replaces
- # "dangerous" HTML characters.
- def restore
- @match[0].gsub(/&/, "&amp;").gsub(/</, "&lt;").gsub(/>/, "&gt;")
- end
-
- # The content may need massaging after processing.
- def self.post_replace(content)
- content
- end
- end
- end
-end
-
- # Load the tokens from the ruwiki/wiki/tokens directory.
-tokens_dir = 'ruwiki/wiki/tokens'
-
-$LOAD_PATH.each do |path|
- target = "#{path}/#{tokens_dir}"
- if File.exists?(target) and File.directory?(target)
- Dir::glob("#{target}/*.rb") do |token|
- begin
- require token
- rescue LoadError
- nil
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/00default.rb b/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/00default.rb
deleted file mode 100644
index 448ff3f..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/00default.rb
+++ /dev/null
@@ -1,188 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-# $debug = File.open("output.txt", "w")
-
-class Ruwiki
- class Wiki
- # The Paragraph Token class changes blank lines to <p> tags. This class,
- # under the current implementation, should be *first* in the Token list
- # after Token.
- class Paragraph < Ruwiki::Wiki::Token
- # This Token is #rank 0, because it should be first in the Token list.
- def self.rank
- 0
- end
-
- # Matches blank lines. %r{^\s*$}
- def self.regexp
- %r{(^\s*$)}
- end
-
- # Replaces with "<p>"
- def replace
- "</p><p>"
- end
-
- # Ensures that <p> won't be surrounded by <br> tags.
- def self.post_replace(content)
- content.gsub!(%r{\A}, '<p>')
- content.gsub!(%r{\z}, '</p>')
- content.gsub!(%r{^}, '<p>')
- content.gsub!(%r{\n}, "</p>\n")
- content.gsub!(%r{<p>(<p>)+}, '<p>')
- content.gsub!(%r{</p>(</p>)+}, '</p>')
- content.gsub!(%r{((?:<p>(?:.*?)</p>\n)+?<p></p><p></p>)}) do |m|
- r = m.gsub(%r{</p>\n<p>}, "\n<p>")
- r.gsub!(%r{<p></p><p></p>}, "</p>")
- r.gsub!(%r{\n<p>}, "\n")
- r.gsub!(%r{\n</p>}, '</p>')
- r
- end
- content.gsub!(%r{<p></p>}, '')
- content
- end
- end
-
- # The Code Token class converts indented text to "unformatted" (<pre>)
- # text. This class should be *second* in the Token list.
- class Code < Ruwiki::Wiki::Token
- # This Token is #rank 1, because it should be second in the Token list.
- def self.rank
- 1
- end
-
- # Matches indented text. %r{^(\s+\S.*)$}
- def self.regexp
- %r{^(\s+\S.*)$}
- end
-
- # Replaces the text to <pre>content</pre>.
- def replace
- content = @match.captures[0]
- content.gsub!(/&/, '&amp;')
- content.gsub!(/</, '&lt;')
- content.gsub!(/>/, '&gt;')
-
- %Q{</p><pre>#{content}</pre>}
- end
-
- # Converts cases of %r{</pre>(\n|<br ?/?>)<pre>} to \1.
- def self.post_replace(content)
- content.gsub!(%r{</pre>((\n)*</p>(\n)*)?<pre>}, "\n")
- content.gsub!(%r{</pre>(\n|<br ?/?>)?<pre>}, '\1')
- content.gsub!(%r{<p><pre>}, '<pre>')
- content.gsub!(%r{</pre></p>}, '</pre>')
- content
- end
- end
-
- RE_URI_SCHEME = %r{[\w.]+?:}
- RE_URI_PATH = %r{[^\s<>\]]}
- RE_URI_TEXT = %r{[^\]]*}
- RE_IMAGE = /(jpg|jpeg|png|gif)$/
-
- # Converts URLs in the form of [url] to numbered links.
- class NumberedLinks < Ruwiki::Wiki::Token
- class << self
- attr_accessor :count
- end
-
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\]}
- end
-
- def replace
- extlink = @match.captures[0]
-
- NumberedLinks.count ||= 0
- NumberedLinks.count += 1
- name = "[#{NumberedLinks.count}]"
-
- if extlink =~ RE_IMAGE
- %Q{<img src="#{extlink}" title="#{name}" alt="#{name}" />}
- else
- %Q{<a class="rw_extlink" href="#{extlink}">#{name}</a>}
- end
- end
- end
-
- # Converts URLs in the form of [url name] to named links.
- class NamedLinks < Ruwiki::Wiki::Token
- def self.rank
- 3
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\s+(#{RE_URI_TEXT})\]}
- end
-
- def replace
- extlink = @match.captures[0]
- name = @match.captures[1]
-
- if extlink =~ RE_IMAGE
- %Q{<img src="#{extlink}" title="#{name}" alt="#{name}" />}
- else
- %Q{<a class="rw_extlink" href="#{extlink}">#{name}</a>}
- end
- end
- end
-
- # Converts URLs to links where the "name" of the link is the URL itself.
- class ExternalLinks < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{\b(#{RE_URI_SCHEME}#{RE_URI_PATH}+)}
- end
-
- def replace
- extlink = @match.captures[0]
-
- if extlink =~ RE_IMAGE
- %Q{<img src="#{extlink}" title="Image at: #{extlink}" alt="Image at: #{extlink}" />}
- else
- %Q{<a class="rw_extlink" href="#{extlink}">#{extlink}</a>}
- end
- end
- end
-
- # Creates a horizontal rule.
- class HRule < Ruwiki::Wiki::Token
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def replace
- "<hr />"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(<p>)*<hr ?/?>(</p>)*}, "<hr />")
- content.gsub!(%r{\n<hr />}, "</p>\n<hr />")
- content.gsub!(%r{<hr ?/?>\n<br ?/?>}, "<hr />")
- content.gsub!(%r{(\n|<br ?/?>)?<hr>(\n|<br ?/?>)?}, "<hr />")
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/01wikilinks.rb b/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/01wikilinks.rb
deleted file mode 100644
index 586bff8..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/01wikilinks.rb
+++ /dev/null
@@ -1,168 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki
- class Wiki
- # This provides the basic WikiWord match. This supports WikiWord,
- # CPlusPlus, ThisIsALink, and C_Plus_Plus.
- RE_WIKI_WORDS = %r{[[:upper:]][\w_]*(?:[[:lower:]]+[[:upper:]_]|[[:upper:]_]+[[:lower:]])[\w_]*}
- # This provides wikipedia format matches, e.g., [[wikipedia links]]. The
- # only restriction on words in this format is that they must NOT begin
- # with an underscore ('_').
- RE_WIKIPEDIA_WORDS = %r{\[\[([^_].*?)\]\]}
- # This provides the basic Wiki Project match.
- RE_PROJECT_WORD = %r{[[:upper:]][[:lower:]]+}
-
- # This provides the Wiki view link format:
- VIEW_LINK = %Q[<a class="rw_pagelink" href="%s">%s</a>]
- EDIT_LINK = %Q[<span class="rw_edittext">%s</span><a class="rw_pagelink" href="%s">?</a>]
-
- # Creates a crosslink for a Project::WikiPage.
- class ProjectCrossLink < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::(#{RE_WIKI_WORDS})}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic.gsub(/_/, ' ')}"]
- else
- EDIT_LINK % ["#{project}::#{topic.gsub(/_/, ' ')}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a crosslink for a Project::WikiPage using a Wikipedia link
- # format.
- class ProjectCrossLinkWikipedia < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::#{RE_WIKIPEDIA_WORDS}}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- if @backend.page_exists?(topic, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic}"]
- else
- EDIT_LINK % ["#{project}::#{topic}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to the project index from ::Project.
- class ProjectIndex < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{(\B|\\)::(#{RE_PROJECT_WORD})}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- project = @match.captures[1]
-
- if @backend.page_exists?('ProjectIndex', project)
- VIEW_LINK % ["#{@script}/#{project}/ProjectIndex", project]
- else
- if @backend.project_exists?(project)
- EDIT_LINK % [project, "#{@script}/#{project}/ProjectIndex/_edit"]
- else
- EDIT_LINK % [project, "#{@script}/#{project}/_create"]
- end
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project.
- class WikiLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\b|\\)(#{RE_WIKI_WORDS})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic.gsub(/_/, ' ')]
- else
- EDIT_LINK % [topic.gsub(/_/, ' '), "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project using a Wikipedia
- # link format.
- class WikipediaLinks < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(\B|\\)#{RE_WIKIPEDIA_WORDS}\B}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- ALT_TEXT = %r{(.+)\|(.+)}o
-
- def replace
- captures = @match.captures
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- at = ALT_TEXT.match(topic)
-
- if not at.nil?
- topic = at.captures[1]
- link = CGI.escape(at.captures[0])
- end
-
- if @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic]
- else
- EDIT_LINK % [topic, "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/abbreviations.rb b/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/abbreviations.rb
deleted file mode 100644
index 3329fab..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/abbreviations.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts abbreviations.
- class Abbreviations < Ruwiki::Wiki::Token
- ABBREVIATIONS = {
- "PM" => "PocoMail"
- }
-
- def self.regexp
- %r!@\{([^\}]*)\}!
- end
-
- def replace
- k = @match.captures[0]
- if k.nil? or k.empty?
- data = "<dl>"
- ABBREVIATIONS.each do |k, v|
- data << "<dt>#{k}</dt><dd>#{v}</dd>"
- end
- data << "</dl>"
- else
- if ABBREVIATIONS.has_key?(k)
- data = ABBREVIATIONS[k]
- else
- data = @match[0]
- end
- end
- data
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/calendar.rb b/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/calendar.rb
deleted file mode 100644
index 4c38d59..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/calendar.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces Lists
- class Calendar < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?%calendar\s*\((?:(today)|(\d+),\s*(\d+))(?:,\s*(#{RE_PROJECT_WORD}))?\)}
- end
-
- def self.make(year, month)
- result = []
- t = Time.local(year, month, 1)
- r = Array.new(t.wday, nil)
- r << 1
-
- 2.upto(31) do |i|
- break if Time.local(year, month, i).month != month
- r << i
- end
-
- r += Array.new((- r.size) % 7, nil)
-
- 0.step(r.size - 1, 7) do |i|
- result << r[i, 7]
- end
- result
- end
-
- def make_month_link(project, year, month, state = nil)
- ym = "%04d%02d" % [year, month]
- case state
- when :prev
- title = "&laquo; #{year}.#{month}"
- when :next
- title = "#{year}.#{month} &raquo;"
- else
- title = "#{project}::#{year}.#{month}"
- end
- url = "#{@script}/#{project}/#{ym}"
-
- if @backend.page_exists?(ym, project)
- VIEW_LINK % [url, title]
- else
- EDIT_LINK % [title, "#{url}/_edit"]
- end
- end
-
- def replace
- today = @match.captures[0]
- project = @match.captures[3] || @project
- now = Time.now
-
- if today.nil?
- year = @match.captures[1].to_i
- month = @match.captures[2].to_i
- else
- year = now.year
- month = now.month
- end
-
- if (year == now.year) and (month == now.month)
- show_today = now.day
- else
- show_today = nil
- end
-
- result = <<-"CALENDAR_HEAD"
-</p>
-<div class="rw_calendar">
-<table class="rw_calendar" summary="calendar for ::#{project}: #{year}.#{month}">
-<thead>
- CALENDAR_HEAD
-
- result << %Q{ <tr>\n<th colspan="7" class="rw_calendar-current-month">}
- result << make_month_link(project, year, month)
- result << %Q{</th>\n </tr>\n <tr>\n<th colspan="2" class="rw_calendar-prev-month">}
- result << make_month_link(project, year, month - 1, :prev)
- result << %Q{</th>\n<th colspan="3"></th>\n<th colspan="2" class="rw_calendar-next-month">}
- result << make_month_link(project, year, month + 1, :next)
- result << "</th>\n"
-
- result << <<-"CALENDAR_HEAD2"
- </tr>
- <tr>
- <th class="rw_calendar-weekend">Su</th>
- <th class="rw_calendar-weekday">Mo</th>
- <th class="rw_calendar-weekday">Tu</th>
- <th class="rw_calendar-weekday">We</th>
- <th class="rw_calendar-weekday">Th</th>
- <th class="rw_calendar-weekday">Fr</th>
- <th class="rw_calendar-weekend">Sa</th>
- </tr>
-</thead>
-<tbody>
- CALENDAR_HEAD2
-
- Calendar.make(year, month).each do |week|
- result << " <tr>\n"
- week.each do |day|
- if day.nil?
- result << %Q{ <td class="rw_calendar-day"></td>\n}
- else
- date = "%04d%02d%02d" % [year, month, day]
- # Add the ability to create pages based on date here.
- if show_today == day
- result << %Q{ <td class="rw_calendar-today">}
- else
- result << %Q{ <td class="rw_calendar-day">}
- end
- if @backend.page_exists?(date, project)
- result << VIEW_LINK % ["#{@script}/#{project}/#{date}", day]
- else
- result << EDIT_LINK % [day, "#{@script}/#{project}/#{date}/_edit"]
- end
- result << %Q{</td>\n}
- end
- end
- result << " </tr>\n"
- end
-
- result << "</tbody>\n</table>\n</div>\n<p>"
- result
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<p>(\s*</?div(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p>(\s*</?table(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p>(\s*</?t(?:head|body|r)(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p>(\s*<t[hd].+?</t[hd]>\s*)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/headings.rb b/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/headings.rb
deleted file mode 100644
index 069f3df..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/headings.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts headings.
- class Headings < Ruwiki::Wiki::Token
-# def self.rank
-# 5
-# end
-
- def self.regexp
- %r{^\\?(=+)\s+(.*)}
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def replace
- level = @match.captures[0].count("=")
- content = @match.captures[1]
- level = 6 if level > 6
- "<h#{level}>#{content}</h#{level}>"
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(</h\d>)\n}) { |m| "#{$1}\n<p>" }
- content.gsub!(%r{(</h\d>)</p>\n<p>}) { |m| "#{$1}\n<p>" }
- content.gsub!(%r{<p>(<h\d>)}, '\1')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/lists.rb b/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/lists.rb
deleted file mode 100644
index 9826a9b..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/lists.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces Lists
- class Lists < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((\*)+|(#)+)\s+(.*)}
- end
-
- def replace
- content = @match.captures[3]
-
- if @match.captures[2].nil?
- char = '*'
- elem = 'ul'
- else
- char = '#'
- elem = 'ol'
- end
-
- indent = @match.captures[0].count(char)
-
- pre = ''
- post = ''
- indent.times do
- pre << "<#{elem}><li>"
- post << "</li></#{elem}>"
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<p><([uo]l)>}, '<\1>')
- content.gsub!(%r{</([uo]l)></p>}, '</\1>')
- content.gsub!(%r{</[uo]l>\n?<[uo]l>}, '')
- content.gsub!(%r{</ol>(\n|(<br ?/?>))?<ol>}, '')
- content.gsub!(%r{</ul>(\n|(<br ?/?>))?<ul>}, '')
- content.gsub!(%r{<li><([uo]l)>}, '<\1>')
- content.gsub!(%r{</li><li>}, "</li>\n<li>")
- content.gsub!(%r{</([uo]l)></li>}, '</\1>')
- content.gsub!(%r{([^>])\n<([uo]l)>}) { |m| "#{$1}</p>\n<#{$2}>" }
- content
- end
- end
-
- # Produces block quotes.
- class Blockquotes < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((:+)|(>+))(\s+.*)$}
- end
-
- def replace
- content = @match.captures[3]
-
- if @match.captures[2].nil?
- char = ':'
- cite = ''
- else
- char = '>'
- cite = ' type="cite"'
- end
- indent = @match.captures[0].count(char)
-
- pre = ''
- post = ''
- indent.times do
- pre << "<blockquote#{cite}>"
- post << "</blockquote>"
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</blockquote>(\n|<br ?/?>)?<blockquote[^>]*>}, '')
- content.gsub!(%r{(</?blockquote[^>]*>\n?)\s*}, '\1')
- content.gsub!(%r{</blockquote>(<blockquote[^>]*>)+}, '\1')
- content
- end
- end
-
- # Produces definition lists. Does not completely work correctly.
- class Definitions < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(;+)\s+([^:]+)\s+:\s+(.*)}
- end
-
- def replace
- definition = @match.captures[2]
- term = @match.captures[1]
- indent = @match.captures[0].count(';')
-
- pre = ''
- post = ''
- indent.times do
- pre << "<dl>"
- post << "</dl>"
- end
- "#{pre}<dt>#{term}</dt><dd>#{definition}</dd>#{post}"
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</dl>(\n|<br ?/?>)?<dl>}, '')
- content.gsub!(%r{</dl>(<dl>)+}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/rubylists.rb b/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/rubylists.rb
deleted file mode 100644
index a33f0df..0000000
--- a/ruwiki/tags/release-0.7/lib/ruwiki/wiki/tokens/rubylists.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Convert ruby-talk mailing list references (e.g., [ruby-talk:12345])
- # into named links.
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- # Convert ruby-core/ext/dev/list/math mailing list references (e.g.,
- # [ruby-core:12345]) into named links.
- class OtherRubyLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-(list|doc|core|dev|ext|math):(\d+)\]}
- end
-
- def replace
- ln, lm = @match.captures[0..1]
- %Q(<a class="rw_extlink" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-#{ln}/#{lm}">#{@match[0]}</a>)
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.7/ruwiki.cgi b/ruwiki/tags/release-0.7/ruwiki.cgi
deleted file mode 100644
index 38ede56..0000000
--- a/ruwiki/tags/release-0.7/ruwiki.cgi
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.7.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-
- # Customize this if you put the RuWiki files in a different location.
-$LOAD_PATH.unshift("lib")
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-wiki.config.webmaster = "webmaster@domain.com"
-
-# wiki.config.debug = false
-# wiki.config.title = "Ruwiki"
-# wiki.config.default_page = "ProjectIndex"
-# wiki.config.default_project = "Default"
-# wiki.config.storage_type = :flatfiles
-# wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# wiki.config.storage_options[:flatfiles][:extension] = nil
-# wiki.config.template_path = "./templates/"
-# wiki.config.template_set = "default"
-# wiki.config.css = "ruwiki.css"
-
-wiki.run
diff --git a/ruwiki/tags/release-0.7/ruwiki_servlet b/ruwiki/tags/release-0.7/ruwiki_servlet
deleted file mode 100644
index 846eff1..0000000
--- a/ruwiki/tags/release-0.7/ruwiki_servlet
+++ /dev/null
@@ -1,253 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.7.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-$LOAD_PATH.unshift("lib")
-
-require 'webrick'
-require 'ruwiki'
-require 'ruwiki/servlet'
-
-require 'optparse'
-require 'ostruct'
-
-copyright_banner = <<-"COPYRIGHT"
-Ruwiki #{Ruwiki::VERSION}
- Copyright © 2002 - 2004, Digikata and HaloStatue
-
- http://rubyforge.org/projects/ruwiki/
-
- Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-
-Licensed under the same terms as Ruby.
-
-$Id$
-COPYRIGHT
-
- # This is for the WEBrick version of Ruwiki. This has been abstracted to
- # accept a Config global variable to reconfigure Ruwiki after initial
- # creation.
-$config = Ruwiki::Config.new
-
- # Because the servlet can be started from the command-line, provide defaults
- # for all possible configuration options.
-opts = OpenStruct.new
-opts.port = 8808
-opts.addresses = []
-opts.mount = '/'
-opts.do_log = true
-opts.log_dest = $stderr
-opts.threads = 1
-
- # Ruwiki::Config options.
-opts.webmaster = 'webmaster@domain.com'
-opts.debug = false
-opts.title = "Ruwiki"
-opts.default_page = "ProjectIndex"
-opts.default_project = "Default"
-opts.template_path = "./templates/"
-opts.template_set = "default"
-opts.css = "ruwiki.css"
-
-opts.storage_type = :flatfiles
-opts.storage_options = Hash.new { |h, k| h[k] = {} }
-opts.storage_options[opts.storage_type][:data_path] = "./data/"
-opts.storage_options[opts.storage_type][:extension] = nil
-
-ARGV.options do |o|
- o.banner = "Usage: #{File.basename($0)} [options]"
- o.separator ""
- o.separator "WEBrick options:"
- o.on('-P', '--port PORT', Numeric,
- 'Runs the Ruwiki servlet on the specified',
- 'port. Default 8808.') do |port|
- opts.port = port
- end
- o.on('-A', '--accept ADDRESS,ADDRESS,ADDRESS', Array,
- 'Restricts the Ruwiki servlet to accepting',
- 'connections from the specified address or',
- '(comma-separated) addresses. May be',
- 'specified multiple times. Defaults to all',
- 'addresses.') do |address|
- opts.addresses += address
- end
- o.on('-L', '--local',
- 'Restricts the Ruwiki servlet to accepting',
- 'only local connections (12.0.0.1).',
- 'Overrides any previous --accept addresses.') do |local|
- opts.addresses = ["127.0.0.1"]
- end
- o.on('-M', '--mount MOUNT-POINT',
- 'The relative URI from which Ruwiki ',
- 'will be accessible. Defaults to "/".') do |mp|
- opts.mount = mp
- end
- o.on('--[no-]log',
- 'Log WEBrick activity. Default is --log.') do |log|
- opts.do_log = log
- end
- o.on('--logfile LOGFILE', 'The file to which WEBrick logs are',
- 'written. Default is standard error.') do |lf|
- opts.log_dest = lf
- end
- o.on('-T', '--threads THREADS', Integer,
- 'Sets the WEBrick threadcount.') do |tc|
- opts.threads = tc
- end
- o.separator ""
- o.separator "Ruwiki options:"
- o.on('--webmaster WEBMASTER',
- 'The Ruwiki webmaster email address.',
- 'Defaults to "webmaster@domain.com".') do |wm|
- opts.webmaster = wm
- end
- o.on('--[no-]debug',
- 'Turns on Ruwiki debugging. Defaults',
- 'to --no-debug.') do |d|
- opts.debug = d
- end
- o.on('--title TITLE',
- 'Provides the Ruwiki title. Default is',
- '"Ruwiki".') do |t|
- opts.title = t
- end
- o.on('--default-page PAGENAME',
- 'An alternate default page. Default is',
- '"ProjectIndex".') do |dp|
- opts.default_page = dp
- end
- o.on('--default-project PAGENAME',
- 'An alternate default project. Default is',
- '"Default".') do |dp|
- opts.default_project = dp
- end
- o.on('--template-path TEMPLATE_PATH',
- 'The location of Ruwiki templates. Default',
- 'is "./templates".') do |tp|
- opts.template_path = tp
- end
- o.on('--templates TEMPLATES',
- 'The name of the Ruwiki templates. Default',
- 'is "default".') do |tp|
- opts.template_set = tp
- end
- o.on('--css CSS_NAME',
- 'The name of the CSS file in the template',
- 'path. Default is "ruwiki.css".') do |css|
- opts.css = css
- end
- o.on('--storage-type TYPE', Ruwiki::KNOWN_BACKENDS,
- 'Select the storage type:',
- "#{Ruwiki::KNOWN_BACKENDS.join(", ")}") do |st|
- opts.storage_type = st
- end
- o.on('--flatfiles-data-path PATH',
- 'The path where data files are stored.',
- 'Default is "./data".') do |fdp|
- opts.storage_options[:flatfiles][:data_path] = fdp
- end
- o.on('--flatfiles-extension EXT',
- 'The extension for data files. Default',
- 'none.') do |ext|
- opts.storage_options[:flatfiles][:extension] = ext
- end
- o.separator ""
- o.separator "General info:"
- o.on_tail('--help', 'Shows this text.') do
- $stderr.puts o
- exit
- end
- o.on_tail('--version', 'Shows the version of Ruwiki.') do
- $stderr.puts copyright_banner
- exit
- end
- o.parse!
-end
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$config.webmaster = opts.webmaster
-$config.debug = opts.debug
-$config.title = opts.title
-$config.default_page = opts.default_page
-$config.default_project = opts.default_project
-$config.storage_type = opts.storage_type
-$config.storage_options[opts.storage_type] = opts.storage_options[opts.storage_type]
-$config.template_path = opts.template_path
-$config.template_set = opts.template_set
-$config.css = opts.css
-
- # If the list of accepted addresses is not empty, provide IP-based
- # restrictions.
-if not opts.addresses.empty?
- localonly = proc do |sock|
- if not opts.addresses.include?(sock.peeraddr[3])
- msg = "Rejected peer address #{sock.peeraddr[3]}. Connections are only accepted from: #{opts.addresses.join(", ")}."
- raise WEBrick::ServerError, msg
- end
- end
-else
- localonly = nil
-end
-
-if opts.do_log
- if opts.log_dest = $stderr
- dest = $stderr
- opts.log_dest = "stderr"
- else
- dest = File.open(opts.log_dest, "wb+")
- end
- logger = WEBrick::Log.new(dest, WEBrick::Log::DEBUG)
-else
- logger = nil
-end
-
-banner = <<-"BANNER"
-#{copyright_banner}
-
-WEBrick options:
- Port #{opts.port}
- Accepted Addresses #{opts.addresses.join(", ")}
- Mount Point #{opts.mount}
- Logging? #{opts.do_log}
- Log Destination #{opts.log_dest}
- Threads #{opts.threads}
-
-Ruwiki options:
- Webmaster #{opts.webmaster}
- Debugging? #{opts.debug}
- Title #{opts.title}
- Default Project #{opts.default_project}
- Default Page #{opts.default_page}
- Template Path #{opts.template_path}
- Template Set #{opts.template_set}
- CSS Source #{opts.css}
-
- Storage Type #{opts.storage_type}
- Data Path #{opts.storage_options[opts.storage_type][:data_path]}
- Extension #{opts.storage_options[opts.storage_type][:extension]}
-
-BANNER
-
-unless logger.nil?
- banner.each { |b| logger.info(b) }
-end
-# logger << banner unless logger.nil?
-
-server = WEBrick::HTTPServer.new(:Port => opts.port.to_i,
- :StartThreads => opts.threads.to_i,
- :AcceptCallback => localonly,
- :Logger => logger)
-server.mount(opts.mount, Ruwiki::Servlet)
-trap("INT") { server.shutdown; exit }
-server.start
diff --git a/ruwiki/tags/release-0.7/ruwiki_servlet.bat b/ruwiki/tags/release-0.7/ruwiki_servlet.bat
deleted file mode 100644
index 8d07f19..0000000
--- a/ruwiki/tags/release-0.7/ruwiki_servlet.bat
+++ /dev/null
@@ -1,16 +0,0 @@
-@echo off
-REM Ruwiki 0.7.0
-REM Copyright © 2002 - 2004, Digikata and HaloStatue
-REM Alan Chen (alan@digikata.com)
-REM Austin Ziegler (ruwiki@halostatue.ca)
-REM
-REM Licensed under the same terms as Ruby.
-REM $Id$
-REM
-if "%OS%"=="Windows_NT" goto WinNT
-ruby -x "ruwiki_servlet" %1 %2 %3 %4 %5 %6 %7 %8 %9
-goto done
-:WinNT
-ruby -x "ruwiki_servlet" %*
-goto done
-:done
diff --git a/ruwiki/tags/release-0.7/templates/de/body.tmpl b/ruwiki/tags/release-0.7/templates/de/body.tmpl
deleted file mode 100644
index 85dc5c1..0000000
--- a/ruwiki/tags/release-0.7/templates/de/body.tmpl
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=%encoding%" />
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.7/templates/de/content.tmpl b/ruwiki/tags/release-0.7/templates/de/content.tmpl
deleted file mode 100644
index f15bf2f..0000000
--- a/ruwiki/tags/release-0.7/templates/de/content.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-!INCLUDE!
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.7/templates/de/controls.tmpl b/ruwiki/tags/release-0.7/templates/de/controls.tmpl
deleted file mode 100644
index 58c7ea1..0000000
--- a/ruwiki/tags/release-0.7/templates/de/controls.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="rw_nav">
- %home_link% |
- Thema: <b>%page_topic%</b> Projekt: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a> |
- <a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">Edit</a>
-</div>
diff --git a/ruwiki/tags/release-0.7/templates/de/edit.tmpl b/ruwiki/tags/release-0.7/templates/de/edit.tmpl
deleted file mode 100644
index 2e70d55..0000000
--- a/ruwiki/tags/release-0.7/templates/de/edit.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="rw_nav">%home_link% | <i>Editieren</i> Thema: <b>%page_topic%</b> Projekt: <b>%page_project%</b></div><br />
-
-<form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button accesskey="A" type="submit" name="action" value="save">Außer</button>
- <button accesskey="L" type="submit" name="action" value="cancel" />Löschen</button>
-</form>
-<div class="rw_edit_raw"><h2>Formatfreie Ursprüngliche Version</h2><pre>%pre_page_content%</pre></div>
-<div class="rw_edit_format"><h2>Formatierte Version</h2>%unedited_page_content%</div>
diff --git a/ruwiki/tags/release-0.7/templates/de/error.tmpl b/ruwiki/tags/release-0.7/templates/de/error.tmpl
deleted file mode 100644
index 0fdbf00..0000000
--- a/ruwiki/tags/release-0.7/templates/de/error.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class="rw_nav">%home_link%</div>
-<h1>%name%</h1>
-<p>Schicken Sie dem webmaster einen Report durch <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
-<p>%backtrace%</p>
diff --git a/ruwiki/tags/release-0.7/templates/de/ruwiki.css b/ruwiki/tags/release-0.7/templates/de/ruwiki.css
deleted file mode 100644
index 5e7ce32..0000000
--- a/ruwiki/tags/release-0.7/templates/de/ruwiki.css
+++ /dev/null
@@ -1,32 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #F2FFA7;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-pre { background-color: #FFFFA7; border: 1px solid black; }
-pre pre { border: 0 }
-
-.rw_nav { background-color: #E9967A }
-.rw_edittext { border: 1px dotted blue }
-.rw_pagelink { }
-.rw_extlink { border: 1px solid red }
-.rw_projectxlink { }
-.rw_projectindex { }
-.rw_edit_form { }
-.rw_edit_raw {
- border: 2px solid green;
- float: left;
- max-width: 48%;
- overflow: scroll;
- clear: right;
-}
-.rw_edit_format {
- border: 2px solid blue;
- float: right;
- max-width: 48%;
- clear: none;
-}
diff --git a/ruwiki/tags/release-0.7/templates/de/save.tmpl b/ruwiki/tags/release-0.7/templates/de/save.tmpl
deleted file mode 100644
index 569c134..0000000
--- a/ruwiki/tags/release-0.7/templates/de/save.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-!INCLUDE!
-Gespeicherte Seite <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic%</a><hr />
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.7/templates/default/body.tmpl b/ruwiki/tags/release-0.7/templates/default/body.tmpl
deleted file mode 100644
index 2283094..0000000
--- a/ruwiki/tags/release-0.7/templates/default/body.tmpl
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=%encoding%" />
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.7/templates/default/content.tmpl b/ruwiki/tags/release-0.7/templates/default/content.tmpl
deleted file mode 100644
index f15bf2f..0000000
--- a/ruwiki/tags/release-0.7/templates/default/content.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-!INCLUDE!
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.7/templates/default/controls.tmpl b/ruwiki/tags/release-0.7/templates/default/controls.tmpl
deleted file mode 100644
index b02e8af..0000000
--- a/ruwiki/tags/release-0.7/templates/default/controls.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="rw_nav">
- %home_link% |
- Topic: <b>%page_topic%</b> Project: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a> |
- <a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">Edit</a>
-</div>
diff --git a/ruwiki/tags/release-0.7/templates/default/edit.tmpl b/ruwiki/tags/release-0.7/templates/default/edit.tmpl
deleted file mode 100644
index d16560a..0000000
--- a/ruwiki/tags/release-0.7/templates/default/edit.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="rw_nav">%home_link% | <i>Editing</i> Topic: <b>%page_topic%</b> Project: <b>%page_project%</b></div><br />
-
-<form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button accesskey="S" type="submit" name="action" value="save">Save</button>
- <button accesskey="C" type="submit" name="action" value="cancel" />Cancel</button>
-</form>
-<div class="rw_edit_raw"><h2>Raw Original Value</h2><pre>%pre_page_content%</pre></div>
-<div class="rw_edit_format"><h2>Formatted Version</h2>%unedited_page_content%</div>
diff --git a/ruwiki/tags/release-0.7/templates/default/error.tmpl b/ruwiki/tags/release-0.7/templates/default/error.tmpl
deleted file mode 100644
index 7c91995..0000000
--- a/ruwiki/tags/release-0.7/templates/default/error.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-<div class="rw_nav">%home_link%</div>
-<h1>%name%</h1>
-<p>Send the webmaster a report by <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">email</a>.</p>
-<p>%backtrace%</p>
diff --git a/ruwiki/tags/release-0.7/templates/default/ruwiki.css b/ruwiki/tags/release-0.7/templates/default/ruwiki.css
deleted file mode 100644
index adbcd6e..0000000
--- a/ruwiki/tags/release-0.7/templates/default/ruwiki.css
+++ /dev/null
@@ -1,38 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #F2FFA7;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-pre { background-color: #FFFFA7; border: 1px solid black; }
-pre pre { border: 0 }
-
-.rw_nav { background-color: #E9967A }
-.rw_edittext { border: 1px dotted blue }
-.rw_pagelink { }
-.rw_extlink { border: 1px solid red }
-.rw_projectxlink { }
-.rw_projectindex { }
-.rw_edit_form { }
-.rw_edit_raw {
- border: 2px solid green;
- float: left;
- max-width: 48%;
- overflow: scroll;
- clear: right;
-}
-.rw_edit_format {
- border: 2px solid blue;
- float: right;
- max-width: 48%;
- clear: none;
-}
-div.rw_calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rw_calendar-today { background-color: #FFFFA7; }
diff --git a/ruwiki/tags/release-0.7/templates/default/save.tmpl b/ruwiki/tags/release-0.7/templates/default/save.tmpl
deleted file mode 100644
index c1ede91..0000000
--- a/ruwiki/tags/release-0.7/templates/default/save.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-!INCLUDE!
-Saved page <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic%</a><hr />
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.7/templates/es/body.tmpl b/ruwiki/tags/release-0.7/templates/es/body.tmpl
deleted file mode 100644
index 53bca17..0000000
--- a/ruwiki/tags/release-0.7/templates/es/body.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
- <head>
- <title>%wiki_title%</title>
- <!-- 20040306az: Overrode the encoding to use the encoding provided by Batsman. -->
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
-<!--<meta http-equiv="Content-Type" content="text/html; charset=%encoding%" />-->
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.7/templates/es/content.tmpl b/ruwiki/tags/release-0.7/templates/es/content.tmpl
deleted file mode 100644
index f15bf2f..0000000
--- a/ruwiki/tags/release-0.7/templates/es/content.tmpl
+++ /dev/null
@@ -1,4 +0,0 @@
-!INCLUDE!
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.7/templates/es/controls.tmpl b/ruwiki/tags/release-0.7/templates/es/controls.tmpl
deleted file mode 100644
index 7f442de..0000000
--- a/ruwiki/tags/release-0.7/templates/es/controls.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="rw_nav">
- %home_link% |
- Nodo: <b>%page_topic%</b> Proyecto: <a href="%cgi_url%/%page_project%/"><b>%page_project%</b></a> |
- <a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">Editar</a>
-</div>
diff --git a/ruwiki/tags/release-0.7/templates/es/edit.tmpl b/ruwiki/tags/release-0.7/templates/es/edit.tmpl
deleted file mode 100644
index 36c20a8..0000000
--- a/ruwiki/tags/release-0.7/templates/es/edit.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="rw_nav">%home_link% | <i>Editando</i> Nodo: <b>%page_topic%</b> Proyecto: <b>%page_project%</b></div><br />
-
-<form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <textarea name="newpage" rows="15" cols="90">%page_content%</textarea>
- <input type="hidden" name="origpage" value="%orig_page%" />
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="old_version" value="%page_old_version%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button accesskey="S" type="submit" name="action" value="save">Salvar</button>
- <button accesskey="C" type="submit" name="action" value="cancel">Cancelar</button>
-</form>
-<div class="rw_edit_raw"><h2>Texto Original Sin formato</h2><pre>%pre_page_content%</pre></div>
-<div class="rw_edit_format"><h2>Versión con formato</h2>%unedited_page_content%</div>
diff --git a/ruwiki/tags/release-0.7/templates/es/error.tmpl b/ruwiki/tags/release-0.7/templates/es/error.tmpl
deleted file mode 100644
index 788ba61..0000000
--- a/ruwiki/tags/release-0.7/templates/es/error.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="rw_nav">%home_link%</div>
-<h1>%name%</h1>
-<p>Envíe al admistrador de este sitio una notificación por <a href="mailto:%webmaster%?subject=%name%&amp;body=%backtrace_email%">correo electrónico</a>.</p>
-
-<p>%backtrace%</p>
diff --git a/ruwiki/tags/release-0.7/templates/es/ruwiki.css b/ruwiki/tags/release-0.7/templates/es/ruwiki.css
deleted file mode 100644
index 5e7ce32..0000000
--- a/ruwiki/tags/release-0.7/templates/es/ruwiki.css
+++ /dev/null
@@ -1,32 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #F2FFA7;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-pre { background-color: #FFFFA7; border: 1px solid black; }
-pre pre { border: 0 }
-
-.rw_nav { background-color: #E9967A }
-.rw_edittext { border: 1px dotted blue }
-.rw_pagelink { }
-.rw_extlink { border: 1px solid red }
-.rw_projectxlink { }
-.rw_projectindex { }
-.rw_edit_form { }
-.rw_edit_raw {
- border: 2px solid green;
- float: left;
- max-width: 48%;
- overflow: scroll;
- clear: right;
-}
-.rw_edit_format {
- border: 2px solid blue;
- float: right;
- max-width: 48%;
- clear: none;
-}
diff --git a/ruwiki/tags/release-0.7/templates/es/save.tmpl b/ruwiki/tags/release-0.7/templates/es/save.tmpl
deleted file mode 100644
index 3355885..0000000
--- a/ruwiki/tags/release-0.7/templates/es/save.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-!INCLUDE!
-Página salvaguardada <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic%</a><hr />
-<!-- topic content -->
-%content%
-<!-- topic content -->
diff --git a/ruwiki/tags/release-0.7/tests/harness-cgi.rb b/ruwiki/tags/release-0.7/tests/harness-cgi.rb
deleted file mode 100644
index 3872b42..0000000
--- a/ruwiki/tags/release-0.7/tests/harness-cgi.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'harness'
-
-ENV["REQUEST_METHOD"] = "HEAD"
-
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_options[:flatfiles][:data_path] = "../data"
-$wiki.config.template_path = "../templates/"
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.storage_options[:flatfiles][:extension] = nil
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.7/tests/harness.rb b/ruwiki/tags/release-0.7/tests/harness.rb
deleted file mode 100644
index 2cc233e..0000000
--- a/ruwiki/tags/release-0.7/tests/harness.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-$LOAD_PATH.unshift("../lib")
-
-ENV["REQUEST_METHOD"] = "HEAD"
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_options[:flatfiles][:data_path] = "../data"
-$wiki.config.template_path = "../templates/"
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.storage_options[:flatfiles][:extension] = nil
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.7/tests/tc_bugs.rb b/ruwiki/tags/release-0.7/tests/tc_bugs.rb
deleted file mode 100644
index 8313496..0000000
--- a/ruwiki/tags/release-0.7/tests/tc_bugs.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.x
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-
-# see if we can reproduce the LicenseandAuthor hang
-# described in bug id 147 on rubyforge
-class TC_LicenseAndAuthorHang < Test::Unit::TestCase
- def setup
- @ffopts = { :data_path => "../data" }
-
- @backend = nil
- @pg = nil
- end
-
- # load "to the metal"
- def test_ffload
- assert_nothing_raised do
- @backend = ::Ruwiki::Backend::Flatfiles.new(@ffopts)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.load('LicenseAndAuthorInfo', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-
- # abstract backend retreive
- def test_beload
- @backend = nil
- assert_nothing_raised do
- mock_ruwiki = OpenStruct.new
- mock_ruwiki.config = OpenStruct.new
- mock_ruwiki.config.message = {}
- mock_ruwiki.config.storage_options = { :flatfiles => @ffopts }
-
- @backend = ::Ruwiki::BackendDelegator.new(mock_ruwiki, :flatfiles)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.retrieve('LicenseAndAuthorInfo', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-end
-
-# if __FILE__ == $0
-# ObjectSpace.each_object { |o| tests << o if o.kind_of?(Class) }
-# tests.delete_if { |o| !o.ancestors.include?(Test::Unit::TestCase) }
-# tests.delete_if { |o| o == Test::Unit::TestCase }
-
-# tests.each { |test| Test::Unit::UI::Console::TestRunner.run(test) }
-# end
diff --git a/ruwiki/tags/release-0.7/tests/tc_tokens.rb b/ruwiki/tags/release-0.7/tests/tc_tokens.rb
deleted file mode 100644
index ce6082f..0000000
--- a/ruwiki/tags/release-0.7/tests/tc_tokens.rb
+++ /dev/null
@@ -1,266 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.1
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-require 'test/unit'
-require 'harness-cgi'
-
-class TokenTestCases < Test::Unit::TestCase
- def setup
- @mrw = MockRuwiki.new
- end
-
- class MockRuwiki
- def initialize
- @project = "Default"
- @tokens = []
- end
-
- def __tokenize(content, token)
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, @project, $wiki.backend, $wiki.request.script_url)
- @tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{@tokens.size - 1}"
- else
- "TOKEN_#{@tokens.size - 1}"
- end
- end
- content
- end
-
- def __replace(content)
- replaced = []
- s = true
- loop do
- break if replaced.size >= @tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].restore
- end
-
- s = content.gsub!(/TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].replace
- end
- end
- content
- end
-
- def __post_replace(content)
- token_classes = @tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
- content
- end
-
- end
-
- def __process(token, content, tokenized, replaced, result)
- assert_equal(tokenized, content = @mrw.__tokenize(content, token))
- assert_equal(replaced, content = @mrw.__replace(content))
- assert_equal(result, content = @mrw.__post_replace(content))
- end
-
- def __display(token, content)
- p tokenized = @mrw.__tokenize(content.dup, token)
- p replaced = @mrw.__replace(tokenized.dup)
- p result = @mrw.__post_replace(replaced.dup)
- end
-
- def test_Paragraph
- token = Ruwiki::Wiki::Paragraph
- content = "\nABC\n\nabc\n"
- tkv = "TOKEN_0\nABC\nTOKEN_1\nabc\n"
- rpv = "</p><p>\nABC\n</p><p>\nabc\n"
- res = "<p>\nABC</p>\n<p>abc</p>\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Code
- content = " line 1\n line 2\nline3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_0\nTOKEN_1\nline3\n"
- rpv = "</p><pre> line 1</pre>\n</p><pre> line 2</pre>\nline3\n"
- res = "</p><pre> line 1\n line 2</pre>\nline3\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NumberedLinks
- token = Ruwiki::Wiki::NumberedLinks
- content = "[http://www.ruby-lang.org] \\[http://www.rubyforge.org]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
- res = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NamedLinks
- token = Ruwiki::Wiki::NamedLinks
- content = "[http://www.ruby-lang.org Ruby] \\[http://www.rubyforge.org RubyForge]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
- res = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ExternalLinks
- token = Ruwiki::Wiki::ExternalLinks
- content = "http://www.ruby-lang.org \\http://www.rubyforge.org"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
- res = %Q{<a class="rw_extlink" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_HRule
- token = Ruwiki::Wiki::HRule
- content = "----\n\\----"
- tkv = "TOKEN_0\n\\TOKEN_1"
- rpv = "<hr />\n----"
- res = "<hr />\n----"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLink
- token = Ruwiki::Wiki::ProjectCrossLink
- content = "Ruwiki::ChangeLog \\Ruwiki::To_Do Ruwiki::NotExist \\Ruwiki::NotExist"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rw_edittext">Ruwiki::NotExist</span><a class="rw_pagelink" href="http://:/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
- res = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rw_edittext">Ruwiki::NotExist</span><a class="rw_pagelink" href="http://:/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLinkWikipedia
- token = Ruwiki::Wiki::ProjectCrossLinkWikipedia
- content = "Ruwiki::[[ChangeLog]] \\Ruwiki::[[To_Do]] Ruwiki::[[Does Not Exist]] \\Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 Ruwiki::[[_invalid]]"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rw_edittext">Ruwiki::Does Not Exist</span><a class="rw_pagelink" href="http://:/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
- res = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rw_edittext">Ruwiki::Does Not Exist</span><a class="rw_pagelink" href="http://:/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectIndex
- token = Ruwiki::Wiki::ProjectIndex
- content = "::Ruwiki \\::Ruwiki ::Newproject \\::Newproject"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rw_edittext">Newproject</span><a class="rw_pagelink" href="http://:/Newproject/_create">?</a> ::Newproject}
- res = %Q{<a class="rw_pagelink" href="http://:/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rw_edittext">Newproject</span><a class="rw_pagelink" href="http://:/Newproject/_create">?</a> ::Newproject}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikiLinks
- token = Ruwiki::Wiki::WikiLinks
- content = "ProjectIndex \\ProjectIndex AustinZiegler \\AustinZiegler Alan_Chen \\Alan_Chen"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5"
- rpv = %Q{<a class="rw_pagelink" href="http://:/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rw_edittext">AustinZiegler</span><a class="rw_pagelink" href="http://:/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rw_edittext">Alan Chen</span><a class="rw_pagelink" href="http://:/Default/Alan_Chen/_edit">?</a> Alan_Chen}
- res = %Q{<a class="rw_pagelink" href="http://:/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rw_edittext">AustinZiegler</span><a class="rw_pagelink" href="http://:/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rw_edittext">Alan Chen</span><a class="rw_pagelink" href="http://:/Default/Alan_Chen/_edit">?</a> Alan_Chen}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikipediaLinks
- token = Ruwiki::Wiki::WikipediaLinks
- content = "[[ProjectIndex]] \\[[ProjectIndex]] [[Austin Ziegler]] \\[[Austin Ziegler]] [[_Alan Chen]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 [[_Alan Chen]]"
- rpv = %Q{<a class=\"rw_pagelink\" href=\"http://:/Default/ProjectIndex\">ProjectIndex</a> [[ProjectIndex]] <span class=\"rw_edittext\">Austin Ziegler</span><a class=\"rw_pagelink\" href=\"http://:/Default/Austin+Ziegler/_edit\">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
- res = %Q{<a class=\"rw_pagelink\" href=\"http://:/Default/ProjectIndex\">ProjectIndex</a> [[ProjectIndex]] <span class=\"rw_edittext\">Austin Ziegler</span><a class=\"rw_pagelink\" href=\"http://:/Default/Austin+Ziegler/_edit\">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Abbreviations
- token = Ruwiki::Wiki::Abbreviations
- content = "@{PM}\n@{}\n\\@{PM}"
- tkv = "TOKEN_0\nTOKEN_1\n\\TOKEN_2"
- rpv = "PocoMail\n<dl><dt>PM</dt><dd>PocoMail</dd></dl>\n@{PM}"
- res = "PocoMail\n<dl><dt>PM</dt><dd>PocoMail</dd></dl>\n@{PM}"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Headings
- token = Ruwiki::Wiki::Headings
- content = "= header 1\n== header 2\n=== header 3\n==== header 4\n===== header 5\n====== header 6\n======= header 7->6\n\\== noheader 2\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\nTOKEN_6\n\\TOKEN_7\n"
- rpv = "<h1>header 1</h1>\n<h2>header 2</h2>\n<h3>header 3</h3>\n<h4>header 4</h4>\n<h5>header 5</h5>\n<h6>header 6</h6>\n<h6>header 7->6</h6>\n== noheader 2\n"
- res = "<h1>header 1</h1>\n<h2>header 2</h2>\n<h3>header 3</h3>\n<h4>header 4</h4>\n<h5>header 5</h5>\n<h6>header 6</h6>\n<h6>header 7->6</h6>\n<p>== noheader 2\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Lists
- content = "* level 1\n** level 2\n*** level 3\n* level 1, item 2\n\\* not an item\n"
- content << "# level 1\n## level 2\n### level 3\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\nTOKEN_5\nTOKEN_6\nTOKEN_7\nTOKEN_8\n\\TOKEN_9\n"
- rpv = "<ul><li>level 1</li></ul>\n<ul><li><ul><li>level 2</li></ul></li></ul>\n<ul><li><ul><li><ul><li>level 3</li></ul></li></ul></li></ul>\n<ul><li>level 1, item 2</li></ul>\n* not an item\n<ol><li>level 1</li></ol>\n<ol><li><ol><li>level 2</li></ol></li></ol>\n<ol><li><ol><li><ol><li>level 3</li></ol></li></ol></li></ol>\n<ol><li>level 1, item 2</li></ol>\n# not an item\n"
- res = "<ul><li>level 1</li><ul><li>level 2</li><ul><li>level 3</li></ul></ul><li>level 1, item 2</li></ul>\n* not an item\n<ol><li>level 1</li><ol><li>level 2</li><ol><li>level 3</li></ol></ol><li>level 1, item 2</li></ol>\n# not an item\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Blockquotes
- token = Ruwiki::Wiki::Blockquotes
- content = ": level 1\n:: level 2\n::: level 3\n: level 1, para 2\n\\: not a blockquote\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = "<blockquote> level 1</blockquote>\n<blockquote><blockquote> level 2</blockquote></blockquote>\n<blockquote><blockquote><blockquote> level 3</blockquote></blockquote></blockquote>\n<blockquote> level 1, para 2</blockquote>\n: not a blockquote\n"
- res = "<blockquote>level 1<blockquote>level 2<blockquote>level 3</blockquote></blockquote>level 1, para 2</blockquote>\n: not a blockquote\n"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Definitions
- content = "; word1 : val1\n;; word2 : val2\n;;; word3 : val3\n; word1/2 : val1/2\n\\; not-a-word : not-a-val\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = "<dl><dt>word1</dt><dd>val1</dd></dl>\n<dl><dl><dt>word2</dt><dd>val2</dd></dl></dl>\n<dl><dl><dl><dt>word3</dt><dd>val3</dd></dl></dl></dl>\n<dl><dt>word1/2</dt><dd>val1/2</dd></dl>\n; not-a-word : not-a-val\n"
- res = "<dl><dt>word1</dt><dd>val1</dd><dl><dt>word2</dt><dd>val2</dd><dl><dt>word3</dt><dd>val3</dd></dl></dl><dt>word1/2</dt><dd>val1/2</dd></dl>\n; not-a-word : not-a-val\n"
-
-# __display(token, content)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_RubyTalkLinks
- token = Ruwiki::Wiki::RubyTalkLinks
- content = "[ruby-talk:12345] \\[ruby-talk:12345]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = "<a class=\"rw_extlink\" href=\"http://www.ruby-talk.org/12345\">[ruby-talk:12345]</a> [ruby-talk:12345]"
- res = "<a class=\"rw_extlink\" href=\"http://www.ruby-talk.org/12345\">[ruby-talk:12345]</a> [ruby-talk:12345]"
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_OtherRubyLinks
- token = Ruwiki::Wiki::OtherRubyLinks
- content = "[ruby-list:123] \\[ruby-list:123] [ruby-doc:123] \\[ruby-doc:123] [ruby-core:123] \\[ruby-core:123] [ruby-dev:123] \\[ruby-dev:123] [ruby-ext:123] \\[ruby-ext:123] [ruby-math:123] \\[ruby-math:123]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5 TOKEN_6 \\TOKEN_7 TOKEN_8 \\TOKEN_9 TOKEN_10 \\TOKEN_11"
- rpv = "<a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123\">[ruby-list:123]</a> [ruby-list:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123\">[ruby-doc:123]</a> [ruby-doc:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123\">[ruby-core:123]</a> [ruby-core:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123\">[ruby-dev:123]</a> [ruby-dev:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123\">[ruby-ext:123]</a> [ruby-ext:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123\">[ruby-math:123]</a> [ruby-math:123]"
- res = "<a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123\">[ruby-list:123]</a> [ruby-list:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123\">[ruby-doc:123]</a> [ruby-doc:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123\">[ruby-core:123]</a> [ruby-core:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123\">[ruby-dev:123]</a> [ruby-dev:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123\">[ruby-ext:123]</a> [ruby-ext:123] <a class=\"rw_extlink\" href=\"http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123\">[ruby-math:123]</a> [ruby-math:123]"
-
- __process(token, content, tkv, rpv, res)
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/README b/ruwiki/tags/release-0.8.0-fixes/README
deleted file mode 100644
index 544ac5e..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/README
+++ /dev/null
@@ -1,65 +0,0 @@
-Ruwiki 0.8.0
-------------
-Ruwiki is a simple, extensible Wiki-clone written in Ruby. It supports both
-CGI and WEBrick interfaces, templates, and CSS formatting. This Wiki differs
-from most other Wikis in that it supports projectt namespaces, so that two
-topics may be named the same for differing projects without colliding or
-having to resort to odd naming conventions. Please see the ::Ruwiki project
-in the running Wiki for more information. Ruwiki 0.8.0 has German and
-Spanish translations available.
-
-Upgrading
----------
-Ruwiki 0.8.0 has a flatfile format that is incompatible with older versions of
-Ruwiki. If you are upgrading from one of these versions, you must use the
-bin/convert. The simple case will be (assuming that your data files are in
-./data):
-
- % bin/convert ./data
-
-Requirements
-------------
-Ruwiki currently requires Ruby 1.8, Diff::LCS 1.1.0 (portions included). The
-YAML backend requires Ruby 1.8.2.
-
-Quick Start (CGI)
------------------
-1. Place the Ruwiki directory in a place that your webserver can execute CGI
- programs and ensure that ruwiki.cgi is executable on your webserver.
-2. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
-2. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of
-Ruwiki without editing the servlet; use ruwiki_servlet --help for more
-information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-Credits
--------
-* This software includes portions of Diff::LCS by Austin Ziegler, available
- for download from the Ruwiki RubyForge project:
- [http://rubyforge.org/projects/ruwiki/]
-* Portions of this software are derived from Dave Thomas's RDoc system, now
- part of the Ruby distribution.
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen]
- on 2003.10.22. Note that the initial template translations (./templates/de/)
- were done via AltaVista Babelfish and should not be blamed on Christian.
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández]
- on 2003.10.22. Note that the initial template translations (./templates/es/)
- were done via AltaVista Babelfish and should not be blamed on Mauricio.
-
-$Id$
diff --git a/ruwiki/tags/release-0.8.0-fixes/contrib/enscript-token.rb b/ruwiki/tags/release-0.8.0-fixes/contrib/enscript-token.rb
deleted file mode 100644
index 80de23b..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/contrib/enscript-token.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# By Javier Fontan <jfontan@pc3d.cesga.es>
-
-require "open3"
-
-class Ruwiki::Wiki::CodeColor < Ruwiki::Wiki::Token
- def self.rank
- 0
- end
-
- def self.regexp
- %r<\{\{\{(?::(\w+)\b)?(.*?)\}\}\}>m
- end
-
- def replace
- cap = @match.captures
-
- if cap[0].nil?
- language = "ruby"
- else
- language = cap[0]
- end
-
- text = cap[1]
-
- i, o, e = Open3.popen3("enscript -B --color=emacs -Whtml -E#{language} -o -")
- i.print text
- i.close
-
- re_script = %r{(<pre>.*?</pre>)}mio
- c = o.readlines[1..-1].join("\n")
- re_script.match(c).captures[0]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<pre>\n}im, '<pre class="rwtk_CodeColor>')
- content.gsub!(%r{\n</pre>}im, '</pre>')
- content.gsub!(%r{<font color="(.+?)">}im, '<span style="color: \1">')
- content.gsub!(%r{</font>}im, '</span>')
- content.gsub!(%r{<B>}i, '<b>')
- content.gsub!(%r{</B}i, '</b>')
- content
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/contrib/rublog_integrator.rb b/ruwiki/tags/release-0.8.0-fixes/contrib/rublog_integrator.rb
deleted file mode 100644
index 730d42c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/contrib/rublog_integrator.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-# NOTE: This is not currently compatible with Ruwiki 0.8.0
-#
-# require 'ruwiki/wiki/handler'
-
-class Ruwiki::RubLogHandler < Ruwiki::Wiki::Handler
- def initialize(entries)
- @entries = entries
- end
-
- def page_exists?(page, project)
-# puts "pP: #{page}, #{project}"
- matches = @entries.find_entries_with_root_name(page)
- matches.each { |entry| return true if(entry.dir_name =~ /#{project}/) }
- false
- end
-
- def project_exists?(project)
- true
- end
-
- def script_url
-# request.environment['SCRIPT_NAME']
-# !!SMELL!!
- ENV['SCRIPT_NAME']
- end
-end
-
- # An experimental convertor for Ruwiki
-class RuwikiConvertor < BaseConvertor
- handles "wiki"
-
- def get_title(f)
- title = "---Untitled---"
- loop do
- line = f.gets
- if(line =~ /^topic: (\S+)/) then
- title = $1
- elsif(line =~ /^\#EHDR/) then
- return title
- end
- end
- end
-
- def convert_html(file_entry, f, all_entries)
- title = get_title(f)
- markup = Ruwiki::Wiki.new('Default', Ruwiki::RubLogHandler.new(all_entries))
- body = markup.parse(f.readlines.join("\n"), file_entry.dir_name)
- HTMLEntry.new(title, body, self)
- end
-
- # FIXME: Need to check this one
- def convert_plain(file_name, f, all_entries)
- f.read
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/convert b/ruwiki/tags/release-0.8.0-fixes/convert
deleted file mode 100644
index 657ef09..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/convert
+++ /dev/null
@@ -1,279 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
-module RuwikiConverter #:nodoc:
- PROGRAM = File.basename($0)
- PATH = File.dirname($0)
-end
-
-begin
- require 'ruwiki'
-rescue LoadError
- $LOAD_PATH.unshift "#{RuwikiConverter::PATH}/../lib"
- # Fail hard if it fails again.
- require 'ruwiki'
-end
-
- # Load all of the known backends.
-require 'ruwiki/backend/flatfiles'
-require 'ruwiki/backend/yaml'
-require 'ruwiki/backend/marshal'
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-
-module RuwikiConverter #:nodoc:
- TARGETS = %w(flatfiles yaml marshal)
-
- # Create the regular expressions that are used in Ruwiki 0.6.2
- OLD_HEADER_RE = /^\s*([a-z]+)\s*:\s*(.*)$/
- OLD_HEADER_END_RE = /^#EHDR$/
- DATA_HEADER_END_RE = /\A#EHDR\z/
- NL_RE = /\n/
-
-
- def with(obj)
- yield obj if block_given?
- end
-
- # Only allow this to be run once. Silently fail otherwise.
- def set_defaults
- return unless @options.nil?
- @options = OpenStruct.new
-
- with @options do |o|
- o.traverse_directories = true
- o.backup_old_files = true
- o.backup_extension = "~"
- o.quiet = false
- o.verbose = false
- o.extension = 'ruwiki'
-# o.target_format = 'yaml'
- o.target_format = 'flatfiles'
- end
- end
-
- def display_options
- end
-
- def summary
- end
-
- def process(argv, out = $stdout, err = $stderr)
- set_defaults
-
- @out = out
- @err = err
-
- argv.options do |opts|
- opts.banner = "Usage: #{PROGRAM} [options] <directory>+"
- opts.separator ''
- opts.on('--format=FORMAT', 'Converts encountered files (regardless', 'of the current format), to the specified', 'format. Default is yaml. Allowed formats', 'are: yaml marshal flatfiles') do |ff|
- @options.target_format = ff
- end
- opts.on('--[no-]backup', 'Create backups of upgraded files.', 'Default is --backup.') do |bb|
- @options.backup_old_files = bb
- end
- opts.on('--backup-extension=EXTENSION', 'Specify the backup extension. Default', 'is "~", which is appended to the data', 'filename.') do |ee|
- if ee.nil? or ee.empty?
- @err << "The backup extension must not be empty." if ee.nil? or ee.empty?
- @err << "#{opts}\n"
- return 0
- end
- @options.backup_extension = ee
- end
- opts.on('--extension=EXTENSION', 'Specifies the extension of Ruwiki data', 'files. The default is .ruwiki') do |ee|
- @options.extension = ee
- end
- opts.on('--no-extension', 'Indicates that the Ruwiki data files', 'have no extension.') do |nn|
- @options.extension = nil
- end
- opts.on('--quiet', 'Runs quietly. Default is to run with', 'normal messages.') do |qq|
- @options.quiet = qq
- @options.verbose = (not qq)
- end
- opts.on('--verbose', 'Runs with full messages. Default is to', 'run with normal messages.') do |vv|
- @options.quiet = (not vv)
- @options.verbose = vv
- end
- opts.separator ''
- opts.on_tail('--help', 'Shows this text.') do
- @err << "#{opts}\n"
- return 0
- end
-
- opts.parse!
- end
-
- if argv.empty?
- @err << "Error: not enough arguments.\n#{argv.options}\n" if not @options.quiet
- return 127
- end
-
- display_options if @options.verbose
-
- @options.target_format.capitalize!
- @options.target_format_class = Ruwiki::Backend.const_get(@options.target_format)
-
- argv.each { |file| process_file(file) }
-
- summary if not @options.quiet
- end
-
- # Process a single file.
- def process_file(file)
- if @options.backup_old_files
- return if file =~ /#{@options.backup_extension}/
- end
- @out << "#{file}: " unless @options.quiet
-
- if File.directory?(file) and @options.traverse_directories
- @out << "directory\n" unless @options.quiet
- Dir.chdir(file) { Dir['*'].each { |entry| process_file(entry) } }
- else
- begin
- page, page_format = load_page(file)
- @out << "converting from #{page_format} to #{@options.target_format} ... " if @options.verbose
- save_page(file, page)
- @out << "done.\n" unless @options.quiet
- rescue PageLoadException
- @out << "not a Ruwiki file; skipping.\n" unless @options.quiet
- rescue PageSaveException => e
- @out << "cannot save modified #{file}.\n" unless @options.quiet
- end
- end
- end
-
- def load_page(file)
- data = File.read(file)
- page_format = nil
-
- if data =~ OLD_HEADER_END_RE
- page_format = 'OldFlatfiles'
-
- page = Ruwiki::Page::NULL_PAGE.dup
-
- unless data.empty?
- rawbuf = data.split(NL_RE).map { |e| e.chomp }
-
- loop do
- if rawbuf[0] =~ OLD_HEADER_END_RE
- rawbuf.shift
- break
- end
-
- match = OLD_HEADER_RE.match(rawbuf[0])
-
- unless match.nil?
- case match.captures[0]
- when 'topic'
- page['properties']['topic'] = match.captures[1]
- page['properties']['title'] = match.captures[1]
- when 'version'
- page['properties']['version'] = match.captures[1].to_i
- else
- nil
- end
- end
- rawbuf.shift
- end
-
- page['page']['content'] = rawbuf.join("\n")
-
- with page['properties'] do |p|
- p['project'] = File.basename(File.dirname(File.expand_path(file)))
- p['editable'] = true
- p['indexable'] = true
- p['entropy'] = 0.0
- end
- end
- end
-
- # Try Marshal
- if page_format.nil?
- begin
- page = ::Marshal.load(data)
- page_format = 'Marshal'
- rescue Exception
- end
- end
-
- # Try YAML
- if page_format.nil?
- begin
- page = YAML.load(data)
- page_format = 'YAML'
- rescue Exception
- end
- end
-
- # Try the Flatfiles format
- if page_format.nil?
- begin
- page = Ruwiki::Backend::Flatfiles.load(data)
- page_format = 'Flatfiles'
- rescue Exception
- end
- end
-
- if page_format.nil? # Cannot detect page type.
- @err << %Q|Cannot detect the page format. |
- raise PageLoadException
- end
- [page, page_format]
- rescue PageLoadException
- raise
- rescue Exception => e
- @err << %Q|#{e.message}\n#{e.backtrace.join("\n")}\n| if @options.verbose
- raise PageLoadException
- end
-
- def save_page(file, page)
- if @options.backup_extension != '~'
- backup = "#{file}.#{@options.backup_extension}"
- else
- backup = "#{file}#{@options.backup_extension}"
- end
-
- # Always backup the file -- we are transactional.
- FileUtils.cp(file, backup)
-
- if @options.target_format == 'Marshal'
- method = :print
- else
- method = :puts
- end
- File.open(file, 'wb') { |f| f.__send__(method, @options.target_format_class.dump(page)) }
- rescue Exception => e
- FileUtils.mv(backup, file) if File.exists?(backup)
- @err << %Q|#{e.message}\n#{e.backtrace.join("\n")}\n| if @options.verbose
- raise PageSaveException
- ensure
- # If we aren't *supposed* to back up the file, then get rid of the
- # backup.
- if File.exists?(backup) and (not @options.backup_old_files)
- FileUtils.rm(backup)
- end
- end
-
- class PageLoadException < RuntimeError; end
- class PageSaveException < RuntimeError; end
-end
-
-if __FILE__ == $0
- include RuwikiConverter
-
- process(ARGV, $stdout, $stderr)
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/convert.bat b/ruwiki/tags/release-0.8.0-fixes/convert.bat
deleted file mode 100644
index 99a0212..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/convert.bat
+++ /dev/null
@@ -1,16 +0,0 @@
-@echo off
-REM Ruwiki 0.8.0
-REM Copyright © 2002 - 2004, Digikata and HaloStatue
-REM Alan Chen (alan@digikata.com)
-REM Austin Ziegler (ruwiki@halostatue.ca)
-REM
-REM Licensed under the same terms as Ruby.
-REM $Id$
-REM
-if "%OS%"=="Windows_NT" goto WinNT
-ruby -x "convert" %1 %2 %3 %4 %5 %6 %7 %8 %9
-goto done
-:WinNT
-ruby -x "convert" %*
-goto done
-:done
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Default/ProjectIndex.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Default/ProjectIndex.ruwiki
deleted file mode 100644
index 21b489c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Default/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,48 +0,0 @@
-page!content: = Ruwiki
- Ruwiki is a simple, extensible Wiki written in Ruby. It supports both
- CGI and \WEBrick interfaces, templates, and CSS formatting.
- Additionally, it supports project namespaces, so that two pages can be
- named the same for differing projects without colliding or odd naming
- conventions. Please see the ::Ruwiki project for more information.
-
- Ruwiki is also a partially internationalised Wiki, although more
- testing, especially testing with multibyte character encodings and
- Unicode (UTF-8) is required. There are German and Spanish translations
- of the messages included with the Ruwiki distribution.
-
- The current version is 0.8.0. Numerous enhancements have been made in
- this version, ranging from a new default look (and two additional
- schemes) to new backend format support to searching and topic listing.
- The full list of changes can be found in Ruwiki::ChangeLog, with
- discussions of various features in Ruwiki::WikiMarkup,
- Ruwiki::Configuring_Ruwiki, and Ruwiki::Extending_Ruwiki.
-
- If you are upgrading from an older version of Ruwiki, please read
- Ruwiki::[[Upgrading and Converting]].
-
- Certain Ruwiki \APIs are considered stable at this point, others will
- be changing leading up to 1.0. Some of this is discussed in
- Ruwiki::To_Do, with further architectural discussions in
- Ruwiki::[[Roadmap]].
-
- %projects()
-
- Please review ::Tutorial and ::Ruwiki if you are unfamiliar with the
- concept of Wikis in general. If you want to play with \WikiFormatting
- for Ruwiki, use the Ruwiki::SandBox.
-
- [http://rubyforge.org/projects/ruwiki Ruwiki development] is hosted at
- [http://rubyforge.org RubyForge]. The current release of Ruwiki can
- always be [http://rubyforge.org/frs/?group_id=84 downloaded] from
- \RubyForge or the development (unstable) version can be obtained from
- CVS.
-
- $Id$
-page!footer:
-page!header:
-properties!project: Default
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/BugTracking.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/BugTracking.ruwiki
deleted file mode 100644
index 0a0f1f7..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/BugTracking.ruwiki
+++ /dev/null
@@ -1,34 +0,0 @@
-page!content: = Ruwiki 0.8.0 Bug Tracking
- This page is for tracking bugs in Ruwiki. Only bugs from recent
- distributions are tracked. In addition to this source-based bug
- tracking, there is the [http://rubyforge.org RubyForge]
- [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug
- tracker] for Ruwiki.
-
- Those interested in Ruwiki development may also find the Ruwiki::To_Do
- list and the Ruwiki::[[Roadmap]] useful. The format of the bug list is
- &ldquo;version: description&rdquo;. For open bugs, the version is the
- version in which the bug was first reported. For closed bugs, the
- version is the version in which the bug was closed.
-
- ----
- == Open Bugs
- * 0.6.2: Not all formatting is applied consistently. The token rankings may need adjusting. Eivind Eklund has suggested a scheme that may help with this, but it will require architectural adjustment and will probably slow things down.
-
- ----
- == Closed Bugs
- * 0.8.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=707&group_id=84&atid=407 Sub-Numbered bullets don&rsquo;t increment]. Fixed a list numbering problem. I think that lists are a bit slower now, but they are completely accurate.
- * 0.7.0: Fixed a link detection problem in \[wikiword] format. Thanks to [mailto:eivind@FreeBSD.org Eivind Eklund] for the patch.
- * 0.7.0: Fixed a problem with &lt;pre&gt; paragraph detection and generation.
- * 0.7.0: Fixed a problem with &lt;p&gt; generation.
- * 0.7.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=197&group_id=84&atid=407 Run-away ruby on some links in default distribution]. This may be related to a runaway header problem that was reported to me on IRC some time back that I believe has been fixed. Please advise.
- * 0.6.1: Projects aren&rsquo;t created appropriately.
- * 0.6.1: Saving without editing (or repost) appears to cause problems. A fix has been applied to attempt to address this. Pages that have not been changed will not be saved.
-
- $Id$
-properties!project: Ruwiki
-properties!title: BugTracking
-properties!topic: BugTracking
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ChangeLog.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ChangeLog.ruwiki
deleted file mode 100644
index 527af16..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ChangeLog.ruwiki
+++ /dev/null
@@ -1,72 +0,0 @@
-page!content: = Ruwiki 0.8.0 ChangeLog
- Uncompleted to-do items can be found in To_Do. Bugs in Ruwiki are
- tracked in BugTracking.
-
- == Version 0.8.0
- * AC: Added topic list (_topics) and project list (_projects) controls on templates and backend.
- * AZ: Added %topics() and %projects() tokens. See WikiMarkup for details.
- * AC: Added simple search on back-end (both project and global); search strings must be validated and cleansed before being sent to the back-end (the back-end must prepare the string for its own search mechanism). The back-end is wholly responsible for the searching of the pages.
- * AC: Added \RecentChanges list to backend and controls.
- * AZ: Changed default for Ruwiki::Config#storage_options[:flatfiles][:extension] to <tt>ruwiki</tt>.
- * AZ: Topic backlink search: searches for mentions of the topic in the other topics of the project.
- * AZ: New templating engine: The Rdoc templating engine has been greatly enhanced in preparation for some changes that will happen surrounding antispam capabilities.
- * AZ: Multiple flatfile-based backend support: tagged file (&ldquo;flatfiles&rdquo;), YAML (&ldquo;yaml&rdquo;), and Marshal (&ldquo;marshal&rdquo;).
- * AZ: A converter utility between backends.
- * AZ: Defined a canonical, extensible page transport format.
- * AZ: Defined a canonical, format-independent diff format.
- * AZ: Fixed list numbering problem. Modified lists to allow for mixed lists. See WikiMarkup for restrictions.
- * AZ: Removed automatic image conversion for \URIs that look like images. Now, images must be specified with the \[image:uri] format. See WikiMarkup for more details.
- * AZ: Fixed minor bugs in several tokens.
- * AZ: New look! Ruwiki now sports a new default look with CSS and template changes.
- * AZ: New look! Ruwiki has a &ldquo;simple&rdquo; template set.
- * AZ: New look! Ruwiki has a &ldquo;sidebar&rdquo; template set.
- * AZ: Fixed a long-standing bug with code tokens.
-
- == Version 0.7.0
- * Changed the tokenization API so that the #post_replace call is made at the Token class level instead of the instance level.
- * Improved HTML code generation.
- * Added servlet runner batch files for Windows. They <strong>will</strong> require modification to run properly.
- * Added %calendar(...) support. See WikiMarkup for more information.
-
- == Version 0.6.2
- * Removed dependencies on Ruwiki from a number of classes (Ruwiki::Backend, Ruwiki::Backend::Flatfiles, Ruwiki::Page, Ruwiki::Wiki, Ruwiki::Wiki::Tokens, and various tokens).
- * Ruwiki now initializes a \Ruwiki::BackendDelegator, which creates the requisite Ruwiki::Backend instance with Ruwiki::Config#storage_options.
- * Added German (Christian Neukirchen &lt;cneukirchin@yahoo.de&gt;) and Spanish translations (Mauricio Fernández &lt;batsman.geo@yahoo.com&gt;).
-
- == Version 0.6.1
- * Changed Ruwiki::Config#data_path to Ruwiki::Config#storage_options[:flatfiles][:data_path]. This represents a generalisation of storage type options so that the Ruwiki::Config object is not polluted with storage type options. Ruwiki::Config#storage_options keys should be the same Ruby Symbol as is used in Ruwiki::Config#storage_type.
- * Added Ruwiki::Config#storage_options[:flatfiles][:extension], based on a request by Chad Fowler. This allows you to have Project/\TopicFile actually stored as Project/\TopicFile.wiki if Ruwiki::Config#storage_options[:flatfiles][:extension] is set to <tt>wiki</tt>. The default for Ruwiki::Config#storage_options[:flatfiles][:extension] is <tt>nil</tt>.
- * Fixed incorrect references. I had been incorrectly attributing [http://sourceforge.net/projects/rdoc-wiki RDoc Wiki] to Dave Thomas. \RDoc Wiki is by Michael Neumann. However, the project I pulled from <strong>is</strong> by Dave Thomas, but it&rsquo;s [http://sourceforge.net/projects/rublog RubLog]. Apologies to both developers.
- * Added RuwikiTemplatingLibrary documentation.
- * Internationalized messages, except for the templating library.
- * Added configuration API for future work surrounding features. The existing wiki is mostly feature complete. Additional features (such as access controls) will be added through the feature interface.
- * Fixed project creation.
- * Fixed problems with \WikiWord links.
- * Added Wikipedia-style Wiki links (\[[list of words]]).
- * Fixed a potential problem with re-posted data or saving without editing.
- * Added the ability to put commands in the URL.
-
- == Version 0.6.0
- * Added Ruby mailing list reference support (e.g., \[ruby-talk:12345]).
- * Reorganised the code (again) to better support alternative frontends. Based, in part, on [http://sourceforge.net/projects/rublog RubLog] by Dave Thomas. (Reference corrected in 0.6.1.)
- * Added a [http://www.webrick.org WEBrick] servlet interface. Based, in part, on the \WEBrick servlet interface provided with \RubLog by Chad Fowler.
- * Added templates, using the [http://rdoc.sourceforge.net RDoc] template.rb library.
- * Changed the default topic to be \ProjectIndex instead of \DefaultProject.
- * Added a new \WikiWord format, \Wiki_Word_with_Spaces.
- * Completed lots of Ruwiki documentation.
- * Updated the save page.
- * Fixed a problem with the linking of project specific pages.
-
- == Version 0.5.0
- * Reorganized the code significantly to be easier to edit and extend.
- * Added abbreviation capabilities.
- * Cleaned up a lot of tokenizing code.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: ChangeLog
-properties!topic: ChangeLog
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Configuring_Ruwiki.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Configuring_Ruwiki.ruwiki
deleted file mode 100644
index 360c863..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Configuring_Ruwiki.ruwiki
+++ /dev/null
@@ -1,114 +0,0 @@
-page!content: = Configuring Ruwiki 0.8.0
- Ruwiki is configured similarly as both a CGI and a \WEBrick servlet.
- The biggest distinction is that because the Wiki servlet is created
- after the \WEBrick server is created (during the dispatch to the
- servlet), it is necessary to configure the wiki with a global
- Ruwiki::Config object, <em>$config</em>. Thus, in the examples below,
- replace <em>wiki.config</em> with <em>$config</em> where necessary.
-
- : Additional configuration options will be added from time to time. The
- : form for specifying configuration may be changed prior to 1.0. In
- : 0.8.1, it will be possible to initialise the configuration object
- : from storage.
-
- If you are looking for the discussion on templates, this has been moved
- to Extending_Ruwiki.
-
- == Ruwiki Configuration Options
- === wiki.config.title
-
- This configuration option names the Wiki; by default this is
- <tt>Ruwiki</tt>. This affects the display of the home link and the
- &lt;title&gt; element of pages.
-
- === wiki.config.webmaster
-
- The email address for the webmaster. This is used in generating error
- reports that can be emailed to the wiki&rsquo;s webmaster.
-
- === wiki.config.default_page, wiki.config.default_project
-
- These options indicate what will happen when the wiki&rsquo;s URL is
- specified without any parameters (the default page in the default
- project is opened), when a topic is specified without a project (the
- topic is opened in the default project), and when a project is
- specified without a topic (the default page is opened in the project).
-
- === wiki.config.storage_type, wiki.config.storage_options
-
- <tt>wiki.config.storage_type</tt> specifies the back-end storage
- mechanism as a Ruby Symbol. Currently, <tt>:flatfiles</tt>,
- <tt>:marshal</tt>, and <tt>:yaml</tt> are supported. YAML is the
- default format for Ruby version 1.8.2 or later; :flatfiles for earlier
- versions. Because of this, the Ruwiki data is stored by default in
- :flatfiles format. See Extending_Ruwiki for more information.
-
- <tt>wiki.config.storage_options</tt> is a hash of option hashes for
- each known storage type known to the Wiki. This must use the same
- Symbol as <tt>wiki.config.storage_type</tt> as the top-level hash key.
-
- ==== ...storage_options[:flatfiles][:data_path], ...storage_options[:yaml][:data_path], ...storage_options[:marshal][:data_path]
-
- The directory in which the wiki files will be found. By default, this
- is &ldquo;<tt>./data/</tt>&rdquo;.
-
- ==== ...storage_options[:flatfiles][:extension]
-
- The extension of the wiki files. By default, this is
- &ldquo;ruwiki&rdquo;. For those upgrading from a previous version of
- Ruwiki, note that you must explicitly set this value to <tt>nil</tt> if
- you wish to have no extension.
-
- === wiki.config.template_path
- This specifies the paths where the Wiki templates will be found. The
- process running the Wiki must have read access to the template_path.
-
- === wiki.config.template_set, wiki.config.css
- These two options indicate which template set will be used. Three
- template sets are provided in the release package:
- &ldquo;default&rdquo;, &ldquo;simple&rdquo;, and &ldquo;sidebar&rdquo;.
- The only CSS file used initially is &ldquo;ruwiki.css&rdquo;. Templates
- work such that they will be found in
- <em>template_path</em>/<em>template_set</em>. All CSS files are loaded
- from the template set directory and emitted as part of the output
- stream.
-
- : The bad that this means that the CSS never caches on the client side
- : as it would if it were a separate file. However, as templates may not
- : be in a web-accessible directory, this is necessary.
-
- == Ruwiki Servlet Options
- Most, if not all, of the configuration above can be achieved through
- command-line options of the ruwiki servlet.
-
- === Servlet Command-Line Options
- ; -P, --port <em>PORT</em> : Runs the Ruwiki servlet on the specified port. Default 8808.
- ; -A, --accept <em>ADDRESSES</em> : Restricts the Ruwiki servlet to accepting connections from the specified address or (comma-separated) addresses. May be specified multiple times. Defaults to all addresses.
- ; -L, --local : Restricts the Ruwiki servlet to accepting only local connections (127.0.0.1). Overrides any previous --accept addresses.
- ; -M, --mount <em>MOUNT_POINT</em> : The relative URI from which Ruwiki will be accessible. Defaults to &ldquo;/&rdquo;.
- ; --[no-]log : Log \WEBrick activity. Default is --log.
- ; --logfile <em>LOGFILE</em> : The file to which \WEBrick logs are written. Default is standard error.
- ; -T, --threads <em>THREADS</em> : Sets the \WEBrick threadcount.
-
- === Ruwiki Command-Line Options
- ; --language <em>LANGUAGE</em> : The interface language for Ruwiki. Defaults to &ldquo;en&rdquo;. May be &ldquo;en&rdquo;, &ldquo;de&rdquo;, or &ldquo;es&rdquo;.
- ; --webmaster <em>WEBMASTER</em> : The Ruwiki webmaster email address. Defaults to &ldquo;webmaster@domain.com&rdquo;.
- ; --[no-]debug : Turns on Ruwiki debugging. Defaults to --no-debug.
- ; --title <em>TITLE</em> : Provides the Ruwiki title. Default is &ldquo;Ruwiki&rdquo;.
- ; --default-page <em>PAGENAME</em> : An alternate default page. Default is &ldquo;\ProjectIndex&rdquo;.
- ; --default-project <em>PAGENAME</em> : An alternate default project. Default is &ldquo;Default&rdquo;.
- ; --template-path <em>TEMPLATE_PATH</em> : The location of Ruwiki templates. Default is &ldquo;./templates&rdquo;.
- ; --templates <em>TEMPLATES</em> : The name of the Ruwiki templates. Default is &ldquo;default&rdquo;.
- ; --css <em>CSS_NAME</em> : The name of the <acronym title="Cascading Style Sheets">CSS</acronym> file in the template path. Default is &ldquo;ruwiki.css&rdquo;.
- ; --storage-type <em>TYPE</em> : Select the storage type: flatfiles, yaml, marshal
- ; --flatfiles-data-path <em>PATH</em> : The path where data files are stored. Default is &ldquo;./data&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
- ; --flatfiles-extension <em>EXT</em> : The extension for data files. Default is &ldquo;ruwiki&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: Configuring_Ruwiki
-properties!topic: Configuring_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Extending_Ruwiki.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Extending_Ruwiki.ruwiki
deleted file mode 100644
index 29bde50..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Extending_Ruwiki.ruwiki
+++ /dev/null
@@ -1,310 +0,0 @@
-page!content: = Extending Ruwiki 0.8.0
- Ruwiki is relatively easily extended to support new features. There are
- four primary ways in which Ruwiki can be extended or modified by the
- end user: templates, translating Ruwiki messages and labels, markup
- tokens, and creating new backends.
-
- == Templates
- Templating is done with a heavily modified version of the \RDoc
- template.rb library included in the distribution of Ruwiki. The
- templating library allows for nested templates, and this is used
- extensively in Ruwiki. This library is documented in
- RuwikiTemplatingLibrary.
-
- There are four major templates: content, edit, save, and error. Each of
- these has a slightly different combination of template files used, and
- this means that there are different sets of variables available.
-
- The major templates are &ldquo;composite templates&rdquo; that are
- defined as follows:
- ; content or search : body.tmpl, content.tmpl, controls.tmpl, footer.tmpl
- ; edit or preview : body.tmpl, edit.tmpl
- ; save : body.tmpl, save.tmpl, controls.tmpl, footer.tmpl
- ; error : body.tmpl, error.tmpl
-
- === Common Variables
- The following template variables are presented for all composite
- templates.
- ; <tt>%css_link%</tt> : The contents of the CSS file for the template set.
- ; <tt>%home_link%</tt> : A link to the root page of the Wiki.
- ; <tt>%editable%</tt> : A boolean value to mark the page as editable or not. Used in a conditional block in the templates.
- ; <tt>%cgi_url%</tt> : The URL for the Wiki.
- ; <tt>%content%</tt> : The formatted content of the current page.
- ; <tt>%page_project%</tt> : The project for the current page.
- ; <tt>%page_raw_topic%</tt> : The topic for the current page, escaped for safe transmission over the web.
- ; <tt>%page_topic%</tt> : The printable topic for the current page.
- ; <tt>%url_project%</tt> : The URL to the current page&rsquo;s project.
- ; <tt>%url_topic_search%</tt> : The URL to search for the current topic in the current project.
- ; <tt>%link_topic_search%</tt> : A link to the current topic search.
-
- === Variables for :content, :save, :search
- ; <tt>%wiki_title%</tt> : The title of the Wiki.
- ; <tt>%label_topic_or_search%</tt> : Either <tt>#topic#</tt> or <tt>#search#</tt>.
- ; <tt>%page_topic_name%</tt> : The same as <tt>%page_topic%</tt>.
-
- === Variables for :edit, :preview
- ; <tt>%wiki_title%</tt> : The title of the Wiki with a tag to indicate that the page is being edited.
- ; <tt>%page_content%</tt> : The content of the page.
- ; <tt>%page_version%</tt> : The current version number of the page.
- ; <tt>%unedited_page_content%</tt> : The formatted, unedited content of the page.
- ; <tt>%pre_page_content%</tt> : A Web-escaped form of the page content.
- ; <tt>%edit_comment%</tt> : The current edit comment.
-
- === Variables for :error
- ; <tt>%wiki_title%</tt> : The title of the Wiki with an error message.
- ; <tt>%name%</tt> : The name of the error.
- ; <tt>%backtrace%</tt> : The backtrace of the error.
- ; <tt>%backtrace_email%</tt> : The backtrace of the error formatted for sending by email.
- ; <tt>%webmaster%</tt> : The email address of the webmaster.
-
- == Translating Ruwiki Messages
- Ruwiki is internationalized. This method sets the Ruwiki error messages
- (and a few other messages) to the specified language Module. The
- language Module must have a constant Hash called <tt>Message</tt>
- containing a set of symbols and localized versions of the messages
- associated with them.
-
- If the file <em>ruwiki/lang/es.rb</em> contains the module
- <tt>Ruwiki::Lang::ES</tt>, the messages for RSS could be localized to
- Spanish thus:
-
- require 'ruwiki/lang/es'
- ...
- wiki.config.language = Ruwiki::Lang::ES
-
- Localization is currently per wiki instance. In a servlet environment,
- this may mean that only a single language is recognised.
-
- It is recommended that the hash be created with a default proc that
- reports unknown message keys.
-
- Message = Hash.new { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
-
- == Extending Ruwiki Markup
-
- : <strong>WARNING:</strong> These \APIs will change in Ruwiki 0.9.0,
- : replacing the instance variables @project, @backend, and @script with
- : a Handler object. There may be other changes as well.
-
- Ruwiki&rsquo;s WikiMarkup can be extended by creating a new
- Ruwiki::Wiki::Token. Tokens will be automatically loaded if they are
- placed in <em>ruwiki/wiki/tokens</em>.
-
- It is recommended that new tokens be added to the test cases in
- <tt>tests/tc_tokens.rb</tt>.
-
- The following Ruwiki::Wiki::Token class will convert strings in the
- forms of \[ruby-talk:12345] to links.
-
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- === Known Instance Variables
- ==== @match
- The match data for this token instance is is kept in @match. This is
- what will be used in #replace and #restore.
-
- ==== @project
- The project being processed.
-
- ==== @backend
- The Backend for the wiki. If you are using Ruwiki tokenizers outside of
- Ruwiki, this does not need to be a \BackendDelegator, but can be the
- direct Backend (which expects less information).
-
- ==== @script
- The URI to the script.
-
- ==== @message
- The message hash for displaying localised messages.
-
- ==== @title
- The title of the wiki instance.
-
- === Required Methods
- ==== ::regexp
- Ruwiki tokens are matched only through regular expression matches. As
- shown in the example above, the regular expression for ruby-talk
- mailing list posts is <tt>%r{\[ruby-\talk:(\d+)\]}</tt>. The purpose of
- the ::regexp method is to return the regexp for matching.
-
- For most inline matches, Ruwiki will ensure that the escape character
- (\) works automatically. For whole-line matches, it is necessary to
- match the escape character manually and provide a #restore method.
-
- As an example, the \HRule class implements these methods.
-
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- It may also be necessary to match escapes manually on inline matches
- that must be along word boundaries where the regular expression
- includes characters that normally match word boundaries. The project
- index match (e.g., \::Ruwiki) regular expression does this
- <tt>%r{(\B|\\)::([A-Z][a-z]+)}</tt>.
-
- ==== #replace
- This returns the formatted token. In the \RubyTalkLinks class above,
- the matched regular expression will be replaced with a hyperlink. The
- text of the hyperlink will be the matched text; the target of the
- hyperlink will include the first captured value.
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
-
- === Optional Methods
- ==== ::rank
- By default, a token will be processed in the order created. Tokens may
- be given a specific rank to ensure that they are processed in a
- particular order. The default rank is <tt>9999</tt>.
-
- ==== #restore
- Restores the token without replacement. Implements the results of the
- escape character. Each Token class is responsible for its own
- restoration. As noted in #regexp, whole-line tokens are most likely to
- need a #restore implementation.
-
- ==== ::post_replace
- Performs any necessary massaging of the data. The Lists token uses this
- to ensure that lists are collapsed together; the Paragraph token uses
- this to ensure that there are no empty paragraph tag pairs
- (&lt;p&gt;&lt;/p&gt;).
-
- : <strong>Note:</strong> This has been changed from Ruwiki 0.6.x.
- : Plugins written for the Ruwiki 0.6.x Token API will need to be
- : modified so that this is defined as:
-
- def self.post_replace
- ...
- end
-
- : as opposed to:
-
- def post_replace
- ...
- end
-
- == Extending Ruwiki Backends
- Ruwiki can support varying backends, as the backend interface has been
- abstracted completely from the data store. The backend
- <strong>must</strong>:
-
- # reside in <em>ruwiki/backends/</em> as <em>backend_name</em>.rb.
- # be registered by adding the <em>backend_name</em> as a symbol (e.g., :<em>backend_name</em>) to Ruwiki::KNOWN_BACKENDS.
- # inherit from Ruwiki::Backend.
- # exist as Ruwiki::Backend::<em>\Backend_name</em>.
-
- === Required Methods
- ==== #initialize(storage_options)
- The backend may only obtain its configuration information from an
- option hash provided by the \BackendDelegate. This is obtained from
- <tt>wiki.config.options[backend]</tt>. If a configuration error is
- detected during initialization, the backend should raise the
- \Ruwiki::Backend exception class \BackendError. This would be done
- with:
-
- raise Ruwiki::Backend::BackendError.new([:message_symbol, [message_parameters]])
-
- Backend writers should add appropriate messages to the
- <em>lang/en.rb</em> at a minimum. The \BackendDelegator will detect
- this and report the results appropriately.
-
- ==== #load(topic, project)
- The backend will be provided the name of the topic and project. It must
- return the selected page as a hash of hashes. The hash must match that
- of \Ruwiki::Page#export. It will be passed as the parameter to
- \Ruwiki:::Page.new.
-
- ==== #store(page)
- This method must store the provided Ruwiki::Page object. Current Ruwiki
- backend implementations store the Ruwiki::Page#export hash. This method
- is responsible for calling the private method Backend#make_diff and
- adding the result to the list of diffs for the page.
-
- ===== Backend#make_diff(oldpage, newpage)
- This method expects two page objects, or their Ruwiki::Page#export
- representation. It will return a hash representing the difference set
- between the two pages.
-
- ==== #obtain_lock(page, address = 'UKNOWN', timeout = 600)
- Obtains an exclusive lock on the page. The lock should have a timeout and
- permit access from the same IP address without restriction. This should
- <strong>not</strong> be a filesystem lock. The time stored for purposes of locking
- should include the timeout (e.g., Time.now.to_i + time).
-
- ==== #release_lock(page, address = 'UNKNOWN')
- Releases the exclusive lock on the page. The lock should not be released
- unless the IP address on the lock is the same or the lock has expired.
-
- ==== #project_exists?(project)
- Returns <tt>true</tt> if the project exists.
-
- ==== #page_exists?(topic, project = 'Default')
- Returns <tt>true</tt> if the page exists within the specified project.
-
- ==== #create_project(project)
- Attempts to create the project.
-
- ==== #search_project(project, search_string)
- String search all topic names and content in a project and return a
- hash of topic hits:
-
- topicname => hits
-
- ==== #list_projects
- Return an array of all projects.
-
- ==== #list_topics(project)
- Return an array of all topics within the project.
-
- === Future Methods
- Note that these methods are currently optional (they are not yet called
- from Ruwiki), but will become required moving forward as the functions
- are implemented in Ruwiki.
-
- ==== #destroy(page)
- Removes the page from the wiki. This should <strong>not</strong> remove
- the change history of the topic (in the event that the page has been
- removed maliciously). There will be a separate method to remove the
- page history.
-
- ==== #destroy_project(project)
- Attempts to destroy the project.
-
- === Optional Methods
- These methods are completely optional. They are guarded in the
- \BackendDelegate by a call to #respond_to?().
-
- ==== #global_search(search_string)
- The global search in the backend delegate is by default implemented as
- a looping search through all projects. A backend may have a more
- efficient backend global search mechanism. If the backend responds to
- #global_search, then the \BackendDelegate will use this method.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: Extending_Ruwiki
-properties!topic: Extending_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/LicenseAndAuthorInfo.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
deleted file mode 100644
index e5fca75..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
+++ /dev/null
@@ -1,33 +0,0 @@
-page!content: = Ruwiki Licence
- Ruwiki is copyright © 2002 - 2004 [mailto:alan@digikata.com Alan Chen] and
- [mailto:ruwiki@halostatue.ca Austin Ziegler].
-
- Ruwiki is provided free of use and without any warranty express or implied.
- You may use, distribute, or modify Ruwiki under the conditions of Ruby&rsquo;s
- licence or the [http://www.gnu.org/copyleft/gpl.html GNU General Public
- Licence].
-
- * Ruwiki includes parts of Diff::LCS by Austin.
- * Ruwiki includes a modified version of rdoc/template.rb originally by Dave Thomas for use in \RDoc.
-
- == Translations
- * Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen] on 2003.10.22, with corrections by Mauricio Fern&aacute;ez. Note that the initial template translations (./templates/de/) were done via \AltaVista Babelfish and should not be blamed on Christian.
- * Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fern&aacute;ndez] on 2003.10.22. Note that the initial template translations (./templates/es/) were done via \AltaVista Babelfish and should not be blamed on Mauricio.
-
- == Austin&rsquo;s Other Projects
- Austin has also released several other projects available on the RAA that you may be interested in:
- * [http://raa.ruby-lang.org/list.rhtml?name=mime-types MIME::Types], \RubyForge [http://rubyforge.org/projects/mime-types project].
- * [http://raa.ruby-lang.org/list.rhtml?name=pdf-writer PDF::Writer], \RubyForge [http://rubyforge.org/projects/ruby-pdf project].
- * [http://raa.ruby-lang.org/list.rhtml?name=text-format Text::Format], \RubyForge [http://rubyforge.org/projects/text-format project].
- * [http://raa.ruby-lang.org/list.rhtml?name=trans-simple Transaction::Simple], \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=uninheritable Uninheritable], Transaction::Simple&rsquo;s \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=diff-lcs Diff::LCS], Ruwiki&rsquo;s \RubyForge [http://rubyforge.org/projects/ruwiki project].
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: LicenseAndAuthorInfo
-properties!topic: LicenseAndAuthorInfo
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ProjectIndex.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ProjectIndex.ruwiki
deleted file mode 100644
index 5d7a218..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,51 +0,0 @@
-page!content: = Ruwiki 0.8.0
- This is the \ProjectIndex page for Ruwiki. For any given project, the
- \ProjectIndex topic will be the default topic for plain project links.
-
- == Features and Information
- * This wiki supports a variety of WikiFeatures that you may be interested in. The rules for WikiMarkup are similar to some other wikis, but there are a few unique markup capabilities in Ruwiki.
- * Configuring_Ruwiki is simple.
- * Extending_Ruwiki is almost as simple.
- * Who wrote Ruwiki? Read the LicenseAndAuthorInfo.
-
- == Requirements
- Ruwiki currently requires Ruby 1.8, Diff::LCS 1.1.0 (portions
- included). The YAML backend requires Ruby 1.8.2.
-
- == Getting Started
- === QuickStart (CGI)
- # Place the Ruwiki directory in a place that your webserver can execute CGI programs and ensure that ruwiki.cgi is executable on your webserver.
- # Point your web browser to the appropriate URL.
- === QuickStart (\WEBrick)
- # Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
- # Point your web browser to <http://localhost:8808/>.
-
- == Support
- * Troubles with Ruwiki? See TroubleShooting for some suggestions. Have a new problem? Add it to the main [http://ruwiki.rubyforge.org/ruwiki.cgi/Ruwiki/TroubleShooting TroubleShooting] page.
- * Subscribe to [http://rubyforge.org/mailman/listinfo/ruwiki-discuss ruwiki-discuss] ([http://rubyforge.org/pipermail/ruwiki-discuss/ archives]).
- * You can also use the [http://rubyforge.org/forum/?group_id=84 Ruwiki Public Forum] or the on \RubyForge.
-
- == Tracking Ruwiki Development
- The development progress of Ruwiki is kept primarily in the wiki
- itself, but the services of [http://rubyforge.org RubyForge] are used
- as well.
- * The BugTracking page in Ruwiki keeps track of open and closed bugs in Ruwiki. Bugs can also be found in the \RubyForge [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug tracker] and [http://rubyforge.org/tracker/?atid=408&group_id=84&func=browse Support Requests].
- * The To_Do list keeps track of major development goals for Ruwiki. Items for this list can be found on \RubyForge in [http://rubyforge.org/tracker/?atid=410&group_id=84&func=browse Feature Requests] and [http://rubyforge.org/tracker/?atid=409&group_id=84&func=browse Patches].
- * There is a mailing list to track CVS changes: [http://rubyforge.org/mailman/listinfo/ruwiki-checkin ruwiki-checkin] ([http://rubyforge.org/pipermail/ruwiki-checkin/ archives]).
-
- == Different Features?
- If this wiki doesn&rsquo;t have the right combination of features, (or if it
- just doesn&rsquo;t feel right) try these other Ruby-based Wikis:
-
- * [http://instiki.rubyforge.org/ Instiki]
- * [http://www.walrus-ruby.org/amrita/cgi-bin/aswiki/aswiki.cgi Amrita Wiki]
- * [http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=top RWiki]
- * [http://www.xpsd.com/MiniRubyWiki MiniRubyWiki]
-
- $Id$
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Roadmap.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Roadmap.ruwiki
deleted file mode 100644
index 11fab66..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Roadmap.ruwiki
+++ /dev/null
@@ -1,223 +0,0 @@
-page!content: = Ruwiki 0.8.0: The Road Ahead
- What lies ahead for Ruwiki? The To_Do list will give a detailed list of
- what is to follow, but this list is not the roadmap. There is no clear
- indication of the reason for &mdash; and in some cases, the meaning of
- &mdash; the items on the list. The intention of this document is to
- expand on that list. As items are completed, they will be removed from
- this document.
-
- == Development Input
- The primary driver of development on Ruwiki is the needs of a few groups
- of people. First, both Alan and Austin use or will use Ruwiki at work.
- There are particular needs that both have. Austin will be replacing an
- installation of \PhpWiki with an installation of Ruwiki sometime in
- September or October 2004.
-
- Second, both [http://www.rubygarden.org/ruby RubyGarden] and
- [http://www.rubyforge.org RubyForge] have expressed an intention to
- replace the Perl-based \UseMod wiki with a Ruby-based wiki. The popular
- and easy-to-use Instiki (&ldquo;there is no step 2&rdquo;) is not an
- ideal choice for either because they either require or prefer a
- CGI-based wiki. Ruwiki has the desired level of performance and
- implemenation simplicity that impresses both groups, and it is the
- current preferred choice. Thus, the needs of both websites factor highly
- into the goals for Ruwiki.
-
- Third, Austin is giving a talk on Ruwiki at \RubyConf 2004. This
- requires that the API must be mostly stable so that the talk,
- &ldquo;Using and Extending Ruwiki&rdquo;, has relevance to current and
- potential users of Ruwiki without having to worry that the API may
- change significantly.
-
- Last, and certainly not least, feature requests and bug reports are a
- factor. One of the things that changed in Ruwiki 0.8.0 was the look and
- feel; admittedly, the look and feel in earlier versions was a bit
- garish, designed to fit in with a particular website more than be a
- general wiki theme. Users complained, and we changed this. The
- continual spam defacement of the \RubyGarden wiki suggested several
- possible improvements that could be made in Ruwiki to fight wiki spam;
- initial work has been implemented in Ruwiki 0.8.0 and other work will be
- implemented in 0.9.0 through to the release of 1.0.
-
- == Ruwiki 0.8.1: &ldquo;Keeping Up Appearances&rdquo;
- Ruwiki 0.8.1 is planned for release a week or so after the release of
- Ruwiki 0.8.0. This will mean little change for users of the standalone
- release, but some work will be done to prepare for versions of Ruwiki
- that can be installed with \RubyGems or <acronym title="Ruby Production
- Archive">RPA</acronym>&rsquo;s rpa-base.
-
- Both installation systems present a particular challenge to Ruwiki, as
- simply running &ldquo;ruwiki_servlet&rdquo; with no arguments will look
- for the data files and the template files relative to the current
- directory. With \RubyGems, though, this would require that the user
- specify something like:
-
- ruwiki_servlet \
- --template-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.8.1/templates \
- --flatfiles-data-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.8.1/data
-
- Instiki does this better, by creating the templates and data files on
- the fly when a new instance is created. This will certainly be an
- option, but it will not be the only option. Since a Wiki instance may be
- private, and since Ruwiki supports CGI execution where this may not be
- an option, we need a secondary installation mechanism that copies the
- default data to a local directory. Ideally, as well, instead of
- providing all of the configuration options on the command-line, we will
- also provide a configuration file mechanism.
-
- Daniel Berger has provided instructions for users of Instiki to install
- it as a service on Win32. There is no reason that this cannot also be
- applied to Ruwiki&rsquo;s \WEBrick servlet, so it will, and it will be
- offered as an option.
-
- After all of this, Ruwiki will be offered as a \RubyGem and the RPA team
- will be asked to offer Ruwiki in the RPA.
-
- Chad Fowler&rsquo;s port of \RubLog&rsquo;s vector search may be added
- to this version if it is ready.
-
- == Ruwiki 0.9.0: &ldquo;Are You Being Served?&rdquo;
- Ruwiki 0.8.0 introduced an incompatible change in the way that page
- diffs were stored, so users were advised to remove any existing .rdiff
- files. This isn&rsquo;t as problematic as it may sound, as until 0.9.0,
- there is no way to actually view the page diffs from Ruwiki itself. One
- of the major goals
-
- In Ruwiki 0.7.0, a new token was introduced: %calendar(). The concept
- here is a sound one that can be extended to make token addition easier.
- Currently, it is necessary for token writers to create their own regular
- expressions. The &ldquo;function token&rdquo; will be added &mdash;
- although the form may not be &ldquo;%<em>function-name</em>&rdquo;
- &mdash; that will work with either a line replacement or a word
- replacement so that the regular expression does not need to be written.
- Tests for the replacement will still need to be written, but
- standardizing new custom tokens will be a good thing.
-
- If it has not been added already, Chad Fowler&rsquo;s port of
- \RubLog&rsquo;s vector search will be added.
-
- The presence of static HTML content (headers and footers) per page has
- been accounted for in Ruwiki 0.8.0, but it will not be displayed.
- Further, there is currently no way to specify or display static content
- for the wiki or the project. (A related problem here is that projects do
- not have any properties. This will become important as projects should
- be able to be marked private within a wiki in the future.)
-
- The purpose of the \WikiWikiWeb is to provide a collaborative, community
- knowledge editing environment. Unfortunately, the pondscum also known as
- spammers have figured out that the \WikiWikiWeb provides a positive
- Google \PageRank, and having their links on our Wikis is benefits them.
- Just as they don&rsquo;t care about filling our mailboxes, they
- don&rsquo;t care about defacing our community knowledge. Thus, Ruwiki
- 0.9.0 will also see the introduction of antispam techniques. They will
- include IP or hostname blacklisting (with timeouts); external URL
- redirection with an exception list; and robot exclusion. Partial robot
- exclusion is implemented in Ruwiki 0.8.0, but there is no transformation
- on actions, which is necessary.
-
- The \RecentChanges mechanism will be updated to make it possible to see
- the \GlobalRecentChanges list.
-
- The most significant change in Ruwiki 0.9.0 will be the modification of
- the request pipeline. This will not be visible to the end user, but it
- will be significant to users who wish to extend Ruwiki. Currently,
- Ruwiki processes all commands in ruwiki.rb. In Ruwiki 0.9.0, this will
- be changed to a dispatch mechanism, where Action objects are introduced,
- and ruwiki.rb dispatches requests to Action objects.
-
- .---------. .--------------------.
- | Request +--------->| Process [Request] |
- ·---------· ·----+---------------·
- |
- v
- .--------------------.
- | Perform [Action] |
- ·----+---------------·
- |
- v
- .--------------------.
- | Prepare [Response] |
- ·----+---------------·
- |
- v
- .--------. .----+---------------.
- | Page |<----------+ Send [Page] |
- ·--------· ·--------------------·
-
- The diagram above shows the general pipeline. The difference is that the
- action will be its own object. In general, it will need to know how to
- process certain URL formats.
-
- In the process of defining the action objects, ActionCards will be
- created. Below is an example \ActionCard for the default action,
- <tt>_show</tt>. In ActionCards, everything is relative to the Ruwiki
- root URI. Important to note is that ActionCards are an ideal: they may
- not represent something that can be accomplished for 0.9, 0.10, or even
- 1.0. They do, however, represent the ultimate target.
-
- === Action: Show [_show] <strong>DEFAULT</strong>
- ;; /Topic, /Topic/_show : Show <em>Topic</em> in the <em>Default</em> project.
- ;; /Project/, /Project/_show : Show <em>Project</em>::\ProjectIndex.
- ;; /Project/Topic, /Project/Topic/_show : Show <em>Project</em>::<em>Topic</em>.
- ;; /Topic?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>], /Topic/_show?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>] : Show the content of <em>Topic</em> as of the specified date, and optionally time.
- ;; /Project/?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>], /Project/_show?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>] : Show the content of <em>Project</em>::\ProjectIndex as of the specified date, and optionally time.
- ;; /Project/Topic/?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>], /Project/Topic/_show?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>] : Show the content of <em>Project</em>::<em>Topic/</em> as of the specified date, and optionally time.
- ;; /Topic?v=<em>version#</em>, /Topic/_show?v=<em>version#</em> : Show the specified version of <em>Topic</em>.
- ;; /Project/?v=<em>version#</em>, /Project/_show?v=<em>version#</em> : Show the specified version of <em>Project</em>::\ProjectIndex.
- ;; /Project/Topic?v=<em>version#</em>, /Project/Topic/_show?v=<em>version#</em> : Show the specified version of <em>Project</em>::<em>Topic</em>.
- ;; /Topic?s=<em>set-id#</em>, /Topic/_show?s=<em>set-id#</em> : Show the specified set of <em>Topic</em>. This is a possible action that will work with &ldquo;changesets&rdquo;.
- ;; /Project/?s=<em>set-id#</em>, /Project/_show?s=<em>set-id#</em> : Show the specified set of <em>Project</em>::\ProjectIndex. This is a possible action that will work with &ldquo;changesets&rdquo;.
- ;; /Project/Topic?s=<em>set-id#</em>, /Project/Topic/_show?s=<em>set-id#</em> : Show the specified set of <em>Project</em>::<em>Topic</em>. This is a possible action that will work with &ldquo;changesets&rdquo;.
-
- == Ruwiki 0.10.0: &ldquo;What&rsquo;s Your Line?&rdquo;
- The antispam techniques introduced in 0.9.0 are positive steps in the
- fight against wiki defacement. They are hopefully effective, too. The
- problem is that because 0.9.0 doesn&rsquo;t offer users or user
- authentication, there&rsquo;s no way of safely allowing the edit of the
- antispam lists. Thus, to allow this and other potentially dangerous
- actions, a user and capability framework will be added to Ruwiki. This
- framework will allow for user identification, authentication, and
- authorization to indicate what users are allowed to perform what
- actions.
-
- Authenticated users will be able to bypass blacklist checking; thus, if
- &ldquo;msn.com&rdquo; is blocked, &ldquo;joe.blog@msn.com&rdquo; could
- still authenticate with Ruwiki and edit the pages. Some users will be
- able to manage user permissions (including user management), edit
- antispam lists, etc.
-
- Other actions will be added, including the ability to rename topics and
- move topics between projects. In both cases, the topic change history
- must be maintained.
-
- The documentation for Ruwiki will be substantially complete with this
- version, lacking only specific information on the features that will be
- added in Ruwiki 1.0.0.
-
- == Ruwiki 1.0.0: &ldquo;Yes, Minister&rdquo;
- A combined strength and weakness of Ruwiki is that it currently does
- little to protect against arbitrary HTML being inserted into the current
- topic. The allowed subset of HTML should be restricted to a safe subset
- to prevent cross-site-scripting attacks.
-
- Pages and projects have properties: we need to provide the ability to
- edit those properties. Part of the properties that should be editable
- include whether a page is frozen &mdash; this means that the page is no
- longer editable by any user (unless it is unfrozen) and is effectively a
- plain HTML page. Other properties include the static header and footer
- information in a page or project.
-
- Modern Wikis require an RSS feed. Ruwiki will provide one.
-
- == The Future: &ldquo;Yes, Prime Minister&rdquo;
- Ruwiki 1.0.0 does not represent the end of the line for Ruwiki, but what
- the future holds is unclear. We&rsquo;ll see what the future brings.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: Roadmap
-properties!topic: Roadmap
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
deleted file mode 100644
index 787f9c1..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
+++ /dev/null
@@ -1,157 +0,0 @@
-page!content: = Ruwiki 0.8.0 Templating
- Ruwiki uses a heavily modified version of the \RDoc
- &ldquo;cheap-n-cheerful&rdquo; HTML page template system. This a
- line-oriented, text-based templating system.
-
- == Templates
- Templates in the templating system are essentially plain strings with
- particular references to templating keys or an include directive.
-
- The template interacts with value and message hashes provided by
- Ruwiki. The keys known to the templates expected by Ruwiki are
- detailed in Extending_Ruwiki. Nested key references are found from the
- inside-out. That is, the closest resolving key to the current level is
- found, not the furthest resolving key.
-
- === Including Other Templates
- Templates may include other templates to any arbitrary level by using the
- <tt>!INCLUDE!</tt> directive. When the \TemplatePage is created, an
- array of template strings are provided; these will be used to satisfy
- <tt>!INCLUDE!</tt> directives. If there are not enough template
- strings provided, <tt>!INCLUDE!</tt> won&rsquo;t be translated.
-
- : This may change before Ruwiki reaches 1.0, so that templates are
- : named instead of iterated.
-
- === Simple Template Keys
- Strings of the format <tt>%<em>key</em>%</tt> or
- <tt>%?<em>key</em>%</tt> are simple template keys. <em>key</em> is
- looked up in the provided value hash and is presented as the string
- value of the result. <tt>%key%</tt> template keys are mandatory; if
- the key is not found in the value hash, an exception will be raised.
- <tt>%?key%</tt> template keys are optional; if they key is not found
- in the value hash, an empty string (&ldquo;&rdquo;) will be used.
-
- === Labels
- Strings of the format <tt>#<em>key</em>#</tt> or
- <tt>#?<em>key</em>#</tt> are labels. <em>key</em> is looked up in the
- provided message hash as a Symbol (e.g.,
- <tt><em>key</em>.intern</tt>). As with simple template keys,
- <tt>#key#</tt> labels are mandatory and <tt>#?key#</tt> labels are
- optional.
-
- === Links
- Strings of the format <tt>HREF:\ref:name</tt> will become HTML links.
- Both <em>ref</em> and <em>name</em> are keys to be looked up.
- <em>name</em> is mandatory; an exception will be raised if it is not
- found.
-
- === Control Structures
- The templating library supports both looping and conditional control
- structures in both single-line and multi-line forms. Single-line
- control structures <strong>may not</strong> be nested; multi-line
- control structures <strong>may</strong> be nested arbitrarily deeply.
-
- ==== Looping Control Structures
- There are two forms of looping control structures.
-
- [:key|stuff:]
-
- START:key
- ... stuff ...
- END:key
-
- ===== Single-Line Looping
- [:key|stuff:]
-
- The value of <em>key</em> may be <tt>nil</tt>, an integer value, a
- range, or an array. When <em>key</em> represents:
- # <tt>nil</tt>, the looping structure will be replaced with an empty string.
- # An integer, <em>stuff</em> will be repeated <em>key</em> times. Values from 1 to <em>key</em> will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # A range, <em>stuff</em> will be repeated once for each successive value in the range of <em>key</em>. Each value will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # An array, the behaviour will differ depending on the contents of the array.
- ## If the array contains hashes, the behaviour is the same as a multi-line looping construct. See below for details.
- ## Otherwise, the template iterates through the array, providing each value to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
-
- As an example, if we have:
-
- "[:b|%b% ]"
-
- # <tt>val["b"] = 3 -> "1&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = (0..2) -> "0&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = ["a", "B"] -> "a&nbsp;B&nbsp;"</tt>
-
- ==== Multi-Line Looping
- START:key
- ... stuff ....
- END:key
-
- The value of <tt>key</tt> must be an array of hashes. <tt>... stuff
- ...</tt> will be repeated once for each entry in the array. The hashes
- will be passed as nested value hashes.
-
- %a% [:b|%a% ]%a%
-
- When the above template string is run with the following hash:
-
- val["a"] = 1
- val["b"] = [ { "a" => 2 }, { "a" => 3 } ]
-
- The result is:
-
- 1 2 3 1
-
- The behaviour is the same for multi-line blocks.
-
- ==== Conditional Block Keys
- IF:key
- ... stuff ...
- ENDIF:key
-
- The block between <tt>\IF:key</tt> and <tt>\ENDIF:key</tt> will be included in
- the output only if the corresponding key is set in the value hash.
-
- == Example
- Given the set of templates T1, T2, and T3 (shown below), here&rsquo;s how we would
- use the templating system.
-
- values = { "name" => "Dave", "state" => "TX" }
- t = TemplatePage.new(T1, T2, T3)
- File.open(name, w) { |f| t.process(f, values) }
-
- or:
-
- <!-- Source -->
- val1 = { "name" => "Dave", "state" => "TX" }
- val2 = { "name" => "Dave" }
- msgs = { }
- res = ""
- t.process(res, values, msgs)
-
- <!-- T1 -->
- Templates can subsitute a wide variety of values.
- !INCLUDE!
-
- <!-- T2 -->
- Name: %name% !INCLUDE!
-
- <!-- T3 -->
- IF:state
- State: %state%
- ENDIF:state
-
- The result will be:
-
- Name: Dave
- State: TX
-
- Name: Dave
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: RuwikiTemplatingLibrary
-properties!topic: RuwikiTemplatingLibrary
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/SandBox.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/SandBox.ruwiki
deleted file mode 100644
index 075cc47..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/SandBox.ruwiki
+++ /dev/null
@@ -1,11 +0,0 @@
-page!content: This page is intended for users to play with freely to
- practice their \WikiFormatting.
-
- $Id$
-properties!indexable: false
-properties!project: Ruwiki
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/To_Do.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/To_Do.ruwiki
deleted file mode 100644
index 8cf88f5..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/To_Do.ruwiki
+++ /dev/null
@@ -1,61 +0,0 @@
-page!content: = Ruwiki 0.8.0 To Do Tracking
- Completed to-do items can be found in the ChangeLog. Bugs in Ruwiki
- are tracked in BugTracking.
-
- == Well-Defined To Do Items
- === Ruwiki 0.8.1
- ; Non-local installation : current Ruwiki can support a non-local configuration (that is, where the data and templates are in a separate directory from the startup program), but there is no mechanism to automate this. In order to enable a \RubyGem or <acronym title="Ruby Production Archive">RPA</acronym> installation of Ruwiki, this mechanism will be necessary.
- ; Stored configurations : allow for configuration objects to be stored. This will make it easier to support non-local installations and configurations.
- ; Ruwiki installer : add a command-line program to create a new deployment of Ruwiki; this will copy the default data to the local installation.
- ; Central location : add the ability to use the data in the central installation that is provided by a \RubyGem or <acronym title="Ruby Production Archive">RPA</acronym> installation.
- ; Windows service : allow Ruwiki to be run as a Windows service for users of the Win32 build of Ruby.
- ; \RubyGem : Offer Ruwiki as a \RubyGem.
- === Ruwiki 0.9.0
- ; Versioning : complete the change history interface. Change history is currently stored in a file <em>topic[.extension]</em>.rdiff. There is no way to display the change history at this point.
- ; Action objects : Actions will be generalised to pull the processing out of the main ruwiki.rb inasmuch as is possible.
- ; Function tokens : generalize the %&lt;function-name&gt;[(&lt;args&gt;)] calling method so that function tokens can be created without having to create a custom regular expression.
- ; Search work : There is further search work required. The current mechanism is effective, but inefficient, as it must load and convert each file in a project to a page and then search selectively within that page. The search mechanism must be improved.
- ; Frozen content : make it so that frozen content can be provided on a per-page or Wiki basis. Will provide both headers and footers. <strong>Note:</strong> Ruwiki 0.9.0 will only provide the ability to present the information, not create or modify it.
- ; Blacklisting : Allow the specification of an allow/deny list for \IPs or hostnames, aimed at blocking known spammers. Entries in this list can be permanent or temporary (e.g., &ldquo;* DENY&rdquo;, &ldquo;spammer.com DENY UNTIL 20040723&rdquo;, &ldquo;139.244.33.25 ALLOW&rdquo;).
- ; External URL redirection : Force \URIs that allow redirection (e.g., HTTP and HTTPS) are redirected through a single point on an instance of Ruwiki (e.g., &lt;ruwiki-uri&gt;_redirect?&lt;url&gt;) unless the specific \URIs or hosts are whitelisted (e.g., rubycentral.com, rubyforge.org, ruby-lang.org, etc.).
- ; Robot exclusion : Recognise known robot user agents; when found, allow them to index and follow links on all pages except command pages (e.g., Project/Topic/_edit, Project/_create, etc.).
- ; \GlobalRecentChanges : Recent changes for all projects.
- === Ruwiki 0.10.0
- ; Authentication : allow user creation and authentication. Authenticate users bypass blacklist checking; thus, if &ldquo;msn.com&rdquo; is blocked, joe.blog@msn.com could still authenticate with Ruwiki and edit the pages.
- ; Topic renaming : add the ability to rename a topic within a project. Topic change history should be maintained.
- ; Topic moving : add the ability to move and/or rename a topic between projects. Topic change history should be maintained.
- ; Complete documentation : Complete the documentation of Ruwiki.
- ; Antispam : Allow the on-line editing of antispam lists to authenticated and authorised users.
- === Ruwiki 1.0.0
- ; Escape HTML Entities : HTML Entities such as &amp;, &lt;, and &gt; are not currently escaped. This may cause problems with some browsers and should be fixed <strong>without</strong> impairing the ability to add at least some raw HTML. Note that the current engine does not check raw HTML and thus could potentially be vulnerable to cross-site-scripting attacks.
- ; RSS Feed : Ruwiki must be able to offer \RecentChanges and \GlobalRecentChanges as RSS feeds. This may not be ideal with the current \RecentChanges format. It may be easier to move to a two-stage \RecentChanges format.
- ; Static content : Allow the creation and editing of static content.
- ; Frozen pages : provide the ability to freeze content in place; the page is no longer &ldquo;wiki&rdquo; editable and is effectively a plain HTML page.
- ; Page properties : provide the ability to generally edit the properties of a given page.
-
- == General Future To Do Items
- ; E-mail gateway : accept topic appends via e-mail.
- ; alternative backends : access other wiki data storage, or other formats, e.g. e-mail boxes in mh or mbox formats
- ; bug tracker backend : with alternate markup
- ; add setup and user config methods : for backend plugin classes, then we can use them with an interactive or gui tool frontend to setup data storage backends. The user might have to run as root or other user with database create permissions.
- ; add id="" to various markup elements (make id specific to topic) : Later we can allow users to tweak a page using uploaded css fragments which might get appended onto the standard css contents.
- ; ruby action : upload a ruby code fragment to add a smart &ldquo;action&rdquo; to that wiki page. Need some sort of security + approval system to handle this safely.
- ; Preview button : add a preview button to the save page.
- ; Alternative templating systems : not as high priority now that there&rsquo;s a real templating system in place.
- ; Alternative markup systems : potentially allow \RedCloth (Textile) and/or \BlueCloth (Markdown) to be processed for a page. This could be implemented as a %function.
- ; Project/topic security : allow certain projects to be restricted/authenticated for read/write based on user.
- ; Track last <em>n</em> links/topics : ?
- ; Write a markup debugger : ?
- ; Validate topic formatting from cgi : ?
- ; Validate project from cgi : ?
- ; Project-based backend : Allow different projects to have different backends.
- ; Arbitrary-depth project namespace support : Foo::Bar::\BazPage.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: To_Do
-properties!topic: To_Do
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/TroubleShooting.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/TroubleShooting.ruwiki
deleted file mode 100644
index 64351ba..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/TroubleShooting.ruwiki
+++ /dev/null
@@ -1,27 +0,0 @@
-page!content: = Ruwiki 0.8.0
- = Ruwiki 0.8.0 Troubleshooting Tips
- Following are some tips contributed by users of Ruwiki. Remember:
- Ruwiki currently requires Ruby version 1.8; the YAML backend requires
- Ruby version 1.8.2 or the latest CVS of Ruby 1.9.
-
- == No such file or directory
- (Unix systems only.) If you get something like:
-
- % ./ruwiki_servlet
- : no such file or directory
-
- run the following in the Ruwiki directory:
-
- % find . | xargs dos2unix
-
- The developers of Ruwiki do what they can to ensure that Ruwiki is
- distributed in a way that works well for both Unix and Windows systems,
- but this will occasionally cause problems.
-
- $Id$
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Upgrading+and+Converting.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Upgrading+and+Converting.ruwiki
deleted file mode 100644
index 1abf6af..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Upgrading+and+Converting.ruwiki
+++ /dev/null
@@ -1,37 +0,0 @@
-page!content: = Ruwiki 0.8.0: Upgrading and Converting
- The flatfile backend format in Ruwiki 0.8.0 is not compatible with that
- of earlier versions of Ruwiki. There are a number of reasons for this,
- but because of this and that there are now three different backends,
- Ruwiki now has a converter utility between backends.
-
- There are two other incompatibilities of note:
- # Ruwiki now defaults to &ldquo;ruwiki&rdquo; as an extension (e.g., \ProjectIndex.ruwiki) to the storage files. This is, of course, is something that can be modified with a configuration option, but you may find it desirable to rename your files to match this naming convention.
- # The rdiff format is incompatible. It is recommended that you remove all .rdiff files from your data directory before using Ruwiki.
-
- == bin/convert [options] &lt;directory&gt;+
- The converter utility will work on all files in a directory and its
- subdirectories.
-
- When a file is encountered, it will be examined to be a known form of a
- Ruwiki backend (marshal, yaml, flatfiles, or "old" flatfiles). If the
- file is not one of these forms, then the file is skipped. Otherwise, it
- is converted to the specified format. By default, the converted files
- will be backed up.
-
- === bin/convert Options
- ; --format=FORMAT : Converts encountered files (regardless of the current format), to the specified format. Default is yaml. Allowed formats are: yaml marshal flatfiles
- ; --[no-]backup : Create backups of upgraded files. Default is --backup.
- ; --backup-extension=EXTENSION : Specify the backup extension. Default is "~", which is appended to the data filename.
- ; --extension=EXTENSION : Specifies the extension of Ruwiki data files. The default is .ruwiki
- ; --no-extension : Indicates that the Ruwiki data files have no extension.
- ; --quiet : Runs quietly. Default is to run with normal messages.
- ; --verbose : Runs with full messages. Default is to run with normal messages.
- ; --help : Shows this text.
-
- $Id$
-properties!project: Ruwiki
-properties!title: Upgrading+and+Converting
-properties!topic: Upgrading+and+Converting
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiFeatures.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiFeatures.ruwiki
deleted file mode 100644
index b4d7a2a..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiFeatures.ruwiki
+++ /dev/null
@@ -1,20 +0,0 @@
-page!content: Ruwiki is a [http://www.ruby-lang.org Ruby]-based wiki. It is
- ideal for personal or small team use.
-
- Ruwiki:
- * Uses the [http://www.ruby-lang.org Ruby] language.
- * Runs quickly and easily as a CGI or \WEBrick servlet.
- * Uses a simple templating system and CSS for presentation.
- * Has flatfile storage with simple versioning.
- * Offers project namespaces. Different projects can have the same topic names and not collide. Thus, \Default::ReadMe and \Project::ReadMe are two different pages.
- * Offers a calendar for date-based collaborative editing.
-
- $Id$
-properties!editable:
-properties!entropy: 0
-properties!project: Ruwiki
-properties!title: WikiFeatures
-properties!topic: WikiFeatures
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiMarkup.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiMarkup.ruwiki
deleted file mode 100644
index ee581e3..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiMarkup.ruwiki
+++ /dev/null
@@ -1,264 +0,0 @@
-page!content: = Ruwiki Markup
- A [http://c2.com/cgi/wiki Wiki] obeys certain formatting rules to make
- it easy to format text without needing to know HTML. This Wiki obeys
- the following rules by default. Because Ruwiki is extensible, there may
- be additional formatting rules. These rules are those rules that apply
- as of Ruwiki 0.8.0.
-
- == \WikiWords, \WikiProjects, Calendars, and External Resources
- While reading stuff on this Wiki, you will see some words mashed
- together with capitalisation (like \WikiWords). While this may seem odd
- at first, this feature allows internal links to be created across the
- Wiki.
-
- There are several allowable forms for \WikiWords.
- # Two or more words concatenated directly. Each word must begin with a capital letter and be followed by zero or more lowercase letters. Thus, \FooBar, \CPlusPlus, and \AbC are all valid \WikiWords, but ABC is not.
- # Two or more words concatenated with underscores. The first word must begin with a capital letter. This makes \Foo_Bar, \C_Plus_Plus, and \A_b_C valid \WikiWords. These \WikiWords will be displayed with spaces instead of underscores. \C_Plus_Plus will be displayed as &ldquo;C Plus Plus&rdquo;.
- # One or more words contained in double square brackets. This the form supported by [http://wikipedia.com/ Wikipedia], and looks like \[[A Wiki Phrase]]. These links will be displayed exactly as entered between the brackets.
- # One or more words contained in double square brackets with display text separated by a vertical bar. These \WikiWords look like \[[A Wiki Phrase|but show this text]]. The link will be to the page &ldquo;A Wiki Phrase&rdquo; and &ldquo;but show this text&rdquo; will be the hyperlink.
-
- If a \WikiWord is found that does not have a page defining the
- \WikiWord, then the word will be shown with a hyperlink question mark
- following it, allowing the \WikiWord to be created.
-
- === \WikiProjects
- This Wiki supports &ldquo;projects.&rdquo; Within each project, a given
- \WikiWord is unique. Thus, if you have a Default project and a Ruwiki
- project, you can have two pages called \ReadMe. Any given \WikiWord
- refers only to topics within its project. That is, if I have \WikiWord
- in the \ReadMe topic of the Default project, it will refer to the
- \WikiWord topic of the Default project. (Another term for this
- capability is &ldquo;namespaces.&rdquo;)
-
- A cross-project link is composed of the project&rsquo;s name, two colons
- (::), and the \WikiWord desired. Thus, from \Default::ReadMe, I can
- have \Ruwiki::ReadMe as a link. The project index can be referred to
- with \::Project. This is the same as doing \Project::ProjectIndex.
- Thus, \::Ruwiki becomes ::Ruwiki, which is the same as
- \Ruwiki::ProjectIndex (Ruwiki::ProjectIndex).
-
- === Project Lists and Topic Lists
- The list of known projects may be listed with the %projects() token;
- the list of known topics for the current project may be listed with the
- %topics() link. An arbitrary project may be provided to the %topics()
- token, as in %topics(Default).
-
- %topics(Default)
-
- %projects()
-
- === Calendars
- Ruwiki supports a miniature calendar. Future versions of Ruwiki will
- allow for calendar aggregation. Using the %calendar function, a
- calendar section will be generated:
-
- %calendar(<year>, <month>[, <project>])
- %calendar(today[, <project>])
-
- %calendar accepts either the English word &ldquo;today&rdquo; (displaying the
- calendar for the current month and year) or a specific month and year
- for display. A calendar for the specified month will be generated
- where each date in the month is treated as a \WikiWord (as are the
- links to the current month, the previous month, and the next month)
- ready for display or editing. As with all other \WikiWord links in
- Ruwiki, a project may be specified in %calendar, making
- &ldquo;%calendar(today, Ruwiki)&rdquo; different from &ldquo;%calendar(today, Default)&rdquo;.
-
- %calendar(today)
- %calendar(1999, 08, Default)
-
- === External Resources
- Ruwiki behaves intelligently about resources external to the Wiki
- itself.
-
- ==== External Links
- \URLs to external resources are automatically detected for web
- addresses, FTP addresses, newsgroups, and email links. They are
- automatically converted to clickable \URLs. Be aware that some things
- that look like URL schemas may be make clickable but are not really
- \URLs.
-
- * \http://www.ruby-lang.org becomes http://www.ruby-lang.org
-
- \URLs may be named with the [url name] syntax. If the name is omitted,
- the URL will be numbered. Numbering is contained to within the page.
-
- * \[http://www.rubygarden.org RubyGarden] becomes [http://www.rubygarden.org RubyGarden].
- * \[http://www.halostatue.ca] and \[http://www.halostatue.ca/ruby] become [http://www.halostatue.ca] and [http://www.halostatue.ca/ruby].
-
- ==== Images
- : <strong>Changed in Ruwiki 0.8.0!</strong>
-
- In preparation for the anti-wiki-spam features of Ruwiki 0.9.0, it has
- been necessary to remove the ability for \URLs to be converted into
- inline images automatically. Inline images are now created with the
- image markup format, generally of the format \[image:URI options]. The
- <em>options</em> format is generally the same format as an HTML
- attribute (<em>name="value"</em>; the quotes are optional for
- single-word option values) and any valid HTML attribute is also a
- valid <em>option</em>. There is one special <em>option</em>,
- <tt>numbered</tt>. This value, if set to any other value than &ldquo;false&rdquo;,
- will set the <tt>title</tt> of the image to a numbered link.
-
- If the <tt>title</tt> attribute is not specified, it will be set from
- the <tt>alt</tt> attribute (if specified) or the image&rsquo;s URL. If the
- <tt>alt</tt> attribute is not specified, it will be set from the
- <tt>title</tt> attribute.
-
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif] [image:http://www.halostatue.ca/graphics/maple_leaf.gif]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true] [image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"]
-
- ==== Ruby Mailing Lists
- If a Ruby mailing list message tag is provided, it will be converted appropriately.
-
- * \[ruby-talk:12345] will become [ruby-talk:12345]
- * \[ruby-core:12345] will become [ruby-core:12345]
- * \[ruby-doc:12345] will become [ruby-doc:12345]
-
- == Headings and Lists
- === Headings
- Use equals signs (=) for headings. Up to six equals signs can be used
- for HTML headings 1 - 6.
-
- \===== Heading five<br />
- \====== Heading six
- ===== Heading five
- ====== Heading six
-
- === Lists
- ==== Bulleted Lists
- Use asterisks (*) to create bulleted lists. More asterisks means more
- levels.
-
- \* level 1<br />
- \** level 2<br />
- \*** level 3
-
- * level 1
- ** level 2
- *** level 3
-
- ==== Numbered Lists
- Use hash marks (#) for numbered lists. More hash marks means deeper
- levels.
-
- \# level 1<br />
- \## level 2<br />
- \### level 3<br />
- \### level 3.2<br />
- \## level 2.2<br />
- \# level 1.2
-
- # level 1
- ## level 2
- ### level 3
- ### level 3.2
- ## level 2.2
- # level 1.2
-
- ==== Definition Lists
- Definitions can be created similar to other lists. Unlike &ldquo;standard&rdquo;
- lists, though, definition lists have both the term and the definition.
- They are specified like so. As with other lists, repeating the first
- item (;) will increase the indentation level. The browser may not
- respect this.
-
- \; term : definition<br />
- \;; term2 : definition<br />
- \;;; term3 : definition
-
- ; term : definition
- ;; term2 : definition
- ;;; term3 : definition
- == Paragraph Formatting
- === Rules
- Four or more dashes ("----") on a line by itself makes a horizontal
- rule, like so:
-
- \----
- ----
- === Paragraphs
- A blank line (it may have whitespace on it) marks a new paragraph. All
- other lines are joined together (excepting headers, lists, and rules).
-
- This line is a new paragraph.
-
- === Block Indent Paragraphs
- Paragraphs can be indented by beginning the paragraph with one or more
- colons (:).
-
- \: Indent Level 1<br />
- \:: Indent Level 2<br />
- \::: Indent Level 3
-
- : Indent Level 1
- :: Indent Level 2
- ::: Indent Level 3
-
- Paragraphs may be indented as &ldquo;cites&rdquo; by using one or more
- greater-than signs (>) at the beginning of the line.
-
- \> Indent Level 1<br />
- \>> Indent Level 2<br />
- \>>> Indent Level 3
-
- > Indent Level 1
- >> Indent Level 2
- >>> Indent Level 3
-
- === Code
- Text that is indented will be presented as formatted in a monospaced
- font. The only change is to escape HTML entities &lt; (&amp;lt;), &gt;
- (&amp;gt;), and &amp; (&amp;amp;).
-
- def replace
- content = @match[1]
- %Q{<pre>#{content}</pre>}
- end
-
- == Miscellaneous Formatting
- === HTML
- The Ruwiki engine currently passes through HTML without changes. Thus,
- &lt;strong&gt;strong&lt;/strong&gt; would be shown as
- <strong>strong</strong>. <strong><em>Note:</em></strong> This
- capability could be very dangerous as it could expose the Wiki to
- cross-site scripting (XSS) vulnerabilities. This will be remedied
- prior to the 1.0 release of Ruwiki.
-
- === Abbreviations
- Certain abbreviations may be known to the Wiki. While there is not yet
- any way for a user to query what abbreviations are known, if the
- abbreviations are told to the users, they may be used. Abbreviations
- are presented with @{key}, where <em>key</em> is the abbreviation
- desired. This Wiki, for example, knows that \@{matz} means &ldquo;@{matz}&rdquo;.
- The special form \@{} will produce the current list of known
- abbreviations. Unknown abbreviations will simply be put back into the
- data stream unchanged. Thus, \@{unknownkey} results in @{unknownkey}.
-
- ==== Known Abbreviations
- @{}
-
- === Preventing Formatting
- If you wish to prevent a word or sequence from being interpreted, put
- a backslash (\) in front of it. This works on all formatting options
- except paragraph positioning. Thus, if I want to prevent a \WikiWord
- from being turned into a hyperlink, I need to backslash it:
- \\WikiWord.
-
- === Other Possible Considerations
- I&rsquo;m looking at adding styles similar to what is shown on the Wiki
- below.
-
- * http://www.pmichaud.com/wiki/PmWiki/WikiStyles
-
- $Id$
-page!footer:
-page!header:
-properties!project: Ruwiki
-properties!title: WikiMarkup
-properties!topic: WikiMarkup
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingPages.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingPages.ruwiki
deleted file mode 100644
index faf6c8c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingPages.ruwiki
+++ /dev/null
@@ -1,17 +0,0 @@
-page!content: = Adding Pages
- To add a new page to Ruwiki, all you need to do is come up with a
- meaningful title, turn it into a \WikiWord (see Ruwiki::WikiMarkup) and
- Ruwiki will automatically recognise it as a reference to a page that
- does not yet exist.
-
- At the end of the new \WikiWord is a hyperlinked question mark;
- clicking on this will open the edit page for the new \WikiWord in
- Ruwiki.
-
- $Id$
-properties!project: Tutorial
-properties!title: AddingPages
-properties!topic: AddingPages
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingProjects.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingProjects.ruwiki
deleted file mode 100644
index b96b809..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingProjects.ruwiki
+++ /dev/null
@@ -1,17 +0,0 @@
-page!content: = Adding Projects
- To add a new project to Ruwiki, all you need to do is come up with a
- meaningful one-word name, and then turn it into a project link, e.g.,
- \::Project. Projects may <strong>only</strong> be a single word &mdash;
- they are not normal \WikiWords (see Ruwiki::WikiMarkup for details).
- Ruwiki will recognise this as a project that does not yet exist. At the
- end of the Project link is a hyperlinked question mark; clicking on
- this will open the \Project::ProjectIndex in Ruwiki for editing and
- create the new project.
-
- $Id$
-properties!project: Tutorial
-properties!title: AddingProjects
-properties!topic: AddingProjects
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/ProjectIndex.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/ProjectIndex.ruwiki
deleted file mode 100644
index 73a13a8..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,12 +0,0 @@
-page!content: = Ruwiki 0.8.0 Tutorial
- This tutorial is incomplate.
-
- %topics(Tutorial)
-
- $Id$
-properties!project: Tutorial
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/SandBox.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/SandBox.ruwiki
deleted file mode 100644
index 9d4e4c8..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/SandBox.ruwiki
+++ /dev/null
@@ -1,10 +0,0 @@
-page!content: This page is intended for users to play with freely to
- practice their \WikiFormatting.
-
- $Id$
-properties!project: Tutorial
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki.rb
deleted file mode 100644
index 9f59e30..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki.rb
+++ /dev/null
@@ -1,452 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-class Ruwiki
- VERSION = '0.8.0'
- CONTENT_VERSION = 2
-end
-
-require 'cgi'
-require 'ruwiki/handler'
-require 'ruwiki/template'
-require 'ruwiki/lang/en' # Default to the English language.
-require 'ruwiki/config'
-require 'ruwiki/backend'
-require 'ruwiki/wiki'
-require 'ruwiki/page'
-
- # = Ruwiki
- # Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI
- # and WEBrick interfaces, templates, and CSS formatting. Additionally, it
- # supports project namespaces, so that two pages can be named the same for
- # differing projects without colliding or having to resort to odd naming
- # conventions. Please see the ::Ruwiki project in the running Wiki for more
- # information. Ruwiki 0.7.0 has German and Spanish translations available.
- #
- # == Quick Start (CGI)
- # 1. Place the Ruwiki directory in a place that your webserver can execute
- # CGI programs and ensure that ruwiki.cgi is executable on your webserver.
- # 2. Point your web browser to the appropriate URL.
- #
- # == Quick Start (WEBrick)
- # 1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
- # 2. Point your web browser to <http://localhost:8808/>.
- #
- # == Configuration
- # There are extensive configuration options available. The Ruwiki WEBrick
- # servlet offers command-line options that simplify the configuration of
- # Ruwiki without editing the servlet; use ruwiki_servlet --help for more
- # information.
- #
- # == Copyright
- # Copyright:: Copyright © 2002 - 2004, Digikata and HaloStatue, Ltd.
- # Authors:: Alan Chen (alan@digikata.com)
- # Austin Ziegler (ruwiki@halostatue.ca)
- # Licence:: Ruby's
-class Ruwiki
- ALLOWED_ACTIONS = %w(edit create)
- EDIT_ACTIONS = %w(save cancel)
- EDIT_VARS = %w(newpage version edcomment q)
- RESERVED = ['save', 'preview', 'cancel', EDIT_VARS].flatten
-
- # Returns the current configuration object.
- attr_reader :config
- # Returns the current Response object.
- attr_reader :response
- # Returns the current Request object.
- attr_reader :request
- # Returns the current Markup object.
- attr_reader :markup
- # Returns the current Backend object.
- attr_reader :backend
-
- # Sets the configuration object to a new configuration object.
- def config=(cc)
- raise self.message[:config_not_ruwiki_config] unless cc.kind_of?(Ruwiki::Config)
- @config = cc
- self.config!
- end
-
- def config!
- @markup.default_project = @config.default_project
- @markup.message = self.message
- end
-
- # The message hash.
- def message
- @config.message
- end
-
- # Initializes Ruwiki.
- def initialize(handler)
- @request = handler.request
- @response = handler.response
-
- @config = Ruwiki::Config.new
-
- @path_info = @request.determine_request_path || ''
-
- @type = nil
- @error = {}
-
- @markup = Ruwiki::Wiki.new(@config.default_project,
- @request.script_url,
- @config.title)
- end
-
- # Initializes the backend for Ruwiki.
- def set_backend
- @backend = BackendDelegator.new(self, @config.storage_type)
- @markup.backend = @backend
- end
-
- # Runs the steps to process the wiki.
- def run
- @config.verify
- set_backend
- set_page
- process_page
- render
- rescue Exception => ee
- render(:error, ee)
- ensure
- output
- end
-
- # Initializes current page for Ruwiki.
- def set_page
- path_info = @path_info.split(%r{/}, -1).map { |ee| ee.empty? ? nil : ee }
-
- if path_info.size == 1 or (path_info.size > 1 and path_info[0])
- raise self.message[:invalid_path_info_value] % [@path_info] unless path_info[0].nil?
- end
-
- # path_info[0] will ALWAYS be nil.
- path_info.shift
-
- case path_info.size
- when 0 # Safety check.
- nil
- when 1 # /PageTopic OR /_edit
- set_page_name_or_action(path_info[0])
- when 2 # /Project/ OR /Project/PageTopic OR /Project/_edit OR /Project/create
- @project = path_info.shift
- set_page_name_or_action(path_info[0])
- else # /Project/PageTopic/_edit OR /Project/diff/3,4 OR something else.
- @project = path_info.shift
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- else
- @topic = item
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- end
- end
- end
-
-# @request.each_parameter { |key, val| puts "#{key} :: #{val.class}" }
-
- @project ||= @config.default_project
- @topic ||= @config.default_page
- end
-
- # Processes the page through the necessary steps. This is where the edit,
- # save, cancel, and display actions are present.
- def process_page
- content = nil
- formatted = false
-
- @page = Ruwiki::Page.new(@backend.retrieve(@topic, @project))
- @type = :content
-
- # TODO Detect if @action has already been set.
- @action ||= @request.parameters['action'].downcase if @request.parameters['action']
- @action ||= 'save' if @request.parameters['save']
- @action ||= 'cancel' if @request.parameters['cancel']
- @action ||= 'preview' if @request.parameters['preview']
-
- case @action
- when 'search'
- # get, validate, and cleanse the search string
- # TODO: add empty string rejection.
- srchstr = validate_search_string(@request.parameters['q'])
- srchall = @request.parameters['a']
-
- @page.content = self.message[:search_results_for] % [srchstr]
- @page.topic = srchstr || ""
-
- unless srchall.nil?
- hits = @backend.search_all_projects(srchstr)
- else
- hits = @backend.search_project(@page.project, srchstr)
- end
-
- # debug hit returns
-# hits.each { |key, val| $stderr << " #{key} : #{val}\n" }
-
- # turn hit hash into content
- hitarr = []
- # organize by number of hits
- hits.each { |key, val| (hitarr[val] ||= []) << key }
-
- rhitarr = hitarr.reverse
- maxhits = hitarr.size
- rhitarr.each_with_index do |tarray, rnhits|
- next if tarray.nil? or tarray.empty?
- nhits = maxhits - rnhits - 1
-
- if nhits > 0
- @page.content << "\n== #{self.message[:number_of_hits] % [nhits]}\n* "
- @page.content << tarray.join("\n* ")
- end
- end
-
- @type = :search
- when 'topics'
- if @backend.project_exists?(@page.project)
- topic_list = @backend.list_topics(@page.project)
- else
- topic_list = []
- end
-
- # todo: make this localized
- if topic_list.empty?
- @page.content = self.message[:no_topics] % [@page.project]
- else
- topic_list.map! do |tt|
- uu = CGI.unescape(tt)
- if (uu != tt) or (tt =~ /^[A-Z][a-z]+$/)
- "[[#{CGI.unescape(tt)}]]"
- else
- tt
- end
- end
- @page.content = <<EPAGE
-= #{self.message[:topics_for_project] % [@page.project]}
-* #{topic_list.join("\n* ")}
-EPAGE
- end
-
- @type = :content
- when 'projects'
- proj_list = @backend.list_projects
-
- if proj_list.empty?
- @page.content = self.message[:no_projects]
- else
- # TODO make this localized
- proj_list.map! { |proj| %[#{proj} (a href='\\#{@request.script_url}/#{proj}/_topics' class='rw_minilink')#{self.message[:project_topics_link]}</a>] }
- @page.content = <<EPAGE
-= #{self.message[:wiki_projects] % [@config.title]}
-* ::#{proj_list.join("\n* ::")}
-EPAGE
- end
-
- content = @page.to_html(@markup)
- content.gsub!(%r{\(a href='([^']+)/_topics' class='rw_minilink'\)}, '<a href="\1/_topics" class="rw_minilink">') #'
- formatted = true
- @type = :content
- when 'edit', 'create'
- # Automatically create the project if it doesn't exist or if the action
- # is 'create'.
- @backend.create_project(@page.project) if @action == 'create'
- @backend.create_project(@page.project) unless @backend.project_exists?(@page.project)
- @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR'])
-
- content = nil
- formatted = true
- @type = :edit
- when 'save', 'preview'
- np = @request.parameters['newpage'].gsub(/\r/, '').chomp
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.editor_ip = @request.environment['REMOTE_ADDR']
-
- if @action == 'save'
- op = @page.content
- else
- op = nil
- end
-
- if np == op and @action == 'save'
- @page.content = op
- @type = :content
- else
- @page.content = np
- edc = @request.parameters['edcomment']
- unless (edc.nil? or edc.empty? or edc == "*")
- @page.edit_comment = edc
- end
-
- if @action == 'save'
- @type = :save
- @page.version = @request.parameters['version'].to_i + 1
- @backend.store(@page)
-
- # hack to ensure that Recent Changes are updated correctly
- if @page.topic == 'RecentChanges'
- recent = Ruwiki::Page.new(@backend.retrieve(@page.topic, @page.project))
- @page.content = recent.content
- end
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- else
- @type = :preview
- content = nil
- formatted = true
- end
- end
- when 'cancel'
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.version = @request.parameters['version'].to_i
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- @type = :content
- else
- # TODO AZ: This should probably return a 501 Not Implemented or some
- # other error unless @action.nil?
- nil
- end
- content = @page.to_html(@markup) if not formatted
- rescue Exception => ee # rescue for def process_page
- @type = :error
- if ee.kind_of?(Ruwiki::Backend::BackendError)
- name = "#{self.message[:error]}: #{ee.to_s}"
- else
- name = "#{self.message[:complete_utter_failure]}: #{ee.to_s}"
- end
- @error[:name] = CGI.escapeHTML(name)
- @error[:backtrace] = ee.backtrace.map { |el| CGI.escapeHTML(el) }.join("<br />\n")
- content = nil
- ensure
- @content = content
- end # def process_page
-
- # Renders the page.
- def render(*args)
- if args.empty?
- type = @type
- error = @error
- else
- raise ArgumentError, self.message[:render_arguments] unless args.size == 2
- type = args[0]
- error = {
- :name => args[1].inspect.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;'),
- :backtrace => args[1].backtrace.join("<br />\n")
- }
- @page = Ruwiki::Page.new(Ruwiki::Page::NULL_PAGE)
- end
-
- @rendered_page = ""
- values = {
- "css_link" => @config.css_link,
- "home_link" => %Q(<a href="#{@request.script_url}">#{@config.title}</a>),
- "cgi_url" => @request.script_url,
- "content" => @content,
- }
-
- if @page.nil?
- values["page_project"] = ""
- values["page_raw_topic"] = ""
- values["page_topic"] = ""
- values["editable"] = false
- values["indexable"] = false
- else
- values["page_project"] = @page.project
- values["page_raw_topic"] = @page.topic
- values["page_topic"] = CGI.unescape(@page.topic)
- values["editable"] = @page.editable
- values["indexable"] = @page.indexable
- end
-
- values["url_project"] = %Q(#{values["cgi_url"]}/#{values["page_project"]})
- values["url_topic_search"] = %Q(#{values["url_project"]}/_search?q=#{values["page_topic"]})
- values["link_topic_search"] = %Q(<a href='#{values["url_topic_search"]}'><strong>#{values["page_topic"]}</strong></a>)
-
- case type
- when :content, :save, :search
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}" if @page.nil?
- values["wiki_title"] ||= "#{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["label_topic_or_search"] = self.message[:label_topic]
- values["page_topic_name"] = values["page_topic"]
- if type == :content or type == :search
- template = TemplatePage.new(@config.template(:body), @config.template(:content), @config.template(:controls), @config.template(:footer))
- if type == :search
- values["label_topic_or_search"] = self.message[:label_search]
- else
- values["page_topic"] = values["link_topic_search"]
- end
- else
- # action type was save
- values["page_topic"] = values["link_topic_search"]
- template = TemplatePage.new(@config.template(:body), @config.template(:save), @config.template(:controls), @config.template(:footer))
- end
- when :edit, :preview
- template = TemplatePage.new(@config.template(:body), @config.template(:edit))
- values["wiki_title"] = "#{self.message[:editing]}: #{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_content"] = @page.content
- values["page_version"] = @page.version.to_s
- values["unedited_page_content"] = @page.to_html(@markup)
- values["pre_page_content"] = CGI.escapeHTML(@page.content)
- if @request.parameters["edcomment"].nil? or @request.parameters["edcomment"].empty?
- values["edit_comment"] = "*"
- else
- values["edit_comment"] = @request.parameters["edcomment"]
- end
- when :error
- template = TemplatePage.new(@config.template(:body), @config.template(:error))
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}"
- values["name"] = error[:name]
- values["backtrace"] = error[:backtrace]
- values["backtrace_email"] = error[:backtrace].gsub(/<br \/>/, '')
- values["webmaster"] = @config.webmaster
- end
-
- template.process(@rendered_page, values, @config.message)
- end
-
- # Outputs the page.
- def output
- @response.add_header("Content-type", "text/html")
- @response.add_header("Cache-Control", "max_age=0")
- @response.write_headers
- @response << @rendered_page
- end
-
- # nil if string is invalid
- def validate_search_string(instr)
- return nil if instr.empty?
-
- modstr = instr.dup
-
- #TODO: add validation of modstr
- return modstr
- end
-
-private
- RE_ACTION = %r{^_([[:lower:]]+)$}
-
- def set_page_name_or_action(item)
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- else
- @topic = item
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend.rb
deleted file mode 100644
index 879d147..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend.rb
+++ /dev/null
@@ -1,306 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'diff/lcs'
-
-class Ruwiki
- # The list of known backends.
- KNOWN_BACKENDS = [:flatfiles, :yaml, :marshal]
-
- # The Ruwiki backend delegator. Ruwiki will always instantiate a version
- # of this class which delegates the actual method execution to the Backend
- # class. Error handling is handled by capturing (and possibly forwarding)
- # exceptions raised by the delegate class.
- class BackendDelegator
- def initialize(ruwiki, backend)
- @message = ruwiki.config.message
- @time_format = ruwiki.config.time_format || "%H:%M:%S"
- @date_format = ruwiki.config.date_format || "%Y.%m.%d"
- @datetime_format = ruwiki.config.datetime_format || "#{@date_format} #{@time_format}"
- options = ruwiki.config.storage_options
- options[:default_page] = ruwiki.config.default_page
-
- unless Ruwiki::KNOWN_BACKENDS.include?(backend)
- raise RuntimeError, @message[:backend_unknown] % [backend]
- end
-
- beconst = (befile = backend.id2name).capitalize
-
- require "ruwiki/backend/#{befile}"
-
- beoptions = options[backend]
- @delegate = Ruwiki::Backend.const_get(beconst).new(beoptions)
- rescue Ruwiki::Backend::BackendError => e
- if e.kind_of?(Array)
- raise Ruwiki::Backend::BackendError.new(nil), @message[e.reason[0]] % e.reason[1]
- else
- raise
- end
- end
-
- # Retrieve the specified topic and project page. Calls Backend#load
- # after verifying that the project exists.
- def retrieve(topic, project = 'Default')
- unless page_exists?(topic, project)
- exported = Ruwiki::Page::NULL_PAGE.dup
- exported['properties'] = {
- 'title' => topic,
- 'topic' => topic,
- 'project' => project,
- 'create-date' => Time.now,
- 'edit-date' => Time.now,
- 'editable' => true,
- 'indexable' => true,
- 'entropy' => 0.0,
- 'html-headers' => [],
- 'version' => 0
- }
- exported['page'] = {
- 'header' => nil,
- 'footer' => nil
- }
-
- if project_exists?(project)
- exported['page']['content'] = ""
- else
- exported['page']['content'] = @message[:project_does_not_exist] % [project]
- end
- return exported
- end
-
- return @delegate.load(topic, project)
- rescue Ruwiki::Backend::InvalidFormatError => e
- raise Ruwiki::Backend::BackendError.new(nil), @message[:page_not_in_backend_format] % [project, topic, @delegate.class]
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_read_topic] % [project, topic]
- rescue Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_retrieve_topic] % p
- end
-
- # Stores the specified topic and project page.
- def store(page)
- @delegate.store(page)
-
- # update change page
- begin
- recent_changes = nil
- if (page.topic == 'RecentChanges')
- recent_changes = page.dup
- else
- recent_changes = Page.new(retrieve('RecentChanges', page.project))
- end
-
- changeline = "\n; #{Time.now.strftime(@datetime_format)}, #{page.topic} : #{page.edit_comment}"
-
- # add changeline to top of page
- recent_changes.content = changeline + (recent_changes.content || "")
- @delegate.store(recent_changes)
- rescue Exception => e
- raise "Couldn't save RecentChanges\n#{e.backtrace}"
- end
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_store_topic] % [page.project, page.topic]
- rescue Exception => e
- p = [page.project, page.topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_store_topic] % p
- end
-
- # Destroys the specified topic and project page.
- def destroy(page)
- @delegate.destroy(page)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_destroy_topic] % [page.project, page.topic]
- rescue Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_destroy_topic] % p
- end
-
- # Releases the lock on the page.
- def release_lock(page, address = 'UNKNOWN')
- @delegate.release_lock(page, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_release_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:error_releasing_lock] % p
- end
-
- # Attempts to obtain a lock on the page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- @delegate.obtain_lock(page, address, timeout)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_obtain_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:error_creating_lock] % p
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- @delegate.project_exists?(project)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- @delegate.page_exists?(topic, project)
- end
-
- # Attempts to create the project.
- def create_project(project)
- @delegate.create_project(project)
- rescue Ruwiki::Backend::ProjectExists => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:project_already_exists] % [project]
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_create_project] % [project]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_create_project] % p
- end
-
- # Attempts to destroy the project.
- def destroy_project(project)
- @delegate.destroy_project(project)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_destroy_project] % [project]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_destroy_project] % p
- end
-
- def search_all_projects(searchstr)
- if @delegate.respond_to?( :search_all_projects )
- return @delegate.search_all_projects(searchstr)
- end
-
- search_all_projects_default(searchstr)
- end
-
- # Attempts to search all projects.
- # this is the default search_all_projects used unless the delegate implements
- # a specialized search_all_projects
- def search_all_projects_default(searchstr)
- hits = {}
- list_projects.each do |project|
- lhits = search_project(project, searchstr)
- # Transform the keys from project local to global links.
- lhits.each { |key, val| hits["#{project}::#{key}"] = val }
- end
- hits
- end
-
- # Attempts to search a project
- def search_project(project, searchstr)
- #TODO: Validate searchstr is a safe regexp?
- @delegate.search_project(project, searchstr)
- rescue Exception => e
- p = [project, searchstr, e.class, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:search_project_fail] % p
- end
-
- # Return an array of projects
- def list_projects
- @delegate.list_projects
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_list_projects]
- rescue Exception => e
- p = ['', %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_list_projects] % p
- end
-
- # Return an array of projects
- def list_topics(projname)
- @delegate.list_topics(projname)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_list_topics] % [projname]
- rescue Exception => e
-# p = [projname, %Q~#{e.mes}<br />\n#{e.backtrace.join('<br />\n')}~]
- p = [projname, e.message]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_list_topics] % p
- end
- end
-
- # The Ruwiki backend abstract class and factory.
- class Backend
- class ProjectExists < RuntimeError #:nodoc:
- end
- class InvalidFormatError < RuntimeError #:nodoc:
- end
- class BackendError < RuntimeError #:nodoc:
- attr_reader :reason
-
- def initialize(reason, *args)
- if @reason.respond_to?(:message)
- @reason = reason.message
- else
- @reason = reason
- end
- end
- end
- def initialize(storage_options)
- end
-
- private
- NL_RE = %r{\n} #:nodoc:
-
- def map_diffset(diffset)
- diffset.map do |hunk|
- if hunk.kind_of?(Array)
- hunk.map { |change| change.to_a }
- else
- hunk.to_a
- end
- end
- end
-
- # Creates the current diff object. This is made from two
- # Ruwiki::Page#export hashes.
- def make_diff(oldpage, newpage)
- oldpage = oldpage.export if oldpage.kind_of?(Ruwiki::Page)
- newpage = newpage.export if newpage.kind_of?(Ruwiki::Page)
-
- diff = Hash.new
-
- newpage.keys.sort.each do |sect|
- newpage[sect].keys.sort.each do |item|
- oldval = oldpage[sect][item]
- newval = newpage[sect][item]
-
- case [sect, item]
- when ['properties', 'html-headers']
- # Protect against NoMethodError.
- oldval ||= []
- newval ||= []
- val = Diff::LCS.sdiff(oldval, newval, Diff::LCS::ContextDiffCallbacks)
- when ['ruwiki', 'content-version'], ['properties', 'version'],
- ['properties', 'entropy']
- val = Diff::LCS.sdiff([oldval], [newval], Diff::LCS::ContextDiffCallbacks)
- when ['properties', 'create-date'], ['properties', 'edit-date']
- val = Diff::LCS.sdiff([oldval.to_i], [newval.to_i], Diff::LCS::ContextDiffCallbacks)
- else
- # Protect against NoMethodError.
- val = Diff::LCS.sdiff(oldval.to_s.split(NL_RE), newval.to_s.split(NL_RE), Diff::LCS::ContextDiffCallbacks)
- end
-
- (diff[sect] ||= {})[item] = map_diffset(val) unless val.nil? or val.empty?
- end
- end
-
- diff_hash = {
- 'old_version' => oldpage['properties']['version'],
- 'new_version' => newpage['properties']['version'],
- 'edit-date' => newpage['properties']['edit-date'].to_i,
- 'editor-ip' => newpage['properties']['editor-ip'],
- 'editor' => newpage['properties']['editor'],
- 'diff' => diff
- }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/_corefiles.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/_corefiles.rb
deleted file mode 100644
index f090de8..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/_corefiles.rb
+++ /dev/null
@@ -1,193 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # Provides common functionality for flatfile support, regardless of the
- # format.
-module Ruwiki::Backend::CoreFiles
- # Initializes the [flat-file] backend. The known options for
- # [flat-file] backends are documented below.
- #
- # :data_path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # :default_page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- @data_path = options[:data_path] || File.join(".", "data")
-
- @extension = options[:extension]
- if @extension.nil?
- @extension_re = /$/
- else
- @extension_re = /\.#{@extension}$/
- end
-
- @default_page = options[:default_page] || "ProjectIndex"
- if not (File.exists?(@data_path) and File.directory?(@data_path))
- raise Ruwiki::Backend::BackendError.new([:flatfiles_no_data_directory, [@data_path]])
- end
-
- super
- end
-
- # Destroys the topic page.
- def destroy(page)
- pf = page_file(page.topic, page.project)
- File.unlink(pf) if File.exists?(pf)
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- pd = project_directory(project)
- File.exists?(pd) and File.directory?(pd)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- pf = page_file(topic, project)
- project_exists?(project) and File.exists?(pf)
- end
-
- # Tries to create the project.
- def create_project(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::ProjectExists if File.exists?(pd)
- Dir.mkdir(pd)
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # String search all topic names and content in a project and
- # return a hash of topic hits.
- def search_project(project, searchstr)
- re_search = Regexp.new(searchstr, Regexp::IGNORECASE)
-
- hits = Hash.new { |h, k| h[k] = 0 }
- topic_list = list_topics(project)
-
- return hits if topic_list.empty?
-
- # search topic content
- topic_list.each do |topic|
- # search name
- hits[topic] += topic.scan(re_search).size
-
- # check content
- page = load(topic, project) rescue Ruwiki::Page::NULL_PAGE
- page['page'].each_value do |item|
- item = item.join("") if item.kind_of?(Array)
- item ||= ""
- hits[topic] += item.scan(re_search).size
- end
- end
-
- hits
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
- time = Time.now.to_i
-
- lock_okay = false
- # See if we have the lock already.
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, we don't care how old it
- # is. Thus, release it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lock_okay = true
- end
-
- if lock_okay
- open(lf, 'w') { |lfh| lfh.puts "#{address}\n#{time + timeout}" }
- else
- raise Ruwiki::Backend::BackendError(nil)
- end
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
- time = Time.now.to_i
-
- lock_okay = false
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, then we can safely remove
- # it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lock_okay = true
- end
-
- if lock_okay
- File.unlink(lf) if File.exists?(lf)
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- end
-
- # list projects found in data path
- def list_projects
- Dir[File.join(@data_path, "*")].select do |d|
- File.directory?(d) and File.exist?(page_file(@default_page, File.basename(d)))
- end.map { |d| File.basename(d) }
- end
-
- # list topics found in data path
- def list_topics(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::BackendError.new(:no_project) unless File.exist?(pd)
-
- Dir[File.join(pd, "*")].select do |f|
- f !~ /\.rdiff$/ and f !~ /\.lock$/ and File.file?(f) and f =~ @extension_re
- end.map { |f| File.basename(f).sub(@extension_re, "") }
- end
-
- def project_directory(project) # :nodoc:
- File.join(@data_path, project)
- end
-
- def page_file(topic, project = 'Default') # :nodoc:
- if @extension.nil?
- File.join(project_directory(project), topic)
- else
- File.join(project_directory(project), "#{topic}.#{@extension}")
- end
- end
-
- def make_rdiff(page_file, new_page)
- diff_file = "#{page_file}.rdiff"
-
- old_page = self.class.load(pf) rescue Ruwiki::Page::NULL_PAGE
-
- diffs = []
- File.open(diff_file, 'rb') { |f| diffs = Marshal.load(f) } if File.exists?(diff_file)
- diffs << make_diff(old_page, new_page)
- changes = Marshal.dump(diffs)
-
- File.open(diff_file, 'wb') { |f| f << changes }
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/flatfiles.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/flatfiles.rb
deleted file mode 100644
index f341ecb..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/flatfiles.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-require 'ruwiki/backend/_corefiles'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Flatfiles < Ruwiki::Backend
- include Ruwiki::Backend::CoreFiles
-
- # Initializes the Flatfiles backend. The known options are known for
- # Flatfiles:
- #
- # :data_path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # :default_page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- super
- end
-
- # Provides a HEADER marker.
- # Loads the topic page from disk.
- def load(topic, project)
- page = Ruwiki::Page::NULL_PAGE.dup
- hash = Ruwiki::Exportable.load(File.read(page_file(topic, project)))
- hash.each_key { |ss| hash[ss].each { |ii, vv| page[ss][ii] = vv } }
- page
- rescue Ruwiki::Exportable::InvalidFormatError
- raise Ruwiki::Backend::InvalidFormatError
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = Ruwiki::Exportable.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |f| f.puts newpage }
- end
-
- # Destroys the topic page.
- def destroy(page)
- super
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- super
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- super
- end
-
- # Tries to create the project.
- def create_project(project)
- super
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- super
- end
-
- # String search all topic names and content in a project and
- # return a has of topic hits
- def search_project(project, searchstr)
- super
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- super
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- super
- end
-
- # list projects found in data path
- def list_projects
- super
- end
-
- # list topics found in data path
- def list_topics(project)
- super
- end
-
-# class << self
-# NL_RE = /\n/
-
-# def dump(page_hash)
-# dumpstr = ""
-
-# page_hash.keys.sort.each do |sect|
-# page_hash[sect].keys.sort.each do |item|
-# val = page_hash[sect][item].to_s.split(NL_RE).join("\n\t")
-# dumpstr << "#{sect}!#{item}:\t#{val}\n"
-# end
-# end
-
-# dumpstr
-# end
-
-# def load(buffer)
-# page = Ruwiki::Page::NULL_PAGE.dup
-# return page if buffer.empty?
-
-# buffer = buffer.split(NL_RE)
-
-# if HEADER_RE.match(buffer[0]).nil?
-# raise Ruwiki::Backend::InvalidFormatError
-# end
-
-# sect = item = nil
-#
-# buffer.each do |line|
-# line.chomp!
-# match = HEADER_RE.match(line)
-
-# # If there is no match, add the current line to the previous match.
-# # Remove the leading \t, though.
-# if match.nil?
-# raise Ruwiki::Backend::InvalidFormatError if FIRST_TAB.match(line).nil?
-# page[sect][item] << "\n#{line.gsub(FIRST_TAB, '')}"
-# else
-# sect = match.captures[0]
-# item = match.captures[1]
-# page[sect][item] = match.captures[2]
-# end
-# end
-
-# page
-# end
-# end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/marshal.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/marshal.rb
deleted file mode 100644
index 4b99610..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/marshal.rb
+++ /dev/null
@@ -1,109 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/backend/_corefiles'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Marshal < Ruwiki::Backend
- include Ruwiki::Backend::CoreFiles
-
- # Initializes the Marshal backend. The known options are known for Marshal:
- #
- # :data_path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # :default_page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- super
- end
-
- # Loads the topic page from disk.
- def load(topic, project)
- Ruwiki::Backend::Marshal.load(File.read(page_file(topic, project)))
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = Ruwiki::Backend::Marshal.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |f| f.print newpage }
- end
-
- # Destroys the topic page.
- def destroy(page)
- super
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- super
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- super
- end
-
- # Tries to create the project.
- def create_project(project)
- super
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # String search all topic names and content in a project and return a
- # has of topic hits
- def search_project(project, searchstr)
- super
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- super
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- super
- end
-
- # list projects found in data path
- def list_projects
- super
- end
-
- # list topics found in data path
- def list_topics(project)
- super
- end
-
- class << self
- def dump(page_hash)
- ::Marshal.dump(page_hash)
- end
-
- def load(buffer)
- ::Marshal.load(buffer)
- rescue TypeError
- raise Ruwiki::Backend::InvalidFormatError
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/yaml.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/yaml.rb
deleted file mode 100644
index 9b10c7c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/yaml.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/backend/_corefiles'
-require 'yaml'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Yaml < Ruwiki::Backend
- include Ruwiki::Backend::CoreFiles
-
- # Initializes the Yaml backend. The known options are known for Yaml:
- #
- # :data_path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # :default_page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- raise Ruwiki::Backend::BackendError.new(:yaml_requires_182_or_higher) unless RUBY_VERSION >= "1.8.2"
- super
- end
-
- # Loads the topic page from disk.
- def load(topic, project)
- Ruwiki::Backend::Yaml.load(File.read(page_file(topic, project)))
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = Ruwiki::Backend::Yaml.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |f| f.puts newpage }
- end
-
- # Destroys the topic page.
- def destroy(page)
- super
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- super
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- super
- end
-
- # Tries to create the project.
- def create_project(project)
- super
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- super
- end
-
- # String search all topic names and content in a project and return a
- # has of topic hits
- def search_project(project, searchstr)
- super
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- super
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- super
- end
-
- # list projects found in data path
- def list_projects
- super
- end
-
- # list topics found in data path
- def list_topics(project)
- super
- end
-
- class << self
- def dump(page_hash)
- ::YAML.dump(page_hash)
- end
-
- def load(buffer)
- ::YAML.load(buffer)
- rescue ArgumentError
- raise Ruwiki::Backend::InvalidFormatError
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/config.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/config.rb
deleted file mode 100644
index 1ac3942..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/config.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # Ruwiki configuration.
-class Ruwiki::Config
- include Ruwiki::Exportable
-
- exportable_group 'ruwiki-config'
- # Sets or returns the logger. The logger, if set, must respond to the same
- # methods as WEBrick::Logger.
- attr_accessor :logger
- # Sets or returns the time format whenever time is outputted in Ruwiki.
- # Default is <tt>%H:%M:%S</tt> (23:59:59).
- attr_accessor :time_format
- exportable :time_format
- # Sets or returns the date format whenever time is outputted in Ruwiki.
- # Default is <tt>%Y.%m.%d</tt> (2004.08.04).
- attr_accessor :date_format
- exportable :date_format
- # Sets or returns the date-time format whenever time is outputted in
- # Ruwiki. Default is <tt>%Y.%m.%d %H:%M:%S</tt> (2004.08.04 23:59:59).
- attr_accessor :datetime_format
- exportable :datetime_format
- # Adds additional information to the (rare) error reports. Defaults to
- # +false+.
- attr_accessor :debug
- exportable :debug
- # The default page for display when Ruwiki is called without any arguments.
- # Defaults to +ProjectIndex+
- attr_accessor :default_page
- exportable :default_page
- # The default project for display when Ruwiki is called without any
- # arguments or a project specification. Defaults to +Default+
- attr_accessor :default_project
- exportable :default_project
- # The storage type as a Symbol. Corresponds to a filename that will be
- # found in ruwiki/backend. In this version of Ruwiki, versions for handling
- # three different types of flat files will be found. The canonical default
- # format is YAML (:yaml). Also supported in this version is :flatfiles (the
- # old flatfile format with some additions), and a format based on
- # Marshal::Dump (:marshal).
- attr_accessor :storage_type
- exportable :storage_type
- # The options for the specified storage type. This is a hash of hashes with
- # auto-vifification. See the storage type for available options.
- attr_reader :storage_options
- exportable :storage_options
- # The path for templates. Defaults to <tt>./templates/</tt>.
- attr_accessor :template_path
- exportable :template_path
- # The name of the Wiki. Defaults to <tt>ruwiki</tt>
- attr_accessor :title
- exportable :title
- # The email address of the webmaster for the Wiki. Defaults to +nil+.
- attr_accessor :webmaster
- exportable :webmaster
- # The name of the Ruwiki CSS file. Defaults to <tt>ruwiki.css</tt>.
- attr_accessor :css
- exportable :css
- # The template set. Templates are always named as
- # <template_path>/<template_set>/<template_name>. Template filename. Must
- # be reachable by File#read.
- attr_accessor :template_set
- exportable :template_set
- # Ruwiki is internationalized. This method sets the Ruwiki error messages
- # (and a few other messages) )to the specified language Module. The
- # language Module must have a constant Hash called +Message+ containing a
- # set of symbols and localized versions of the messages associated with
- # them.
- #
- # If the file 'ruwiki/lang/es.rb' contains the module
- # <tt>Ruwiki::Lang::ES</tt>, the error messages for RSS could be localized
- # to Español thus:
- #
- # require 'ruwiki/lang/es'
- # ...
- # wiki.config.language = Ruwiki::Lang::ES
- #
- # Localization is per wiki instance. In a servlet environment, this may
- # mean that only a single language is recognised.
- #
- # See Ruwiki::Lang::EN for more information.
- attr_accessor :language
- exportable :language
- # The message hash.
- attr_reader :message
-
- def language=(l) #:nodoc:
- @language = l
- @message = l::Message
- end
-
- # Returns the specified template as a string.
- def template(name)
- File.read(File.join(@template_path, @template_set, "#{name.to_s}.tmpl"))
- rescue Errno::ENOENT
- raise ConfigError, message[:no_template_found] % [name.inspect, @template_set]
- end
-
- # Returns the CSS stylesheet content for the Wiki. This previously
- # returned the <link> to the stylesheet, but instead returns a <style>
- # block in the head so that the CSS is kept with the template set, which
- # may be kept outside of the HTML area.
- def css_link
- %Q[<style type="text/css" media="screen,print">#{File.read(File.join(@template_path, @template_set, @css))}</style>]
- end
-
- # Creates a new configuration object.
- def initialize
- @debug = false
- @default_project = "Default"
- @default_page = "ProjectIndex"
- @storage_type = :yaml
- @storage_options = Hash.new { |h, k| h[k] = {} }
- @template_path = "./templates/"
- @template_set = "default"
- @css = "ruwiki.css"
- @webmaster = nil
- @title = "Ruwiki"
- @time_format = "%H:%M:%S"
- @date_format = "%Y.%m.%d"
- @datetime_format = "#{@date_format} #{@time_format}"
-
- self.language = Ruwiki::Lang::EN
- end
-
- # Verifies that required configuration options are actually set. Right
- # now, it only checks the values that are defaulted to +nil+.
- def verify
- raise ConfigError, message[:no_webmaster_defined] if @webmaster.nil?
- raise ConfigError, message[:invalid_template_dir] % [@template_path] unless File.exists?(@template_path) and File.directory?(@template_path)
- t = File.join(@template_path, @template_set)
- raise ConfigError, message[:no_template_set] % [@template_set] unless File.exists?(t) and File.directory?(t)
- end
-
- # Provides the canonical export hash.
- def export
- super
- end
-
- class ConfigError < StandardError; end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/exportable.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/exportable.rb
deleted file mode 100644
index 9cafb13..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/exportable.rb
+++ /dev/null
@@ -1,105 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # Adds a class method to mark methods exportable.
-module Ruwiki::Exportable
- class InvalidFormatError < RuntimeError; end
-
- class << self
- def append_features(mod)
- super
-
- class << mod
- attr_reader :__exportables
-
- define_method(:exportable_group) do |name|
- @__exportable_group = name || 'default'
- end
-
- define_method(:exportable) do |*symset|
- symbol = symset.shift
- options = symset.shift || {}
-
- @__exportables ||= {}
-
- options[:name] ||= symbol.to_s.gsub(/_/, '-')
- options[:group] ||= @__exportable_group || 'default'
-
- @__exportables[options[:group]] ||= {}
- @__exportables[options[:group]][options[:name]] = "@#{symbol.to_s}".intern
- end
- end
- end
-
- NL_RE = /\n/
- HEADER_RE = /^([a-z][-a-z]+)!([a-z][-a-z]+):\t(.*)$/
- FIRST_TAB = /^\t/
-
-
- def dump(export_hash)
- dumpstr = ""
-
- export_hash.keys.sort.each do |sect|
- export_hash[sect].keys.sort.each do |item|
- val = export_hash[sect][item].to_s.split(NL_RE).join("\n\t")
- dumpstr << "#{sect}!#{item}:\t#{val}\n"
- end
- end
-
- dumpstr
- end
-
- def load(buffer)
- hash = {}
- return hash if buffer.empty?
-
- buffer = buffer.split(NL_RE)
-
- if HEADER_RE.match(buffer[0]).nil?
- raise Ruwiki::Exportable::InvalidFormatError
- end
-
- sect = item = nil
-
- buffer.each do |line|
- line.chomp!
- match = HEADER_RE.match(line)
-
- # If there is no match, add the current line to the previous match.
- # Remove the leading \t, though.
- if match.nil?
- raise Ruwiki::Exportable::InvalidFormatError if FIRST_TAB.match(line).nil?
- hash[sect][item] << "\n#{line.gsub(FIRST_TAB, '')}"
- else
- sect = match.captures[0]
- item = match.captures[1]
- hash[sect] ||= {}
- hash[sect][item] = match.captures[2]
- end
- end
-
- hash
- end
- end
-
- def export
- sym = {}
-
- self.class.__exportables.each do |group, gval|
- gname = group || @__exportable_group || 'default'
- gsym = {}
- gval.each { |name, nval| gsym[name] = self.instance_variable_get(nval) }
- sym[gname] = gsym
- end
-
- sym
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/handler.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/handler.rb
deleted file mode 100644
index e31bbc1..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/handler.rb
+++ /dev/null
@@ -1,207 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Handler
- class << self
- # Generate a new Handler pair from a CGI request.
- def from_cgi(cgi, output_stream = $stdout)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::CGIRequest.new(cgi)
- o.response = Ruwiki::Handler::CGIResponse.new(cgi, output_stream)
- end
- end
-
- # Generate a new Handler pair from a WEBrick request.
- def from_webrick(req, res)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::WEBrickRequest.new(req)
- o.response = Ruwiki::Handler::WEBrickResponse.new(res)
- end
- end
- end
-
- # Returns the handler's request object.
- attr_accessor :request
- # Returns the handler's response object.
- attr_accessor :response
-
- # Creates the handler pair.
- def initialize(&block) #:yields: self
- @request = nil
- @response = nil
- yield self if block_given?
- end
-
- # REpresents an abstract incoming request. This insulates the rest of
- # the code from knowing whether parameters are passed as part of the
- # path, as parameters in the URL, or in some other fashion.
- class AbstractRequest
- def initialize(*args)
- end
- end
-
- # Handles all requests from web applications.
- #
- # Subclasses should provide:
- # @parameters:: Hash-like object that responds to #[] and #hash_key?]
- # @environment:: Hash-like object that responds to #[]
- class AbstractWebRequest < AbstractRequest
- # The parameters provided via the web request.
- attr_reader :parameters
- # The environment provided to the web request.
- attr_reader :environment
- # The request path.
- attr_reader :path
-
- # Yields each parameter key in succession.
- def each_parameter #:yields: key, value
- @parameters.each { |k, v| yield k, v }
- end
-
- def each_environment #:yields: key, value
- @environment.each { |k, v| yield k, v }
- end
-
- # Return the URL of our server.
- def server_url
- res = "http://" # should detect whether we're in secure server mode.
- if @environment['HTTP_HOST']
- res << @environment['HTTP_HOST']
- else
- res << "#{@environment['SERVER_NAME']}:#{@environment['SERVER_PORT']}"
- end
- end
-
- # Return the URL of this script.
- def script_url
- server_url << @environment['SCRIPT_NAME'].to_s
- end
-
- # Return the URL of this request.
- def request_url
- res = script_url
- res << @environment['PATH_INFO'] if @environment['PATH_INFO']
- query = @environment['QUERY_STRING']
- res << "?#{@environment['QUERY_STRING']}" if query && !query.empty?
- res
- end
-
- # Convert a file path into a URL
- def make_url(project, path)
- "#{server_url}/#{project}/#{path}"
- end
-
- def determine_request_path
- @path = ""
- return @path if @environment['PATH_INFO'].nil?
- @path = @environment['PATH_INFO'].dup
- end
- end
-
- # Request for CGI-based activity to ruwiki.
- class CGIRequest < AbstractWebRequest
- def initialize(cgi, output_stream = $stdout)
- @environment = ENV
- @cgi = cgi
- @parameters = {}
- cgi.params.each { |k, v| @parameters[k] = v[0] }
- super
- end
- end
-
- # Request for WEBrick based servlet activity to ruwiki.
- class WEBrickRequest < AbstractWebRequest
- def initialize(req)
- @environment = req.meta_vars
- @parameters = req.query
- super
- end
- end
-
- # Used to write responses in different execution environments such as
- # CGI and Webrick.
- #
- # If you want to create a new response object, you'll need to implement
- # #add_header, #write_headers, and #<<.
- #
- # The Response object is instantiated with an output stream which must
- # supply +<<+ and +puts+ methods.
- class AbstractResponse
- # Add to the list of headers to be sent back to the client.
- def add_header(key, value)
- raise "Not implemented"
- end
-
- # Write the accumulated headers back to the client.
- def write_headers
- raise "Not implemented"
- end
-
- # Write the string to the client.
- def <<(string)
- raise "Not implemented"
- end
-
- # output_stream must respond to #<< and #puts.
- def initialize(output_stream = $stdout)
- @headers = {}
- @output_stream = output_stream
- end
- end
-
- # CGIResponse is the response object for CGI mode.
- class CGIResponse < AbstractResponse
- # output_stream must respond to #<< and #puts.
- def initialize(cgi, output_stream = $stdout)
- @cgi = cgi
- super(output_stream)
- end
-
- # Add the header pair for later output as a CGI header.
- def add_header(key, value)
- @headers[key] = value
- end
-
- # Write the headers to the stream. The headers can only be written
- # once.
- def write_headers
- return if @written
- @headers.each { |key, value| @output_stream.puts "#{key}: #{value}\r\n" }
- @output_stream.puts
- @written = true
- end
-
- # Output the string to the stream provided.
- def <<(string)
- @output_stream << string
- end
- end
-
- # WEBrickResponse is the response object for WEBrick servlet mode.
- class WEBrickResponse < AbstractResponse
- def initialize(webrick_response)
- @response = webrick_response
- end
-
- def add_header(key,value)
- @response[key] = value
- end
-
- def write_headers
- # Webrick will take care of this on its own.
- end
-
- def <<(string)
- @response.body << string
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/de.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/de.rb
deleted file mode 100644
index 7fb7b3b..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/de.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Translation by Christian Neukirchen (chneukirchen@yahoo.de) on 22oct2003
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::DE is the German-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module DE
- Message = Hash.new { |h, k| h[k] = "Sprachdatei-FEHLER: Unbekannter Nachrichten-Typ #{k.inspect}."; h[k] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Unbekanntes Backend %s.",
- :cannot_create_project => "Kann %s nicht erstellen: %s",
- :cannot_destroy_project => "Kann %s nicht zerstören: %s",
- :cannot_destroy_topic => "Kann %s::%s nicht zerstören: %s",
- :cannot_obtain_lock => "Kann keine Sperre für %s::%s erhalten. Bitte in Kürze nochmal versuchen.",
- :cannot_release_lock => "Kann die Sperre für %s::%s nicht lösen. Bitte später nochmal versuchen.",
- :cannot_retrieve_topic => "Kann auf %s::%s nicht zugreifen: %s",
- :cannot_store_topic => "Kann %s::%s nicht speichern: %s",
- :error_creating_lock => "Fehler beim Erzeugen der Sperre von %s::%s: %s",
- :error_releasing_lock => "Fehler beim Lösen der Sperre von %s::%s: %s",
- :flatfiles_no_data_directory => "Das Daten-Verzeichnis (%s) existiert nicht.",
- :no_access_to_create_project => "Keine Berechtigung um das Projekt (%s) zu erstellen.",
- :no_access_to_destroy_project => "Keine Berechtigung um das Projekt (%s) zu zerstören.",
- :no_access_to_destroy_topic => "Kann %s::%s nicht zerstören: %s.",
- :no_access_to_read_topic => "Kann auf %s::%s nicht zugreifen: %s.",
- :no_access_to_store_topic => "Kann %s::%s nicht speichern: %s.",
- :project_already_exists => "Das Projekt %s existiert bereits.",
- :project_does_not_exist => "Das Projekt %s existiert nicht.",
- :no_access_list_projects => "Keine Berechtigung um das Projektliste",
- :no_access_list_topics => "Keine Berechtigung um das Themaliste (%s).",
- :search_project_fail => "Suchprojektausfallen %s Zeichenkette %s",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Die Konfiguration muss von Typ der Klasse Ruwiki::Config sein.",
- :invalid_template_dir => "Der angegebene Pfad für Schablonen (%s) existiert nicht oder ist kein Verzeichnis.",
- :no_template_found => "Keine Schablone %s im Schablonen-Set '%s' gefunden.",
- :no_template_set => "Es gibt kein Schablonen-Set '%s' im Schablonen-Pfad.",
- :no_webmaster_defined => "Konfigurations-Fehler: Webmaster nicht definiert.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fataler Fehler",
- :editing => "Editieren",
- :error => "Fehler",
- :invalid_path_info_value => "Fataler Fehler in der Web-Umgebung. PATH_INFO = %s",
- # Should this really get translated? --chris
- :render_arguments => "Ruwiki#render muss mit zwei oder mehr Argumenten aufgerufen werden.",
- :unknown_feature => "Unbekanntes Feature %s.",
-
- # Labels
- :label_search_project => "SuchcProjeckt",
- :label_search_all => "Alles",
- :label_search => "Suchc: ",
- :label_project => "Projekt: ",
- :label_topic => "Thema: ",
- :label_edit => "Edit",
- :label_recent_changes => "Neue Änderungen",
- :label_topics => "Themaliste",
- :label_projects => "ProjektListe",
- :label_editing => "Editieren",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Redigieren Sie Anmerkung: ",
- :label_comment_accelerator => "R",
- :label_save => "Außer",
- :label_save_accelerator => "A",
- :label_cancel => "Löschen",
- :label_cancel_accelerator => "L",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Ursprüngliche Version",
- :label_raw => "Formatfreie",
- :label_formatted => "Formatierte",
- :label_send_report_by => "Schicken Sie dem webmaster einen Report durch email.",
- :label_send_report => "Schicken Report.",
- :label_saved_page => "Gespeicherte Seite: ",
- }
- message.each { |k, v| Message[k] = v }
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/en.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/en.rb
deleted file mode 100644
index f58e780..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/en.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::EN is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module EN
- Message = Hash.new { |h, k| h[k] = "Language ERROR: Unknown message key #{k.inspect}."; h[k] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Backend %s is unknown.",
- :cannot_create_project => "Cannot create project %s: %s",
- :cannot_destroy_project => "Cannot destroy project %s: %s",
- :cannot_destroy_topic => "Cannot destroy %s::%s: %s",
- :cannot_obtain_lock => "Unable to obtain a lock on %s::%s. Try again shortly.",
- :cannot_release_lock => "Unable to release the lock on %s::%s. Try again shortly.",
- :cannot_retrieve_topic => "Cannot retrieve %s::%s: %s",
- :cannot_store_topic => "Cannot store %s::%s: %s",
- :cannot_list_topics => "Cannot list topics for project %s: %s",
- :error_creating_lock => "Error creating lock on %s::%s: %s",
- :error_releasing_lock => "Error releasing lock on %s::%s: %s",
- :flatfiles_no_data_directory => "The data directory (%s) does not exist.",
- :no_access_list_projects => "No permission to list projects.",
- :no_access_list_topics => "No permission to list topics in project %s.",
- :no_access_to_create_project => "No permission to create project %s.",
- :no_access_to_destroy_project => "No permission to destroy project %s::%s.",
- :no_access_to_destroy_topic => "No permission to destroy topic %s::%s.",
- :no_access_to_read_topic => "No permission to retrieve the %s::%s.",
- :no_access_to_store_topic => "No permission to store the %s::%s.",
- :page_not_in_backend_format => "%s::%s is not in the format supported by the backend %s.",
- :project_already_exists => "Project %s already exists.",
- :project_does_not_exist => "Project %s does not exist.",
- :search_project_fail => "Failure searching project %s with string %s.",
- :yaml_requires_182_or_higher => "YAML flatfile support exists only for Ruby version 1.8.2 or higher.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Configuration must be of class Ruwiki::Config.",
- :invalid_template_dir => "The specified path for templates (%s) does not exist or is not a directory.",
- :no_template_found => "No template of %s found in template set %s.",
- :no_template_set => "There is no template set '%s' in the template path.",
- :no_webmaster_defined => "Configuration error: Webmaster is unset.",
- # Miscellaneous messages.
- :complete_utter_failure => "Complete and Utter Failure",
- :editing => "Editing",
- :error => "Error",
- :invalid_path_info_value => "Something has gone seriously wrong with the web environment. PATH_INFO = %s",
- :render_arguments => "Ruwiki#render must be called with zero or two arguments.",
- :unknown_feature => "Unknown feature %s.",
- :topics_for_project => "Topics for Project ::%s",
- :project_topics_link => "(topics)",
- :wiki_projects => "Projects in %s",
- :no_projects => "No known projects.",
- :no_topics => "No topics in project %s.",
- :search_results_for => "= Search results for: %s",
- :number_of_hits => "%d Hits",
-
- # Labels
- :label_search_project => "Search Project",
- :label_search_all => "All",
- :label_search => "Search: ",
- :label_project => "Project: ",
- :label_topic => "Topic: ",
- :label_edit => "Edit",
- :label_recent_changes => "Recent Changes",
- :label_topics => "Topics",
- :label_projects => "Projects",
- :label_editing => "Editing",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Edit Comment: ",
- :label_comment_accelerator => "O",
- :label_save => "Save",
- :label_save_accelerator => "S",
- :label_cancel => "Cancel",
- :label_cancel_accelerator => "C",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Original Text",
- :label_raw => "Raw",
- :label_formatted => "Formatted",
- :label_send_report_by => "Send the Wiki maintainer a report by email.",
- :label_send_report => "Send report.",
- :label_saved_page => "Saved page: ",
- }
- message.each { |k, v| Message[k] = v }
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/es.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/es.rb
deleted file mode 100644
index 3249c18..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/es.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Mauricio Julio Fernández Pradier (batsman.geo@yahoo.com)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::ES is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module ES
- Message = Hash.new { |h, k| h[k] = "ERROR De la Lengua: Llave desconocida del mensaje #{k.inspect}."; h[k] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Clase Backend desconocida: %s.",
- :cannot_create_project => "No puede crearse el proyecto %s: %s",
- :cannot_destroy_project => "No puede borrarse el proyecto %s: %s",
- :cannot_destroy_topic => "No puede borrarse %s::%s: %s",
- :cannot_obtain_lock => "Imposible obtener acceso exclusivo sobre %s::%s. Reinténtelo en breve.",
- :cannot_release_lock => "Imposible liberar acceso exclusivo sobre %s::%s. Reinténtelo en breve.",
- :cannot_retrieve_topic => "No puede leerse %s::%s: %s",
- :cannot_store_topic => "No puede archivarse %s::%s: %s",
- :error_creating_lock => "Error al crear el cerrojo sobre %s::%s: %s",
- :error_releasing_lock => "Error al liberar el cerrojo sobre %s::%s: %s",
- :flatfiles_no_data_directory => "El directorio de datos (%s) no existe.",
- :no_access_to_create_project => "Permiso denegado al crear el proyecto %s.",
- :no_access_to_destroy_project => "Permiso denegado al borrar el proyecto %s::%s.",
- :no_access_to_destroy_topic => "Permiso denegado al borrar el nodo %s::%s.",
- :no_access_to_read_topic => "Permiso denegado al leer el nodo %s::%s.",
- :no_access_to_store_topic => "Permiso denegado al salvar el nodo %s::%s.",
- :project_already_exists => "El proyecto %s ya existe.",
- :project_does_not_exist => "El proyecto %s no existe.",
- :no_access_list_projects => "Permiso denegado al lista del proyecto.",
- :no_access_list_topics => "Permiso denagado al lista del nodo, procecto: %s.",
- :search_project_fail => "Falta que busca proyecto %s con la secuencia %s.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "La configuración debe ser de clase Ruwiki::Config.",
- :invalid_template_dir => "El path especificado para plantillas (%s) no existe o no es un directorio.",
- :no_template_found => "No se encontró ninguna plantilla para %s en el conjunto %s.",
- :no_template_set => "No hay ningún juego de plantillas '%s' en el path.",
- :no_webmaster_defined => "Error de configuración: Webmaster no está definido.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fallo total y absoluto.",
- :editing => "Editando",
- :error => "Error",
- :invalid_path_info_value => "Algo huele a podrido en su entorno Web. PATH_INFO = %s",
- :render_arguments => "Ruwiki#render debe ser llamado con cero o dos argumentos.",
- :unknown_feature => "Clase Feature desconocida: %s.",
-
- # Labels
- :label_search_project => "Proyecto De la Búsqueda",
- :label_search_all => "<all>",
- :label_search => "Suchc: ",
- :label_project => "Proyecto: ",
- :label_topic => "Nodo: ",
- :label_edit => "Editar",
- :label_recent_changes => "Cambios Recientes",
- :label_topics => "Lista del Nodo",
- :label_projects => "Lista del Proyecto",
- :label_editing => "Editando",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Corrija el Commentario: ",
- :label_comment_accelerator => "O",
- :label_save => "Salvar",
- :label_save_accelerator => "S",
- :label_cancel => "Cancelar",
- :label_cancel_accelerator => "C",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Texto Original",
- :label_raw => "Version sin formato",
- :label_formatted => "Version con formato",
- :label_send_report_by => "Envie al admistrador de este sitio una notificación por correo electrónico.",
- :label_send_report => "Envie notificación.",
- :label_saved_page => "Página salvaguardada: ",
- }
- message.each { |k, v| Message[k] = v }
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/page.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/page.rb
deleted file mode 100644
index 165422b..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/page.rb
+++ /dev/null
@@ -1,259 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # The page class for Ruwiki. The page defines the data and meta-data for a
- # page.
-class Ruwiki::Page
- include Ruwiki::Exportable
-
- exportable_group 'ruwiki'
- # Returns the content version of the page. If the page has a greater
- # content version than this version of Ruwiki does, we should probably
- # throw an exception, because attempting to save such a page will cause a
- # loss of data. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +content-version+
- attr_reader :content_version
- exportable :content_version
- # Returns the version of Ruwiki from which this page was generated.
- # Informational only. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +version+
- attr_reader :ruwiki_version
- exportable :ruwiki_version, :name => 'version'
-
- exportable_group 'properties'
- # Returns or sets the displayed title of the page, which may differ from
- # the topic of the page. As of Ruwiki 0.8.0, this is not currently used and
- # it may disappear.
- #
- # Class:: +properties+
- # ID:: +title+
- attr_accessor :title
- exportable :title
- # Returns or sets the topic of the page, which may differ from the title.
- # This is used to set the topic on a page being saved.
- #
- # Class:: +properties+
- # ID:: +topic+
- attr_accessor :topic
- exportable :topic
- # Returns or sets the project of the page, which may differ from the title.
- # This is used to set the project on a page being saved.
- #
- # Class:: +properties+
- # ID:: +project+
- attr_accessor :project
- exportable :project
- # Returns or sets the creator of the page. Unless we know the user (via a
- # cookie, not yet implemented in Ruwiki 0.8.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +creator+
- attr_accessor :creator
- exportable :creator
- # Returns or sets the creator's IP address. This should always be set. It
- # will have a value of "UNKNOWN" on the off-chance that something prevents
- # this from working.
- #
- # Class:: +properties+
- # ID:: +creator-ip+
- attr_accessor :creator_ip
- exportable :creator_ip
- # Returns or sets the date of creation.
- #
- # Class:: +properties+
- # ID:: +create-date+
- attr_accessor :create_date
- exportable :create_date
- # Returns or sets the last editor of the page. Unless we know the user (via
- # a cookie, not yet implemented in Ruwiki 0.8.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +editor+
- attr_accessor :editor
- exportable :editor
- # Returns or sets the last editor's IP address. This should always be set.
- # It will have a value of "UNKNOWN" on the off-chance that something
- # prevents this from working.
- #
- # Class:: +properties+
- # ID:: +editor-ip+
- attr_accessor :editor_ip
- exportable :editor_ip
- # Returns or sets the date of the last edit.
- #
- # Class:: +properties+
- # ID:: +edit-date+
- attr_accessor :edit_date
- exportable :edit_date
- # Indicates whether the page is editable. Non-editable pages are
- # effectively static pages.
- #
- # Class:: +properties+
- # ID:: +editable+
- attr_accessor :editable
- exportable :editable
- # Indicates whether the page is indexable. Non-indexable pages are
- # invisible to compliant web robots, and their links may not be followed.
- #
- # Class:: +properties+
- # ID:: +indexable+
- attr_accessor :indexable
- exportable :indexable
- # The current version of the page. The old version is always (#version -
- # 1).
- #
- # Class:: +properties+
- # ID:: +version+
- attr_accessor :version
- exportable :version
- # An array of complete tags that will appear in the HTML <HEAD> section.
- # Can be used to specify additional CSS, <META> tags, or even JavaScript on
- # a per-page basis. Currently unused.
- #
- # Class:: +properties+
- # ID:: +html-headers+
- attr_accessor :html_headers
- exportable :html_headers
- # The entropy of the page. This is a ratio of the number of lines changed
- # in the file vs. the total number of lines in the file. This value is
- # currently unused. (And, sad to say, I don't remember why I included it.
- # However, it's an interesting value that may be useful in spam fighting
- # techniques. It is currently stored in the meta-data, but that may change
- # moving forward.)
- #
- # Class:: +properties+
- # ID:: +entropy+
- attr_reader :entropy
- exportable :entropy
- # The edit comment for the current revision of the page.
- #
- # Class:: +properties+
- # ID:: +edit-comment+
- attr_accessor :edit_comment
- exportable :edit_comment
-
- exportable_group 'page'
- # The header content of the page. This is static content (in either Wiki or
- # HTML formats) that appears before the editable contents of the page. If
- # both this and Wiki-level header content are specified, this will appear
- # *after* the Wiki-level header content.
- #
- # Class:: +page+
- # ID:: +header+
- attr_accessor :header
- exportable :header
- # The footer content of the page. This is static content (in either Wiki or
- # HTML formats) that appears before the editable contents of the page. If
- # both this and Wiki-level footer content are specified, this will appear
- # *before* the Wiki-level footer content.
- #
- # Class:: +page+
- # ID:: +footer+
- attr_accessor :footer
- exportable :footer
- # The editable unformatted Wiki content of the page.
- #
- # Class:: +page+
- # ID:: +content+
- attr_accessor :content
- exportable :content
-
- # Creates a Ruwiki page. This must be created from the canonical export
- # hash.
- def initialize(exported = {})
- ruwiki = exported['ruwiki']
- @content_version = (ruwiki['content-version'] || Ruwiki::CONTENT_VERSION).to_i
- @ruwiki_version = ruwiki['version'] || Ruwiki::VERSION
-
- props = exported['properties']
- @title = props['title']
- @topic = props['topic'] || "NewTopic"
- @project = props['project'] || "Default"
- @creator = props['creator'] || ""
- @creator_ip = props['creator-ip'] || "UNKNOWN"
- @create_date = Time.at((props['create-date'] || Time.now).to_i)
- @editor = props['editor'] || ""
- @editor_ip = props['editor-ip'] || "UNKNOWN"
- @edit_date = Time.at((props['edit-date'] || Time.now).to_i)
- @edit_comment = props['edit-comment'] || ""
- case props['editable']
- when false
- @editable = false
- else
- @editable = true
- end
- case props['indexable']
- when false
- @indexable = false
- else
- @indexable = true
- end
- @entropy = (props['entropy'] || 0).to_f
- @html_headers = props['html-headers'] || []
- @version = (props['version'] || 0).to_i
-
- page = exported['page']
- @header = page['header'] || ""
- @content = page['content'] || ""
- @footer = page['footer'] || ""
-
- # Fix the possibility that the content might be an array of chunks.
- @content = @content.join("") if @content.kind_of?(Array)
-
- @content.gsub!(/\r/, "")
- end
-
- # Outputs the HTML version of the page.
- def to_html(markup)
- # Normalise the content, first
- @content.gsub!(/\r/, "")
- markup.parse(@content, @project)
- end
-
- # Provides the canonical export hash.
- def export
- sym = super
-
- sym.each_key do |sect|
- if sect == 'ruwiki'
- sym[sect]['content-version'] = Ruwiki::CONTENT_VERSION
- sym[sect]['version'] = Ruwiki::VERSION
- else
- sym[sect].each_key do |item|
- case [sect, item]
- when ['properties', 'create-date'], ['properties', 'edit-date']
- sym[sect][item] = sym[sect][item].to_i
- when ['properties', 'editable'], ['properties', 'indexable']
- sym[sect][item] = (sym[sect][item] ? 'true' : 'false')
- else
- sym[sect][item] = sym[sect][item].to_s
- end
- end
- end
- end
-
- sym
- end
-
- NULL_PAGE = {
- 'ruwiki' => {
- 'content-version' => Ruwiki::CONTENT_VERSION,
- 'version' => Ruwiki::VERSION
- },
- 'properties' => { },
- 'page' => { },
- }
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/servlet.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/servlet.rb
deleted file mode 100644
index 19feddf..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/servlet.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'webrick'
-
-class Ruwiki
- class Servlet < WEBrick::HTTPServlet::AbstractServlet
- def initialize(config)
- @config = config
- end
-
- # Converts a POST into a GET.
- def do_POST(req, res)
- do_GET(req, res)
- end
-
- def do_GET(req, res)
- # Generate the reponse handlers for Ruwiki from the request and response
- # objects provided.
- wiki = Ruwiki.new(Ruwiki::Handler.from_webrick(req, res))
-
- # Configuration defaults to certain values. This overrides the defaults.
- wiki.config = $config unless $config.nil?
- wiki.config.logger = @config.logger
- wiki.run
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/template.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/template.rb
deleted file mode 100644
index 1acbbab..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/template.rb
+++ /dev/null
@@ -1,331 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file is originally from rdoc by Dave Thomas (dave@pragprog.com).
-#
-# $Id$
-#++
-
- # Ruwiki templating, based originally on RDoc's "cheap-n-cheerful" HTML page
- # template system, which is a line-oriented, text-based templating system.
- #
- # Templates can contain:
- #
- # * The directive !INCLUDE!, which will include the next template from the
- # provided list. This is processed before any template substitution, so
- # repeating and optional blocks work on the values within the template
- # substitution.
- # * Substitutable variable values between percent signs (<tt>%key%</tt>).
- # Optional variable values can be preceded by a question mark
- # (<tt>%?key%</tt>).
- # * Label values between hash marks (<tt>#key#</tt>). Optional label values
- # can be preceded by a question mark (<tt>#?key#</tt>).
- # * Links (<tt>HREF:ref:name:</tt>).
- # * Repeating substitution values (<tt>[:key| stuff :]</tt>). The value of
- # +key+ may be an integer value or a range (in which case key will be used
- # as an iterator, providing the current value of key on successive values),
- # an array of scalar values (substituting each value), or an array of
- # hashes (in which case it works like repeating blocks, see below). These
- # must NOT be nested. Note that integer value counting is one-based.
- # * Optional substitution values (<tt>[?key| stuff ?]</tt> or <tt>[!key|
- # stuff ?]</tt>. These must NOT be nested.
- # * Repeating blocks:
- # START:key
- # ... stuff
- # END:key
- # * Optional blocks:
- # IF:key
- # ... stuff
- # ENDIF:key
- # or:
- # IFNOT:key
- # ... stuff
- # ENDIF:key
- #
- # When generating the output, a hash of values is provided and an optional
- # hash of labels is provided. Simple variables are resolved directly from the
- # hash; labels are resolved as Symbols from the label hash or are otherwise
- # treated as variables. Labels are always resolved from a single label hash.
- #
- # The +key+ for repeating blocks (one-line or multi-line) must be an array of
- # hashes. The repeating block will be generated once for each entry. Blocks
- # can be nested arbitrarily deeply.
- #
- # Optional blocks will only be generated if +key+ has a non-nil value, or if
- # +key+ has a nil value in an IFNOT block.
- #
- # Usage: Given a set of templates <tt>T1</tt>, <tt>T2</tt>, etc.
- #
- # values = { "name" => "Dave", "state" => "TX" }
- # fr = { :name => "Nom", :state => "Etat" }
- # en = { :name => "Name", :state => "State" }
- # t = TemplatePage.new(T1, T2, T3)
- #
- # res = ""
- # t.process(res, values, fr)
- # t.process(res, values, en)
- #
-class Ruwiki::TemplatePage
- BLOCK_RE = /^(IF|IFNOT|ENDIF|START|END):(\w+)?/
- HREF_RE = /HREF:(\w+?):(\w+?):/
- LABEL_RE = /#(\?)?(\w+?)#/
- VARIABLE_RE = /%(\?)?(\w+?)%/
- IFLINE_RE = /\[([?!])(\w+?)\|(.*?)\?\]/
- BLOCKLINE_RE = /\[:(\w+?)\|(.*?):\]/
-
- # A context holds a stack of key/value pairs (like a symbol table). When
- # asked to resolve a key, it first searches the top of the stack, then the
- # next level, and so on until it finds a match (or runs out of entries).
- class Context
- def initialize
- @stack = []
- end
-
- def push(hash)
- @stack.push(hash)
- end
-
- def pop
- @stack.pop
- end
-
- # Find a scalar value, throwing an exception if not found. This method is
- # used when substituting the %xxx% constructs
- def find_scalar(key)
- @stack.reverse_each do |level|
- return level[key] unless level[key].kind_of?(Array)
- end
- raise "Template error: can't find variable '#{key}'."
- end
-
- # Lookup any key in the stack of hashes
- def lookup(key)
- @stack.reverse_each do |level|
- return level[key] unless level[key].nil?
- end
- nil
- end
- end
-
- # Simple class to read lines out of a string
- class LineReader
- attr_reader :lines
- def initialize(lines)
- @lines = lines
- end
-
- # read the next line
- def read
- @lines.shift
- end
-
- # Return a list of lines up to the line that matches a pattern. That last
- # line is discarded.
- def read_up_to(pattern)
- res = []
- while line = read
- if pattern.match(line)
- return LineReader.new(res)
- else
- res << line
- end
- end
- raise "Missing end tag in template: #{pattern.source}"
- end
-
- # Return a copy of ourselves that can be modified without affecting us
- def dup
- LineReader.new(@lines.dup)
- end
- end
-
- # +templates+ is an array of strings containing the templates. We start at
- # the first, and substitute in subsequent ones where the string
- # <tt>!INCLUDE!</tt> occurs. For example, we could have the overall page
- # template containing
- #
- # <html><body>
- # <h1>Master</h1>
- # !INCLUDE!
- # </body></html>
- #
- # and substitute subpages in to it by passing [master, sub_page]. This
- # gives us a cheap way of framing pages
- def initialize(*templates)
- result = "!INCLUDE!"
- templates.each { |content| result.sub!(/!INCLUDE!/, content) }
- @lines = LineReader.new(result.split(/\r?\n/))
- end
-
- attr_reader :lines
-
- # Render the templates, storing the result on +output+ using the method
- # <tt><<</tt> The <tt>value_hash</tt> contains key/value pairs used to
- # drive the substitution (as described above). The <tt>label_hash</tt>
- # contains key/value pairs used to drive the substitution of labels (see
- # above).
- def process(output, value_hash, message_hash = {})
- @context = Context.new
- @message = message_hash
- output << sub(@lines.dup, value_hash).tr("\000", '\\')
- output
- end
-
- # Substitute a set of key/value pairs into the given template. Keys with
- # scalar values have them substituted directly into the page. Those with
- # array values invoke <tt>substitute_array</tt> (below), which examples a
- # block of the template once for each row in the array.
- #
- # This routine also copes with the <tt>IF:</tt>_key_ directive, removing
- # chunks of the template if the corresponding key does not appear in the
- # hash, and the START: directive, which loops its contents for each value
- # in an array
- def sub(lines, values)
- @context.push(values)
- skip_to = nil
- result = []
-
- while line = lines.read
- mv = line.match(BLOCK_RE)
-
- if mv.nil?
- result << expand(line.dup)
- next
- else
- cmd = mv.captures[0]
- tag = mv.captures[1]
- end
-
- case cmd
- when "IF", "IFNOT"
- raise "#{cmd}: must have a key to test." if tag.nil?
-
- test = @context.lookup(tag).nil?
- test = (cmd == "IF") ? test : (not test)
- lines.read_up_to(/^ENDIF:#{tag}/) if test
- when "ENDIF"
- nil
- when "START"
- raise "#{cmd}: must have a key." if tag.nil?
-
- body = lines.read_up_to(/^END:#{tag}/)
- inner = @context.lookup(tag)
- raise "unknown tag: #{tag}" unless inner
- raise "not array: #{tag}" unless inner.kind_of?(Array)
- inner.each { |vals| result << sub(body.dup, vals) }
- result << "" # Append the missing \n
- else
- result << expand(line.dup)
- end
- end
-
- @context.pop
-
- result.join("\n")
- end
-
- # Given an individual line, we look for %xxx%, %?xxx%, #xxx#, #?xxx#,
- # [:key| xxx :], [?key| stuff ?], [!key| stuff ?] and HREF:ref:name:
- # constructs, substituting as appropriate.
- def expand(line)
- # Generate a cross-reference if a reference is given. Otherwise, just
- # fill in the name part.
- line = line.gsub(HREF_RE) do
- ref = @context.lookup($1)
- name = @context.find_scalar($2)
-
- if ref and not ref.kind_of?(Array)
- %Q(<a href="#{ref}">#{name}</a>)
- else
- name
- end
- end
-
- # Look for optional content.
- line = line.gsub(IFLINE_RE) do
- type = $1
- name = $2
- stuff = $3
-
- case type
- when '?'
- test = @context.lookup(name)
- when '!'
- test = (not @context.lookup(name))
- end
-
- if test
- stuff
- else
- ""
- end
- end
-
- # Look for repeating content.
- line = line.gsub(BLOCKLINE_RE) do |match|
- name = $1
- stuff = $2
-
- val = @context.lookup(name)
- s = ""
- case val
- when nil
- nil
- when Fixnum
- val.times { |i| s << stuff.sub(/%#{name}%/, "#{i + 1}") }
- when Range
- val.each { |i| s << stuff.sub(/%#{name}%/, "#{i}") }
- when Array
- if not val.empty? and val[0].kind_of?(Hash)
- val.each do |v|
- @context.push(v)
- s << expand(stuff)
- @context.pop
- end
- else
- val.each { |e| s << stuff.sub(/%#{name}%/, "#{e}") }
- end
- end
- s
- end
-
- # Substitute in values for #xxx# constructs.
- line = line.gsub(LABEL_RE) do
- mandatory = $1.nil?
- key = $2.intern
- val = @message[key]
-
- if val.nil?
- raise "Template error: can't find label '#{key}'." if mandatory
- ""
- else
- "#{val}".tr('\\', "\000")
- end
- end
-
- # Substitute in values for %xxx% constructs. This is made complex
- # because the replacement string may contain characters that are
- # meaningful to the regexp (like \1)
- line = line.gsub(VARIABLE_RE) do
- mandatory = $1.nil?
- key = $2
- val = @context.lookup(key)
-
- if val.nil?
- raise "Template error: can't find variable '#{key}'." if mandatory
- ""
- else
- "#{val}".tr('\\', "\000")
- end
- end
-
- line
- rescue Exception => e
- raise "Error in template: #{e}\nOriginal line: #{line}\n#{e.backtrace[0]}"
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki.rb
deleted file mode 100644
index a060c75..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Ruwiki's Wiki markup class. This will convert the Wiki markup known by
- # Ruwiki (defined by Token classes). The algorithm is as follows:
- #
- # 1. For each known Token class, match each instance of it in the content
- # stream. Replace each instance in the content stream with a Token
- # marker: TOKEN_x or \TOKEN_x, where x is a digit representing the
- # Token. (\TOKEN_x is a special case of token matching. See
- # Ruwiki::Markup::Token for more information.) Store the Token for
- # later processing.
- # 2. Go back through the content, replacing each instance of \TOKEN_x
- # with the Token's defined restore value (which should be the same
- # value as was originally matched).
- # 3. Go through the content, replacing each instance of TOKEN_x with the
- # Token's defined replacement value.
- # 4. Go through the tokens, in reverse, and execute the post replacement
- # routine defined by the Token. (This may be necessary to collapse
- # consecutive HTML structures.)
- # 5. Return the parsed content and the collected metadata.
- #
- # == Tokens
- # Look at Ruwiki::Markup::Token describes how to create Token objects.
- class Wiki
- def parse(content, project)
- content = content.dup
- tokens = []
- project ||= @default_project
-
- Token.tokenlist.each do |token|
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, project, @backend, @script, @message, @title)
- tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{tokens.size - 1}"
- else
- "TOKEN_#{tokens.size - 1}"
- end
- end
- end
-
- replaced = []
- s = true
- loop do
- break if replaced.size >= tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].restore
- }
-
- s = content.gsub!(/TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].replace
- }
- end
-
- token_classes = tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
-
- content
- end
-
- attr_accessor :default_project
- attr_accessor :script
- attr_accessor :backend
- attr_accessor :message
-
- # Creates the markup class.
- def initialize(default_project, script, title)
- @default_project = default_project
- @script = script
- @title = title
- end
- end
-end
-
-require 'ruwiki/wiki/tokens'
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens.rb
deleted file mode 100644
index d0e47fc..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens.rb
+++ /dev/null
@@ -1,136 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # The base Token class. All Token classes must inherit from Token and
- # *must* implement the following methods:
- #
- # [self.regexp] The regular expression that the Token will be
- # replacing.
- # [replace] The mechanism for replacing the Token with the desired
- # results.
- #
- # Token classes <i>should</i> implement the following method:
- # [self.rank] Default: <tt>5000</tt>. Affects the sort order.
- # Must return an integer.
- #
- # Token classes <i>may</i> implement the following methods:
- # [restore] Restores the token without replacement.
- # Implements the results of the escape character.
- # NOTE: each Token class is responsible for its own
- # restore. Tokens that are anchored to the
- # beginning of a line are the most likely to need
- # to reimplement this.
- # [self.post_replace] Performs any necessary massaging of the data. See
- # the implementation of Ruwiki::Wiki::Lists for
- # more information.
- class Token
- @@tokenlist = []
- @@sorted = false
-
- class << self
- # Tokens should define rank if they must be first or last in
- # processing. Otherwise, they are sorted in the order defined.
- def rank
- 5000
- end
-
- # The Wiki parsing routine uses Token.tokenlist to determine the
- # tokens that are processed, and the order in which they are
- # processed. See Token.rank for more information.
- def tokenlist
- unless @@sorted
- head = @@tokenlist.shift
- @@tokenlist.sort! { |a, b| a.rank <=> b.rank }
- @@tokenlist.unshift(head)
- sorted = true
- end
- @@tokenlist
- end
-
- def inherited(child_class) #:nodoc:
- @@tokenlist << Token if @@tokenlist.empty?
-
- # Make the child class post_replace a blank function because we
- # don't want to propogate the currently defined post_replace.
- # The current post_replace is specific to Token_Base only.
- class << child_class
- def self.post_replace(content)
- content
- end
- end
-
- @@tokenlist << child_class
- @@sorted = false
- end
-
- # The replacement regular expression.
- def regexp
- /TOKEN_(\d*)/
- end
- end
-
- # All Token classes must match this header signature if they define
- # #initialize.
- #
- # [match] The MatchData object for this Token.
- # [project] The project being processed.
- # [backend] The backend for the wiki. This is used to determine if
- # the page or project exists. The object passed must
- # respond to #project_exists?(project) and
- # #page_exists?(page, project).
- # [script] The URI to the script.
- # [message] The message hash for localized messages.
- # [title] The title of the Wiki.
- def initialize(match, project, backend, script, message, title)
- @match = match
- @project = project
- @backend = backend
- @script = script
- @message = message
- @title = title
- end
-
- # The replacement method. Uses @match to replace the token with the
- # appropriate values.
- def replace
- "TOKEN_#{@match[1]}"
- end
-
- # Restores the token without replacement. By default, replaces
- # "dangerous" HTML characters.
- def restore
- @match[0].gsub(/&/, "&amp;").gsub(/</, "&lt;").gsub(/>/, "&gt;")
- end
-
- # The content may need massaging after processing.
- def self.post_replace(content)
- content
- end
- end
- end
-end
-
- # Load the tokens from the ruwiki/wiki/tokens directory.
-tokens_dir = 'ruwiki/wiki/tokens'
-
-$LOAD_PATH.each do |path|
- target = "#{path}/#{tokens_dir}"
- if File.exists?(target) and File.directory?(target)
- Dir::glob("#{target}/*.rb") do |token|
- begin
- require token
- rescue LoadError
- nil
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/00default.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/00default.rb
deleted file mode 100644
index d57544f..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/00default.rb
+++ /dev/null
@@ -1,206 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-# $debug = File.open("output.txt", "wb")
-
-class Ruwiki::Wiki
- # The Paragraph Token class changes blank lines to <p> tags. This class,
- # under the current implementation, should be *first* in the Token list
- # after Token.
- class Paragraph < Ruwiki::Wiki::Token
- # This Token is #rank 0, because it should be first in the Token list.
- def self.rank
- 0
- end
-
- # Matches blank lines. %r{^$}
- def self.regexp
- %r{(^$)}
- end
-
- def replace
- %Q(</p><p class="rwtk_Paragraph">)
- end
-
- # Ensures that <p> won't be surrounded by <br> tags.
- def self.post_replace(content)
- content.gsub!(%r{\A}, '<p class="rwtk_Paragraph">')
- content.gsub!(%r{\z}, '</p>')
- content.gsub!(%r{\n(</p>)}, '\1')
- content.gsub!(%r{(<p[^>]*>)\n}, '\1')
- content.gsub!(%r{(</p>)(<p[^>]*>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{<p[^>]*></p>}, '')
- content.gsub!(%r{^\n(<p[^>]*>)}, '\1')
- content
- end
- end
-
- # The Code Token class converts indented text to "unformatted" (<pre>)
- # text. This class should be *second* in the Token list.
- class Code < Ruwiki::Wiki::Token
- # This Token is #rank 1, because it should be second in the Token list.
- def self.rank
- 1
- end
-
- # Matches indented text. %r{^(\s+\S?.*)$}
- def self.regexp
- %r{^([ \t]+[^\n]*)\n}
- end
-
- # Replaces the text to <pre>content</pre>.
- def replace
- content = @match.captures[0]
- content.gsub!(/&/, '&amp;')
- content.gsub!(/</, '&lt;')
- content.gsub!(/>/, '&gt;')
-
- %Q{</p><pre class="rwtk_Code">#{content}</pre>\n}
- end
-
- # Converts cases of %r{</pre>(\n|<br ?/?>)<pre>} to \1.
- def self.post_replace(content)
- content.gsub!(%r{</pre>((\n)*</p>(\n)*)?<pre[^>]*>}, "\n")
- content.gsub!(%r{</pre>(\n|<br ?/?>)?<pre[^>]*>}, '\1')
- content.gsub!(%r{<p[^>]*>(<pre[^>]*>)}, '\1')
- content.gsub!(%r{</pre></p>}, '</pre>')
-# content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content
- end
- end
-
- RE_URI_SCHEME = %r{[-a-z0-9+.]{3,}?:}
- RE_URI_PATH = %r{[^\s<>\]]}
- RE_URI_TEXT = %r{[^\]]*}
-
- # Converts URLs in the form of [url] to numbered links.
- class NumberedLinks < Ruwiki::Wiki::Token
- class << self
- def increment
- @count ||= 0
- @count += 1
- end
-
- def reset
- @count = 0
- end
- end
-
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\]}
- end
-
- def replace
- extlink = @match.captures[0]
-
- name = "[#{NumberedLinks.increment}]"
-
- %Q{<a class="rwtk_NumberedLinks" href="#{extlink}">#{name}</a>}
- end
- end
-
- class Image < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- RE_IMAGE_OPTIONS=%r{([^=]+)=("[^"]+"|[^ ]+)}
-
- def self.regexp
- %r{\[image\s*:\s*(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)(\s+[^\]]+)?\]}
- end
-
- def replace
- options = { 'src' => %Q("#{@match.captures[0]}") }
- groups = @match.captures[1]
- unless groups.nil?
- groups.scan(RE_IMAGE_OPTIONS).each { |g| options[g[0].strip] = g[1].strip }
- end
-
- unless options['numbered'].nil? or options['numbered'] == "false"
- options['title'] = %Q("[#{NumberedLinks.increment}]")
- options.delete('numbered')
- end
-
- options['title'] ||= options['alt']
- options['title'] ||= options['src']
- options['alt'] ||= options['title']
-
- ss = ""
- options.keys.sort.map { |kk| ss << %Q( #{kk}=#{options[kk]}) }
-
- %Q{<img class="rwtk_Image"#{ss} />}
- end
- end
-
- # Converts URLs in the form of [url name] to named links.
- class NamedLinks < Ruwiki::Wiki::Token
- def self.rank
- 3
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\s+(#{RE_URI_TEXT})\]}
- end
-
- def replace
- extlink = @match.captures[0]
- name = @match.captures[1]
-
- %Q{<a class="rwtk_NamedLinks" href="#{extlink}">#{name}</a>}
- end
- end
-
- # Converts URLs to links where the "name" of the link is the URL itself.
- class ExternalLinks < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{\b(#{RE_URI_SCHEME}#{RE_URI_PATH}+)}
- end
-
- def replace
- extlink = @match.captures[0]
-
- %Q{<a class="rwtk_ExternalLinks" href="#{extlink}">#{extlink}</a>}
- end
- end
-
- # Creates a horizontal rule.
- class HRule < Ruwiki::Wiki::Token
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def replace
- %Q(<hr class="rwtk_HRule" />)
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(<p[^>]*>)*(<hr[^ />]* ?/?>)(</p>)*}, '\1')
- content.gsub!(%r{\n<hr />}, "</p>\n<hr />")
- content.gsub!(%r{<hr ?/?>\n<br ?/?>}, "<hr />")
- content.gsub!(%r{(\n|<br ?/?>)?<hr>(\n|<br ?/?>)?}, "<hr />")
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/01wikilinks.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/01wikilinks.rb
deleted file mode 100644
index 442a201..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/01wikilinks.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # This provides the basic WikiWord match. This supports WikiWord,
- # CPlusPlus, ThisIsALink, and C_Plus_Plus.
- RE_WIKI_WORDS = %r{[[:upper:]][\w_]*(?:[[:lower:]]+[[:upper:]_]|[[:upper:]_]+[[:lower:]])[\w_]*}
- # This provides wikipedia format matches, e.g., [[wikipedia links]]. The
- # only restriction on words in this format is that they must NOT begin
- # with an underscore ('_').
- RE_WIKIPEDIA_WORDS = %r{\[\[([^_].*?)\]\]}
- # This provides the basic Wiki Project match.
- RE_PROJECT_WORD = %r{[[:upper:]][[:lower:]]+}
-
- # This provides the Wiki view link format:
- VIEW_LINK = %Q[<a class="rwtk_WikiLink" href="%s">%s</a>]
- EDIT_LINK = %Q[<span class="rwtk_EditWikiLink">%s</span><a class="rwtk_WikiLink" href="%s">?</a>]
-
- # Creates a crosslink for a Project::WikiPage.
- class ProjectCrossLink < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::(#{RE_WIKI_WORDS})}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic.gsub(/_/, ' ')}"]
- else
- EDIT_LINK % ["#{project}::#{topic.gsub(/_/, ' ')}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a crosslink for a Project::WikiPage using a Wikipedia link
- # format.
- class ProjectCrossLinkWikipedia < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::#{RE_WIKIPEDIA_WORDS}}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic}"]
- else
- EDIT_LINK % ["#{project}::#{topic}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to the project index from ::Project.
- class ProjectIndex < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{(\B|\\)::(#{RE_PROJECT_WORD})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- project = @match.captures[1]
-
- if @backend.page_exists?('ProjectIndex', project)
- VIEW_LINK % ["#{@script}/#{project}/ProjectIndex", project]
- else
- if @backend.project_exists?(project)
- EDIT_LINK % [project, "#{@script}/#{project}/ProjectIndex/_edit"]
- else
- EDIT_LINK % [project, "#{@script}/#{project}/_create"]
- end
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project.
- class WikiLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\b|\\)(#{RE_WIKI_WORDS})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic.gsub(/_/, ' ')]
- else
- EDIT_LINK % [topic.gsub(/_/, ' '), "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project using a Wikipedia
- # link format.
- class WikipediaLinks < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(\B|\\)#{RE_WIKIPEDIA_WORDS}\B}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- ALT_TEXT = %r{(.+)\|(.+)}o
-
- def replace
- captures = @match.captures
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- at = ALT_TEXT.match(topic)
-
- if not at.nil?
- topic = at.captures[1]
- link = CGI.escape(at.captures[0])
- end
-
- if @backend.page_exists?(link, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic]
- else
- EDIT_LINK % [topic, "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/02actions.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/02actions.rb
deleted file mode 100644
index fd0d5b8..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/02actions.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # Produces a list of topics.
- class TopicList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%topics\((#{Ruwiki::Wiki::RE_PROJECT_WORD})?\)$}
- end
-
- def replace
- project = @match.captures[0] || @project
-
- if @backend.project_exists?(project)
- topic_list = @backend.list_topics(project)
- else
- topic_list = []
- end
-
- if topic_list.empty?
- s = @message[:no_topics] % [project]
- else
- s = %Q(<h4 class="rwtk_Headings">#{@message[:topics_for_project] % [project]}</h4>\n<ul class="rwtk_Lists">\n)
- topic_list.each do |tt|
- s << %Q(<li class="rwtk_Lists">)
- s << VIEW_LINK % ["#{@script}/#{project}/#{tt}", "#{CGI::unescape(tt.gsub(/_/, ' '))}"]
- s << "</li>\n"
- end
- s << "</ul>\n"
- end
-
- s
- end
- end
-
- class ProjectList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%projects\(\)$}
- end
-
- def replace
- proj_list = @backend.list_projects
-
- s = %Q(<h4 class="rwtk_Headings">#{@message[:wiki_projects] % [@title]}</h4>\n<ul class="rwtk_Lists">\n)
- proj_list.each do |pp|
- s << %Q(<li class="rwtk_Lists">)
- s << VIEW_LINK % ["#{@script}/#{pp}/ProjectIndex", pp]
- s << %Q! <a href='#{@script}/#{pp}/_topics' class='rw_minilink'>#{@message[:project_topics_link]}</a>!
- s << "</li>\n"
- end
- s << "</ul>\n"
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/abbreviations.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/abbreviations.rb
deleted file mode 100644
index 3f80d83..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/abbreviations.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Converts abbreviations.
- class Abbreviations < Ruwiki::Wiki::Token
- ABBREVIATIONS = {
- "matz" => "Yukihiro Matsumoto",
- }
-
- def self.regexp
- %r!@\{([^\}]*)\}!
- end
-
- def replace
- k = @match.captures[0]
- if k.nil? or k.empty?
- data = %Q(<dl class="rwtk_Abbreviations">)
- ABBREVIATIONS.each do |k, v|
- data << %Q(<dt class="rwtk_Abbreviations">#{k}</dt><dd class="rwtk_Abbreviations">#{v}</dd>)
- end
- data << %Q(</dl>)
- else
- if ABBREVIATIONS.has_key?(k)
- data = ABBREVIATIONS[k]
- else
- data = @match[0]
- end
- end
- data
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/calendar.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/calendar.rb
deleted file mode 100644
index 88f52d9..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/calendar.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces a mini-calendar with dates as WikiWords.
- class Calendar < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?%calendar\((?:(today)|(\d+),\s*(\d+))(?:,\s*(#{RE_PROJECT_WORD}))?\)}
- end
-
- def self.make(year, month)
- result = []
- t = Time.local(year, month, 1)
- r = Array.new(t.wday, nil)
- r << 1
-
- 2.upto(31) do |i|
- break if Time.local(year, month, i).month != month
- r << i
- end
-
- r += Array.new((- r.size) % 7, nil)
-
- 0.step(r.size - 1, 7) do |i|
- result << r[i, 7]
- end
- result
- end
-
- def make_month_link(project, year, month, state = nil)
- ym = "%04d%02d" % [year, month]
- case state
- when :prev
- title = "&laquo; #{year}.#{month}"
- when :next
- title = "#{year}.#{month} &raquo;"
- else
- title = "#{project}::#{year}.#{month}"
- end
- url = "#{@script}/#{project}/#{ym}"
-
- if @backend.page_exists?(ym, project)
- VIEW_LINK % [url, title]
- else
- EDIT_LINK % [title, "#{url}/_edit"]
- end
- end
-
- def replace
- today = @match.captures[0]
- project = @match.captures[3] || @project
- now = Time.now
-
- if today.nil?
- year = @match.captures[1].to_i
- month = @match.captures[2].to_i
- else
- year = now.year
- month = now.month
- end
-
- if (year == now.year) and (month == now.month)
- show_today = now.day
- else
- show_today = nil
- end
-
- result = <<-"CALENDAR_HEAD"
-</p>
-<div class="rwtk_Calendar">
-<table class="rwtk_Calendar" summary="calendar for ::#{project}: #{year}.#{month}">
-<thead>
- CALENDAR_HEAD
-
- result << %Q{ <tr>\n<th colspan="7" class="rwtk_Calendar_current_month">}
- result << make_month_link(project, year, month)
- result << %Q{</th>\n </tr>\n <tr>\n<th colspan="2" class="rwtk_Calendar_prev_month">}
- result << make_month_link(project, year, month - 1, :prev)
- result << %Q{</th>\n<th colspan="3"></th>\n<th colspan="2" class="rwtk_Calendar_next_month">}
- result << make_month_link(project, year, month + 1, :next)
- result << "</th>\n"
-
- result << <<-"CALENDAR_HEAD2"
- </tr>
- <tr>
- <th class="rwtk_Calendar_weekend">Su</th>
- <th class="rwtk_Calendar_weekday">Mo</th>
- <th class="rwtk_Calendar_weekday">Tu</th>
- <th class="rwtk_Calendar_weekday">We</th>
- <th class="rwtk_Calendar_weekday">Th</th>
- <th class="rwtk_Calendar_weekday">Fr</th>
- <th class="rwtk_Calendar_weekend">Sa</th>
- </tr>
-</thead>
-<tbody>
- CALENDAR_HEAD2
-
- Calendar.make(year, month).each do |week|
- result << " <tr>\n"
- week.each do |day|
- if day.nil?
- result << %Q{ <td class="rwtk_Calendar_day"></td>\n}
- else
- date = "%04d%02d%02d" % [year, month, day]
- # Add the ability to create pages based on date here.
- if show_today == day
- result << %Q{ <td class="rwtk_Calendar_today">}
- else
- result << %Q{ <td class="rwtk_Calendar_day">}
- end
- if @backend.page_exists?(date, project)
- result << VIEW_LINK % ["#{@script}/#{project}/#{date}", day]
- else
- result << EDIT_LINK % [day, "#{@script}/#{project}/#{date}/_edit"]
- end
- result << %Q{</td>\n}
- end
- end
- result << " </tr>\n"
- end
-
- result << %Q(</tbody>\n</table>\n</div>\n<p class="rwtk_Paragraph">)
- result
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*>(\s*</?div(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?table(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?t(?:head|body|r)(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*<t[hd].+?</t[hd]>\s*)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/headings.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/headings.rb
deleted file mode 100644
index cfc3001..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/headings.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts headings.
- class Headings < Ruwiki::Wiki::Token
-# def self.rank
-# 5
-# end
-
- def self.regexp
- %r{^\\?(=+)\s+(.*)}
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def replace
- level = @match.captures[0].count("=")
- content = @match.captures[1]
- level = 6 if level > 6
- %Q(<h#{level} class="rwtk_Headings">#{content}</h#{level}>)
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(</h\d>)\n}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{(</h\d>)</p>\n<p>}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{<p[^>]*>(<h\d[^>]*>)}, '\1')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/lists.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/lists.rb
deleted file mode 100644
index 1615c2c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/lists.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Produces Lists
- class Lists < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?([*#]+)\s+(.*)$}
- end
-
- def replace
- indent = @match.captures[0].scan(/./).map { |ee| ee == "*" ? 'ul' : 'ol' }
- content = @match.captures[1]
-
- pre = ''
- post = ''
- indent.each { |elem| pre << %Q(<#{elem} class="rwtk_Lists">) }
- indent.reverse_each { |elem| post << %Q(</#{elem}>) }
- %Q(#{pre}<li class="rwtk_Lists">#{content}</li>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- RE_NESTED_LISTS = %r{</[uo]l>\s*<[uo]l[^>]*>}
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*><([uo]l[^>]*)>}, '<\1>')
- content.gsub!(%r{</([uo]l)></p>}, '</\1>')
- content.gsub!(RE_NESTED_LISTS, '') while content =~ RE_NESTED_LISTS
- content
- end
- end
-
- # Produces block quotes.
- class Blockquotes < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((:+)|(>+))(\s+.*)$}
- end
-
- def replace
- content = @match.captures[3]
-
- if @match.captures[2].nil?
- char = ':'
- cite = ''
- else
- char = '>'
- cite = ' type="cite"'
- end
- indent = @match.captures[0].count(char)
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<blockquote#{cite} class="rwtk_Blockquotes">)
- post << %Q(</blockquote>)
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1].gsub(/^>/, '&gt;')
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</blockquote>(\n|<br ?/?>)?<blockquote[^>]*>}, '')
- content.gsub!(%r{(</?blockquote[^>]*>\n?)\s*}, '\1')
- content.gsub!(%r{</blockquote>(<blockquote[^>]*>)+}, '\1')
- content
- end
- end
-
- # Produces definition lists. Does not completely work correctly.
- class Definitions < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(;+)\s+(.+?)\s+:\s+(.*)}
- end
-
- def replace
- definition = @match.captures[2]
- term = @match.captures[1]
- indent = @match.captures[0].count(';')
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<dl class="rwtk_Definitions">)
- post << %Q(</dl>)
- end
- %Q(#{pre}<dt class="rwtk_Definitions">#{term}</dt><dd class="rwtk_Definitions">#{definition}</dd>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</dl>(\n|<br ?/?>)?<dl[^>]*>}, '')
- content.gsub!(%r{</dl>(<dl[^>]*>)+}, '\1')
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/rubylists.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/rubylists.rb
deleted file mode 100644
index 520bedf..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/rubylists.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Convert ruby-talk mailing list references (e.g., [ruby-talk:12345])
- # into named links.
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- # Convert ruby-core/ext/dev/list/math mailing list references (e.g.,
- # [ruby-core:12345]) into named links.
- class OtherRubyLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-(list|doc|core|dev|ext|math):(\d+)\]}
- end
-
- def replace
- ln, lm = @match.captures[0..1]
- %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-#{ln}/#{lm}">#{@match[0]}</a>)
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/tar.rb b/ruwiki/tags/release-0.8.0-fixes/lib/tar.rb
deleted file mode 100644
index 0020397..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/tar.rb
+++ /dev/null
@@ -1,684 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# This file is based on and incorporating parts of RPA::Package (rpa-base's
-# lib/rpa/package.rb and lib/rpa/util.rb) by Marucio Julio Fernández Pradier,
-# copyright © 2004.
-#
-# This file is licensed under the following conditions [NOTE: this file does
-# not fall under condition 4; there is no LEGAL file to be concerned about]:
-#
-# You can redistribute it and/or modify it under either the terms of the GNU
-# General Public License, or:
-#
-# 1. You may make and give away verbatim copies of the source form of the
-# software without restriction, provided that you duplicate all of the
-# original copyright notices and associated disclaimers.
-#
-# 2. You may modify your copy of the software in any way, provided that you do
-# at least ONE of the following:
-#
-# a) place your modifications in the Public Domain or otherwise make them
-# Freely Available, such as by posting said modifications to Usenet or an
-# equivalent medium, or by allowing the author to include your
-# modifications in the software.
-# b) use the modified software only within your corporation or organization.
-# c) give non-standard binaries non-standard names, with instructions on
-# where to get the original software distribution.
-# d) make other distribution arrangements with the author.
-# 3. You may distribute the software in object code or binary form, provided
-# that you do at least ONE of the following:
-# a) distribute the binaries and library files of the software, together
-# with instructions (in the manual page or equivalent) on where to get
-# the original distribution.
-# b) accompany the distribution with the machine-readable source of the
-# software.
-# c) give non-standard binaries non-standard names, with instructions on
-# where to get the original software distribution.
-# d) make other distribution arrangements with the author.
-# 4. You may modify and include the part of the software into any other
-# software (possibly commercial). But some files in the distribution are
-# not written by the author, so that they are not under these terms.
-#
-# For the list of those files and their copying conditions, see the file
-# LEGAL.
-# 5. The scripts and library files supplied as input to or produced as output
-# from the software do not automatically fall under the copyright of the
-# software, but belong to whomever generated them, and may be sold
-# commercially, and may be aggregated with this software.
-# 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-#
-# $Id$
-#++
-
-require 'fileutils'
-require 'find'
-
-module Tar
- class NonSeekableIO < StandardError; end
- class ArgumentError < ::ArgumentError; end
- class ClosedIO < StandardError; end
- class BadCheckSum < StandardError; end
- class TooLongFileName < StandardError; end
- class InvalidMode < ::ArgumentError; end
- class BlockNeeded < StandardError; end
-
- module FSyncDir
- private
- def fsync_dir(dirname)
- # make sure this hits the disc
- begin
- dir = open(dirname, "r")
- dir.fsync
- rescue # ignore IOError if it's an unpatched (old) Ruby
- ensure
- dir.close if dir rescue nil
- end
- end
-
- def dir?(path)
- # Apparently fixes a corrupted stat() on Windows:
- File.directory?((path[-1] == ?/) ? path : "#{path}/")
- end
- end
-
- class Header
- FIELDS = [:name, :mode, :uid, :gid, :size, :mtime, :checksum, :typeflag,
- :linkname, :magic, :version, :uname, :gname, :devmajor,
- :devminor, :prefix]
- FIELDS.each { |x| attr_reader x }
-
- # The tarfile header:
- #
- # struct tarfile_entry_posix
- # {
- # char name[100]; // ASCII (+ Z unless filled) A100
- # char mode[8]; // 0 padded, octal, null A8
- # char uid[8]; // ditto A8
- # char gid[8]; // ditto A8
- # char size[12]; // 0 padded, octal, null A12
- # char mtime[12]; // 0 padded, octal, null A12
- # char checksum[8]; // 0 padded, octal, null, space A8
- # char typeflag[1]; // file: "0" dir: "5" A
- # char linkname[100]; // ASCII + (Z unless filled) A100
- # char magic[6]; // "ustar\0" A6
- # char version[2]; // "00" A2
- # char uname[32]; // ASCIIZ A32
- # char gname[32]; // ASCIIZ A32
- # char devmajor[8]; // 0 padded, octal, null A8
- # char devminor[8]; // o padded, octal, null A8
- # char prefix[155]; // ASCII (+ Z unless filled) A155
- # };
- HEADER_PACK_FORMAT = "A100A8A8A8A12A12A8AA100A6A2A32A32A8A8A155"
-
- def self.new_from_stream(stream)
- data = stream.read(512)
- fields = data.unpack(HEADER_PACK_FORMAT)
- name = fields.shift
- mode = fields.shift.oct
- uid = fields.shift.oct
- gid = fields.shift.oct
- size = fields.shift.oct
- mtime = fields.shift.oct
- checksum = fields.shift.oct
- typeflag = fields.shift
- linkname = fields.shift
- magic = fields.shift
- version = fields.shift.oct
- uname = fields.shift
- gname = fields.shift
- devmajor = fields.shift.oct
- devminor = fields.shift.oct
- prefix = fields.shift
-
- empty = (data == "\0" * 512)
-
- new(:name => name, :mode => mode, :uid => uid, :gid => gid,
- :size => size, :mtime => mtime, :checksum => checksum,
- :typeflag => typeflag, :magic => magic, :version => version,
- :uname => uname, :gname => gname, :devmajor => devmajor,
- :devminor => devminor, :prefix => prefix, :empty => empty)
- end
-
- def initialize(vals)
- unless vals[:name] && vals[:size] && vals[:prefix] && vals[:mode]
- raise Tar::ArgumentError
- end
-
- vals[:mtime] ||= 0
- vals[:checksum] ||= ""
- vals[:typeflag] ||= "0"
- vals[:magic] ||= "ustar "
- vals[:version] ||= "\0\0"
- vals[:devmajor]
- vals[:devminor]
-
- FIELDS.each { |x| instance_variable_set "@#{x.to_s}", vals[x] }
-
- @empty = vals[:empty]
- end
-
- def empty?
- @empty
- end
-
- def to_s
- update_checksum
- header(@checksum)
- end
-
- def update_checksum
- h = header(" " * 8)
- @checksum = oct(calculate_checksum(h), 6)
- end
-
- private
- def null_pad(val, len)
- if val.nil?
- "\0" * len
- else
- %Q|#{val}#{"\0" * (len - val.size + 1)}|
- end
- end
-
- def oct(num, len)
- if num.nil?
- "\0" * (len + 1)
- else
- "%0#{len}o" % num
- end
- end
-
- def calculate_checksum(hdr)
- hdr.unpack("C*").inject { |a, b| a + b }
- end
-
- def header(chksum)
- arr = [null_pad(name, 100), oct(mode, 7), oct(uid, 7), oct(gid, 7),
- oct(size, 11), oct(mtime, 11), chksum, typeflag,
- null_pad(linkname, 100), null_pad(magic, 8), version,
- null_pad(uname, 32), null_pad(gname, 32), oct(devmajor, 7),
- oct(devminor, 7), null_pad(prefix, 155)]
- str = arr.pack(HEADER_PACK_FORMAT)
- str + "\0" * ((512 - str.size) % 512)
- end
- end
-
- class Writer
- class FileOverflow < StandardError; end
-
- class BoundedStream
- attr_reader :limit, :written
-
- def initialize(io, limit)
- @io = io
- @limit = limit
- @written = 0
- end
-
- def write(data)
- if data.size + @written > @limit
- raise FileOverflow,
- "You tried to feed more data than fits in the file."
- end
- @io.write data
- @written += data.size
- data.size
- end
- end
-
- class RestrictedStream
- def initialize(anIO)
- @io = anIO
- end
-
- def write(data)
- @io.write data
- end
- end
-
- def self.new(anIO)
- writer = super(anIO)
-
- return writer unless block_given?
-
- begin
- yield writer
- ensure
- writer.close
- end
-
- nil
- end
-
- def initialize(anIO)
- @io = anIO
- @closed = false
- end
-
- def add_file_simple(name, mode, size)
- raise BlockNeeded unless block_given?
- raise ClosedIO if @closed
-
- name, prefix = split_name(name)
-
- header = Header.new(:name => name, :mode => mode, :size => size,
- :prefix => prefix).to_s
-
- @io.write header
-
- os = BoundedStream.new(@io, size)
- yield os
- #FIXME: what if an exception is raised in the block?
-
- min_padding = size - os.written
- @io.write("\0" * min_padding)
- remainder = (512 - (size % 512)) % 512
- @io.write("\0" * remainder)
- end
-
- def add_file(name, mode)
- raise BlockNeeded unless block_given?
- raise ClosedIO if @closed
- raise NonSeekableIO unless @io.respond_to?(:pos=)
-
- name, prefix = split_name(name)
- init_pos = @io.pos
- @io.write "\0" * 512 # placeholder for the header
-
- yield RestrictedStream.new(@io)
- #FIXME: what if an exception is raised in the block?
-
- size = @io.pos - init_pos - 512
- remainder = (512 - (size % 512)) % 512
- @io.write("\0" * remainder)
- final_pos = @io.pos
- @io.pos = init_pos
-
- header = Header.new(:name => name, :mode => mode, :size => size,
- :prefix => prefix).to_s
-
- @io.write header
- @io.pos = final_pos
- end
-
- def mkdir(name, mode)
- raise ClosedIO if @closed
- name = "#{name}/" if name[-1] != ?/
- name, prefix = split_name(name)
- header = Header.new(:name => name, :mode => mode, :typeflag => "5",
- :size => 0, :prefix => prefix).to_s
- @io.write header
- nil
- end
-
- def flush
- raise ClosedIO if @closed
- @io.flush if @io.respond_to?(:flush)
- end
-
- def close
- return if @closed
- @io.write "\0" * 1024
- @closed = true
- end
-
- private
- def split_name name
- raise TooLongFileName if name.size > 256
- if name.size <= 100
- prefix = ""
- else
- parts = name.split(/\//)
- newname = parts.pop
-
- nxt = ""
-
- loop do
- nxt = parts.pop
- break if newname.size + 1 + nxt.size > 100
- newname = "#{nxt}/#{newname}"
- end
-
- prefix = (parts + [nxt]).join("/")
-
- name = newname
-
- raise TooLongFileName if name.size > 100 || prefix.size > 155
- end
- return name, prefix
- end
- end
-
- class Reader
- class UnexpectedEOF < StandardError; end
-
- module InvalidEntry
- def read(len = nil); raise ClosedIO; end
- def getc; raise ClosedIO; end
- def rewind; raise ClosedIO; end
- end
-
- class Entry
- Header::FIELDS.each { |x| attr_reader x }
-
- def initialize(header, anIO)
- @io = anIO
- @name = header.name
- @mode = header.mode
- @uid = header.uid
- @gid = header.gid
- @size = header.size
- @mtime = header.mtime
- @checksum = header.checksum
- @typeflag = header.typeflag
- @linkname = header.linkname
- @magic = header.magic
- @version = header.version
- @uname = header.uname
- @gname = header.gname
- @devmajor = header.devmajor
- @devminor = header.devminor
- @prefix = header.prefix
- @read = 0
- @orig_pos = @io.pos
- end
-
- def read(len = nil)
- return nil if @read >= @size
- len ||= @size - @read
- max_read = [len, @size - @read].min
- ret = @io.read(max_read)
- @read += ret.size
- ret
- end
-
- def getc
- return nil if @read >= @size
- ret = @io.getc
- @read += 1 if ret
- ret
- end
-
- def is_directory?
- @typeflag == "5"
- end
-
- def is_file?
- @typeflag == "0"
- end
-
- def eof?
- @read >= @size
- end
-
- def pos
- @read
- end
-
- def rewind
- raise NonSeekableIO unless @io.respond_to?(:pos=)
- @io.pos = @orig_pos
- @read = 0
- end
-
- alias_method :is_directory, :is_directory?
- alias_method :is_file, :is_file
-
- def bytes_read
- @read
- end
-
- def full_name
- if @prefix != ""
- File.join(@prefix, @name)
- else
- @name
- end
- end
-
- def close
- invalidate
- end
-
- private
- def invalidate
- extend InvalidEntry
- end
- end
-
- def self.new(anIO)
- reader = super(anIO)
- return reader unless block_given?
- begin
- yield reader
- ensure
- reader.close
- end
- nil
- end
-
- def initialize(anIO)
- @io = anIO
- @init_pos = anIO.pos
- end
-
- def each(&block)
- each_entry(&block)
- end
-
- # do not call this during a #each or #each_entry iteration
- def rewind
- if @init_pos == 0
- raise NonSeekableIO unless @io.respond_to?(:rewind)
- @io.rewind
- else
- raise NonSeekableIO unless @io.respond_to?(:pos=)
- @io.pos = @init_pos
- end
- end
-
- def each_entry
- loop do
- return if @io.eof?
- header = Header.new_from_stream(@io)
- return if header.empty?
- entry = Entry.new header, @io
- size = entry.size
- yield entry
- skip = (512 - (size % 512)) % 512
- if @io.respond_to?(:seek)
- # avoid reading...
- @io.seek(size - entry.bytes_read, IO::SEEK_CUR)
- else
- pending = size - entry.bytes_read
- while pending > 0
- bread = @io.read([pending, 4096].min).size
- raise UnexpectedEOF if @io.eof?
- pending -= bread
- end
- end
- @io.read(skip) # discard trailing zeros
- # make sure nobody can use #read, #getc or #rewind anymore
- entry.close
- end
- end
-
- def close
- end
- end
-
- class Input
- include FSyncDir
- include Enumerable
-
- class << self
- private :new
-
- def open(input)
- raise BlockRequired unless block_given?
-
- is = new(input)
- yield is
- return nil
- ensure
- is.close if is
- end
- end
-
- def initialize(input)
- if input.respond_to?(:read)
- @io = input
- else
- @io = open(filename, "rb")
- end
- @tarreader = Tar::Reader.new(@io)
- end
-
- def each(&block)
- @tarreader.each { |entry| yield entry }
- ensure
- @tarreader.rewind
- end
-
- def extract_entry(destdir, entry, expected_md5sum = nil)
- if entry.is_directory?
- dest = File.join(destdir, entry.full_name)
- if dir?(dest)
- begin
- FileUtils.chmod(entry.mode, dest)
- rescue Exception
- nil
- end
- else
- FileUtils.mkdir_p(dest, :mode => entry.mode)
- end
- fsync_dir(dest)
- fsync_dir(File.join(dest, ".."))
- return
- else # it's a file
- md5 = Digest::MD5.new if expected_md5sum
- destdir = File.join(destdir, File.dirname(entry.full_name))
- FileUtils.mkdir_p(destdir, :mode => 0755)
- destfile = File.join(destdir, File.basename(entry.full_name))
- FileUtils.chmod(0600, destfile) rescue nil # Errno::ENOENT
- File.open(destfile, "wb", entry.mode) do |os|
- loop do
- data = entry.read(4096)
- break unless data
- md5 << data if expected_md5sum
- os.write(data)
- end
- os.fsync
- end
- FileUtils.chmod(entry.mode, destfile)
- fsync_dir(File.dirname(destfile))
- fsync_dir(File.join(File.dirname(destfile), ".."))
- if expected_md5sum && expected_md5sum != md5.hexdigest
- raise BadCheckSum
- end
- end
- end
-
- def close
- @io.close
- @tarreader.close
- end
- end
-
- class Output
- class << self
- private :new
-
- def open(output, &block)
- raise BlockNeeded unless block
- outputter = new(output)
-
- yield outputter.external_handle
- return nil
- ensure
- outputter.close if outputter
- end
- end
-
- def initialize(output)
- if output.respond_to?(:write)
- @io = output
- else
- @io = ::File.open(output, "wb")
- end
- @external = Tar::Writer.new(@io)
- end
-
- def external_handle
- @external
- end
-
- def close
- @external.close
- @io.close
- end
- end
-
- class << self
- include FSyncDir
-
- def open(dest, mode = "r", &block)
- raise BlockNeeded unless block
-
- case mode
- when "r"
- Input.open(dest, &block)
- when "w"
- Output.open(dest, &block)
- else
- raise "Unknown TarFile open mode"
- end
- end
-
- def pack_entry(entry, outputter)
- entry = entry.sub(%r{\./}, '')
- stat = File.stat(entry)
- case
- when File.file?(entry)
- outputter.add_file_simple(entry, stat.mode, stat.size) do |os|
- File.open(entry, "rb") { |f| os.write(f.read(4096)) until f.eof? }
- end
- when dir?(entry)
- outputter.mkdir(entry, stat.mode)
- else
- raise "Don't yet know how to pack this type of file."
- end
- end
-
- def pack(src, dest)
- Output.open(dest) do |outp|
- if src.kind_of?(String)
- Find.find(src) { |entry| pack_entry(entry, outp) }
- else
- src.each do |ee|
- Find.find(ee) { |entry| pack_entry(entry, outp) }
- end
- end
- end
- end
-
- def unpack(src, dest, files = [])
- Input.open(src) do |inp|
- if File.exist?(dest) and (not dir?(dest))
- raise "Can't unpack to a non-directory."
- elsif not File.exist?(dest)
- FileUtils.mkdir_p(dest)
- end
-
- inp.each { |entry| inp.extract_entry(dest, entry) }
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/ruwiki.cgi b/ruwiki/tags/release-0.8.0-fixes/ruwiki.cgi
deleted file mode 100644
index 20ddbb1..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/ruwiki.cgi
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-begin
- require 'ruwiki'
-rescue LoadError
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib"
- require 'ruwiki'
-end
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-wiki.config.webmaster = "webmaster@domain.com"
-
-# wiki.config.debug = false
-# wiki.config.title = "Ruwiki"
-# wiki.config.default_page = "ProjectIndex"
-# wiki.config.default_project = "Default"
- # This next defaults to :flatfiles for Ruby 1.8.1 or earlier and to :yaml for
- # Ruby 1.8.2 or later.
-# wiki.config.storage_type = :flatfiles
-# wiki.config.storage_options[wiki.config.storage_type][:data_path] = "./data/"
-wiki.config.storage_options[wiki.config.storage_type][:extension] = "ruwiki"
-# wiki.config.template_path = "./templates/"
-# wiki.config.template_set = "default"
-# wiki.config.css = "ruwiki.css"
-# wiki.config.time_format = "%H:%M:%S"
-# wiki.config.date_format = "%Y.%m.%d"
-# wiki.config.datetime_format = "%Y.%m.%d %H:%M:%S"
-wiki.config = wiki.config
-
-wiki.run
diff --git a/ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet b/ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet
deleted file mode 100644
index 1c835a8..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet
+++ /dev/null
@@ -1,245 +0,0 @@
-#!/usr/bin/env ruby
-
- # Customize this if you put the RuWiki files in a different location.
-require 'webrick'
-
-begin
- require 'ruwiki'
-rescue LoadError
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib"
- require 'ruwiki'
-end
-
-require 'ruwiki/servlet'
-require 'ruwiki/lang/en'
-require 'ruwiki/lang/de'
-require 'ruwiki/lang/es'
-
-require 'optparse'
-require 'ostruct'
-
-copyright_banner = <<-"COPYRIGHT"
-Ruwiki #{Ruwiki::VERSION}
- Copyright © 2002 - 2004, Digikata and HaloStatue
-
- http://rubyforge.org/projects/ruwiki/
-
- Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-
-Licensed under the same terms as Ruby.
-
-$Id$
-COPYRIGHT
-
- # This is for the WEBrick version of Ruwiki. This has been abstracted to
- # accept a Config global variable to reconfigure Ruwiki after initial
- # creation.
-$config = Ruwiki::Config.new
-
- # Because the servlet can be started from the command-line, provide defaults
- # for all possible configuration options.
-opts = OpenStruct.new
-opts.port = 8808
-opts.addresses = []
-opts.mount = '/'
-opts.do_log = true
-opts.log_dest = $stderr
-opts.threads = 1
-opts.language = Ruwiki::Lang::EN
-
- # Ruwiki::Config options.
-opts.webmaster = 'webmaster@domain.com'
-opts.debug = false
-opts.title = "Ruwiki"
-opts.default_page = "ProjectIndex"
-opts.default_project = "Default"
-opts.template_path = "./templates/"
-opts.template_set = "default"
-opts.css = "ruwiki.css"
-opts.time_format = "%H:%M:%S"
-opts.date_format = "%Y.%m.%d"
-opts.datetime_format = "%Y.%m.%d %H:%M:%S"
-
-# if RUBY_VERSION >= "1.8.2"
-# opts.storage_type = :yaml
-# else
-# opts.storage_type = :flatfiles
-# end
- # Temporarily disabled the above.
-opts.storage_type = :flatfiles
-
-opts.storage_options = Hash.new { |h, k| h[k] = {} }
-opts.storage_options[opts.storage_type][:data_path] = "./data/"
-opts.storage_options[opts.storage_type][:extension] = "ruwiki"
-
-ARGV.options do |o|
- o.banner = "Usage: #{File.basename($0)} [options]"
- o.separator ""
- o.separator "WEBrick options:"
- o.on('-P', '--port PORT', Numeric, 'Runs the Ruwiki servlet on the specified', 'port. Default 8808.') { |port|
- opts.port = port
- }
- o.on('-A', '--accept ADDRESS,ADDRESS,ADDRESS', Array, 'Restricts the Ruwiki servlet to accepting', 'connections from the specified address or', '(comma-separated) addresses. May be', 'specified multiple times. Defaults to all', 'addresses.') { |address|
- opts.addresses += address
- }
- o.on('-L', '--local', 'Restricts the Ruwiki servlet to accepting', 'only local connections (127.0.0.1).', 'Overrides any previous --accept addresses.') { |local|
- opts.addresses = ["127.0.0.1"]
- }
- o.on('-M', '--mount MOUNT-POINT', 'The relative URI from which Ruwiki ', 'will be accessible. Defaults to "/".') { |mp|
- opts.mount = mp
- }
- o.on('--[no-]log', 'Log WEBrick activity. Default is --log.') { |log|
- opts.do_log = log
- }
- o.on('--logfile LOGFILE', 'The file to which WEBrick logs are', 'written. Default is standard error.') { |lf|
- opts.log_dest = lf
- }
- o.on('-T', '--threads THREADS', Integer, 'Sets the WEBrick threadcount.') { |tc|
- opts.threads = tc
- }
- o.separator ""
- o.separator "Ruwiki options:"
- o.on('--language LANGUAGE', 'The interface language for Ruwiki.', 'Defaults to "en". May be "en", "de", or', '"es".') { |lang|
- case lang
- when 'en'
- opts.language = Ruwiki::Lang::EN
- when 'es'
- opts.language = Ruwiki::Lang::ES
- when 'de'
- opts.language = Ruwiki::Lang::DE
- end
- }
- o.on('--webmaster WEBMASTER', 'The Ruwiki webmaster email address.', 'Defaults to "webmaster@domain.com".') { |wm|
- opts.webmaster = wm
- }
- o.on('--[no-]debug', 'Turns on Ruwiki debugging. Defaults', 'to --no-debug.') { |d|
- opts.debug = d
- }
- o.on('--title TITLE', 'Provides the Ruwiki title. Default is', '"Ruwiki".') { |t|
- opts.title = t
- }
- o.on('--default-page PAGENAME', 'An alternate default page. Default is', '"ProjectIndex".') { |dp|
- opts.default_page = dp
- }
- o.on('--default-project PAGENAME', 'An alternate default project. Default is', '"Default".') { |dp|
- opts.default_project = dp
- }
- o.on('--template-path TEMPLATE_PATH', 'The location of Ruwiki templates. Default', 'is "./templates".') { |tp|
- opts.template_path = tp
- }
- o.on('--templates TEMPLATES', 'The name of the Ruwiki templates. Default', 'is "default".') { |tp|
- opts.template_set = tp
- }
- o.on('--css CSS_NAME', 'The name of the CSS file in the template', 'path. Default is "ruwiki.css".') { |css|
- opts.css = css
- }
- o.on('--storage-type TYPE', Ruwiki::KNOWN_BACKENDS, 'Select the storage type:', "#{Ruwiki::KNOWN_BACKENDS.join(", ")}") { |st|
- opts.storage_type = st
- opts.storage_options[opts.storage_type][:data_path] ||= "./data/"
- opts.storage_options[opts.storage_type][:extension] ||= "ruwiki"
- }
- o.on('--flatfiles-data-path PATH', 'The path where data files are stored.', 'Default is "./data".') { |fdp|
- opts.storage_options[:flatfiles][:data_path] = fdp
- opts.storage_options[:yaml][:data_path] = fdp
- opts.storage_options[:marshal][:data_path] = fdp
- }
- o.on('--flatfiles-extension EXT', 'The extension for data files.', 'Default is "ruwiki".') { |ext|
- opts.storage_options[:flatfiles][:extension] = ext
- opts.storage_options[:yaml][:extension] = ext
- opts.storage_options[:marshal][:extension] = ext
- }
-
- # TODO: Add options for time, date, and datetime formats.
- o.separator ""
- o.separator "General info:"
- o.on_tail('--help', 'Shows this text.') {
- $stderr.puts o
- exit
- }
- o.on_tail('--version', 'Shows the version of Ruwiki.') {
- $stderr.puts copyright_banner
- exit
- }
- o.parse!
-end
-
- # Configuration defaults to certain values. This overrides the defaults. The
- # webmaster.
-$config.webmaster = opts.webmaster
-$config.debug = opts.debug
-$config.title = opts.title
-$config.default_page = opts.default_page
-$config.default_project = opts.default_project
-$config.storage_type = opts.storage_type
-$config.storage_options[opts.storage_type] = opts.storage_options[opts.storage_type]
-$config.template_path = opts.template_path
-$config.template_set = opts.template_set
-$config.css = opts.css
-$config.time_format = opts.time_format
-$config.date_format = opts.date_format
-$config.datetime_format = opts.datetime_format
-$config.language = opts.language
-
- # If the list of accepted addresses is not empty, provide IP-based
- # restrictions.
-if not opts.addresses.empty?
- localonly = proc do |sock|
- if not opts.addresses.include?(sock.peeraddr[3])
- msg = "Rejected peer address #{sock.peeraddr[3]}. Connections are only accepted from: #{opts.addresses.join(", ")}."
- raise WEBrick::ServerError, msg
- end
- end
-else
- localonly = nil
-end
-
-if opts.do_log
- if opts.log_dest = $stderr
- dest = $stderr
- opts.log_dest = "stderr"
- else
- dest = File.open(opts.log_dest, "wb+")
- end
- logger = WEBrick::Log.new(dest, WEBrick::Log::DEBUG)
-else
- logger = nil
-end
-
-banner = <<-"BANNER"
-#{copyright_banner}
-
-WEBrick options:
- Port #{opts.port}
- Accepted Addresses #{opts.addresses.join(", ")}
- Mount Point #{opts.mount}
- Logging? #{opts.do_log}
- Log Destination #{opts.log_dest}
- Threads #{opts.threads}
-
-Ruwiki options:
- Webmaster #{opts.webmaster}
- Debugging? #{opts.debug}
- Title #{opts.title}
- Default Project #{opts.default_project}
- Default Page #{opts.default_page}
- Template Path #{opts.template_path}
- Template Set #{opts.template_set}
- CSS Source #{opts.css}
-
- Storage Type #{opts.storage_type}
- Data Path #{opts.storage_options[opts.storage_type][:data_path]}
- Extension #{opts.storage_options[opts.storage_type][:extension]}
-
-BANNER
-
-banner.each { |b| logger.info(b) } unless logger.nil?
-
-server = WEBrick::HTTPServer.new(:Port => opts.port.to_i,
- :StartThreads => opts.threads.to_i,
- :AcceptCallback => localonly,
- :Logger => logger)
-$config.logger = logger
-server.mount(opts.mount, Ruwiki::Servlet)
-trap("INT") { server.shutdown; exit }
-server.start
diff --git a/ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet.bat b/ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet.bat
deleted file mode 100644
index 32012f7..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet.bat
+++ /dev/null
@@ -1,17 +0,0 @@
-@echo off
-REM Ruwiki 0.8.0
-REM Copyright © 2002 - 2004, Digikata and HaloStatue
-REM Alan Chen (alan@digikata.com)
-REM Austin Ziegler (ruwiki@halostatue.ca)
-REM
-REM Licensed under the same terms as Ruby.
-REM $Id$
-REM
-if "%OS%"=="Windows_NT" goto WinNT
-ruby -x "ruwiki_servlet" %1 %2 %3 %4 %5 %6 %7 %8 %9
-goto done
-:WinNT
-title Ruwiki
-ruby -x "ruwiki_servlet" %*
-goto done
-:done
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/body.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/body.tmpl
deleted file mode 100644
index 2f3c10f..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/content.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/content.tmpl
deleted file mode 100644
index 63b638a..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/content.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/controls.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/controls.tmpl
deleted file mode 100644
index 1137336..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/controls.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_header">
- <form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- <!-- Right-hand tabs must go in reverse order! -->
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10">
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/edit.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/edit.tmpl
deleted file mode 100644
index 02f21e4..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/edit.tmpl
+++ /dev/null
@@ -1,26 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_navbar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_navbar_righttab" id="rw_editing_tab"><strong><em>#label_editing#</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/error.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/error.tmpl
deleted file mode 100644
index a3887b2..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/error.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/footer.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/footer.tmpl
deleted file mode 100644
index 2f0fdbc..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/footer.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_footer">
- <form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- <!-- Right-hand tabs must go in reverse order! -->
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10">
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/ruwiki.css b/ruwiki/tags/release-0.8.0-fixes/templates/default/ruwiki.css
deleted file mode 100644
index 5c612e8..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/ruwiki.css
+++ /dev/null
@@ -1,285 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_footer
-{
- position: absolute;
- width: 100%;
- bottom: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_footer { position: fixed; }
-
-body > div#rw_footer > .rw_navbar { position: fixed; bottom: 0; }
-body > div#rw_footer > .rw_navbar > div { position: relative; top: -2em; }
-
-body
-{
- margin: 0.5em;
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_navbar
-{
- width: 100%;
- margin: 0;
- padding: 0.1em;
- font-size: 0.7em;
- border: 1px solid black;
- color: white;
- background-color: #27C;
- height: 0.5em;
- z-index: 2;
-}
-
-.rw_navbar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_navbar a:visited
-{
- color: #2E7;
- font-weight: normal;
- border-bottom: 1px dashed #2E7;
-}
-
-.rw_navbar a:hover
-{
- text-decoration: none;
-}
-
-.rw_navbar_tab
-{
- float: left;
- background-color: #27C;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_navbar_tab:hover
-{
- background-color: #49E;
-}
-
-.rw_navbar_righttab
-{
- float: right;
- padding-left: 0.8em;
- padding-top: 0.3em;
- padding-right: 0.8em;
- border: 1px solid #059;
- background-color: #27C;
- margin: 0 0.3em;
- height: 2em;
-}
-
-.rw_navbar_righttab:hover
-{
- background-color: #49E;
-}
-
-.rw_content
-{
- clear: both;
- margin-top: 2em;
- margin-left: 3em;
- margin-right: 3em;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #27C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #27C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab { background-color: #C72; }
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- background-color: #999;
- border: 1px solid black;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
-
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/save.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/save.tmpl
deleted file mode 100644
index 04069b1..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/body.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/body.tmpl
deleted file mode 100644
index 2f3c10f..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/content.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/content.tmpl
deleted file mode 100644
index 1d3ca9c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/content.tmpl
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/controls.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/controls.tmpl
deleted file mode 100644
index 6e12b22..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_titlebar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_titlebar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/edit.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/edit.tmpl
deleted file mode 100644
index 2604b01..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/edit.tmpl
+++ /dev/null
@@ -1,26 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_titlebar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_titlebar_tab" id="rw_editing_tab"><strong><em>#label_editing#</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content_edit">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/error.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/error.tmpl
deleted file mode 100644
index 5a2882e..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/error.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/footer.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/footer.tmpl
deleted file mode 100644
index f43eb32..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/footer.tmpl
+++ /dev/null
@@ -1,22 +0,0 @@
-<div class="rw_footer">
- <form class="rw_footer_tab" action="_search">
- <div>
- <input class="rw_search_box" type="text" name="q" size="10">
- </div>
- <div>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- </div>
- </form>
- <div class="rw_footer_tab">
- <dl>
- <dt>%page_project%::</dt>
- <dd><a href="%cgi_url%/%page_project%/_topics">#label_topics#</a><br />
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </dd>
- </div>
- <div class="rw_footer_tab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/ruwiki.css b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/ruwiki.css
deleted file mode 100644
index 5e9cf4f..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/ruwiki.css
+++ /dev/null
@@ -1,336 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
-.rw_titlebar
-{
- margin: 0 auto;
- height: 0.5em;
-}
-
- /* Normal styling from here on out. */
-body
-{
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_titlebar
-{
- font-size: 0.7em;
- border: 1px solid #059;
- color: white;
- background-color: #5C9;
- height: 0.5em;
- width: 100%;
-}
-
-.rw_titlebar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_titlebar a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_titlebar a:hover
-{
- text-decoration: none;
-}
-
-.rw_titlebar_tab
-{
- float: left;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_titlebar_tab:hover
-{
- background-color: #4E9;
-}
-
-div.rw_footer
-{
- position: fixed;
- left: 72%;
- width: 20%;
- height: 100%;
- padding: 0.2em;
- padding-top: 0.5em;
-//background-color: #95C;
- font-size: 0.9em;
-}
-
-.rw_footer
-{
-}
-
-.rw_footer a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_footer a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_footer a:hover
-{
- text-decoration: none;
-}
-
-.rw_footer_tab
-{
- color: yellow;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0.3em;
- min-height: 2em;
- clear: both;
-}
-
-.rw_footer_tab div
-{
- text-align: right;
-}
-
-div#rw_content
-{
- padding: 50px 0 0 0;
- margin-left: 0;
- voice-family: "\"}\""; /* fake out IE5/Win */
- voice-family: inherit;
- margin-left: 16px;
-}
-
-body > div#rw_content
-{
- margin-left: 0;
-}
-
-.rw_content
-{
- padding-top: 0;
- margin-left: 3em;
- width: 65%;
- float: left;
-}
-
-.rw_content_edit
-{
- width: 90%;
- margin: 0 auto;
- padding: 2em;
- padding-top: 0;
- float: left;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #59C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #59C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #59C;
- margin: 0.1em;
-}
-
-.rw_search_box
-{
- border: 1px dotted #59C;
- width: 100%;
- margin: 0.1em;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab
-{
- background-color: #C72;
- text-align: right;
- margin-right: 2em;
- float: right;
-}
-
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- background-color: #999;
- border: 1px solid black;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/save.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/save.tmpl
deleted file mode 100644
index 7c4c31c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/save.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-<div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/body.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/body.tmpl
deleted file mode 100644
index b3281d0..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/body.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/content.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/content.tmpl
deleted file mode 100644
index 1ba8ef7..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/content.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/controls.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/controls.tmpl
deleted file mode 100644
index 29cdf3a..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <a href="%cgi_url%/%page_project%/">%page_project%</a>
- &raquo;
- %page_topic%
- [?editable|<a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">[#label_edit#]</a>?]
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/edit.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/edit.tmpl
deleted file mode 100644
index b427114..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/edit.tmpl
+++ /dev/null
@@ -1,24 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <strong>%page_topic%</strong>
- &raquo;
- <strong>%page_project%</strong>
- [<strong><em>#label_editing#</em></strong>]
-</div>
-
-<div class="rw_content">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/error.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/error.tmpl
deleted file mode 100644
index ac898ea..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/error.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- |
- <strong><em>%name%</em></strong>
-</div>
-<div class="rw_content">
-<h1>%name%</h1>
-<p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
-<p>%backtrace%</p>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/footer.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/footer.tmpl
deleted file mode 100644
index dcd65ef..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/footer.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<form class="rw_navbar" action="_search">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- |
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>,
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- |
- <input class="rw_search_box" type="text" name="q" size="10">
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
-</form>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/ruwiki.css b/ruwiki/tags/release-0.8.0-fixes/templates/simple/ruwiki.css
deleted file mode 100644
index 0c80c74..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/ruwiki.css
+++ /dev/null
@@ -1,181 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #fafafa;
-}
-
-.rw_navbar
-{
- font-weight: bold;
- font-size: 1.1em;
- padding: 0.3em;
-}
-
-.rw_navbar a
-{
- border-bottom: 1px dashed black;
- font-weight: bold;
-}
-.rw_navbar a:visited
-{
- color: maroon;
- border-bottom: 1px dashed maroon;
-}
-.rw_navbar a:hover { background-color: #afafaf; }
-
-.rw_content
-{
- background-color: white;
- border: 1px dashed grey;
- padding: 0.5em;
- margin-left: 1em;
- margin-right: 1em;
-}
-
-.rw_edit_content
-{
- border: 1px solid black;
- padding: 0.3em;
- width: 95%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px solid black;
- padding: 0.3em;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px solid black;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form { }
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px solid black;
-}
-
-.rw_pagelink { text-decoration: none; }
-.rw_projectxlink { }
-.rw_projectindex { }
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title { }
-
-.rw_edit_format div
-{
-}
-
-.rw_search_button
-{
- border: 1px solid black;
-}
-
-.rw_search_box
-{
- border: 1px solid black;
-}
-
-.rw_search_box:hover { }
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_saved_page_announcement { }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- background-color: #EEE;
- border: 1px solid black;
-}
-.rwtk_Image { border: none; }
-.rwtk_NumberedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_NamedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_ExternalLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_RubyTalkLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_OtherRubyLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dashed grey; }
-.rwtk_WikiLink { text-decoration: none; }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/save.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/save.tmpl
deleted file mode 100644
index 51de9f4..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/harness-cgi.rb b/ruwiki/tags/release-0.8.0-fixes/tests/harness-cgi.rb
deleted file mode 100644
index a0e9604..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/harness-cgi.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'harness'
-
-ENV["REQUEST_METHOD"] = "HEAD"
-
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_type = :flatfiles
-$wiki.config.storage_options[:flatfiles][:data_path] = "../data"
-$wiki.config.storage_options[:flatfiles][:extension] = "ruwiki"
-$wiki.config.template_path = "../templates/"
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/harness.rb b/ruwiki/tags/release-0.8.0-fixes/tests/harness.rb
deleted file mode 100644
index 3e65272..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/harness.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-$LOAD_PATH.unshift("../lib")
-
-ENV["REQUEST_METHOD"] = "HEAD"
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_type = :flatfiles
-$wiki.config.storage_options[:flatfiles][:data_path] = "../data"
-$wiki.config.storage_options[:flatfiles][:extension] = "ruwiki"
-$wiki.config.template_path = "../templates/"
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/tc_backend_flatfile.rb b/ruwiki/tags/release-0.8.0-fixes/tests/tc_backend_flatfile.rb
deleted file mode 100644
index 6b9969b..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/tc_backend_flatfile.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-require 'fileutils'
-
-class TestBackendFlatfiles < Test::Unit::TestCase
- def setup
- @ffopts = { :data_path => "./test/data", :extension => nil }
-
- # generate a database
- raise "Setup Error: #{@ffopts[:data_path]} exists" if File.exists?(@ffopts[:data_path])
-
- @flatbase = {
- 'Proj1' => ['ProjectIndex:all projects must have this',
- 'P1TopicOne:this is the content',
- 'P1TopicTwo:more content'],
- 'Proj2' => ['ProjectIndex:all projects must have this',
- 'P2TopicOne:this is the content',
- 'P2TopicTwo:more content',
- 'P2TopicThree:even more more content']
- }
-
- @flatbase.each do |key, val|
- prjdir = "#{@ffopts[:data_path]}/#{key}"
- FileUtils.mkdir_p(prjdir) rescue nil
- val.each do |topcon|
- topic, content = topcon.split(":")
- File.open("#{prjdir}/#{topic}", "w") { |fh| fh.puts "page!content: #{content}" }
- end
- end
-
- @backend = nil
- @pg = nil
- end
-
- def teardown
- # remove testing flatabase
- FileUtils.rm_rf(@ffopts[:data_path])
- Dir.rmdir("./test") # ugly but it works
- end
-
- def test_list_projects
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- # should be ['Proj1', 'Proj2']
- assert_equal(@flatbase.keys, @backend.list_projects)
- end
-
- def test_list_topics
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- @flatbase.keys.sort.each do |proj|
- got_topics = @backend.list_topics(proj)
- exp_topics = @flatbase[proj].map { |ent| ent.split(':')[0] }
- assert_equal(exp_topics.sort, got_topics.sort)
- end
- end
-
- # test simple one word lookups
- # need to add more complex search strings
- def test_search_project
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- assert_equal({'ProjectIndex' => 1,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 0 }.to_a.sort,
- @backend.search_project('Proj1', 'this').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 0,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'more').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'topic').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'content').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P2TopicOne' => 0,
- 'P2TopicTwo' => 1,
- 'P2TopicThree' => 2 }.to_a.sort,
- @backend.search_project('Proj2', 'more').to_a.sort)
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/tc_bugs.rb b/ruwiki/tags/release-0.8.0-fixes/tests/tc_bugs.rb
deleted file mode 100644
index 4f6b3d0..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/tc_bugs.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-
-# see if we can reproduce the LicenseandAuthor hang
-# described in bug id 147 on rubyforge
-class TC_LicenseAndAuthorHang < Test::Unit::TestCase
- def setup
- @ffopts = { :data_path => "../data" }
-
- @backend = nil
- @pg = nil
- end
-
- # load "to the metal"
- def test_ffload
- assert_nothing_raised do
- @backend = ::Ruwiki::Backend::Flatfiles.new(@ffopts)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.load('LicenseAndAuthorInfo.ruwiki', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-
- # abstract backend retreive
- def test_beload
- @backend = nil
- assert_nothing_raised do
- mock_ruwiki = OpenStruct.new
- mock_ruwiki.config = OpenStruct.new
- mock_ruwiki.config.message = {}
- mock_ruwiki.config.storage_options = { :flatfiles => @ffopts }
-
- @backend = ::Ruwiki::BackendDelegator.new(mock_ruwiki, :flatfiles)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.retrieve('LicenseAndAuthorInfo', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-end
-
-# if __FILE__ == $0
-# ObjectSpace.each_object { |o| tests << o if o.kind_of?(Class) }
-# tests.delete_if { |o| !o.ancestors.include?(Test::Unit::TestCase) }
-# tests.delete_if { |o| o == Test::Unit::TestCase }
-
-# tests.each { |test| Test::Unit::UI::Console::TestRunner.run(test) }
-# end
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/tc_exportable.rb b/ruwiki/tags/release-0.8.0-fixes/tests/tc_exportable.rb
deleted file mode 100644
index 4dc60d1..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/tc_exportable.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-if __FILE__ == $0
- $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib")
- class Ruwiki; end
-end
-
-require 'ruwiki/exportable'
-require 'test/unit'
-
- class TCExportable < Test::Unit::TestCase
- class Exportable
- include Ruwiki::Exportable
-
- attr_accessor :a, :b, :long_name, :altname, :xform, :group2
- exportable :a
- exportable :long_name
- exportable :altname, :name => 'alt-name'
- exportable :group2, :group => 'group2'
- end
-
- def test_exportable
- __exportables = {
- 'default' => {
- 'a' => '@a'.intern,
- 'long-name' => '@long_name'.intern,
- 'alt-name' => '@altname'.intern,
- },
- 'group2' => {
- 'group2' => '@group2'.intern
- }
- }
- __values = {
- 'default' => {
- 'a' => 'a',
- 'long-name' => 'c',
- 'alt-name' => 'd',
- },
- 'group2' => { 'group2' => 'e' }
- }
- xx = nil
- ss = nil
- assert_nothing_raised do
- xx = Exportable.new
- xx.a = "a"
- xx.b = "b"
- xx.long_name = "c"
- xx.altname = "d"
- xx.xform = 22/7
- xx.group2 = "e"
- ss = xx.export
- end
- assert_equal(__exportables, xx.class.__exportables)
- assert_equal(__values, ss)
- end
- end
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/tc_template.rb b/ruwiki/tags/release-0.8.0-fixes/tests/tc_template.rb
deleted file mode 100644
index 3a7f0ab..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/tc_template.rb
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'test/unit'
-require 'harness-cgi'
-
- class TestTemplates < Test::Unit::TestCase
- def test_include
- a = "a!INCLUDE!c"
- b = "b"
- t = Ruwiki::TemplatePage.new(a, b)
- assert_equal(["abc"], t.lines.lines)
- end
-
- def test_variables
- a = "a%b%c"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.process("", v))
- end
-
- def test_optional_variables
- a = "a%b%%?c%d"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.process("", v))
-
- v["c"] = "c"
- assert_equal("abcd", t.process("", v))
- end
-
- def test_labels
- a = "a#b#c"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.process("", v, m))
- end
-
- def test_optional_labels
- a = "a#b##?c#d"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.process("", v, m))
-
- m[:c] = "c"
- assert_equal("abcd", t.process("", v, m))
- end
-
- def test_hrefs
- a = "HREF:a:b:"
- t = Ruwiki::TemplatePage.new(a)
- v = { "b" => "b" }
-
- assert_equal("b", t.process("", v))
-
- s = ""
- v["a"] = "link"
- assert_equal(%Q(<a href="link">b</a>), t.process("", v))
- end
-
- def test_repeat_subst
- v1 = { "a" => 3 }
- v2 = { "a" => 2...4 }
- v3 = { "a" => -4...-2 }
- v4 = { "a" => [3, 1, 4, 1, 5, 9] }
- v5 = { "a" => [{ "a" => 3 }, { "a" => 1 }, { "a" => 4 }, { "a" => 1 }, { "a" => 5 }, { "a" => 9 }] }
-
- a = "[:a|xy:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("xyxyxy", t.process("", v1))
- assert_equal("xyxy", t.process("", v2))
- assert_equal("xyxy", t.process("", v3))
- assert_equal("xyxyxyxyxyxy", t.process("", v4))
- assert_equal("xyxyxyxyxyxy", t.process("", v5))
-
- a = "[:a|%a%:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("123", t.process("", v1))
- assert_equal("23", t.process("", v2))
- assert_equal("-4-3", t.process("", v3))
- assert_equal("314159", t.process("", v4))
- assert_equal("314159", t.process("", v5))
- end
-
- def test_optional_subst
- v1 = { "a" => "a" }
- v2 = { "a" => nil }
- a1 = "[?a|xy?]"
- a2 = "[!a|xy?]"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
-
- assert_equal("xy", t1.process("", v1))
- assert_equal("", t1.process("", v2))
- assert_equal("", t2.process("", v1))
- assert_equal("xy", t2.process("", v2))
- end
-
- def test_repeat_block
- a1 = "START:a\nxy\nEND:a"
- a2 = "START:a\nx%b%y\nEND:a"
- a3 = "START:\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- v = { "a" => [{ "b" => 3 }, { "b" => 1 }, { "b" => 4 }, { "b" => 1 }, { "b" => 5 }, { "b" => 9 }] }
-
- assert_equal("xy\nxy\nxy\nxy\nxy\nxy\n", t1.process("", v))
- assert_equal("x3y\nx1y\nx4y\nx1y\nx5y\nx9y\n", t2.process("", v))
- assert_raises(RuntimeError) { t3.process("", v) }
- end
-
- def test_optional_block
- a1 = "IF:a\nxy\nENDIF:a"
- a2 = "IF:\nxy\nEND:"
- a3 = "IFNOT:a\nxy\nENDIF:a"
- a4 = "IFNOT:\nxy\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- t4 = Ruwiki::TemplatePage.new(a4)
- v1 = { "a" => true }
- v2 = { "a" => nil }
-
- assert_equal("xy", t1.process("", v1))
- assert_equal("", t1.process("", v2))
- assert_raises(RuntimeError) { t2.process("", v1) }
- assert_equal("", t3.process("", v1))
- assert_equal("xy", t3.process("", v2))
- assert_raises(RuntimeError) { t4.process("", v1) }
- end
- end
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/tc_tokens.rb b/ruwiki/tags/release-0.8.0-fixes/tests/tc_tokens.rb
deleted file mode 100644
index a8639b5..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/tc_tokens.rb
+++ /dev/null
@@ -1,327 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.1
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'test/unit'
-require 'harness-cgi'
-
-class TokenTestCases < Test::Unit::TestCase
- def setup
- @mrw = MockRuwiki.new
- end
-
- class MockRuwiki
- def initialize
- @project = "Default"
- @tokens = []
- @script = "<uri>"
- @message = Hash.new { |h, k| h[k] = "#{k.inspect}" }
- @title = "Ruwiki"
- end
-
- def __tokenize(content, token)
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, @project, $wiki.backend, @script, @message, @title)
- @tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{@tokens.size - 1}"
- else
- "TOKEN_#{@tokens.size - 1}"
- end
- end
- content
- end
-
- def __replace(content)
- replaced = []
- s = true
- loop do
- break if replaced.size >= @tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].restore
- end
-
- s = content.gsub!(/TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].replace
- end
- end
- content
- end
-
- def __post_replace(content)
- token_classes = @tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
- content
- end
-
- end
-
- def __process(token, content, tokenized, replaced, result)
- assert_equal(tokenized, content = @mrw.__tokenize(content, token), "Tokenization failure.")
- assert_equal(replaced, content = @mrw.__replace(content), "Replacement failure.")
- assert_equal(result, content = @mrw.__post_replace(content), "Post-replace failure.")
- end
-
- def __display(token, content)
- p tokenized = @mrw.__tokenize(content.dup, token)
- p replaced = @mrw.__replace(tokenized.dup)
- p result = @mrw.__post_replace(replaced.dup)
- end
-
- def test_Paragraph
- token = Ruwiki::Wiki::Paragraph
- content = "\nABC\n\nabc\n"
- tkv = "TOKEN_0\nABC\nTOKEN_1\nabc\n"
- rpv = %Q(</p><p class="rwtk_Paragraph">\nABC\n</p><p class="rwtk_Paragraph">\nabc\n)
- res = %Q(<p class="rwtk_Paragraph">ABC</p>\n<p class="rwtk_Paragraph">abc</p>)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Image
- token = Ruwiki::Wiki::Image
- content = "[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_0"
- rpv = %Q(<img class="rwtk_Image" alt="http://www.halostatue.ca/graphics/maple_leaf.gif" src="http://www.halostatue.ca/graphics/maple_leaf.gif" title="http://www.halostatue.ca/graphics/maple_leaf.gif" />)
- res = rpv
-
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_1"
- content = %Q([image : http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" title="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="Maple Leaf" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_2"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true])
- rpv = %Q(<img class="rwtk_Image" alt="[1]" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[1]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_3"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true alt="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[2]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- content = "\[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_4"
- rpv = content
- res = content
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Code
- content = " line 1\n line 2\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_0TOKEN_1line 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2</pre>\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
-
- content = " line 1\n line 2\n \n\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_2TOKEN_3TOKEN_4\nline 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\n</p><pre class="rwtk_Code"> </pre>\n\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2\n </pre>\n\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NumberedLinks
- token = Ruwiki::Wiki::NumberedLinks
- Ruwiki::Wiki::NumberedLinks.reset
- content = "[http://www.ruby-lang.org] \\[http://www.rubyforge.org]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
- res = %Q{<a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NamedLinks
- token = Ruwiki::Wiki::NamedLinks
- content = "[http://www.ruby-lang.org Ruby] \\[http://www.rubyforge.org RubyForge]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
- res = %Q{<a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ExternalLinks
- token = Ruwiki::Wiki::ExternalLinks
- content = "http://www.ruby-lang.org \\http://www.rubyforge.org"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
- res = %Q{<a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_HRule
- token = Ruwiki::Wiki::HRule
- content = "----\n\\----"
- tkv = "TOKEN_0\n\\TOKEN_1"
- rpv = %Q(<hr class="rwtk_HRule" />\n----)
- res = %Q(<hr class="rwtk_HRule" />\n----)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLink
- token = Ruwiki::Wiki::ProjectCrossLink
- content = "Ruwiki::ChangeLog \\Ruwiki::To_Do Ruwiki::NotExist \\Ruwiki::NotExist"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLinkWikipedia
- token = Ruwiki::Wiki::ProjectCrossLinkWikipedia
- content = "Ruwiki::[[ChangeLog]] \\Ruwiki::[[To_Do]] Ruwiki::[[Does Not Exist]] \\Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 Ruwiki::[[_invalid]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectIndex
- token = Ruwiki::Wiki::ProjectIndex
- content = "::Ruwiki \\::Ruwiki ::Newproject \\::Newproject"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikiLinks
- token = Ruwiki::Wiki::WikiLinks
- content = "ProjectIndex \\ProjectIndex AustinZiegler \\AustinZiegler Alan_Chen \\Alan_Chen"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikipediaLinks
- token = Ruwiki::Wiki::WikipediaLinks
- content = "[[ProjectIndex]] \\[[ProjectIndex]] [[Austin Ziegler]] \\[[Austin Ziegler]] [[_Alan Chen]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 [[_Alan Chen]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Abbreviations
- token = Ruwiki::Wiki::Abbreviations
- content = "@{matz}\n@{}\n\\@{matz}"
- tkv = "TOKEN_0\nTOKEN_1\n\\TOKEN_2"
- rpv = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
- res = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Headings
- token = Ruwiki::Wiki::Headings
- content = "= header 1\n== header 2\n=== header 3\n==== header 4\n===== header 5\n====== header 6\n======= header 7->6\n\\== noheader 2\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\nTOKEN_6\n\\TOKEN_7\n"
- rpv = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n== noheader 2\n)
- res = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n<p class="rwtk_Paragraph">== noheader 2\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Blockquotes
- token = Ruwiki::Wiki::Blockquotes
- content = ": level 1\n:: level 2\n::: level 3\n: level 1, para 2\n\\: not a blockquote\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<blockquote class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n: not a blockquote\n)
- res = %Q(<blockquote class="rwtk_Blockquotes">level 1<blockquote class="rwtk_Blockquotes">level 2<blockquote class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n: not a blockquote\n)
- __process(token, content, tkv, rpv, res)
-
- content = "> level 1\n>> level 2\n>>> level 3\n> level 1, para 2\n\\> not a blockquote\n"
- tkv = "TOKEN_5\nTOKEN_6\nTOKEN_7\nTOKEN_8\n\\TOKEN_9\n"
- rpv = %Q(<blockquote type="cite" class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- res = %Q(<blockquote type="cite" class="rwtk_Blockquotes">level 1<blockquote type="cite" class="rwtk_Blockquotes">level 2<blockquote type="cite" class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Definitions
- token = Ruwiki::Wiki::Definitions
- content = "; word1 : val1\n;; word2 : val2\n;;; word3 : val3\n; word1/2 : val1/2\n\\; not-a-word : not-a-val\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd></dl></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl></dl>\n<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
- res = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
-
-# __display(token, content)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Lists
- content = "* level 1\n** level 2\n*** level 3\n*** level 3, item 2\n** level 2, item 2\n* level 1, item 2\n\\* not an item\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\n\\TOKEN_6\n"
- rpv = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ul></ul>\n<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- res = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ul><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n## level 2\n### level 3\n### level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_7\nTOKEN_8\nTOKEN_9\nTOKEN_10\nTOKEN_11\nTOKEN_12\n\\TOKEN_13\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ol><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n*# level 2\n*** level 3\n*#* level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_14\nTOKEN_15\nTOKEN_16\nTOKEN_17\nTOKEN_18\nTOKEN_19\n\\TOKEN_20\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ol></ul>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
- end
-
-
- def test_RubyTalkLinks
- token = Ruwiki::Wiki::RubyTalkLinks
- content = "[ruby-talk:12345] \\[ruby-talk:12345]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
- res = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_OtherRubyLinks
- token = Ruwiki::Wiki::OtherRubyLinks
- content = "[ruby-list:123] \\[ruby-list:123] [ruby-doc:123] \\[ruby-doc:123] [ruby-core:123] \\[ruby-core:123] [ruby-dev:123] \\[ruby-dev:123] [ruby-ext:123] \\[ruby-ext:123] [ruby-math:123] \\[ruby-math:123]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5 TOKEN_6 \\TOKEN_7 TOKEN_8 \\TOKEN_9 TOKEN_10 \\TOKEN_11"
- rpv = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
- res = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
-
- __process(token, content, tkv, rpv, res)
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/testall.rb b/ruwiki/tags/release-0.8.0-fixes/tests/testall.rb
deleted file mode 100755
index 35bb8c9..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/testall.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-puts "Checking for test cases:"
-Dir['tc*.rb'].each do |testcase|
- puts "\t#{testcase}"
- require testcase
-end
-puts " "
diff --git a/ruwiki/tags/release-0.8.0/README b/ruwiki/tags/release-0.8.0/README
deleted file mode 100644
index 544ac5e..0000000
--- a/ruwiki/tags/release-0.8.0/README
+++ /dev/null
@@ -1,65 +0,0 @@
-Ruwiki 0.8.0
-------------
-Ruwiki is a simple, extensible Wiki-clone written in Ruby. It supports both
-CGI and WEBrick interfaces, templates, and CSS formatting. This Wiki differs
-from most other Wikis in that it supports projectt namespaces, so that two
-topics may be named the same for differing projects without colliding or
-having to resort to odd naming conventions. Please see the ::Ruwiki project
-in the running Wiki for more information. Ruwiki 0.8.0 has German and
-Spanish translations available.
-
-Upgrading
----------
-Ruwiki 0.8.0 has a flatfile format that is incompatible with older versions of
-Ruwiki. If you are upgrading from one of these versions, you must use the
-bin/convert. The simple case will be (assuming that your data files are in
-./data):
-
- % bin/convert ./data
-
-Requirements
-------------
-Ruwiki currently requires Ruby 1.8, Diff::LCS 1.1.0 (portions included). The
-YAML backend requires Ruby 1.8.2.
-
-Quick Start (CGI)
------------------
-1. Place the Ruwiki directory in a place that your webserver can execute CGI
- programs and ensure that ruwiki.cgi is executable on your webserver.
-2. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
-2. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of
-Ruwiki without editing the servlet; use ruwiki_servlet --help for more
-information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-Credits
--------
-* This software includes portions of Diff::LCS by Austin Ziegler, available
- for download from the Ruwiki RubyForge project:
- [http://rubyforge.org/projects/ruwiki/]
-* Portions of this software are derived from Dave Thomas's RDoc system, now
- part of the Ruby distribution.
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen]
- on 2003.10.22. Note that the initial template translations (./templates/de/)
- were done via AltaVista Babelfish and should not be blamed on Christian.
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández]
- on 2003.10.22. Note that the initial template translations (./templates/es/)
- were done via AltaVista Babelfish and should not be blamed on Mauricio.
-
-$Id$
diff --git a/ruwiki/tags/release-0.8.0/contrib/enscript-token.rb b/ruwiki/tags/release-0.8.0/contrib/enscript-token.rb
deleted file mode 100644
index 80de23b..0000000
--- a/ruwiki/tags/release-0.8.0/contrib/enscript-token.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# By Javier Fontan <jfontan@pc3d.cesga.es>
-
-require "open3"
-
-class Ruwiki::Wiki::CodeColor < Ruwiki::Wiki::Token
- def self.rank
- 0
- end
-
- def self.regexp
- %r<\{\{\{(?::(\w+)\b)?(.*?)\}\}\}>m
- end
-
- def replace
- cap = @match.captures
-
- if cap[0].nil?
- language = "ruby"
- else
- language = cap[0]
- end
-
- text = cap[1]
-
- i, o, e = Open3.popen3("enscript -B --color=emacs -Whtml -E#{language} -o -")
- i.print text
- i.close
-
- re_script = %r{(<pre>.*?</pre>)}mio
- c = o.readlines[1..-1].join("\n")
- re_script.match(c).captures[0]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<pre>\n}im, '<pre class="rwtk_CodeColor>')
- content.gsub!(%r{\n</pre>}im, '</pre>')
- content.gsub!(%r{<font color="(.+?)">}im, '<span style="color: \1">')
- content.gsub!(%r{</font>}im, '</span>')
- content.gsub!(%r{<B>}i, '<b>')
- content.gsub!(%r{</B}i, '</b>')
- content
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/convert b/ruwiki/tags/release-0.8.0/convert
deleted file mode 100644
index 657ef09..0000000
--- a/ruwiki/tags/release-0.8.0/convert
+++ /dev/null
@@ -1,279 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
-module RuwikiConverter #:nodoc:
- PROGRAM = File.basename($0)
- PATH = File.dirname($0)
-end
-
-begin
- require 'ruwiki'
-rescue LoadError
- $LOAD_PATH.unshift "#{RuwikiConverter::PATH}/../lib"
- # Fail hard if it fails again.
- require 'ruwiki'
-end
-
- # Load all of the known backends.
-require 'ruwiki/backend/flatfiles'
-require 'ruwiki/backend/yaml'
-require 'ruwiki/backend/marshal'
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-
-module RuwikiConverter #:nodoc:
- TARGETS = %w(flatfiles yaml marshal)
-
- # Create the regular expressions that are used in Ruwiki 0.6.2
- OLD_HEADER_RE = /^\s*([a-z]+)\s*:\s*(.*)$/
- OLD_HEADER_END_RE = /^#EHDR$/
- DATA_HEADER_END_RE = /\A#EHDR\z/
- NL_RE = /\n/
-
-
- def with(obj)
- yield obj if block_given?
- end
-
- # Only allow this to be run once. Silently fail otherwise.
- def set_defaults
- return unless @options.nil?
- @options = OpenStruct.new
-
- with @options do |o|
- o.traverse_directories = true
- o.backup_old_files = true
- o.backup_extension = "~"
- o.quiet = false
- o.verbose = false
- o.extension = 'ruwiki'
-# o.target_format = 'yaml'
- o.target_format = 'flatfiles'
- end
- end
-
- def display_options
- end
-
- def summary
- end
-
- def process(argv, out = $stdout, err = $stderr)
- set_defaults
-
- @out = out
- @err = err
-
- argv.options do |opts|
- opts.banner = "Usage: #{PROGRAM} [options] <directory>+"
- opts.separator ''
- opts.on('--format=FORMAT', 'Converts encountered files (regardless', 'of the current format), to the specified', 'format. Default is yaml. Allowed formats', 'are: yaml marshal flatfiles') do |ff|
- @options.target_format = ff
- end
- opts.on('--[no-]backup', 'Create backups of upgraded files.', 'Default is --backup.') do |bb|
- @options.backup_old_files = bb
- end
- opts.on('--backup-extension=EXTENSION', 'Specify the backup extension. Default', 'is "~", which is appended to the data', 'filename.') do |ee|
- if ee.nil? or ee.empty?
- @err << "The backup extension must not be empty." if ee.nil? or ee.empty?
- @err << "#{opts}\n"
- return 0
- end
- @options.backup_extension = ee
- end
- opts.on('--extension=EXTENSION', 'Specifies the extension of Ruwiki data', 'files. The default is .ruwiki') do |ee|
- @options.extension = ee
- end
- opts.on('--no-extension', 'Indicates that the Ruwiki data files', 'have no extension.') do |nn|
- @options.extension = nil
- end
- opts.on('--quiet', 'Runs quietly. Default is to run with', 'normal messages.') do |qq|
- @options.quiet = qq
- @options.verbose = (not qq)
- end
- opts.on('--verbose', 'Runs with full messages. Default is to', 'run with normal messages.') do |vv|
- @options.quiet = (not vv)
- @options.verbose = vv
- end
- opts.separator ''
- opts.on_tail('--help', 'Shows this text.') do
- @err << "#{opts}\n"
- return 0
- end
-
- opts.parse!
- end
-
- if argv.empty?
- @err << "Error: not enough arguments.\n#{argv.options}\n" if not @options.quiet
- return 127
- end
-
- display_options if @options.verbose
-
- @options.target_format.capitalize!
- @options.target_format_class = Ruwiki::Backend.const_get(@options.target_format)
-
- argv.each { |file| process_file(file) }
-
- summary if not @options.quiet
- end
-
- # Process a single file.
- def process_file(file)
- if @options.backup_old_files
- return if file =~ /#{@options.backup_extension}/
- end
- @out << "#{file}: " unless @options.quiet
-
- if File.directory?(file) and @options.traverse_directories
- @out << "directory\n" unless @options.quiet
- Dir.chdir(file) { Dir['*'].each { |entry| process_file(entry) } }
- else
- begin
- page, page_format = load_page(file)
- @out << "converting from #{page_format} to #{@options.target_format} ... " if @options.verbose
- save_page(file, page)
- @out << "done.\n" unless @options.quiet
- rescue PageLoadException
- @out << "not a Ruwiki file; skipping.\n" unless @options.quiet
- rescue PageSaveException => e
- @out << "cannot save modified #{file}.\n" unless @options.quiet
- end
- end
- end
-
- def load_page(file)
- data = File.read(file)
- page_format = nil
-
- if data =~ OLD_HEADER_END_RE
- page_format = 'OldFlatfiles'
-
- page = Ruwiki::Page::NULL_PAGE.dup
-
- unless data.empty?
- rawbuf = data.split(NL_RE).map { |e| e.chomp }
-
- loop do
- if rawbuf[0] =~ OLD_HEADER_END_RE
- rawbuf.shift
- break
- end
-
- match = OLD_HEADER_RE.match(rawbuf[0])
-
- unless match.nil?
- case match.captures[0]
- when 'topic'
- page['properties']['topic'] = match.captures[1]
- page['properties']['title'] = match.captures[1]
- when 'version'
- page['properties']['version'] = match.captures[1].to_i
- else
- nil
- end
- end
- rawbuf.shift
- end
-
- page['page']['content'] = rawbuf.join("\n")
-
- with page['properties'] do |p|
- p['project'] = File.basename(File.dirname(File.expand_path(file)))
- p['editable'] = true
- p['indexable'] = true
- p['entropy'] = 0.0
- end
- end
- end
-
- # Try Marshal
- if page_format.nil?
- begin
- page = ::Marshal.load(data)
- page_format = 'Marshal'
- rescue Exception
- end
- end
-
- # Try YAML
- if page_format.nil?
- begin
- page = YAML.load(data)
- page_format = 'YAML'
- rescue Exception
- end
- end
-
- # Try the Flatfiles format
- if page_format.nil?
- begin
- page = Ruwiki::Backend::Flatfiles.load(data)
- page_format = 'Flatfiles'
- rescue Exception
- end
- end
-
- if page_format.nil? # Cannot detect page type.
- @err << %Q|Cannot detect the page format. |
- raise PageLoadException
- end
- [page, page_format]
- rescue PageLoadException
- raise
- rescue Exception => e
- @err << %Q|#{e.message}\n#{e.backtrace.join("\n")}\n| if @options.verbose
- raise PageLoadException
- end
-
- def save_page(file, page)
- if @options.backup_extension != '~'
- backup = "#{file}.#{@options.backup_extension}"
- else
- backup = "#{file}#{@options.backup_extension}"
- end
-
- # Always backup the file -- we are transactional.
- FileUtils.cp(file, backup)
-
- if @options.target_format == 'Marshal'
- method = :print
- else
- method = :puts
- end
- File.open(file, 'wb') { |f| f.__send__(method, @options.target_format_class.dump(page)) }
- rescue Exception => e
- FileUtils.mv(backup, file) if File.exists?(backup)
- @err << %Q|#{e.message}\n#{e.backtrace.join("\n")}\n| if @options.verbose
- raise PageSaveException
- ensure
- # If we aren't *supposed* to back up the file, then get rid of the
- # backup.
- if File.exists?(backup) and (not @options.backup_old_files)
- FileUtils.rm(backup)
- end
- end
-
- class PageLoadException < RuntimeError; end
- class PageSaveException < RuntimeError; end
-end
-
-if __FILE__ == $0
- include RuwikiConverter
-
- process(ARGV, $stdout, $stderr)
-end
diff --git a/ruwiki/tags/release-0.8.0/convert.bat b/ruwiki/tags/release-0.8.0/convert.bat
deleted file mode 100644
index 99a0212..0000000
--- a/ruwiki/tags/release-0.8.0/convert.bat
+++ /dev/null
@@ -1,16 +0,0 @@
-@echo off
-REM Ruwiki 0.8.0
-REM Copyright © 2002 - 2004, Digikata and HaloStatue
-REM Alan Chen (alan@digikata.com)
-REM Austin Ziegler (ruwiki@halostatue.ca)
-REM
-REM Licensed under the same terms as Ruby.
-REM $Id$
-REM
-if "%OS%"=="Windows_NT" goto WinNT
-ruby -x "convert" %1 %2 %3 %4 %5 %6 %7 %8 %9
-goto done
-:WinNT
-ruby -x "convert" %*
-goto done
-:done
diff --git a/ruwiki/tags/release-0.8.0/data/Default/ProjectIndex.ruwiki b/ruwiki/tags/release-0.8.0/data/Default/ProjectIndex.ruwiki
deleted file mode 100644
index 21b489c..0000000
--- a/ruwiki/tags/release-0.8.0/data/Default/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,48 +0,0 @@
-page!content: = Ruwiki
- Ruwiki is a simple, extensible Wiki written in Ruby. It supports both
- CGI and \WEBrick interfaces, templates, and CSS formatting.
- Additionally, it supports project namespaces, so that two pages can be
- named the same for differing projects without colliding or odd naming
- conventions. Please see the ::Ruwiki project for more information.
-
- Ruwiki is also a partially internationalised Wiki, although more
- testing, especially testing with multibyte character encodings and
- Unicode (UTF-8) is required. There are German and Spanish translations
- of the messages included with the Ruwiki distribution.
-
- The current version is 0.8.0. Numerous enhancements have been made in
- this version, ranging from a new default look (and two additional
- schemes) to new backend format support to searching and topic listing.
- The full list of changes can be found in Ruwiki::ChangeLog, with
- discussions of various features in Ruwiki::WikiMarkup,
- Ruwiki::Configuring_Ruwiki, and Ruwiki::Extending_Ruwiki.
-
- If you are upgrading from an older version of Ruwiki, please read
- Ruwiki::[[Upgrading and Converting]].
-
- Certain Ruwiki \APIs are considered stable at this point, others will
- be changing leading up to 1.0. Some of this is discussed in
- Ruwiki::To_Do, with further architectural discussions in
- Ruwiki::[[Roadmap]].
-
- %projects()
-
- Please review ::Tutorial and ::Ruwiki if you are unfamiliar with the
- concept of Wikis in general. If you want to play with \WikiFormatting
- for Ruwiki, use the Ruwiki::SandBox.
-
- [http://rubyforge.org/projects/ruwiki Ruwiki development] is hosted at
- [http://rubyforge.org RubyForge]. The current release of Ruwiki can
- always be [http://rubyforge.org/frs/?group_id=84 downloaded] from
- \RubyForge or the development (unstable) version can be obtained from
- CVS.
-
- $Id$
-page!footer:
-page!header:
-properties!project: Default
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/BugTracking.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/BugTracking.ruwiki
deleted file mode 100644
index 0a0f1f7..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/BugTracking.ruwiki
+++ /dev/null
@@ -1,34 +0,0 @@
-page!content: = Ruwiki 0.8.0 Bug Tracking
- This page is for tracking bugs in Ruwiki. Only bugs from recent
- distributions are tracked. In addition to this source-based bug
- tracking, there is the [http://rubyforge.org RubyForge]
- [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug
- tracker] for Ruwiki.
-
- Those interested in Ruwiki development may also find the Ruwiki::To_Do
- list and the Ruwiki::[[Roadmap]] useful. The format of the bug list is
- &ldquo;version: description&rdquo;. For open bugs, the version is the
- version in which the bug was first reported. For closed bugs, the
- version is the version in which the bug was closed.
-
- ----
- == Open Bugs
- * 0.6.2: Not all formatting is applied consistently. The token rankings may need adjusting. Eivind Eklund has suggested a scheme that may help with this, but it will require architectural adjustment and will probably slow things down.
-
- ----
- == Closed Bugs
- * 0.8.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=707&group_id=84&atid=407 Sub-Numbered bullets don&rsquo;t increment]. Fixed a list numbering problem. I think that lists are a bit slower now, but they are completely accurate.
- * 0.7.0: Fixed a link detection problem in \[wikiword] format. Thanks to [mailto:eivind@FreeBSD.org Eivind Eklund] for the patch.
- * 0.7.0: Fixed a problem with &lt;pre&gt; paragraph detection and generation.
- * 0.7.0: Fixed a problem with &lt;p&gt; generation.
- * 0.7.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=197&group_id=84&atid=407 Run-away ruby on some links in default distribution]. This may be related to a runaway header problem that was reported to me on IRC some time back that I believe has been fixed. Please advise.
- * 0.6.1: Projects aren&rsquo;t created appropriately.
- * 0.6.1: Saving without editing (or repost) appears to cause problems. A fix has been applied to attempt to address this. Pages that have not been changed will not be saved.
-
- $Id$
-properties!project: Ruwiki
-properties!title: BugTracking
-properties!topic: BugTracking
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/ChangeLog.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/ChangeLog.ruwiki
deleted file mode 100644
index 527af16..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/ChangeLog.ruwiki
+++ /dev/null
@@ -1,72 +0,0 @@
-page!content: = Ruwiki 0.8.0 ChangeLog
- Uncompleted to-do items can be found in To_Do. Bugs in Ruwiki are
- tracked in BugTracking.
-
- == Version 0.8.0
- * AC: Added topic list (_topics) and project list (_projects) controls on templates and backend.
- * AZ: Added %topics() and %projects() tokens. See WikiMarkup for details.
- * AC: Added simple search on back-end (both project and global); search strings must be validated and cleansed before being sent to the back-end (the back-end must prepare the string for its own search mechanism). The back-end is wholly responsible for the searching of the pages.
- * AC: Added \RecentChanges list to backend and controls.
- * AZ: Changed default for Ruwiki::Config#storage_options[:flatfiles][:extension] to <tt>ruwiki</tt>.
- * AZ: Topic backlink search: searches for mentions of the topic in the other topics of the project.
- * AZ: New templating engine: The Rdoc templating engine has been greatly enhanced in preparation for some changes that will happen surrounding antispam capabilities.
- * AZ: Multiple flatfile-based backend support: tagged file (&ldquo;flatfiles&rdquo;), YAML (&ldquo;yaml&rdquo;), and Marshal (&ldquo;marshal&rdquo;).
- * AZ: A converter utility between backends.
- * AZ: Defined a canonical, extensible page transport format.
- * AZ: Defined a canonical, format-independent diff format.
- * AZ: Fixed list numbering problem. Modified lists to allow for mixed lists. See WikiMarkup for restrictions.
- * AZ: Removed automatic image conversion for \URIs that look like images. Now, images must be specified with the \[image:uri] format. See WikiMarkup for more details.
- * AZ: Fixed minor bugs in several tokens.
- * AZ: New look! Ruwiki now sports a new default look with CSS and template changes.
- * AZ: New look! Ruwiki has a &ldquo;simple&rdquo; template set.
- * AZ: New look! Ruwiki has a &ldquo;sidebar&rdquo; template set.
- * AZ: Fixed a long-standing bug with code tokens.
-
- == Version 0.7.0
- * Changed the tokenization API so that the #post_replace call is made at the Token class level instead of the instance level.
- * Improved HTML code generation.
- * Added servlet runner batch files for Windows. They <strong>will</strong> require modification to run properly.
- * Added %calendar(...) support. See WikiMarkup for more information.
-
- == Version 0.6.2
- * Removed dependencies on Ruwiki from a number of classes (Ruwiki::Backend, Ruwiki::Backend::Flatfiles, Ruwiki::Page, Ruwiki::Wiki, Ruwiki::Wiki::Tokens, and various tokens).
- * Ruwiki now initializes a \Ruwiki::BackendDelegator, which creates the requisite Ruwiki::Backend instance with Ruwiki::Config#storage_options.
- * Added German (Christian Neukirchen &lt;cneukirchin@yahoo.de&gt;) and Spanish translations (Mauricio Fernández &lt;batsman.geo@yahoo.com&gt;).
-
- == Version 0.6.1
- * Changed Ruwiki::Config#data_path to Ruwiki::Config#storage_options[:flatfiles][:data_path]. This represents a generalisation of storage type options so that the Ruwiki::Config object is not polluted with storage type options. Ruwiki::Config#storage_options keys should be the same Ruby Symbol as is used in Ruwiki::Config#storage_type.
- * Added Ruwiki::Config#storage_options[:flatfiles][:extension], based on a request by Chad Fowler. This allows you to have Project/\TopicFile actually stored as Project/\TopicFile.wiki if Ruwiki::Config#storage_options[:flatfiles][:extension] is set to <tt>wiki</tt>. The default for Ruwiki::Config#storage_options[:flatfiles][:extension] is <tt>nil</tt>.
- * Fixed incorrect references. I had been incorrectly attributing [http://sourceforge.net/projects/rdoc-wiki RDoc Wiki] to Dave Thomas. \RDoc Wiki is by Michael Neumann. However, the project I pulled from <strong>is</strong> by Dave Thomas, but it&rsquo;s [http://sourceforge.net/projects/rublog RubLog]. Apologies to both developers.
- * Added RuwikiTemplatingLibrary documentation.
- * Internationalized messages, except for the templating library.
- * Added configuration API for future work surrounding features. The existing wiki is mostly feature complete. Additional features (such as access controls) will be added through the feature interface.
- * Fixed project creation.
- * Fixed problems with \WikiWord links.
- * Added Wikipedia-style Wiki links (\[[list of words]]).
- * Fixed a potential problem with re-posted data or saving without editing.
- * Added the ability to put commands in the URL.
-
- == Version 0.6.0
- * Added Ruby mailing list reference support (e.g., \[ruby-talk:12345]).
- * Reorganised the code (again) to better support alternative frontends. Based, in part, on [http://sourceforge.net/projects/rublog RubLog] by Dave Thomas. (Reference corrected in 0.6.1.)
- * Added a [http://www.webrick.org WEBrick] servlet interface. Based, in part, on the \WEBrick servlet interface provided with \RubLog by Chad Fowler.
- * Added templates, using the [http://rdoc.sourceforge.net RDoc] template.rb library.
- * Changed the default topic to be \ProjectIndex instead of \DefaultProject.
- * Added a new \WikiWord format, \Wiki_Word_with_Spaces.
- * Completed lots of Ruwiki documentation.
- * Updated the save page.
- * Fixed a problem with the linking of project specific pages.
-
- == Version 0.5.0
- * Reorganized the code significantly to be easier to edit and extend.
- * Added abbreviation capabilities.
- * Cleaned up a lot of tokenizing code.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: ChangeLog
-properties!topic: ChangeLog
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/Configuring_Ruwiki.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/Configuring_Ruwiki.ruwiki
deleted file mode 100644
index 360c863..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/Configuring_Ruwiki.ruwiki
+++ /dev/null
@@ -1,114 +0,0 @@
-page!content: = Configuring Ruwiki 0.8.0
- Ruwiki is configured similarly as both a CGI and a \WEBrick servlet.
- The biggest distinction is that because the Wiki servlet is created
- after the \WEBrick server is created (during the dispatch to the
- servlet), it is necessary to configure the wiki with a global
- Ruwiki::Config object, <em>$config</em>. Thus, in the examples below,
- replace <em>wiki.config</em> with <em>$config</em> where necessary.
-
- : Additional configuration options will be added from time to time. The
- : form for specifying configuration may be changed prior to 1.0. In
- : 0.8.1, it will be possible to initialise the configuration object
- : from storage.
-
- If you are looking for the discussion on templates, this has been moved
- to Extending_Ruwiki.
-
- == Ruwiki Configuration Options
- === wiki.config.title
-
- This configuration option names the Wiki; by default this is
- <tt>Ruwiki</tt>. This affects the display of the home link and the
- &lt;title&gt; element of pages.
-
- === wiki.config.webmaster
-
- The email address for the webmaster. This is used in generating error
- reports that can be emailed to the wiki&rsquo;s webmaster.
-
- === wiki.config.default_page, wiki.config.default_project
-
- These options indicate what will happen when the wiki&rsquo;s URL is
- specified without any parameters (the default page in the default
- project is opened), when a topic is specified without a project (the
- topic is opened in the default project), and when a project is
- specified without a topic (the default page is opened in the project).
-
- === wiki.config.storage_type, wiki.config.storage_options
-
- <tt>wiki.config.storage_type</tt> specifies the back-end storage
- mechanism as a Ruby Symbol. Currently, <tt>:flatfiles</tt>,
- <tt>:marshal</tt>, and <tt>:yaml</tt> are supported. YAML is the
- default format for Ruby version 1.8.2 or later; :flatfiles for earlier
- versions. Because of this, the Ruwiki data is stored by default in
- :flatfiles format. See Extending_Ruwiki for more information.
-
- <tt>wiki.config.storage_options</tt> is a hash of option hashes for
- each known storage type known to the Wiki. This must use the same
- Symbol as <tt>wiki.config.storage_type</tt> as the top-level hash key.
-
- ==== ...storage_options[:flatfiles][:data_path], ...storage_options[:yaml][:data_path], ...storage_options[:marshal][:data_path]
-
- The directory in which the wiki files will be found. By default, this
- is &ldquo;<tt>./data/</tt>&rdquo;.
-
- ==== ...storage_options[:flatfiles][:extension]
-
- The extension of the wiki files. By default, this is
- &ldquo;ruwiki&rdquo;. For those upgrading from a previous version of
- Ruwiki, note that you must explicitly set this value to <tt>nil</tt> if
- you wish to have no extension.
-
- === wiki.config.template_path
- This specifies the paths where the Wiki templates will be found. The
- process running the Wiki must have read access to the template_path.
-
- === wiki.config.template_set, wiki.config.css
- These two options indicate which template set will be used. Three
- template sets are provided in the release package:
- &ldquo;default&rdquo;, &ldquo;simple&rdquo;, and &ldquo;sidebar&rdquo;.
- The only CSS file used initially is &ldquo;ruwiki.css&rdquo;. Templates
- work such that they will be found in
- <em>template_path</em>/<em>template_set</em>. All CSS files are loaded
- from the template set directory and emitted as part of the output
- stream.
-
- : The bad that this means that the CSS never caches on the client side
- : as it would if it were a separate file. However, as templates may not
- : be in a web-accessible directory, this is necessary.
-
- == Ruwiki Servlet Options
- Most, if not all, of the configuration above can be achieved through
- command-line options of the ruwiki servlet.
-
- === Servlet Command-Line Options
- ; -P, --port <em>PORT</em> : Runs the Ruwiki servlet on the specified port. Default 8808.
- ; -A, --accept <em>ADDRESSES</em> : Restricts the Ruwiki servlet to accepting connections from the specified address or (comma-separated) addresses. May be specified multiple times. Defaults to all addresses.
- ; -L, --local : Restricts the Ruwiki servlet to accepting only local connections (127.0.0.1). Overrides any previous --accept addresses.
- ; -M, --mount <em>MOUNT_POINT</em> : The relative URI from which Ruwiki will be accessible. Defaults to &ldquo;/&rdquo;.
- ; --[no-]log : Log \WEBrick activity. Default is --log.
- ; --logfile <em>LOGFILE</em> : The file to which \WEBrick logs are written. Default is standard error.
- ; -T, --threads <em>THREADS</em> : Sets the \WEBrick threadcount.
-
- === Ruwiki Command-Line Options
- ; --language <em>LANGUAGE</em> : The interface language for Ruwiki. Defaults to &ldquo;en&rdquo;. May be &ldquo;en&rdquo;, &ldquo;de&rdquo;, or &ldquo;es&rdquo;.
- ; --webmaster <em>WEBMASTER</em> : The Ruwiki webmaster email address. Defaults to &ldquo;webmaster@domain.com&rdquo;.
- ; --[no-]debug : Turns on Ruwiki debugging. Defaults to --no-debug.
- ; --title <em>TITLE</em> : Provides the Ruwiki title. Default is &ldquo;Ruwiki&rdquo;.
- ; --default-page <em>PAGENAME</em> : An alternate default page. Default is &ldquo;\ProjectIndex&rdquo;.
- ; --default-project <em>PAGENAME</em> : An alternate default project. Default is &ldquo;Default&rdquo;.
- ; --template-path <em>TEMPLATE_PATH</em> : The location of Ruwiki templates. Default is &ldquo;./templates&rdquo;.
- ; --templates <em>TEMPLATES</em> : The name of the Ruwiki templates. Default is &ldquo;default&rdquo;.
- ; --css <em>CSS_NAME</em> : The name of the <acronym title="Cascading Style Sheets">CSS</acronym> file in the template path. Default is &ldquo;ruwiki.css&rdquo;.
- ; --storage-type <em>TYPE</em> : Select the storage type: flatfiles, yaml, marshal
- ; --flatfiles-data-path <em>PATH</em> : The path where data files are stored. Default is &ldquo;./data&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
- ; --flatfiles-extension <em>EXT</em> : The extension for data files. Default is &ldquo;ruwiki&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: Configuring_Ruwiki
-properties!topic: Configuring_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/Extending_Ruwiki.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/Extending_Ruwiki.ruwiki
deleted file mode 100644
index d1b6803..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/Extending_Ruwiki.ruwiki
+++ /dev/null
@@ -1,310 +0,0 @@
-page!content: = Extending Ruwiki 0.8.0
- Ruwiki is relatively easily extended to support new features. There are
- four primary ways in which Ruwiki can be extended or modified by the
- end user: templates, translating Ruwiki messages and labels, markup
- tokens, and creating new backends.
-
- == Templates
- Templating is done with a heavily modified version of the \RDoc
- template.rb library included in the distribution of Ruwiki. The
- templating library allows for nested templates, and this is used
- extensively in Ruwiki. This library is documented in
- RuwikiTemplatingLibrary.
-
- There are four major templates: content, edit, save, and error. Each of
- these has a slightly different combination of template files used, and
- this means that there are different sets of variables available.
-
- The major templates are &ldquo;composite templates&rdquo; that are
- defined as follows:
- ; content or search : body.tmpl, content.tmpl, controls.tmpl, footer.tmpl
- ; edit or preview : body.tmpl, edit.tmpl
- ; save : body.tmpl, save.tmpl, controls.tmpl, footer.tmpl
- ; error : body.tmpl, error.tmpl
-
- === Common Variables
- The following template variables are presented for all composite
- templates.
- ; <tt>%css_link%</tt> : The contents of the CSS file for the template set.
- ; <tt>%home_link%</tt> : A link to the root page of the Wiki.
- ; <tt>%editable%</tt> : A boolean value to mark the page as editable or not. Used in a conditional block in the templates.
- ; <tt>%cgi_url%</tt> : The URL for the Wiki.
- ; <tt>%content%</tt> : The formatted content of the current page.
- ; <tt>%page_project%</tt> : The project for the current page.
- ; <tt>%page_raw_topic%</tt> : The topic for the current page, escaped for safe transmission over the web.
- ; <tt>%page_topic%</tt> : The printable topic for the current page.
- ; <tt>%url_project%</tt> : The URL to the current page&rsquo;s project.
- ; <tt>%url_topic_search%</tt> : The URL to search for the current topic in the current project.
- ; <tt>%link_topic_search%</tt> : A link to the current topic search.
-
- === Variables for :content, :save, :search
- ; <tt>%wiki_title%</tt> : The title of the Wiki.
- ; <tt>%label_topic_or_search%</tt> : Either <tt>#topic#</tt> or <tt>#search#</tt>.
- ; <tt>%page_topic_name%</tt> : The same as <tt>%page_topic%</tt>.
-
- === Variables for :edit, :preview
- ; <tt>%wiki_title%</tt> : The title of the Wiki with a tag to indicate that the page is being edited.
- ; <tt>%page_content%</tt> : The content of the page.
- ; <tt>%page_version%</tt> : The current version number of the page.
- ; <tt>%unedited_page_content%</tt> : The formatted, unedited content of the page.
- ; <tt>%pre_page_content%</tt> : A Web-escaped form of the page content.
- ; <tt>%edit_comment%</tt> : The current edit comment.
-
- === Variables for :error
- ; <tt>%wiki_title%</tt> : The title of the Wiki with an error message.
- ; <tt>%name%</tt> : The name of the error.
- ; <tt>%backtrace%</tt> : The backtrace of the error.
- ; <tt>%backtrace_email%</tt> : The backtrace of the error formatted for sending by email.
- ; <tt>%webmaster%</tt> : The email address of the webmaster.
-
- == Translating Ruwiki Messages
- Ruwiki is internationalized. This method sets the Ruwiki error messages
- (and a few other messages) to the specified language Module. The
- language Module must have a constant Hash called <tt>Message</tt>
- containing a set of symbols and localized versions of the messages
- associated with them.
-
- If the file <em>ruwiki/lang/es.rb</em> contains the module
- <tt>Ruwiki::Lang::ES</tt>, the messages for RSS could be localized to
- Spanish thus:
-
- require 'ruwiki/lang/es'
- ...
- wiki.config.language = Ruwiki::Lang::ES
-
- Localization is currently per wiki instance. In a servlet environment,
- this may mean that only a single language is recognised.
-
- It is recommended that the hash be created with a default proc that
- reports unknown message keys.
-
- Message = Hash.new { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
-
- == Extending Ruwiki Markup
-
- : <strong>WARNING:</strong> These \APIs will change in Ruwiki 0.9.0,
- : replacing the instance variables @project, @backend, and @script with
- : a Handler object. There may be other changes as well.
-
- Ruwiki&rsquo;s WikiMarkup can be extended by creating a new
- Ruwiki::Wiki::Token. Tokens will be automatically loaded if they are
- placed in <em>ruwiki/wiki/tokens</em>.
-
- It is recommended that new tokens be added to the test cases in
- <tt>tests/tc_tokens.rb</tt>.
-
- The following Ruwiki::Wiki::Token class will convert strings in the
- forms of \[ruby-talk:12345] to links.
-
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- === Known Instance Variables
- ==== @match
- The match data for this token instance is is kept in @match. This is
- what will be used in #replace and #restore.
-
- ==== @project
- The project being processed.
-
- ==== @backend
- The Backend for the wiki. If you are using Ruwiki tokenizers outside of
- Ruwiki, this does not need to be a \BackendDelegator, but can be the
- direct Backend (which expects less information).
-
- ==== @script
- The URI to the script.
-
- ==== @message
- The message hash for displaying localised messages.
-
- ==== @title
- The title of the wiki instance.
-
- === Required Methods
- ==== ::regexp
- Ruwiki tokens are matched only through regular expression matches. As
- shown in the example above, the regular expression for ruby-talk
- mailing list posts is <tt>%r{\[ruby-\talk:(\d+)\]}</tt>. The purpose of
- the ::regexp method is to return the regexp for matching.
-
- For most inline matches, Ruwiki will ensure that the escape character
- (\) works automatically. For whole-line matches, it is necessary to
- match the escape character manually and provide a #restore method.
-
- As an example, the \HRule class implements these methods.
-
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- It may also be necessary to match escapes manually on inline matches
- that must be along word boundaries where the regular expression
- includes characters that normally match word boundaries. The project
- index match (e.g., \::Ruwiki) regular expression does this
- <tt>%r{(\B|\\)::([A-Z][a-z]+)}</tt>.
-
- ==== #replace
- This returns the formatted token. In the \RubyTalkLinks class above,
- the matched regular expression will be replaced with a hyperlink. The
- text of the hyperlink will be the matched text; the target of the
- hyperlink will include the first captured value.
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
-
- === Optional Methods
- ==== ::rank
- By default, a token will be processed in the order created. Tokens may
- be given a specific rank to ensure that they are processed in a
- particular order. The default rank is <tt>9999</tt>.
-
- ==== #restore
- Restores the token without replacement. Implements the results of the
- escape character. Each Token class is responsible for its own
- restoration. As noted in #regexp, whole-line tokens are most likely to
- need a #restore implementation.
-
- ==== ::post_replace
- Performs any necessary massaging of the data. The Lists token uses this
- to ensure that lists are collapsed together; the Paragraph token uses
- this to ensure that there are no empty paragraph tag pairs
- (&lt;p&gt;&lt;/p&gt;).
-
- : <strong>Note:</strong> This has been changed from Ruwiki 0.6.x.
- : Plugins written for the Ruwiki 0.6.x Token API will need to be
- : modified so that this is defined as:
-
- def self.post_replace
- ...
- end
-
- : as opposed to:
-
- def post_replace
- ...
- end
-
- == Extending Ruwiki Backends
- Ruwiki can support varying backends, as the backend interface has been
- abstracted completely from the data store. The backend
- <strong>must</strong>:
-
- # reside in <em>ruwiki/backends/</em> as <em>backend_name</em>.rb.
- # be registered by adding the <em>backend_name</em> as a symbol (e.g., :<em>backend_name</em>) to Ruwiki::KNOWN_BACKENDS.
- # inherit from Ruwiki::Backend.
- # exist as Ruwiki::Backend::<em>\Backend_name</em>.
-
- === Required Methods
- ==== #initialize(storage_options)
- The backend may only obtain its configuration information from an
- option hash provided by the \BackendDelegate. This is obtained from
- <tt>wiki.config.options[backend]</tt>. If a configuration error is
- detected during initialization, the backend should raise the
- \Ruwiki::Backend exception class \BackendError. This would be done
- with:
-
- raise Ruwiki::Backend::BackendError.new([:message_symbol, [message_parameters]])
-
- Backend writers should add appropriate messages to the
- <em>lang/en.rb</em> at a minimum. The \BackendDelegator will detect
- this and report the results appropriately.
-
- ==== #load(topic, project)
- The backend will be provided the name of the topic and project. It must
- return the selected page as a hash of hashes. The hash must match that
- of \Ruwiki::Page#export. It will be passed as the parameter to
- \Ruwiki:::Page.new.
-
- ==== #store(page)
- This method must store the provided Ruwiki::Page object. Current Ruwiki
- backend implementations store the Ruwiki::Page#export hash. This method
- is responsible for calling the private method Backend#make_diff and
- adding the result to the list of diffs for the page.
-
- ===== Backend#make_diff(oldpage, newpage)
- This method expects two page objects, or their Ruwiki::Page#export
- representation. It will return a hash representing the difference set
- between the two pages.
-
- ==== #obtain_lock(page, address = 'UKNOWN', timeout = 600)
- Obtains an exclusive lock on the page. The lock should have a timeout and
- permit access from the same IP address without restriction. This should
- <strong>not</strong> be a filesystem lock. The time stored for purposes of locking
- should include the timeout (e.g., Time.now.to_i + time).
-
- ==== #release_lock(page, address = 'UNKNOWN')
- Releases the exclusive lock on the page. The lock should not be released
- unless the IP address on the lock is the same or the lock has expired.
-
- ==== #project_exists?(project)
- Returns <tt>true</tt> if the project exists.
-
- ==== #page_exists?(topic, project = 'Default')
- Returns <tt>true</tt> if the page exists within the specified project.
-
- ==== #create_project(project)
- Attempts to create the project.
-
- ==== #search_project(project, search_string)
- String search all topic names and content in a project and return a
- hash of topic hits:
-
- topicname => hits
-
- ==== #list_projects
- Return an array of all projects.
-
- ==== #list_topics(project)
- Return an array of all topics within the project.
-
- === Future Methods
- Note that these methods are currently optional (they are not yet called
- from Ruwiki), but will become required moving forward as the functions
- are implemented in Ruwiki.
-
- ==== #destroy(page)
- Removes the page from the wiki. This should <strong>not</strong> remove
- the change history of the topic (in the event that the page has been
- removed maliciously). There will be a separate method to remove the
- page history.
-
- ==== #destroy_project(project)
- Attempts to destroy the project.
-
- === Optional Methods
- These methods are completely optional. They are guarded in the
- \BackendDelegate by a call to #respond_to?().
-
- ==== #global_search(search_string)
- The global search in the backend delegate is by default implemented as
- a looping search through all projects. A backend may have a more
- efficient backend global search mechanism. If the backend responds to
- #global_search, then the \BackendDelegate will use this method.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: Extending_Ruwiki
-properties!topic: Extending_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/LicenseAndAuthorInfo.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
deleted file mode 100644
index e5fca75..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
+++ /dev/null
@@ -1,33 +0,0 @@
-page!content: = Ruwiki Licence
- Ruwiki is copyright © 2002 - 2004 [mailto:alan@digikata.com Alan Chen] and
- [mailto:ruwiki@halostatue.ca Austin Ziegler].
-
- Ruwiki is provided free of use and without any warranty express or implied.
- You may use, distribute, or modify Ruwiki under the conditions of Ruby&rsquo;s
- licence or the [http://www.gnu.org/copyleft/gpl.html GNU General Public
- Licence].
-
- * Ruwiki includes parts of Diff::LCS by Austin.
- * Ruwiki includes a modified version of rdoc/template.rb originally by Dave Thomas for use in \RDoc.
-
- == Translations
- * Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen] on 2003.10.22, with corrections by Mauricio Fern&aacute;ez. Note that the initial template translations (./templates/de/) were done via \AltaVista Babelfish and should not be blamed on Christian.
- * Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fern&aacute;ndez] on 2003.10.22. Note that the initial template translations (./templates/es/) were done via \AltaVista Babelfish and should not be blamed on Mauricio.
-
- == Austin&rsquo;s Other Projects
- Austin has also released several other projects available on the RAA that you may be interested in:
- * [http://raa.ruby-lang.org/list.rhtml?name=mime-types MIME::Types], \RubyForge [http://rubyforge.org/projects/mime-types project].
- * [http://raa.ruby-lang.org/list.rhtml?name=pdf-writer PDF::Writer], \RubyForge [http://rubyforge.org/projects/ruby-pdf project].
- * [http://raa.ruby-lang.org/list.rhtml?name=text-format Text::Format], \RubyForge [http://rubyforge.org/projects/text-format project].
- * [http://raa.ruby-lang.org/list.rhtml?name=trans-simple Transaction::Simple], \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=uninheritable Uninheritable], Transaction::Simple&rsquo;s \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=diff-lcs Diff::LCS], Ruwiki&rsquo;s \RubyForge [http://rubyforge.org/projects/ruwiki project].
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: LicenseAndAuthorInfo
-properties!topic: LicenseAndAuthorInfo
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/ProjectIndex.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/ProjectIndex.ruwiki
deleted file mode 100644
index 5d7a218..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,51 +0,0 @@
-page!content: = Ruwiki 0.8.0
- This is the \ProjectIndex page for Ruwiki. For any given project, the
- \ProjectIndex topic will be the default topic for plain project links.
-
- == Features and Information
- * This wiki supports a variety of WikiFeatures that you may be interested in. The rules for WikiMarkup are similar to some other wikis, but there are a few unique markup capabilities in Ruwiki.
- * Configuring_Ruwiki is simple.
- * Extending_Ruwiki is almost as simple.
- * Who wrote Ruwiki? Read the LicenseAndAuthorInfo.
-
- == Requirements
- Ruwiki currently requires Ruby 1.8, Diff::LCS 1.1.0 (portions
- included). The YAML backend requires Ruby 1.8.2.
-
- == Getting Started
- === QuickStart (CGI)
- # Place the Ruwiki directory in a place that your webserver can execute CGI programs and ensure that ruwiki.cgi is executable on your webserver.
- # Point your web browser to the appropriate URL.
- === QuickStart (\WEBrick)
- # Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
- # Point your web browser to <http://localhost:8808/>.
-
- == Support
- * Troubles with Ruwiki? See TroubleShooting for some suggestions. Have a new problem? Add it to the main [http://ruwiki.rubyforge.org/ruwiki.cgi/Ruwiki/TroubleShooting TroubleShooting] page.
- * Subscribe to [http://rubyforge.org/mailman/listinfo/ruwiki-discuss ruwiki-discuss] ([http://rubyforge.org/pipermail/ruwiki-discuss/ archives]).
- * You can also use the [http://rubyforge.org/forum/?group_id=84 Ruwiki Public Forum] or the on \RubyForge.
-
- == Tracking Ruwiki Development
- The development progress of Ruwiki is kept primarily in the wiki
- itself, but the services of [http://rubyforge.org RubyForge] are used
- as well.
- * The BugTracking page in Ruwiki keeps track of open and closed bugs in Ruwiki. Bugs can also be found in the \RubyForge [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug tracker] and [http://rubyforge.org/tracker/?atid=408&group_id=84&func=browse Support Requests].
- * The To_Do list keeps track of major development goals for Ruwiki. Items for this list can be found on \RubyForge in [http://rubyforge.org/tracker/?atid=410&group_id=84&func=browse Feature Requests] and [http://rubyforge.org/tracker/?atid=409&group_id=84&func=browse Patches].
- * There is a mailing list to track CVS changes: [http://rubyforge.org/mailman/listinfo/ruwiki-checkin ruwiki-checkin] ([http://rubyforge.org/pipermail/ruwiki-checkin/ archives]).
-
- == Different Features?
- If this wiki doesn&rsquo;t have the right combination of features, (or if it
- just doesn&rsquo;t feel right) try these other Ruby-based Wikis:
-
- * [http://instiki.rubyforge.org/ Instiki]
- * [http://www.walrus-ruby.org/amrita/cgi-bin/aswiki/aswiki.cgi Amrita Wiki]
- * [http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=top RWiki]
- * [http://www.xpsd.com/MiniRubyWiki MiniRubyWiki]
-
- $Id$
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/Roadmap.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/Roadmap.ruwiki
deleted file mode 100644
index 11fab66..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/Roadmap.ruwiki
+++ /dev/null
@@ -1,223 +0,0 @@
-page!content: = Ruwiki 0.8.0: The Road Ahead
- What lies ahead for Ruwiki? The To_Do list will give a detailed list of
- what is to follow, but this list is not the roadmap. There is no clear
- indication of the reason for &mdash; and in some cases, the meaning of
- &mdash; the items on the list. The intention of this document is to
- expand on that list. As items are completed, they will be removed from
- this document.
-
- == Development Input
- The primary driver of development on Ruwiki is the needs of a few groups
- of people. First, both Alan and Austin use or will use Ruwiki at work.
- There are particular needs that both have. Austin will be replacing an
- installation of \PhpWiki with an installation of Ruwiki sometime in
- September or October 2004.
-
- Second, both [http://www.rubygarden.org/ruby RubyGarden] and
- [http://www.rubyforge.org RubyForge] have expressed an intention to
- replace the Perl-based \UseMod wiki with a Ruby-based wiki. The popular
- and easy-to-use Instiki (&ldquo;there is no step 2&rdquo;) is not an
- ideal choice for either because they either require or prefer a
- CGI-based wiki. Ruwiki has the desired level of performance and
- implemenation simplicity that impresses both groups, and it is the
- current preferred choice. Thus, the needs of both websites factor highly
- into the goals for Ruwiki.
-
- Third, Austin is giving a talk on Ruwiki at \RubyConf 2004. This
- requires that the API must be mostly stable so that the talk,
- &ldquo;Using and Extending Ruwiki&rdquo;, has relevance to current and
- potential users of Ruwiki without having to worry that the API may
- change significantly.
-
- Last, and certainly not least, feature requests and bug reports are a
- factor. One of the things that changed in Ruwiki 0.8.0 was the look and
- feel; admittedly, the look and feel in earlier versions was a bit
- garish, designed to fit in with a particular website more than be a
- general wiki theme. Users complained, and we changed this. The
- continual spam defacement of the \RubyGarden wiki suggested several
- possible improvements that could be made in Ruwiki to fight wiki spam;
- initial work has been implemented in Ruwiki 0.8.0 and other work will be
- implemented in 0.9.0 through to the release of 1.0.
-
- == Ruwiki 0.8.1: &ldquo;Keeping Up Appearances&rdquo;
- Ruwiki 0.8.1 is planned for release a week or so after the release of
- Ruwiki 0.8.0. This will mean little change for users of the standalone
- release, but some work will be done to prepare for versions of Ruwiki
- that can be installed with \RubyGems or <acronym title="Ruby Production
- Archive">RPA</acronym>&rsquo;s rpa-base.
-
- Both installation systems present a particular challenge to Ruwiki, as
- simply running &ldquo;ruwiki_servlet&rdquo; with no arguments will look
- for the data files and the template files relative to the current
- directory. With \RubyGems, though, this would require that the user
- specify something like:
-
- ruwiki_servlet \
- --template-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.8.1/templates \
- --flatfiles-data-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.8.1/data
-
- Instiki does this better, by creating the templates and data files on
- the fly when a new instance is created. This will certainly be an
- option, but it will not be the only option. Since a Wiki instance may be
- private, and since Ruwiki supports CGI execution where this may not be
- an option, we need a secondary installation mechanism that copies the
- default data to a local directory. Ideally, as well, instead of
- providing all of the configuration options on the command-line, we will
- also provide a configuration file mechanism.
-
- Daniel Berger has provided instructions for users of Instiki to install
- it as a service on Win32. There is no reason that this cannot also be
- applied to Ruwiki&rsquo;s \WEBrick servlet, so it will, and it will be
- offered as an option.
-
- After all of this, Ruwiki will be offered as a \RubyGem and the RPA team
- will be asked to offer Ruwiki in the RPA.
-
- Chad Fowler&rsquo;s port of \RubLog&rsquo;s vector search may be added
- to this version if it is ready.
-
- == Ruwiki 0.9.0: &ldquo;Are You Being Served?&rdquo;
- Ruwiki 0.8.0 introduced an incompatible change in the way that page
- diffs were stored, so users were advised to remove any existing .rdiff
- files. This isn&rsquo;t as problematic as it may sound, as until 0.9.0,
- there is no way to actually view the page diffs from Ruwiki itself. One
- of the major goals
-
- In Ruwiki 0.7.0, a new token was introduced: %calendar(). The concept
- here is a sound one that can be extended to make token addition easier.
- Currently, it is necessary for token writers to create their own regular
- expressions. The &ldquo;function token&rdquo; will be added &mdash;
- although the form may not be &ldquo;%<em>function-name</em>&rdquo;
- &mdash; that will work with either a line replacement or a word
- replacement so that the regular expression does not need to be written.
- Tests for the replacement will still need to be written, but
- standardizing new custom tokens will be a good thing.
-
- If it has not been added already, Chad Fowler&rsquo;s port of
- \RubLog&rsquo;s vector search will be added.
-
- The presence of static HTML content (headers and footers) per page has
- been accounted for in Ruwiki 0.8.0, but it will not be displayed.
- Further, there is currently no way to specify or display static content
- for the wiki or the project. (A related problem here is that projects do
- not have any properties. This will become important as projects should
- be able to be marked private within a wiki in the future.)
-
- The purpose of the \WikiWikiWeb is to provide a collaborative, community
- knowledge editing environment. Unfortunately, the pondscum also known as
- spammers have figured out that the \WikiWikiWeb provides a positive
- Google \PageRank, and having their links on our Wikis is benefits them.
- Just as they don&rsquo;t care about filling our mailboxes, they
- don&rsquo;t care about defacing our community knowledge. Thus, Ruwiki
- 0.9.0 will also see the introduction of antispam techniques. They will
- include IP or hostname blacklisting (with timeouts); external URL
- redirection with an exception list; and robot exclusion. Partial robot
- exclusion is implemented in Ruwiki 0.8.0, but there is no transformation
- on actions, which is necessary.
-
- The \RecentChanges mechanism will be updated to make it possible to see
- the \GlobalRecentChanges list.
-
- The most significant change in Ruwiki 0.9.0 will be the modification of
- the request pipeline. This will not be visible to the end user, but it
- will be significant to users who wish to extend Ruwiki. Currently,
- Ruwiki processes all commands in ruwiki.rb. In Ruwiki 0.9.0, this will
- be changed to a dispatch mechanism, where Action objects are introduced,
- and ruwiki.rb dispatches requests to Action objects.
-
- .---------. .--------------------.
- | Request +--------->| Process [Request] |
- ·---------· ·----+---------------·
- |
- v
- .--------------------.
- | Perform [Action] |
- ·----+---------------·
- |
- v
- .--------------------.
- | Prepare [Response] |
- ·----+---------------·
- |
- v
- .--------. .----+---------------.
- | Page |<----------+ Send [Page] |
- ·--------· ·--------------------·
-
- The diagram above shows the general pipeline. The difference is that the
- action will be its own object. In general, it will need to know how to
- process certain URL formats.
-
- In the process of defining the action objects, ActionCards will be
- created. Below is an example \ActionCard for the default action,
- <tt>_show</tt>. In ActionCards, everything is relative to the Ruwiki
- root URI. Important to note is that ActionCards are an ideal: they may
- not represent something that can be accomplished for 0.9, 0.10, or even
- 1.0. They do, however, represent the ultimate target.
-
- === Action: Show [_show] <strong>DEFAULT</strong>
- ;; /Topic, /Topic/_show : Show <em>Topic</em> in the <em>Default</em> project.
- ;; /Project/, /Project/_show : Show <em>Project</em>::\ProjectIndex.
- ;; /Project/Topic, /Project/Topic/_show : Show <em>Project</em>::<em>Topic</em>.
- ;; /Topic?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>], /Topic/_show?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>] : Show the content of <em>Topic</em> as of the specified date, and optionally time.
- ;; /Project/?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>], /Project/_show?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>] : Show the content of <em>Project</em>::\ProjectIndex as of the specified date, and optionally time.
- ;; /Project/Topic/?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>], /Project/Topic/_show?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>] : Show the content of <em>Project</em>::<em>Topic/</em> as of the specified date, and optionally time.
- ;; /Topic?v=<em>version#</em>, /Topic/_show?v=<em>version#</em> : Show the specified version of <em>Topic</em>.
- ;; /Project/?v=<em>version#</em>, /Project/_show?v=<em>version#</em> : Show the specified version of <em>Project</em>::\ProjectIndex.
- ;; /Project/Topic?v=<em>version#</em>, /Project/Topic/_show?v=<em>version#</em> : Show the specified version of <em>Project</em>::<em>Topic</em>.
- ;; /Topic?s=<em>set-id#</em>, /Topic/_show?s=<em>set-id#</em> : Show the specified set of <em>Topic</em>. This is a possible action that will work with &ldquo;changesets&rdquo;.
- ;; /Project/?s=<em>set-id#</em>, /Project/_show?s=<em>set-id#</em> : Show the specified set of <em>Project</em>::\ProjectIndex. This is a possible action that will work with &ldquo;changesets&rdquo;.
- ;; /Project/Topic?s=<em>set-id#</em>, /Project/Topic/_show?s=<em>set-id#</em> : Show the specified set of <em>Project</em>::<em>Topic</em>. This is a possible action that will work with &ldquo;changesets&rdquo;.
-
- == Ruwiki 0.10.0: &ldquo;What&rsquo;s Your Line?&rdquo;
- The antispam techniques introduced in 0.9.0 are positive steps in the
- fight against wiki defacement. They are hopefully effective, too. The
- problem is that because 0.9.0 doesn&rsquo;t offer users or user
- authentication, there&rsquo;s no way of safely allowing the edit of the
- antispam lists. Thus, to allow this and other potentially dangerous
- actions, a user and capability framework will be added to Ruwiki. This
- framework will allow for user identification, authentication, and
- authorization to indicate what users are allowed to perform what
- actions.
-
- Authenticated users will be able to bypass blacklist checking; thus, if
- &ldquo;msn.com&rdquo; is blocked, &ldquo;joe.blog@msn.com&rdquo; could
- still authenticate with Ruwiki and edit the pages. Some users will be
- able to manage user permissions (including user management), edit
- antispam lists, etc.
-
- Other actions will be added, including the ability to rename topics and
- move topics between projects. In both cases, the topic change history
- must be maintained.
-
- The documentation for Ruwiki will be substantially complete with this
- version, lacking only specific information on the features that will be
- added in Ruwiki 1.0.0.
-
- == Ruwiki 1.0.0: &ldquo;Yes, Minister&rdquo;
- A combined strength and weakness of Ruwiki is that it currently does
- little to protect against arbitrary HTML being inserted into the current
- topic. The allowed subset of HTML should be restricted to a safe subset
- to prevent cross-site-scripting attacks.
-
- Pages and projects have properties: we need to provide the ability to
- edit those properties. Part of the properties that should be editable
- include whether a page is frozen &mdash; this means that the page is no
- longer editable by any user (unless it is unfrozen) and is effectively a
- plain HTML page. Other properties include the static header and footer
- information in a page or project.
-
- Modern Wikis require an RSS feed. Ruwiki will provide one.
-
- == The Future: &ldquo;Yes, Prime Minister&rdquo;
- Ruwiki 1.0.0 does not represent the end of the line for Ruwiki, but what
- the future holds is unclear. We&rsquo;ll see what the future brings.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: Roadmap
-properties!topic: Roadmap
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
deleted file mode 100644
index 787f9c1..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
+++ /dev/null
@@ -1,157 +0,0 @@
-page!content: = Ruwiki 0.8.0 Templating
- Ruwiki uses a heavily modified version of the \RDoc
- &ldquo;cheap-n-cheerful&rdquo; HTML page template system. This a
- line-oriented, text-based templating system.
-
- == Templates
- Templates in the templating system are essentially plain strings with
- particular references to templating keys or an include directive.
-
- The template interacts with value and message hashes provided by
- Ruwiki. The keys known to the templates expected by Ruwiki are
- detailed in Extending_Ruwiki. Nested key references are found from the
- inside-out. That is, the closest resolving key to the current level is
- found, not the furthest resolving key.
-
- === Including Other Templates
- Templates may include other templates to any arbitrary level by using the
- <tt>!INCLUDE!</tt> directive. When the \TemplatePage is created, an
- array of template strings are provided; these will be used to satisfy
- <tt>!INCLUDE!</tt> directives. If there are not enough template
- strings provided, <tt>!INCLUDE!</tt> won&rsquo;t be translated.
-
- : This may change before Ruwiki reaches 1.0, so that templates are
- : named instead of iterated.
-
- === Simple Template Keys
- Strings of the format <tt>%<em>key</em>%</tt> or
- <tt>%?<em>key</em>%</tt> are simple template keys. <em>key</em> is
- looked up in the provided value hash and is presented as the string
- value of the result. <tt>%key%</tt> template keys are mandatory; if
- the key is not found in the value hash, an exception will be raised.
- <tt>%?key%</tt> template keys are optional; if they key is not found
- in the value hash, an empty string (&ldquo;&rdquo;) will be used.
-
- === Labels
- Strings of the format <tt>#<em>key</em>#</tt> or
- <tt>#?<em>key</em>#</tt> are labels. <em>key</em> is looked up in the
- provided message hash as a Symbol (e.g.,
- <tt><em>key</em>.intern</tt>). As with simple template keys,
- <tt>#key#</tt> labels are mandatory and <tt>#?key#</tt> labels are
- optional.
-
- === Links
- Strings of the format <tt>HREF:\ref:name</tt> will become HTML links.
- Both <em>ref</em> and <em>name</em> are keys to be looked up.
- <em>name</em> is mandatory; an exception will be raised if it is not
- found.
-
- === Control Structures
- The templating library supports both looping and conditional control
- structures in both single-line and multi-line forms. Single-line
- control structures <strong>may not</strong> be nested; multi-line
- control structures <strong>may</strong> be nested arbitrarily deeply.
-
- ==== Looping Control Structures
- There are two forms of looping control structures.
-
- [:key|stuff:]
-
- START:key
- ... stuff ...
- END:key
-
- ===== Single-Line Looping
- [:key|stuff:]
-
- The value of <em>key</em> may be <tt>nil</tt>, an integer value, a
- range, or an array. When <em>key</em> represents:
- # <tt>nil</tt>, the looping structure will be replaced with an empty string.
- # An integer, <em>stuff</em> will be repeated <em>key</em> times. Values from 1 to <em>key</em> will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # A range, <em>stuff</em> will be repeated once for each successive value in the range of <em>key</em>. Each value will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # An array, the behaviour will differ depending on the contents of the array.
- ## If the array contains hashes, the behaviour is the same as a multi-line looping construct. See below for details.
- ## Otherwise, the template iterates through the array, providing each value to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
-
- As an example, if we have:
-
- "[:b|%b% ]"
-
- # <tt>val["b"] = 3 -> "1&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = (0..2) -> "0&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = ["a", "B"] -> "a&nbsp;B&nbsp;"</tt>
-
- ==== Multi-Line Looping
- START:key
- ... stuff ....
- END:key
-
- The value of <tt>key</tt> must be an array of hashes. <tt>... stuff
- ...</tt> will be repeated once for each entry in the array. The hashes
- will be passed as nested value hashes.
-
- %a% [:b|%a% ]%a%
-
- When the above template string is run with the following hash:
-
- val["a"] = 1
- val["b"] = [ { "a" => 2 }, { "a" => 3 } ]
-
- The result is:
-
- 1 2 3 1
-
- The behaviour is the same for multi-line blocks.
-
- ==== Conditional Block Keys
- IF:key
- ... stuff ...
- ENDIF:key
-
- The block between <tt>\IF:key</tt> and <tt>\ENDIF:key</tt> will be included in
- the output only if the corresponding key is set in the value hash.
-
- == Example
- Given the set of templates T1, T2, and T3 (shown below), here&rsquo;s how we would
- use the templating system.
-
- values = { "name" => "Dave", "state" => "TX" }
- t = TemplatePage.new(T1, T2, T3)
- File.open(name, w) { |f| t.process(f, values) }
-
- or:
-
- <!-- Source -->
- val1 = { "name" => "Dave", "state" => "TX" }
- val2 = { "name" => "Dave" }
- msgs = { }
- res = ""
- t.process(res, values, msgs)
-
- <!-- T1 -->
- Templates can subsitute a wide variety of values.
- !INCLUDE!
-
- <!-- T2 -->
- Name: %name% !INCLUDE!
-
- <!-- T3 -->
- IF:state
- State: %state%
- ENDIF:state
-
- The result will be:
-
- Name: Dave
- State: TX
-
- Name: Dave
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: RuwikiTemplatingLibrary
-properties!topic: RuwikiTemplatingLibrary
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/SandBox.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/SandBox.ruwiki
deleted file mode 100644
index 075cc47..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/SandBox.ruwiki
+++ /dev/null
@@ -1,11 +0,0 @@
-page!content: This page is intended for users to play with freely to
- practice their \WikiFormatting.
-
- $Id$
-properties!indexable: false
-properties!project: Ruwiki
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/To_Do.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/To_Do.ruwiki
deleted file mode 100644
index 8cf88f5..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/To_Do.ruwiki
+++ /dev/null
@@ -1,61 +0,0 @@
-page!content: = Ruwiki 0.8.0 To Do Tracking
- Completed to-do items can be found in the ChangeLog. Bugs in Ruwiki
- are tracked in BugTracking.
-
- == Well-Defined To Do Items
- === Ruwiki 0.8.1
- ; Non-local installation : current Ruwiki can support a non-local configuration (that is, where the data and templates are in a separate directory from the startup program), but there is no mechanism to automate this. In order to enable a \RubyGem or <acronym title="Ruby Production Archive">RPA</acronym> installation of Ruwiki, this mechanism will be necessary.
- ; Stored configurations : allow for configuration objects to be stored. This will make it easier to support non-local installations and configurations.
- ; Ruwiki installer : add a command-line program to create a new deployment of Ruwiki; this will copy the default data to the local installation.
- ; Central location : add the ability to use the data in the central installation that is provided by a \RubyGem or <acronym title="Ruby Production Archive">RPA</acronym> installation.
- ; Windows service : allow Ruwiki to be run as a Windows service for users of the Win32 build of Ruby.
- ; \RubyGem : Offer Ruwiki as a \RubyGem.
- === Ruwiki 0.9.0
- ; Versioning : complete the change history interface. Change history is currently stored in a file <em>topic[.extension]</em>.rdiff. There is no way to display the change history at this point.
- ; Action objects : Actions will be generalised to pull the processing out of the main ruwiki.rb inasmuch as is possible.
- ; Function tokens : generalize the %&lt;function-name&gt;[(&lt;args&gt;)] calling method so that function tokens can be created without having to create a custom regular expression.
- ; Search work : There is further search work required. The current mechanism is effective, but inefficient, as it must load and convert each file in a project to a page and then search selectively within that page. The search mechanism must be improved.
- ; Frozen content : make it so that frozen content can be provided on a per-page or Wiki basis. Will provide both headers and footers. <strong>Note:</strong> Ruwiki 0.9.0 will only provide the ability to present the information, not create or modify it.
- ; Blacklisting : Allow the specification of an allow/deny list for \IPs or hostnames, aimed at blocking known spammers. Entries in this list can be permanent or temporary (e.g., &ldquo;* DENY&rdquo;, &ldquo;spammer.com DENY UNTIL 20040723&rdquo;, &ldquo;139.244.33.25 ALLOW&rdquo;).
- ; External URL redirection : Force \URIs that allow redirection (e.g., HTTP and HTTPS) are redirected through a single point on an instance of Ruwiki (e.g., &lt;ruwiki-uri&gt;_redirect?&lt;url&gt;) unless the specific \URIs or hosts are whitelisted (e.g., rubycentral.com, rubyforge.org, ruby-lang.org, etc.).
- ; Robot exclusion : Recognise known robot user agents; when found, allow them to index and follow links on all pages except command pages (e.g., Project/Topic/_edit, Project/_create, etc.).
- ; \GlobalRecentChanges : Recent changes for all projects.
- === Ruwiki 0.10.0
- ; Authentication : allow user creation and authentication. Authenticate users bypass blacklist checking; thus, if &ldquo;msn.com&rdquo; is blocked, joe.blog@msn.com could still authenticate with Ruwiki and edit the pages.
- ; Topic renaming : add the ability to rename a topic within a project. Topic change history should be maintained.
- ; Topic moving : add the ability to move and/or rename a topic between projects. Topic change history should be maintained.
- ; Complete documentation : Complete the documentation of Ruwiki.
- ; Antispam : Allow the on-line editing of antispam lists to authenticated and authorised users.
- === Ruwiki 1.0.0
- ; Escape HTML Entities : HTML Entities such as &amp;, &lt;, and &gt; are not currently escaped. This may cause problems with some browsers and should be fixed <strong>without</strong> impairing the ability to add at least some raw HTML. Note that the current engine does not check raw HTML and thus could potentially be vulnerable to cross-site-scripting attacks.
- ; RSS Feed : Ruwiki must be able to offer \RecentChanges and \GlobalRecentChanges as RSS feeds. This may not be ideal with the current \RecentChanges format. It may be easier to move to a two-stage \RecentChanges format.
- ; Static content : Allow the creation and editing of static content.
- ; Frozen pages : provide the ability to freeze content in place; the page is no longer &ldquo;wiki&rdquo; editable and is effectively a plain HTML page.
- ; Page properties : provide the ability to generally edit the properties of a given page.
-
- == General Future To Do Items
- ; E-mail gateway : accept topic appends via e-mail.
- ; alternative backends : access other wiki data storage, or other formats, e.g. e-mail boxes in mh or mbox formats
- ; bug tracker backend : with alternate markup
- ; add setup and user config methods : for backend plugin classes, then we can use them with an interactive or gui tool frontend to setup data storage backends. The user might have to run as root or other user with database create permissions.
- ; add id="" to various markup elements (make id specific to topic) : Later we can allow users to tweak a page using uploaded css fragments which might get appended onto the standard css contents.
- ; ruby action : upload a ruby code fragment to add a smart &ldquo;action&rdquo; to that wiki page. Need some sort of security + approval system to handle this safely.
- ; Preview button : add a preview button to the save page.
- ; Alternative templating systems : not as high priority now that there&rsquo;s a real templating system in place.
- ; Alternative markup systems : potentially allow \RedCloth (Textile) and/or \BlueCloth (Markdown) to be processed for a page. This could be implemented as a %function.
- ; Project/topic security : allow certain projects to be restricted/authenticated for read/write based on user.
- ; Track last <em>n</em> links/topics : ?
- ; Write a markup debugger : ?
- ; Validate topic formatting from cgi : ?
- ; Validate project from cgi : ?
- ; Project-based backend : Allow different projects to have different backends.
- ; Arbitrary-depth project namespace support : Foo::Bar::\BazPage.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: To_Do
-properties!topic: To_Do
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/TroubleShooting.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/TroubleShooting.ruwiki
deleted file mode 100644
index 64351ba..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/TroubleShooting.ruwiki
+++ /dev/null
@@ -1,27 +0,0 @@
-page!content: = Ruwiki 0.8.0
- = Ruwiki 0.8.0 Troubleshooting Tips
- Following are some tips contributed by users of Ruwiki. Remember:
- Ruwiki currently requires Ruby version 1.8; the YAML backend requires
- Ruby version 1.8.2 or the latest CVS of Ruby 1.9.
-
- == No such file or directory
- (Unix systems only.) If you get something like:
-
- % ./ruwiki_servlet
- : no such file or directory
-
- run the following in the Ruwiki directory:
-
- % find . | xargs dos2unix
-
- The developers of Ruwiki do what they can to ensure that Ruwiki is
- distributed in a way that works well for both Unix and Windows systems,
- but this will occasionally cause problems.
-
- $Id$
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/Upgrading+and+Converting.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/Upgrading+and+Converting.ruwiki
deleted file mode 100644
index 1abf6af..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/Upgrading+and+Converting.ruwiki
+++ /dev/null
@@ -1,37 +0,0 @@
-page!content: = Ruwiki 0.8.0: Upgrading and Converting
- The flatfile backend format in Ruwiki 0.8.0 is not compatible with that
- of earlier versions of Ruwiki. There are a number of reasons for this,
- but because of this and that there are now three different backends,
- Ruwiki now has a converter utility between backends.
-
- There are two other incompatibilities of note:
- # Ruwiki now defaults to &ldquo;ruwiki&rdquo; as an extension (e.g., \ProjectIndex.ruwiki) to the storage files. This is, of course, is something that can be modified with a configuration option, but you may find it desirable to rename your files to match this naming convention.
- # The rdiff format is incompatible. It is recommended that you remove all .rdiff files from your data directory before using Ruwiki.
-
- == bin/convert [options] &lt;directory&gt;+
- The converter utility will work on all files in a directory and its
- subdirectories.
-
- When a file is encountered, it will be examined to be a known form of a
- Ruwiki backend (marshal, yaml, flatfiles, or "old" flatfiles). If the
- file is not one of these forms, then the file is skipped. Otherwise, it
- is converted to the specified format. By default, the converted files
- will be backed up.
-
- === bin/convert Options
- ; --format=FORMAT : Converts encountered files (regardless of the current format), to the specified format. Default is yaml. Allowed formats are: yaml marshal flatfiles
- ; --[no-]backup : Create backups of upgraded files. Default is --backup.
- ; --backup-extension=EXTENSION : Specify the backup extension. Default is "~", which is appended to the data filename.
- ; --extension=EXTENSION : Specifies the extension of Ruwiki data files. The default is .ruwiki
- ; --no-extension : Indicates that the Ruwiki data files have no extension.
- ; --quiet : Runs quietly. Default is to run with normal messages.
- ; --verbose : Runs with full messages. Default is to run with normal messages.
- ; --help : Shows this text.
-
- $Id$
-properties!project: Ruwiki
-properties!title: Upgrading+and+Converting
-properties!topic: Upgrading+and+Converting
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/WikiFeatures.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/WikiFeatures.ruwiki
deleted file mode 100644
index b4d7a2a..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/WikiFeatures.ruwiki
+++ /dev/null
@@ -1,20 +0,0 @@
-page!content: Ruwiki is a [http://www.ruby-lang.org Ruby]-based wiki. It is
- ideal for personal or small team use.
-
- Ruwiki:
- * Uses the [http://www.ruby-lang.org Ruby] language.
- * Runs quickly and easily as a CGI or \WEBrick servlet.
- * Uses a simple templating system and CSS for presentation.
- * Has flatfile storage with simple versioning.
- * Offers project namespaces. Different projects can have the same topic names and not collide. Thus, \Default::ReadMe and \Project::ReadMe are two different pages.
- * Offers a calendar for date-based collaborative editing.
-
- $Id$
-properties!editable:
-properties!entropy: 0
-properties!project: Ruwiki
-properties!title: WikiFeatures
-properties!topic: WikiFeatures
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Ruwiki/WikiMarkup.ruwiki b/ruwiki/tags/release-0.8.0/data/Ruwiki/WikiMarkup.ruwiki
deleted file mode 100644
index ee581e3..0000000
--- a/ruwiki/tags/release-0.8.0/data/Ruwiki/WikiMarkup.ruwiki
+++ /dev/null
@@ -1,264 +0,0 @@
-page!content: = Ruwiki Markup
- A [http://c2.com/cgi/wiki Wiki] obeys certain formatting rules to make
- it easy to format text without needing to know HTML. This Wiki obeys
- the following rules by default. Because Ruwiki is extensible, there may
- be additional formatting rules. These rules are those rules that apply
- as of Ruwiki 0.8.0.
-
- == \WikiWords, \WikiProjects, Calendars, and External Resources
- While reading stuff on this Wiki, you will see some words mashed
- together with capitalisation (like \WikiWords). While this may seem odd
- at first, this feature allows internal links to be created across the
- Wiki.
-
- There are several allowable forms for \WikiWords.
- # Two or more words concatenated directly. Each word must begin with a capital letter and be followed by zero or more lowercase letters. Thus, \FooBar, \CPlusPlus, and \AbC are all valid \WikiWords, but ABC is not.
- # Two or more words concatenated with underscores. The first word must begin with a capital letter. This makes \Foo_Bar, \C_Plus_Plus, and \A_b_C valid \WikiWords. These \WikiWords will be displayed with spaces instead of underscores. \C_Plus_Plus will be displayed as &ldquo;C Plus Plus&rdquo;.
- # One or more words contained in double square brackets. This the form supported by [http://wikipedia.com/ Wikipedia], and looks like \[[A Wiki Phrase]]. These links will be displayed exactly as entered between the brackets.
- # One or more words contained in double square brackets with display text separated by a vertical bar. These \WikiWords look like \[[A Wiki Phrase|but show this text]]. The link will be to the page &ldquo;A Wiki Phrase&rdquo; and &ldquo;but show this text&rdquo; will be the hyperlink.
-
- If a \WikiWord is found that does not have a page defining the
- \WikiWord, then the word will be shown with a hyperlink question mark
- following it, allowing the \WikiWord to be created.
-
- === \WikiProjects
- This Wiki supports &ldquo;projects.&rdquo; Within each project, a given
- \WikiWord is unique. Thus, if you have a Default project and a Ruwiki
- project, you can have two pages called \ReadMe. Any given \WikiWord
- refers only to topics within its project. That is, if I have \WikiWord
- in the \ReadMe topic of the Default project, it will refer to the
- \WikiWord topic of the Default project. (Another term for this
- capability is &ldquo;namespaces.&rdquo;)
-
- A cross-project link is composed of the project&rsquo;s name, two colons
- (::), and the \WikiWord desired. Thus, from \Default::ReadMe, I can
- have \Ruwiki::ReadMe as a link. The project index can be referred to
- with \::Project. This is the same as doing \Project::ProjectIndex.
- Thus, \::Ruwiki becomes ::Ruwiki, which is the same as
- \Ruwiki::ProjectIndex (Ruwiki::ProjectIndex).
-
- === Project Lists and Topic Lists
- The list of known projects may be listed with the %projects() token;
- the list of known topics for the current project may be listed with the
- %topics() link. An arbitrary project may be provided to the %topics()
- token, as in %topics(Default).
-
- %topics(Default)
-
- %projects()
-
- === Calendars
- Ruwiki supports a miniature calendar. Future versions of Ruwiki will
- allow for calendar aggregation. Using the %calendar function, a
- calendar section will be generated:
-
- %calendar(<year>, <month>[, <project>])
- %calendar(today[, <project>])
-
- %calendar accepts either the English word &ldquo;today&rdquo; (displaying the
- calendar for the current month and year) or a specific month and year
- for display. A calendar for the specified month will be generated
- where each date in the month is treated as a \WikiWord (as are the
- links to the current month, the previous month, and the next month)
- ready for display or editing. As with all other \WikiWord links in
- Ruwiki, a project may be specified in %calendar, making
- &ldquo;%calendar(today, Ruwiki)&rdquo; different from &ldquo;%calendar(today, Default)&rdquo;.
-
- %calendar(today)
- %calendar(1999, 08, Default)
-
- === External Resources
- Ruwiki behaves intelligently about resources external to the Wiki
- itself.
-
- ==== External Links
- \URLs to external resources are automatically detected for web
- addresses, FTP addresses, newsgroups, and email links. They are
- automatically converted to clickable \URLs. Be aware that some things
- that look like URL schemas may be make clickable but are not really
- \URLs.
-
- * \http://www.ruby-lang.org becomes http://www.ruby-lang.org
-
- \URLs may be named with the [url name] syntax. If the name is omitted,
- the URL will be numbered. Numbering is contained to within the page.
-
- * \[http://www.rubygarden.org RubyGarden] becomes [http://www.rubygarden.org RubyGarden].
- * \[http://www.halostatue.ca] and \[http://www.halostatue.ca/ruby] become [http://www.halostatue.ca] and [http://www.halostatue.ca/ruby].
-
- ==== Images
- : <strong>Changed in Ruwiki 0.8.0!</strong>
-
- In preparation for the anti-wiki-spam features of Ruwiki 0.9.0, it has
- been necessary to remove the ability for \URLs to be converted into
- inline images automatically. Inline images are now created with the
- image markup format, generally of the format \[image:URI options]. The
- <em>options</em> format is generally the same format as an HTML
- attribute (<em>name="value"</em>; the quotes are optional for
- single-word option values) and any valid HTML attribute is also a
- valid <em>option</em>. There is one special <em>option</em>,
- <tt>numbered</tt>. This value, if set to any other value than &ldquo;false&rdquo;,
- will set the <tt>title</tt> of the image to a numbered link.
-
- If the <tt>title</tt> attribute is not specified, it will be set from
- the <tt>alt</tt> attribute (if specified) or the image&rsquo;s URL. If the
- <tt>alt</tt> attribute is not specified, it will be set from the
- <tt>title</tt> attribute.
-
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif] [image:http://www.halostatue.ca/graphics/maple_leaf.gif]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true] [image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"]
-
- ==== Ruby Mailing Lists
- If a Ruby mailing list message tag is provided, it will be converted appropriately.
-
- * \[ruby-talk:12345] will become [ruby-talk:12345]
- * \[ruby-core:12345] will become [ruby-core:12345]
- * \[ruby-doc:12345] will become [ruby-doc:12345]
-
- == Headings and Lists
- === Headings
- Use equals signs (=) for headings. Up to six equals signs can be used
- for HTML headings 1 - 6.
-
- \===== Heading five<br />
- \====== Heading six
- ===== Heading five
- ====== Heading six
-
- === Lists
- ==== Bulleted Lists
- Use asterisks (*) to create bulleted lists. More asterisks means more
- levels.
-
- \* level 1<br />
- \** level 2<br />
- \*** level 3
-
- * level 1
- ** level 2
- *** level 3
-
- ==== Numbered Lists
- Use hash marks (#) for numbered lists. More hash marks means deeper
- levels.
-
- \# level 1<br />
- \## level 2<br />
- \### level 3<br />
- \### level 3.2<br />
- \## level 2.2<br />
- \# level 1.2
-
- # level 1
- ## level 2
- ### level 3
- ### level 3.2
- ## level 2.2
- # level 1.2
-
- ==== Definition Lists
- Definitions can be created similar to other lists. Unlike &ldquo;standard&rdquo;
- lists, though, definition lists have both the term and the definition.
- They are specified like so. As with other lists, repeating the first
- item (;) will increase the indentation level. The browser may not
- respect this.
-
- \; term : definition<br />
- \;; term2 : definition<br />
- \;;; term3 : definition
-
- ; term : definition
- ;; term2 : definition
- ;;; term3 : definition
- == Paragraph Formatting
- === Rules
- Four or more dashes ("----") on a line by itself makes a horizontal
- rule, like so:
-
- \----
- ----
- === Paragraphs
- A blank line (it may have whitespace on it) marks a new paragraph. All
- other lines are joined together (excepting headers, lists, and rules).
-
- This line is a new paragraph.
-
- === Block Indent Paragraphs
- Paragraphs can be indented by beginning the paragraph with one or more
- colons (:).
-
- \: Indent Level 1<br />
- \:: Indent Level 2<br />
- \::: Indent Level 3
-
- : Indent Level 1
- :: Indent Level 2
- ::: Indent Level 3
-
- Paragraphs may be indented as &ldquo;cites&rdquo; by using one or more
- greater-than signs (>) at the beginning of the line.
-
- \> Indent Level 1<br />
- \>> Indent Level 2<br />
- \>>> Indent Level 3
-
- > Indent Level 1
- >> Indent Level 2
- >>> Indent Level 3
-
- === Code
- Text that is indented will be presented as formatted in a monospaced
- font. The only change is to escape HTML entities &lt; (&amp;lt;), &gt;
- (&amp;gt;), and &amp; (&amp;amp;).
-
- def replace
- content = @match[1]
- %Q{<pre>#{content}</pre>}
- end
-
- == Miscellaneous Formatting
- === HTML
- The Ruwiki engine currently passes through HTML without changes. Thus,
- &lt;strong&gt;strong&lt;/strong&gt; would be shown as
- <strong>strong</strong>. <strong><em>Note:</em></strong> This
- capability could be very dangerous as it could expose the Wiki to
- cross-site scripting (XSS) vulnerabilities. This will be remedied
- prior to the 1.0 release of Ruwiki.
-
- === Abbreviations
- Certain abbreviations may be known to the Wiki. While there is not yet
- any way for a user to query what abbreviations are known, if the
- abbreviations are told to the users, they may be used. Abbreviations
- are presented with @{key}, where <em>key</em> is the abbreviation
- desired. This Wiki, for example, knows that \@{matz} means &ldquo;@{matz}&rdquo;.
- The special form \@{} will produce the current list of known
- abbreviations. Unknown abbreviations will simply be put back into the
- data stream unchanged. Thus, \@{unknownkey} results in @{unknownkey}.
-
- ==== Known Abbreviations
- @{}
-
- === Preventing Formatting
- If you wish to prevent a word or sequence from being interpreted, put
- a backslash (\) in front of it. This works on all formatting options
- except paragraph positioning. Thus, if I want to prevent a \WikiWord
- from being turned into a hyperlink, I need to backslash it:
- \\WikiWord.
-
- === Other Possible Considerations
- I&rsquo;m looking at adding styles similar to what is shown on the Wiki
- below.
-
- * http://www.pmichaud.com/wiki/PmWiki/WikiStyles
-
- $Id$
-page!footer:
-page!header:
-properties!project: Ruwiki
-properties!title: WikiMarkup
-properties!topic: WikiMarkup
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Tutorial/AddingPages.ruwiki b/ruwiki/tags/release-0.8.0/data/Tutorial/AddingPages.ruwiki
deleted file mode 100644
index faf6c8c..0000000
--- a/ruwiki/tags/release-0.8.0/data/Tutorial/AddingPages.ruwiki
+++ /dev/null
@@ -1,17 +0,0 @@
-page!content: = Adding Pages
- To add a new page to Ruwiki, all you need to do is come up with a
- meaningful title, turn it into a \WikiWord (see Ruwiki::WikiMarkup) and
- Ruwiki will automatically recognise it as a reference to a page that
- does not yet exist.
-
- At the end of the new \WikiWord is a hyperlinked question mark;
- clicking on this will open the edit page for the new \WikiWord in
- Ruwiki.
-
- $Id$
-properties!project: Tutorial
-properties!title: AddingPages
-properties!topic: AddingPages
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Tutorial/AddingProjects.ruwiki b/ruwiki/tags/release-0.8.0/data/Tutorial/AddingProjects.ruwiki
deleted file mode 100644
index b96b809..0000000
--- a/ruwiki/tags/release-0.8.0/data/Tutorial/AddingProjects.ruwiki
+++ /dev/null
@@ -1,17 +0,0 @@
-page!content: = Adding Projects
- To add a new project to Ruwiki, all you need to do is come up with a
- meaningful one-word name, and then turn it into a project link, e.g.,
- \::Project. Projects may <strong>only</strong> be a single word &mdash;
- they are not normal \WikiWords (see Ruwiki::WikiMarkup for details).
- Ruwiki will recognise this as a project that does not yet exist. At the
- end of the Project link is a hyperlinked question mark; clicking on
- this will open the \Project::ProjectIndex in Ruwiki for editing and
- create the new project.
-
- $Id$
-properties!project: Tutorial
-properties!title: AddingProjects
-properties!topic: AddingProjects
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Tutorial/ProjectIndex.ruwiki b/ruwiki/tags/release-0.8.0/data/Tutorial/ProjectIndex.ruwiki
deleted file mode 100644
index 73a13a8..0000000
--- a/ruwiki/tags/release-0.8.0/data/Tutorial/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,12 +0,0 @@
-page!content: = Ruwiki 0.8.0 Tutorial
- This tutorial is incomplate.
-
- %topics(Tutorial)
-
- $Id$
-properties!project: Tutorial
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/data/Tutorial/SandBox.ruwiki b/ruwiki/tags/release-0.8.0/data/Tutorial/SandBox.ruwiki
deleted file mode 100644
index 9d4e4c8..0000000
--- a/ruwiki/tags/release-0.8.0/data/Tutorial/SandBox.ruwiki
+++ /dev/null
@@ -1,10 +0,0 @@
-page!content: This page is intended for users to play with freely to
- practice their \WikiFormatting.
-
- $Id$
-properties!project: Tutorial
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki.rb
deleted file mode 100644
index 8c089e1..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki.rb
+++ /dev/null
@@ -1,449 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-class Ruwiki
- VERSION = '0.8.0'
- CONTENT_VERSION = 2
-end
-
-require 'cgi'
-require 'ruwiki/handler'
-require 'ruwiki/template'
-require 'ruwiki/lang/en' # Default to the English language.
-require 'ruwiki/config'
-require 'ruwiki/backend'
-require 'ruwiki/wiki'
-require 'ruwiki/page'
-
- # = Ruwiki
- # Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI
- # and WEBrick interfaces, templates, and CSS formatting. Additionally, it
- # supports project namespaces, so that two pages can be named the same for
- # differing projects without colliding or having to resort to odd naming
- # conventions. Please see the ::Ruwiki project in the running Wiki for more
- # information. Ruwiki 0.7.0 has German and Spanish translations available.
- #
- # == Quick Start (CGI)
- # 1. Place the Ruwiki directory in a place that your webserver can execute
- # CGI programs and ensure that ruwiki.cgi is executable on your webserver.
- # 2. Point your web browser to the appropriate URL.
- #
- # == Quick Start (WEBrick)
- # 1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
- # 2. Point your web browser to <http://localhost:8808/>.
- #
- # == Configuration
- # There are extensive configuration options available. The Ruwiki WEBrick
- # servlet offers command-line options that simplify the configuration of
- # Ruwiki without editing the servlet; use ruwiki_servlet --help for more
- # information.
- #
- # == Copyright
- # Copyright:: Copyright © 2002 - 2004, Digikata and HaloStatue, Ltd.
- # Authors:: Alan Chen (alan@digikata.com)
- # Austin Ziegler (ruwiki@halostatue.ca)
- # Licence:: Ruby's
-class Ruwiki
- ALLOWED_ACTIONS = %w(edit create)
- EDIT_ACTIONS = %w(save cancel)
- EDIT_VARS = %w(newpage version edcomment q)
- RESERVED = ['save', 'preview', 'cancel', EDIT_VARS].flatten
-
- # Returns the current configuration object.
- attr_reader :config
- # Returns the current Response object.
- attr_reader :response
- # Returns the current Request object.
- attr_reader :request
- # Returns the current Markup object.
- attr_reader :markup
- # Returns the current Backend object.
- attr_reader :backend
-
- # Sets the configuration object to a new configuration object.
- def config=(cc)
- raise self.message[:config_not_ruwiki_config] unless cc.kind_of?(Ruwiki::Config)
- @config = cc
- @markup.default_project = @config.default_project
- @markup.message = self.message
- end
-
- # The message hash.
- def message
- @config.message
- end
-
- # Initializes Ruwiki.
- def initialize(handler)
- @request = handler.request
- @response = handler.response
-
- @config = Ruwiki::Config.new
-
- @path_info = @request.determine_request_path || ''
-
- @type = nil
- @error = {}
-
- @markup = Ruwiki::Wiki.new(@config.default_project,
- @request.script_url,
- @config.title)
- end
-
- # Initializes the backend for Ruwiki.
- def set_backend
- @backend = BackendDelegator.new(self, @config.storage_type)
- @markup.backend = @backend
- end
-
- # Runs the steps to process the wiki.
- def run
- @config.verify
- set_backend
- set_page
- process_page
- render
- rescue Exception => ee
- render(:error, ee)
- ensure
- output
- end
-
- # Initializes current page for Ruwiki.
- def set_page
- path_info = @path_info.split(%r{/}, -1).map { |ee| ee.empty? ? nil : ee }
-
- if path_info.size == 1 or (path_info.size > 1 and path_info[0])
- raise self.message[:invalid_path_info_value] % [@path_info] unless path_info[0].nil?
- end
-
- # path_info[0] will ALWAYS be nil.
- path_info.shift
-
- case path_info.size
- when 0 # Safety check.
- nil
- when 1 # /PageTopic OR /_edit
- set_page_name_or_action(path_info[0])
- when 2 # /Project/ OR /Project/PageTopic OR /Project/_edit OR /Project/create
- @project = path_info.shift
- set_page_name_or_action(path_info[0])
- else # /Project/PageTopic/_edit OR /Project/diff/3,4 OR something else.
- @project = path_info.shift
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- else
- @topic = item
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- end
- end
- end
-
-# @request.each_parameter { |key, val| puts "#{key} :: #{val.class}" }
-
- @project ||= @config.default_project
- @topic ||= @config.default_page
- end
-
- # Processes the page through the necessary steps. This is where the edit,
- # save, cancel, and display actions are present.
- def process_page
- content = nil
- formatted = false
-
- @page = Ruwiki::Page.new(@backend.retrieve(@topic, @project))
- @type = :content
-
- # TODO Detect if @action has already been set.
- @action ||= @request.parameters['action'].downcase if @request.parameters['action']
- @action ||= 'save' if @request.parameters['save']
- @action ||= 'cancel' if @request.parameters['cancel']
- @action ||= 'preview' if @request.parameters['preview']
-
- case @action
- when 'search'
- # todo: add global search checkbox
- # get, validate, and cleanse the search string
- srchstr = validate_search_string(@request.parameters['q'])
- srchall = @request.parameters['a']
-
- @page.content = self.message[:search_results_for] % [srchstr]
- @page.topic = srchstr
-
- unless srchall.nil?
- hits = @backend.search_all_projects(srchstr)
- else
- hits = @backend.search_project(@page.project, srchstr)
- end
-
- # debug hit returns
-# hits.each { |key, val| $stderr << " #{key} : #{val}\n" }
-
- # turn hit hash into content
- hitarr = []
- # organize by number of hits
- hits.each { |key, val| (hitarr[val] ||= []) << key }
-
- rhitarr = hitarr.reverse
- maxhits = hitarr.size
- rhitarr.each_with_index do |tarray, rnhits|
- next if tarray.nil? or tarray.empty?
- nhits = maxhits - rnhits - 1
-
- if nhits > 0
- @page.content << "\n== #{self.message[:number_of_hits] % [nhits]}\n* "
- @page.content << tarray.join("\n* ")
- end
- end
-
- @type = :search
- when 'topics'
- if @backend.project_exists?(@page.project)
- topic_list = @backend.list_topics(@page.project)
- else
- topic_list = []
- end
-
- # todo: make this localized
- if topic_list.empty?
- @page.content = self.message[:no_topics] % [@page.project]
- else
- topic_list.map! do |tt|
- uu = CGI.unescape(tt)
- if (uu != tt) or (tt =~ /^[A-Z][a-z]+$/)
- "[[#{CGI.unescape(tt)}]]"
- else
- tt
- end
- end
- @page.content = <<EPAGE
-= #{self.message[:topics_for_project] % [@page.project]}
-* #{topic_list.join("\n* ")}
-EPAGE
-$stderr.puts @page.content.inspect
- end
-
- @type = :content
- when 'projects'
- proj_list = @backend.list_projects
-
- if proj_list.empty?
- @page.content = self.message[:no_projects]
- else
- # TODO make this localized
- proj_list.map! { |proj| %[#{proj} (a href='\\#{@request.script_url}/#{proj}/_topics' class='rw_minilink')#{self.message[:project_topics_link]}</a>] }
- @page.content = <<EPAGE
-= #{self.message[:wiki_projects] % [@config.title]}
-* ::#{proj_list.join("\n* ::")}
-EPAGE
- end
-
- content = @page.to_html(@markup)
- content.gsub!(%r{\(a href='([^']+)/_topics' class='rw_minilink'\)}, '<a href="\1/_topics" class="rw_minilink">') #'
- formatted = true
- @type = :content
- when 'edit', 'create'
- # Automatically create the project if it doesn't exist or if the action
- # is 'create'.
- @backend.create_project(@page.project) if @action == 'create'
- @backend.create_project(@page.project) unless @backend.project_exists?(@page.project)
- @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR'])
-
- content = nil
- formatted = true
- @type = :edit
- when 'save', 'preview'
- np = @request.parameters['newpage'].gsub(/\r/, '').chomp
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.editor_ip = @request.environment['REMOTE_ADDR']
-
- if @action == 'save'
- op = @page.content
- else
- op = nil
- end
-
- if np == op and @action == 'save'
- @page.content = op
- @type = :content
- else
- @page.content = np
- edc = @request.parameters['edcomment']
- unless (edc.nil? or edc.empty? or edc == "*")
- @page.edit_comment = edc
- end
-
- if @action == 'save'
- @type = :save
- @page.version = @request.parameters['version'].to_i + 1
- @backend.store(@page)
-
- # hack to ensure that Recent Changes are updated correctly
- if @page.topic == 'RecentChanges'
- recent = Ruwiki::Page.new(@backend.retrieve(@page.topic, @page.project))
- @page.content = recent.content
- end
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- else
- @type = :preview
- content = nil
- formatted = true
- end
- end
- when 'cancel'
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.version = @request.parameters['version'].to_i
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- @type = :content
- else
- # TODO AZ: This should probably return a 501 Not Implemented or some
- # other error unless @action.nil?
- nil
- end
- content = @page.to_html(@markup) if not formatted
- rescue Exception => ee # rescue for def process_page
- @type = :error
- if ee.kind_of?(Ruwiki::Backend::BackendError)
- name = "#{self.message[:error]}: #{ee.to_s}"
- else
- name = "#{self.message[:complete_utter_failure]}: #{ee.to_s}"
- end
- @error[:name] = CGI.escapeHTML(name)
- @error[:backtrace] = ee.backtrace.map { |el| CGI.escapeHTML(el) }.join("<br />\n")
- content = nil
- ensure
- @content = content
- end # def process_page
-
- # Renders the page.
- def render(*args)
- if args.empty?
- type = @type
- error = @error
- else
- raise ArgumentError, self.message[:render_arguments] unless args.size == 2
- type = args[0]
- error = {
- :name => args[1].inspect.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;'),
- :backtrace => args[1].backtrace.join("<br />\n")
- }
- @page = Ruwiki::Page.new(Ruwiki::Page::NULL_PAGE)
- end
-
- @rendered_page = ""
- values = {
- "css_link" => @config.css_link,
- "home_link" => %Q(<a href="#{@request.script_url}">#{@config.title}</a>),
- "cgi_url" => @request.script_url,
- "content" => @content,
- }
-
- if @page.nil?
- values["page_project"] = ""
- values["page_raw_topic"] = ""
- values["page_topic"] = ""
- values["editable"] = false
- values["indexable"] = false
- else
- values["page_project"] = @page.project
- values["page_raw_topic"] = @page.topic
- values["page_topic"] = CGI.unescape(@page.topic)
- values["editable"] = @page.editable
- values["indexable"] = @page.indexable
- end
-
- values["url_project"] = %Q(#{values["cgi_url"]}/#{values["page_project"]})
- values["url_topic_search"] = %Q(#{values["url_project"]}/_search?q=#{values["page_topic"]})
- values["link_topic_search"] = %Q(<a href='#{values["url_topic_search"]}'><strong>#{values["page_topic"]}</strong></a>)
-
- case type
- when :content, :save, :search
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}" if @page.nil?
- values["wiki_title"] ||= "#{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["label_topic_or_search"] = self.message[:label_topic]
- values["page_topic_name"] = values["page_topic"]
- if type == :content or type == :search
- template = TemplatePage.new(@config.template(:body), @config.template(:content), @config.template(:controls), @config.template(:footer))
- if type == :search
- values["label_topic_or_search"] = self.message[:label_search]
- else
- values["page_topic"] = values["link_topic_search"]
- end
- else
- # action type was save
- values["page_topic"] = values["link_topic_search"]
- template = TemplatePage.new(@config.template(:body), @config.template(:save), @config.template(:controls), @config.template(:footer))
- end
- when :edit, :preview
- template = TemplatePage.new(@config.template(:body), @config.template(:edit))
- values["wiki_title"] = "#{self.message[:editing]}: #{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_content"] = @page.content
- values["page_version"] = @page.version.to_s
- values["unedited_page_content"] = @page.to_html(@markup)
- values["pre_page_content"] = CGI.escapeHTML(@page.content)
- if @request.parameters["edcomment"].nil? or @request.parameters["edcomment"].empty?
- values["edit_comment"] = "*"
- else
- values["edit_comment"] = @request.parameters["edcomment"]
- end
- when :error
- template = TemplatePage.new(@config.template(:body), @config.template(:error))
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}"
- values["name"] = error[:name]
- values["backtrace"] = error[:backtrace]
- values["backtrace_email"] = error[:backtrace].gsub(/<br \/>/, '')
- values["webmaster"] = @config.webmaster
- end
-
- template.process(@rendered_page, values, @config.message)
- end
-
- # Outputs the page.
- def output
- @response.add_header("Content-type", "text/html")
- @response.add_header("Cache-Control", "max_age=0")
- @response.write_headers
- @response << @rendered_page
- end
-
- # nil if string is invalid
- def validate_search_string(instr)
- return nil if instr.empty?
-
- modstr = instr.dup
-
- #TODO: add validation of modstr
- return modstr
- end
-
-private
- RE_ACTION = %r{^_([[:lower:]]+)$}
-
- def set_page_name_or_action(item)
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- else
- @topic = item
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/backend.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/backend.rb
deleted file mode 100644
index 879d147..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/backend.rb
+++ /dev/null
@@ -1,306 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'diff/lcs'
-
-class Ruwiki
- # The list of known backends.
- KNOWN_BACKENDS = [:flatfiles, :yaml, :marshal]
-
- # The Ruwiki backend delegator. Ruwiki will always instantiate a version
- # of this class which delegates the actual method execution to the Backend
- # class. Error handling is handled by capturing (and possibly forwarding)
- # exceptions raised by the delegate class.
- class BackendDelegator
- def initialize(ruwiki, backend)
- @message = ruwiki.config.message
- @time_format = ruwiki.config.time_format || "%H:%M:%S"
- @date_format = ruwiki.config.date_format || "%Y.%m.%d"
- @datetime_format = ruwiki.config.datetime_format || "#{@date_format} #{@time_format}"
- options = ruwiki.config.storage_options
- options[:default_page] = ruwiki.config.default_page
-
- unless Ruwiki::KNOWN_BACKENDS.include?(backend)
- raise RuntimeError, @message[:backend_unknown] % [backend]
- end
-
- beconst = (befile = backend.id2name).capitalize
-
- require "ruwiki/backend/#{befile}"
-
- beoptions = options[backend]
- @delegate = Ruwiki::Backend.const_get(beconst).new(beoptions)
- rescue Ruwiki::Backend::BackendError => e
- if e.kind_of?(Array)
- raise Ruwiki::Backend::BackendError.new(nil), @message[e.reason[0]] % e.reason[1]
- else
- raise
- end
- end
-
- # Retrieve the specified topic and project page. Calls Backend#load
- # after verifying that the project exists.
- def retrieve(topic, project = 'Default')
- unless page_exists?(topic, project)
- exported = Ruwiki::Page::NULL_PAGE.dup
- exported['properties'] = {
- 'title' => topic,
- 'topic' => topic,
- 'project' => project,
- 'create-date' => Time.now,
- 'edit-date' => Time.now,
- 'editable' => true,
- 'indexable' => true,
- 'entropy' => 0.0,
- 'html-headers' => [],
- 'version' => 0
- }
- exported['page'] = {
- 'header' => nil,
- 'footer' => nil
- }
-
- if project_exists?(project)
- exported['page']['content'] = ""
- else
- exported['page']['content'] = @message[:project_does_not_exist] % [project]
- end
- return exported
- end
-
- return @delegate.load(topic, project)
- rescue Ruwiki::Backend::InvalidFormatError => e
- raise Ruwiki::Backend::BackendError.new(nil), @message[:page_not_in_backend_format] % [project, topic, @delegate.class]
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_read_topic] % [project, topic]
- rescue Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_retrieve_topic] % p
- end
-
- # Stores the specified topic and project page.
- def store(page)
- @delegate.store(page)
-
- # update change page
- begin
- recent_changes = nil
- if (page.topic == 'RecentChanges')
- recent_changes = page.dup
- else
- recent_changes = Page.new(retrieve('RecentChanges', page.project))
- end
-
- changeline = "\n; #{Time.now.strftime(@datetime_format)}, #{page.topic} : #{page.edit_comment}"
-
- # add changeline to top of page
- recent_changes.content = changeline + (recent_changes.content || "")
- @delegate.store(recent_changes)
- rescue Exception => e
- raise "Couldn't save RecentChanges\n#{e.backtrace}"
- end
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_store_topic] % [page.project, page.topic]
- rescue Exception => e
- p = [page.project, page.topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_store_topic] % p
- end
-
- # Destroys the specified topic and project page.
- def destroy(page)
- @delegate.destroy(page)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_destroy_topic] % [page.project, page.topic]
- rescue Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_destroy_topic] % p
- end
-
- # Releases the lock on the page.
- def release_lock(page, address = 'UNKNOWN')
- @delegate.release_lock(page, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_release_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:error_releasing_lock] % p
- end
-
- # Attempts to obtain a lock on the page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- @delegate.obtain_lock(page, address, timeout)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_obtain_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:error_creating_lock] % p
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- @delegate.project_exists?(project)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- @delegate.page_exists?(topic, project)
- end
-
- # Attempts to create the project.
- def create_project(project)
- @delegate.create_project(project)
- rescue Ruwiki::Backend::ProjectExists => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:project_already_exists] % [project]
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_create_project] % [project]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_create_project] % p
- end
-
- # Attempts to destroy the project.
- def destroy_project(project)
- @delegate.destroy_project(project)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_destroy_project] % [project]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_destroy_project] % p
- end
-
- def search_all_projects(searchstr)
- if @delegate.respond_to?( :search_all_projects )
- return @delegate.search_all_projects(searchstr)
- end
-
- search_all_projects_default(searchstr)
- end
-
- # Attempts to search all projects.
- # this is the default search_all_projects used unless the delegate implements
- # a specialized search_all_projects
- def search_all_projects_default(searchstr)
- hits = {}
- list_projects.each do |project|
- lhits = search_project(project, searchstr)
- # Transform the keys from project local to global links.
- lhits.each { |key, val| hits["#{project}::#{key}"] = val }
- end
- hits
- end
-
- # Attempts to search a project
- def search_project(project, searchstr)
- #TODO: Validate searchstr is a safe regexp?
- @delegate.search_project(project, searchstr)
- rescue Exception => e
- p = [project, searchstr, e.class, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:search_project_fail] % p
- end
-
- # Return an array of projects
- def list_projects
- @delegate.list_projects
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_list_projects]
- rescue Exception => e
- p = ['', %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_list_projects] % p
- end
-
- # Return an array of projects
- def list_topics(projname)
- @delegate.list_topics(projname)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_list_topics] % [projname]
- rescue Exception => e
-# p = [projname, %Q~#{e.mes}<br />\n#{e.backtrace.join('<br />\n')}~]
- p = [projname, e.message]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_list_topics] % p
- end
- end
-
- # The Ruwiki backend abstract class and factory.
- class Backend
- class ProjectExists < RuntimeError #:nodoc:
- end
- class InvalidFormatError < RuntimeError #:nodoc:
- end
- class BackendError < RuntimeError #:nodoc:
- attr_reader :reason
-
- def initialize(reason, *args)
- if @reason.respond_to?(:message)
- @reason = reason.message
- else
- @reason = reason
- end
- end
- end
- def initialize(storage_options)
- end
-
- private
- NL_RE = %r{\n} #:nodoc:
-
- def map_diffset(diffset)
- diffset.map do |hunk|
- if hunk.kind_of?(Array)
- hunk.map { |change| change.to_a }
- else
- hunk.to_a
- end
- end
- end
-
- # Creates the current diff object. This is made from two
- # Ruwiki::Page#export hashes.
- def make_diff(oldpage, newpage)
- oldpage = oldpage.export if oldpage.kind_of?(Ruwiki::Page)
- newpage = newpage.export if newpage.kind_of?(Ruwiki::Page)
-
- diff = Hash.new
-
- newpage.keys.sort.each do |sect|
- newpage[sect].keys.sort.each do |item|
- oldval = oldpage[sect][item]
- newval = newpage[sect][item]
-
- case [sect, item]
- when ['properties', 'html-headers']
- # Protect against NoMethodError.
- oldval ||= []
- newval ||= []
- val = Diff::LCS.sdiff(oldval, newval, Diff::LCS::ContextDiffCallbacks)
- when ['ruwiki', 'content-version'], ['properties', 'version'],
- ['properties', 'entropy']
- val = Diff::LCS.sdiff([oldval], [newval], Diff::LCS::ContextDiffCallbacks)
- when ['properties', 'create-date'], ['properties', 'edit-date']
- val = Diff::LCS.sdiff([oldval.to_i], [newval.to_i], Diff::LCS::ContextDiffCallbacks)
- else
- # Protect against NoMethodError.
- val = Diff::LCS.sdiff(oldval.to_s.split(NL_RE), newval.to_s.split(NL_RE), Diff::LCS::ContextDiffCallbacks)
- end
-
- (diff[sect] ||= {})[item] = map_diffset(val) unless val.nil? or val.empty?
- end
- end
-
- diff_hash = {
- 'old_version' => oldpage['properties']['version'],
- 'new_version' => newpage['properties']['version'],
- 'edit-date' => newpage['properties']['edit-date'].to_i,
- 'editor-ip' => newpage['properties']['editor-ip'],
- 'editor' => newpage['properties']['editor'],
- 'diff' => diff
- }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/backend/_corefiles.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/backend/_corefiles.rb
deleted file mode 100644
index f090de8..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/backend/_corefiles.rb
+++ /dev/null
@@ -1,193 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # Provides common functionality for flatfile support, regardless of the
- # format.
-module Ruwiki::Backend::CoreFiles
- # Initializes the [flat-file] backend. The known options for
- # [flat-file] backends are documented below.
- #
- # :data_path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # :default_page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- @data_path = options[:data_path] || File.join(".", "data")
-
- @extension = options[:extension]
- if @extension.nil?
- @extension_re = /$/
- else
- @extension_re = /\.#{@extension}$/
- end
-
- @default_page = options[:default_page] || "ProjectIndex"
- if not (File.exists?(@data_path) and File.directory?(@data_path))
- raise Ruwiki::Backend::BackendError.new([:flatfiles_no_data_directory, [@data_path]])
- end
-
- super
- end
-
- # Destroys the topic page.
- def destroy(page)
- pf = page_file(page.topic, page.project)
- File.unlink(pf) if File.exists?(pf)
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- pd = project_directory(project)
- File.exists?(pd) and File.directory?(pd)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- pf = page_file(topic, project)
- project_exists?(project) and File.exists?(pf)
- end
-
- # Tries to create the project.
- def create_project(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::ProjectExists if File.exists?(pd)
- Dir.mkdir(pd)
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # String search all topic names and content in a project and
- # return a hash of topic hits.
- def search_project(project, searchstr)
- re_search = Regexp.new(searchstr, Regexp::IGNORECASE)
-
- hits = Hash.new { |h, k| h[k] = 0 }
- topic_list = list_topics(project)
-
- return hits if topic_list.empty?
-
- # search topic content
- topic_list.each do |topic|
- # search name
- hits[topic] += topic.scan(re_search).size
-
- # check content
- page = load(topic, project) rescue Ruwiki::Page::NULL_PAGE
- page['page'].each_value do |item|
- item = item.join("") if item.kind_of?(Array)
- item ||= ""
- hits[topic] += item.scan(re_search).size
- end
- end
-
- hits
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
- time = Time.now.to_i
-
- lock_okay = false
- # See if we have the lock already.
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, we don't care how old it
- # is. Thus, release it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lock_okay = true
- end
-
- if lock_okay
- open(lf, 'w') { |lfh| lfh.puts "#{address}\n#{time + timeout}" }
- else
- raise Ruwiki::Backend::BackendError(nil)
- end
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
- time = Time.now.to_i
-
- lock_okay = false
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, then we can safely remove
- # it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lock_okay = true
- end
-
- if lock_okay
- File.unlink(lf) if File.exists?(lf)
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- end
-
- # list projects found in data path
- def list_projects
- Dir[File.join(@data_path, "*")].select do |d|
- File.directory?(d) and File.exist?(page_file(@default_page, File.basename(d)))
- end.map { |d| File.basename(d) }
- end
-
- # list topics found in data path
- def list_topics(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::BackendError.new(:no_project) unless File.exist?(pd)
-
- Dir[File.join(pd, "*")].select do |f|
- f !~ /\.rdiff$/ and f !~ /\.lock$/ and File.file?(f) and f =~ @extension_re
- end.map { |f| File.basename(f).sub(@extension_re, "") }
- end
-
- def project_directory(project) # :nodoc:
- File.join(@data_path, project)
- end
-
- def page_file(topic, project = 'Default') # :nodoc:
- if @extension.nil?
- File.join(project_directory(project), topic)
- else
- File.join(project_directory(project), "#{topic}.#{@extension}")
- end
- end
-
- def make_rdiff(page_file, new_page)
- diff_file = "#{page_file}.rdiff"
-
- old_page = self.class.load(pf) rescue Ruwiki::Page::NULL_PAGE
-
- diffs = []
- File.open(diff_file, 'rb') { |f| diffs = Marshal.load(f) } if File.exists?(diff_file)
- diffs << make_diff(old_page, new_page)
- changes = Marshal.dump(diffs)
-
- File.open(diff_file, 'wb') { |f| f << changes }
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/backend/flatfiles.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/backend/flatfiles.rb
deleted file mode 100644
index 4bbd3fd..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/backend/flatfiles.rb
+++ /dev/null
@@ -1,185 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/backend/_corefiles'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Flatfiles < Ruwiki::Backend
- include Ruwiki::Backend::CoreFiles
-
- # Initializes the Flatfiles backend. The known options are known for
- # Flatfiles:
- #
- # :data_path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # :default_page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- super
- end
-
- # Provides a HEADER marker.
- HEADER_RE = /^(?:([a-z][-a-z]+)!)?([a-z][-a-z]+):\t(.*)$/
- FIRST_TAB = /^\t/
-
- # Loads the topic page from disk.
- def load(topic, project)
- Ruwiki::Backend::Flatfiles.load(File.read(page_file(topic, project)))
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = Ruwiki::Backend::Flatfiles.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |f| f.puts newpage }
- end
-
- # Destroys the topic page.
- def destroy(page)
- super
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- super
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- super
- end
-
- # Tries to create the project.
- def create_project(project)
- super
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- super
- end
-
- # String search all topic names and content in a project and
- # return a has of topic hits
- def search_project(project, searchstr)
- super
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- super
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- super
- end
-
- # list projects found in data path
- def list_projects
- super
- end
-
- # list topics found in data path
- def list_topics(project)
- super
- end
-
- class << self
- NL_RE = /\n/
- NL_END_RE = /\n$/
-
- def dump(page_hash)
- dumpstr = ""
-
- page_hash.keys.sort.each do |sect|
- page_hash[sect].keys.sort.each do |item|
- val = page_hash[sect][item]
-
- case [sect, item]
- when ['properties', 'create-date'], ['properties', 'edit-date']
- val = val.to_i
- when ['properties', 'editable'], ['properties', 'indexable']
- val = (val ? 'true' : 'false')
- else # string values
- val = val.to_s
- vala = val.split(NL_RE)
- if vala.size == 1
- line = val
- line.gsub!(NL_END_RE) { "\\n" }
- else
- line = vala.shift
- vala.each { |vl| line << "\n\t#{vl}" }
- end
- end
-
- dumpstr << "#{sect}!#{item}:\t#{line}\n"
- end
- end
-
- dumpstr
- end
-
- def load(buffer)
- page = Ruwiki::Page::NULL_PAGE.dup
- return page if buffer.empty?
-
- buffer = buffer.split(NL_RE)
-
- if HEADER_RE.match(buffer[0]).nil?
- raise Ruwiki::Backend::InvalidFormatError
- end
-
- sect = item = nil
-
- buffer.each do |line|
- line.chomp!
- match = HEADER_RE.match(line)
-
- # If there is no match, add the current line to the previous match.
- # Remove the leading \t, though.
- if match.nil?
- raise Ruwiki::Backend::InvalidFormatError if FIRST_TAB.match(line).nil?
- page[sect][item] << "\n#{line.gsub(FIRST_TAB, '')}"
- else
- cap = match.captures
- # Set the section, if provided.
- sect = cap[0] unless cap[0].nil?
- item = cap[1]
- val = cap[2]
-
- case [sect, item]
- when ['ruwiki', 'content-version'], ['properties', 'version']
- val = val.to_i
- when ['properties', 'entropy']
- val = val.to_f
- when ['properties', 'create-date'], ['properties', 'edit-date']
- val = Time.at(val.to_i)
- when ['properties', 'editable'], ['properties', 'indexable']
- val = (val == 'true')
- else # string values
- nil
- end
-
- page[sect][item] = val
- end
- end
-
- page
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/backend/marshal.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/backend/marshal.rb
deleted file mode 100644
index 4b99610..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/backend/marshal.rb
+++ /dev/null
@@ -1,109 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/backend/_corefiles'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Marshal < Ruwiki::Backend
- include Ruwiki::Backend::CoreFiles
-
- # Initializes the Marshal backend. The known options are known for Marshal:
- #
- # :data_path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # :default_page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- super
- end
-
- # Loads the topic page from disk.
- def load(topic, project)
- Ruwiki::Backend::Marshal.load(File.read(page_file(topic, project)))
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = Ruwiki::Backend::Marshal.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |f| f.print newpage }
- end
-
- # Destroys the topic page.
- def destroy(page)
- super
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- super
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- super
- end
-
- # Tries to create the project.
- def create_project(project)
- super
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # String search all topic names and content in a project and return a
- # has of topic hits
- def search_project(project, searchstr)
- super
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- super
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- super
- end
-
- # list projects found in data path
- def list_projects
- super
- end
-
- # list topics found in data path
- def list_topics(project)
- super
- end
-
- class << self
- def dump(page_hash)
- ::Marshal.dump(page_hash)
- end
-
- def load(buffer)
- ::Marshal.load(buffer)
- rescue TypeError
- raise Ruwiki::Backend::InvalidFormatError
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/backend/yaml.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/backend/yaml.rb
deleted file mode 100644
index 9b10c7c..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/backend/yaml.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/backend/_corefiles'
-require 'yaml'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Yaml < Ruwiki::Backend
- include Ruwiki::Backend::CoreFiles
-
- # Initializes the Yaml backend. The known options are known for Yaml:
- #
- # :data_path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # :default_page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- raise Ruwiki::Backend::BackendError.new(:yaml_requires_182_or_higher) unless RUBY_VERSION >= "1.8.2"
- super
- end
-
- # Loads the topic page from disk.
- def load(topic, project)
- Ruwiki::Backend::Yaml.load(File.read(page_file(topic, project)))
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = Ruwiki::Backend::Yaml.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |f| f.puts newpage }
- end
-
- # Destroys the topic page.
- def destroy(page)
- super
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- super
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- super
- end
-
- # Tries to create the project.
- def create_project(project)
- super
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- super
- end
-
- # String search all topic names and content in a project and return a
- # has of topic hits
- def search_project(project, searchstr)
- super
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- super
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- super
- end
-
- # list projects found in data path
- def list_projects
- super
- end
-
- # list topics found in data path
- def list_topics(project)
- super
- end
-
- class << self
- def dump(page_hash)
- ::YAML.dump(page_hash)
- end
-
- def load(buffer)
- ::YAML.load(buffer)
- rescue ArgumentError
- raise Ruwiki::Backend::InvalidFormatError
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/config.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/config.rb
deleted file mode 100644
index c2c3b33..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/config.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Features known to Ruwiki.
- KNOWN_FEATURES = [ ]
-
- # Ruwiki configuration.
- class Config
- # Templates known to Ruwiki.
- TEMPLATES = [ :body, :content, :error, :edit, :controls, :save, :footer ]
-
- # Sets or returns the logger. The logger, if set, must respond to the
- # same methods as WEBrick::Logger.
- attr_accessor :logger
- # Sets or returns the time format whenever time is outputted in Ruwiki.
- # Default is <tt>%H:%M:%S</tt> (23:59:59).
- attr_accessor :time_format
- # Sets or returns the date format whenever time is outputted in Ruwiki.
- # Default is <tt>%Y.%m.%d</tt> (2004.08.04).
- attr_accessor :date_format
- # Sets or returns the date-time format whenever time is outputted in Ruwiki.
- # Default is <tt>%Y.%m.%d %H:%M:%S</tt> (2004.08.04 23:59:59).
- attr_accessor :datetime_format
- # Adds additional information to the (rare) error reports. Defaults to
- # +false+.
- attr_accessor :debug
- # The default page for display when Ruwiki is called without any
- # arguments. Defaults to +ProjectIndex+
- attr_accessor :default_page
- # The default project for display when Ruwiki is called without any
- # arguments or a project specification. Defaults to +Default+
- attr_accessor :default_project
- # The storage type as a Symbol. Corresponds to a filename that will be
- # found in ruwiki/backend. In this version of Ruwiki, versions for
- # handling three different types of flat files will be found. The
- # canonical default format is YAML (:yaml). Also supported in this
- # version is :flatfiles (the old flatfile format with some additions),
- # and a format based on Marshal::Dump (:marshal).
- attr_accessor :storage_type
- # The options for the specified storage type. This is a hash of hashes
- # with auto-vifification. See the storage type for available options.
- attr_reader :storage_options
- # The options for the specified feature. This is a hash of hashes with
- # auto-vifification. See #features for more information.
- attr_reader :feature_options
- # The path for templates. Defaults to <tt>./templates/</tt>.
- attr_accessor :template_path
- # The name of the Wiki. Defaults to <tt>ruwiki</tt>
- attr_accessor :title
- # The email address of the webmaster for the Wiki. Defaults to +nil+.
- attr_accessor :webmaster
- # The name of the Ruwiki CSS file. Defaults to <tt>ruwiki.css</tt>.
- attr_accessor :css
- # The template set. Templates are always named as
- # <template_path>/<template_set>/<template_kind>.
- #Template filename. Must be reachable by File#read.
- attr_accessor :template_set
- # Ruwiki is internationalized. This method sets the Ruwiki error
- # messages (and a few other messages) )to the specified language Module.
- # The language Module must have a constant Hash called +Message+
- # containing a set of symbols and localized versions of the messages
- # associated with them.
- #
- # If the file 'ruwiki/lang/es.rb' contains the module
- # <tt>Ruwiki::Lang::ES</tt>, the error messages for RSS could be
- # localized to Español thus:
- #
- # require 'ruwiki/lang/es'
- # ...
- # wiki.config.language = Ruwiki::Lang::ES
- #
- # Localization is per wiki instance. In a servlet environment, this may
- # mean that only a single language is recognised.
- #
- # See Ruwiki::Lang::EN for more information.
- attr_accessor :language
- # The message hash.
- attr_reader :message
-
- def language=(l) #:nodoc:
- @language = l
- @message = l::Message
- end
-
- # Returns the template string
- def template(kind = :body)
- raise ConfigError, message[:no_template_found] % [kind.inspect, @template_set] unless TEMPLATES.include?(kind)
- File.read(File.join(@template_path, @template_set, "#{kind.to_s}.tmpl"))
- end
-
- # Returns a copy of the list of features supported by this Wiki.
- def features
- @features.dup
- end
-
- # Adds a new feature to the Wiki.
- def add_feature(feature)
- raise ConfigError, message[:unknown_feature] % [feature.inspect] unless KNOWN_FEATURES.include?(feature)
- @features << feature
- end
-
- # Returns the CSS stylesheet content for the Wiki. This previously
- # returned the <link> to the stylesheet, but instead returns a <style>
- # block in the head so that the CSS is kept with the template set, which
- # may be kept outside of the HTML area.
- def css_link
- %Q[<style type="text/css" media="screen,print">#{File.read(File.join(@template_path, @template_set, @css))}</style>]
- end
-
- # Creates a new configuration object.
- def initialize
- @debug = false
- @default_project = "Default"
- @default_page = "ProjectIndex"
- @storage_type = :yaml
- @storage_options = Hash.new { |h, k| h[k] = {} }
- @template_path = "./templates/"
- @template_set = "default"
- @css = "ruwiki.css"
- @webmaster = nil
- @title = "Ruwiki"
- @features = []
- @feature_options = Hash.new { |h, k| h[k] = {} }
- @time_format = "%H:%M:%S"
- @date_format = "%Y.%m.%d"
- @datetime_format = "#{@date_format} #{@time_format}"
-
- self.language = Ruwiki::Lang::EN
- end
-
- # Verifies that required configuration options are actually set. Right
- # now, it only checks the values that are defaulted to +nil+.
- def verify
- raise ConfigError, message[:no_webmaster_defined] if @webmaster.nil?
- raise ConfigError, message[:invalid_template_dir] % [@template_path] unless File.exists?(@template_path) and File.directory?(@template_path)
- t = File.join(@template_path, @template_set)
- raise ConfigError, message[:no_template_set] % [@template_set] unless File.exists?(t) and File.directory?(t)
- end
-
- class ConfigError < StandardError #:nodoc:
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/handler.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/handler.rb
deleted file mode 100644
index e31bbc1..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/handler.rb
+++ /dev/null
@@ -1,207 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Handler
- class << self
- # Generate a new Handler pair from a CGI request.
- def from_cgi(cgi, output_stream = $stdout)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::CGIRequest.new(cgi)
- o.response = Ruwiki::Handler::CGIResponse.new(cgi, output_stream)
- end
- end
-
- # Generate a new Handler pair from a WEBrick request.
- def from_webrick(req, res)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::WEBrickRequest.new(req)
- o.response = Ruwiki::Handler::WEBrickResponse.new(res)
- end
- end
- end
-
- # Returns the handler's request object.
- attr_accessor :request
- # Returns the handler's response object.
- attr_accessor :response
-
- # Creates the handler pair.
- def initialize(&block) #:yields: self
- @request = nil
- @response = nil
- yield self if block_given?
- end
-
- # REpresents an abstract incoming request. This insulates the rest of
- # the code from knowing whether parameters are passed as part of the
- # path, as parameters in the URL, or in some other fashion.
- class AbstractRequest
- def initialize(*args)
- end
- end
-
- # Handles all requests from web applications.
- #
- # Subclasses should provide:
- # @parameters:: Hash-like object that responds to #[] and #hash_key?]
- # @environment:: Hash-like object that responds to #[]
- class AbstractWebRequest < AbstractRequest
- # The parameters provided via the web request.
- attr_reader :parameters
- # The environment provided to the web request.
- attr_reader :environment
- # The request path.
- attr_reader :path
-
- # Yields each parameter key in succession.
- def each_parameter #:yields: key, value
- @parameters.each { |k, v| yield k, v }
- end
-
- def each_environment #:yields: key, value
- @environment.each { |k, v| yield k, v }
- end
-
- # Return the URL of our server.
- def server_url
- res = "http://" # should detect whether we're in secure server mode.
- if @environment['HTTP_HOST']
- res << @environment['HTTP_HOST']
- else
- res << "#{@environment['SERVER_NAME']}:#{@environment['SERVER_PORT']}"
- end
- end
-
- # Return the URL of this script.
- def script_url
- server_url << @environment['SCRIPT_NAME'].to_s
- end
-
- # Return the URL of this request.
- def request_url
- res = script_url
- res << @environment['PATH_INFO'] if @environment['PATH_INFO']
- query = @environment['QUERY_STRING']
- res << "?#{@environment['QUERY_STRING']}" if query && !query.empty?
- res
- end
-
- # Convert a file path into a URL
- def make_url(project, path)
- "#{server_url}/#{project}/#{path}"
- end
-
- def determine_request_path
- @path = ""
- return @path if @environment['PATH_INFO'].nil?
- @path = @environment['PATH_INFO'].dup
- end
- end
-
- # Request for CGI-based activity to ruwiki.
- class CGIRequest < AbstractWebRequest
- def initialize(cgi, output_stream = $stdout)
- @environment = ENV
- @cgi = cgi
- @parameters = {}
- cgi.params.each { |k, v| @parameters[k] = v[0] }
- super
- end
- end
-
- # Request for WEBrick based servlet activity to ruwiki.
- class WEBrickRequest < AbstractWebRequest
- def initialize(req)
- @environment = req.meta_vars
- @parameters = req.query
- super
- end
- end
-
- # Used to write responses in different execution environments such as
- # CGI and Webrick.
- #
- # If you want to create a new response object, you'll need to implement
- # #add_header, #write_headers, and #<<.
- #
- # The Response object is instantiated with an output stream which must
- # supply +<<+ and +puts+ methods.
- class AbstractResponse
- # Add to the list of headers to be sent back to the client.
- def add_header(key, value)
- raise "Not implemented"
- end
-
- # Write the accumulated headers back to the client.
- def write_headers
- raise "Not implemented"
- end
-
- # Write the string to the client.
- def <<(string)
- raise "Not implemented"
- end
-
- # output_stream must respond to #<< and #puts.
- def initialize(output_stream = $stdout)
- @headers = {}
- @output_stream = output_stream
- end
- end
-
- # CGIResponse is the response object for CGI mode.
- class CGIResponse < AbstractResponse
- # output_stream must respond to #<< and #puts.
- def initialize(cgi, output_stream = $stdout)
- @cgi = cgi
- super(output_stream)
- end
-
- # Add the header pair for later output as a CGI header.
- def add_header(key, value)
- @headers[key] = value
- end
-
- # Write the headers to the stream. The headers can only be written
- # once.
- def write_headers
- return if @written
- @headers.each { |key, value| @output_stream.puts "#{key}: #{value}\r\n" }
- @output_stream.puts
- @written = true
- end
-
- # Output the string to the stream provided.
- def <<(string)
- @output_stream << string
- end
- end
-
- # WEBrickResponse is the response object for WEBrick servlet mode.
- class WEBrickResponse < AbstractResponse
- def initialize(webrick_response)
- @response = webrick_response
- end
-
- def add_header(key,value)
- @response[key] = value
- end
-
- def write_headers
- # Webrick will take care of this on its own.
- end
-
- def <<(string)
- @response.body << string
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/lang/de.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/lang/de.rb
deleted file mode 100644
index 7fb7b3b..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/lang/de.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Translation by Christian Neukirchen (chneukirchen@yahoo.de) on 22oct2003
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::DE is the German-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module DE
- Message = Hash.new { |h, k| h[k] = "Sprachdatei-FEHLER: Unbekannter Nachrichten-Typ #{k.inspect}."; h[k] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Unbekanntes Backend %s.",
- :cannot_create_project => "Kann %s nicht erstellen: %s",
- :cannot_destroy_project => "Kann %s nicht zerstören: %s",
- :cannot_destroy_topic => "Kann %s::%s nicht zerstören: %s",
- :cannot_obtain_lock => "Kann keine Sperre für %s::%s erhalten. Bitte in Kürze nochmal versuchen.",
- :cannot_release_lock => "Kann die Sperre für %s::%s nicht lösen. Bitte später nochmal versuchen.",
- :cannot_retrieve_topic => "Kann auf %s::%s nicht zugreifen: %s",
- :cannot_store_topic => "Kann %s::%s nicht speichern: %s",
- :error_creating_lock => "Fehler beim Erzeugen der Sperre von %s::%s: %s",
- :error_releasing_lock => "Fehler beim Lösen der Sperre von %s::%s: %s",
- :flatfiles_no_data_directory => "Das Daten-Verzeichnis (%s) existiert nicht.",
- :no_access_to_create_project => "Keine Berechtigung um das Projekt (%s) zu erstellen.",
- :no_access_to_destroy_project => "Keine Berechtigung um das Projekt (%s) zu zerstören.",
- :no_access_to_destroy_topic => "Kann %s::%s nicht zerstören: %s.",
- :no_access_to_read_topic => "Kann auf %s::%s nicht zugreifen: %s.",
- :no_access_to_store_topic => "Kann %s::%s nicht speichern: %s.",
- :project_already_exists => "Das Projekt %s existiert bereits.",
- :project_does_not_exist => "Das Projekt %s existiert nicht.",
- :no_access_list_projects => "Keine Berechtigung um das Projektliste",
- :no_access_list_topics => "Keine Berechtigung um das Themaliste (%s).",
- :search_project_fail => "Suchprojektausfallen %s Zeichenkette %s",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Die Konfiguration muss von Typ der Klasse Ruwiki::Config sein.",
- :invalid_template_dir => "Der angegebene Pfad für Schablonen (%s) existiert nicht oder ist kein Verzeichnis.",
- :no_template_found => "Keine Schablone %s im Schablonen-Set '%s' gefunden.",
- :no_template_set => "Es gibt kein Schablonen-Set '%s' im Schablonen-Pfad.",
- :no_webmaster_defined => "Konfigurations-Fehler: Webmaster nicht definiert.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fataler Fehler",
- :editing => "Editieren",
- :error => "Fehler",
- :invalid_path_info_value => "Fataler Fehler in der Web-Umgebung. PATH_INFO = %s",
- # Should this really get translated? --chris
- :render_arguments => "Ruwiki#render muss mit zwei oder mehr Argumenten aufgerufen werden.",
- :unknown_feature => "Unbekanntes Feature %s.",
-
- # Labels
- :label_search_project => "SuchcProjeckt",
- :label_search_all => "Alles",
- :label_search => "Suchc: ",
- :label_project => "Projekt: ",
- :label_topic => "Thema: ",
- :label_edit => "Edit",
- :label_recent_changes => "Neue Änderungen",
- :label_topics => "Themaliste",
- :label_projects => "ProjektListe",
- :label_editing => "Editieren",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Redigieren Sie Anmerkung: ",
- :label_comment_accelerator => "R",
- :label_save => "Außer",
- :label_save_accelerator => "A",
- :label_cancel => "Löschen",
- :label_cancel_accelerator => "L",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Ursprüngliche Version",
- :label_raw => "Formatfreie",
- :label_formatted => "Formatierte",
- :label_send_report_by => "Schicken Sie dem webmaster einen Report durch email.",
- :label_send_report => "Schicken Report.",
- :label_saved_page => "Gespeicherte Seite: ",
- }
- message.each { |k, v| Message[k] = v }
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/lang/en.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/lang/en.rb
deleted file mode 100644
index f58e780..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/lang/en.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::EN is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module EN
- Message = Hash.new { |h, k| h[k] = "Language ERROR: Unknown message key #{k.inspect}."; h[k] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Backend %s is unknown.",
- :cannot_create_project => "Cannot create project %s: %s",
- :cannot_destroy_project => "Cannot destroy project %s: %s",
- :cannot_destroy_topic => "Cannot destroy %s::%s: %s",
- :cannot_obtain_lock => "Unable to obtain a lock on %s::%s. Try again shortly.",
- :cannot_release_lock => "Unable to release the lock on %s::%s. Try again shortly.",
- :cannot_retrieve_topic => "Cannot retrieve %s::%s: %s",
- :cannot_store_topic => "Cannot store %s::%s: %s",
- :cannot_list_topics => "Cannot list topics for project %s: %s",
- :error_creating_lock => "Error creating lock on %s::%s: %s",
- :error_releasing_lock => "Error releasing lock on %s::%s: %s",
- :flatfiles_no_data_directory => "The data directory (%s) does not exist.",
- :no_access_list_projects => "No permission to list projects.",
- :no_access_list_topics => "No permission to list topics in project %s.",
- :no_access_to_create_project => "No permission to create project %s.",
- :no_access_to_destroy_project => "No permission to destroy project %s::%s.",
- :no_access_to_destroy_topic => "No permission to destroy topic %s::%s.",
- :no_access_to_read_topic => "No permission to retrieve the %s::%s.",
- :no_access_to_store_topic => "No permission to store the %s::%s.",
- :page_not_in_backend_format => "%s::%s is not in the format supported by the backend %s.",
- :project_already_exists => "Project %s already exists.",
- :project_does_not_exist => "Project %s does not exist.",
- :search_project_fail => "Failure searching project %s with string %s.",
- :yaml_requires_182_or_higher => "YAML flatfile support exists only for Ruby version 1.8.2 or higher.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Configuration must be of class Ruwiki::Config.",
- :invalid_template_dir => "The specified path for templates (%s) does not exist or is not a directory.",
- :no_template_found => "No template of %s found in template set %s.",
- :no_template_set => "There is no template set '%s' in the template path.",
- :no_webmaster_defined => "Configuration error: Webmaster is unset.",
- # Miscellaneous messages.
- :complete_utter_failure => "Complete and Utter Failure",
- :editing => "Editing",
- :error => "Error",
- :invalid_path_info_value => "Something has gone seriously wrong with the web environment. PATH_INFO = %s",
- :render_arguments => "Ruwiki#render must be called with zero or two arguments.",
- :unknown_feature => "Unknown feature %s.",
- :topics_for_project => "Topics for Project ::%s",
- :project_topics_link => "(topics)",
- :wiki_projects => "Projects in %s",
- :no_projects => "No known projects.",
- :no_topics => "No topics in project %s.",
- :search_results_for => "= Search results for: %s",
- :number_of_hits => "%d Hits",
-
- # Labels
- :label_search_project => "Search Project",
- :label_search_all => "All",
- :label_search => "Search: ",
- :label_project => "Project: ",
- :label_topic => "Topic: ",
- :label_edit => "Edit",
- :label_recent_changes => "Recent Changes",
- :label_topics => "Topics",
- :label_projects => "Projects",
- :label_editing => "Editing",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Edit Comment: ",
- :label_comment_accelerator => "O",
- :label_save => "Save",
- :label_save_accelerator => "S",
- :label_cancel => "Cancel",
- :label_cancel_accelerator => "C",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Original Text",
- :label_raw => "Raw",
- :label_formatted => "Formatted",
- :label_send_report_by => "Send the Wiki maintainer a report by email.",
- :label_send_report => "Send report.",
- :label_saved_page => "Saved page: ",
- }
- message.each { |k, v| Message[k] = v }
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/lang/es.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/lang/es.rb
deleted file mode 100644
index 3249c18..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/lang/es.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Mauricio Julio Fernández Pradier (batsman.geo@yahoo.com)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::ES is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module ES
- Message = Hash.new { |h, k| h[k] = "ERROR De la Lengua: Llave desconocida del mensaje #{k.inspect}."; h[k] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Clase Backend desconocida: %s.",
- :cannot_create_project => "No puede crearse el proyecto %s: %s",
- :cannot_destroy_project => "No puede borrarse el proyecto %s: %s",
- :cannot_destroy_topic => "No puede borrarse %s::%s: %s",
- :cannot_obtain_lock => "Imposible obtener acceso exclusivo sobre %s::%s. Reinténtelo en breve.",
- :cannot_release_lock => "Imposible liberar acceso exclusivo sobre %s::%s. Reinténtelo en breve.",
- :cannot_retrieve_topic => "No puede leerse %s::%s: %s",
- :cannot_store_topic => "No puede archivarse %s::%s: %s",
- :error_creating_lock => "Error al crear el cerrojo sobre %s::%s: %s",
- :error_releasing_lock => "Error al liberar el cerrojo sobre %s::%s: %s",
- :flatfiles_no_data_directory => "El directorio de datos (%s) no existe.",
- :no_access_to_create_project => "Permiso denegado al crear el proyecto %s.",
- :no_access_to_destroy_project => "Permiso denegado al borrar el proyecto %s::%s.",
- :no_access_to_destroy_topic => "Permiso denegado al borrar el nodo %s::%s.",
- :no_access_to_read_topic => "Permiso denegado al leer el nodo %s::%s.",
- :no_access_to_store_topic => "Permiso denegado al salvar el nodo %s::%s.",
- :project_already_exists => "El proyecto %s ya existe.",
- :project_does_not_exist => "El proyecto %s no existe.",
- :no_access_list_projects => "Permiso denegado al lista del proyecto.",
- :no_access_list_topics => "Permiso denagado al lista del nodo, procecto: %s.",
- :search_project_fail => "Falta que busca proyecto %s con la secuencia %s.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "La configuración debe ser de clase Ruwiki::Config.",
- :invalid_template_dir => "El path especificado para plantillas (%s) no existe o no es un directorio.",
- :no_template_found => "No se encontró ninguna plantilla para %s en el conjunto %s.",
- :no_template_set => "No hay ningún juego de plantillas '%s' en el path.",
- :no_webmaster_defined => "Error de configuración: Webmaster no está definido.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fallo total y absoluto.",
- :editing => "Editando",
- :error => "Error",
- :invalid_path_info_value => "Algo huele a podrido en su entorno Web. PATH_INFO = %s",
- :render_arguments => "Ruwiki#render debe ser llamado con cero o dos argumentos.",
- :unknown_feature => "Clase Feature desconocida: %s.",
-
- # Labels
- :label_search_project => "Proyecto De la Búsqueda",
- :label_search_all => "<all>",
- :label_search => "Suchc: ",
- :label_project => "Proyecto: ",
- :label_topic => "Nodo: ",
- :label_edit => "Editar",
- :label_recent_changes => "Cambios Recientes",
- :label_topics => "Lista del Nodo",
- :label_projects => "Lista del Proyecto",
- :label_editing => "Editando",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Corrija el Commentario: ",
- :label_comment_accelerator => "O",
- :label_save => "Salvar",
- :label_save_accelerator => "S",
- :label_cancel => "Cancelar",
- :label_cancel_accelerator => "C",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Texto Original",
- :label_raw => "Version sin formato",
- :label_formatted => "Version con formato",
- :label_send_report_by => "Envie al admistrador de este sitio una notificación por correo electrónico.",
- :label_send_report => "Envie notificación.",
- :label_saved_page => "Página salvaguardada: ",
- }
- message.each { |k, v| Message[k] = v }
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/page.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/page.rb
deleted file mode 100644
index 91ccaae..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/page.rb
+++ /dev/null
@@ -1,235 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # The page class for Ruwiki. The page defines the data and meta-data for a
- # page.
-class Ruwiki::Page
- # Returns the content version of the page. If the page has a greater
- # content version than this version of Ruwiki does, we should probably
- # throw an exception, because attempting to save such a page will cause a
- # loss of data. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +content-version+
- attr_reader :content_version
- # Returns the version of Ruwiki from which this page was generated.
- # Informational only. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +version+
- attr_reader :ruwiki_version
-
- # Returns or sets the displayed title of the page, which may differ from
- # the topic of the page. As of Ruwiki 0.8.0, this is not currently used and
- # it may disappear.
- #
- # Class:: +properties+
- # ID:: +title+
- attr_accessor :title
- # Returns or sets the topic of the page, which may differ from the title.
- # This is used to set the topic on a page being saved.
- #
- # Class:: +properties+
- # ID:: +topic+
- attr_accessor :topic
- # Returns or sets the project of the page, which may differ from the title.
- # This is used to set the project on a page being saved.
- #
- # Class:: +properties+
- # ID:: +project+
- attr_accessor :project
- # Returns or sets the creator of the page. Unless we know the user (via a
- # cookie, not yet implemented in Ruwiki 0.8.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +creator+
- attr_accessor :creator
- # Returns or sets the creator's IP address. This should always be set. It
- # will have a value of "UNKNOWN" on the off-chance that something prevents
- # this from working.
- #
- # Class:: +properties+
- # ID:: +creator-ip+
- attr_accessor :creator_ip
- # Returns or sets the date of creation.
- #
- # Class:: +properties+
- # ID:: +create-date+
- attr_accessor :create_date
- # Returns or sets the last editor of the page. Unless we know the user (via
- # a cookie, not yet implemented in Ruwiki 0.8.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +editor+
- attr_accessor :editor
- # Returns or sets the last editor's IP address. This should always be set.
- # It will have a value of "UNKNOWN" on the off-chance that something
- # prevents this from working.
- #
- # Class:: +properties+
- # ID:: +editor-ip+
- attr_accessor :editor_ip
- # Returns or sets the date of the last edit.
- #
- # Class:: +properties+
- # ID:: +edit-date+
- attr_accessor :edit_date
- # Indicates whether the page is editable. Non-editable pages are
- # effectively static pages.
- #
- # Class:: +properties+
- # ID:: +editable+
- attr_accessor :editable
- # Indicates whether the page is indexable. Non-indexable pages are
- # invisible to compliant web robots, and their links may not be followed.
- #
- # Class:: +properties+
- # ID:: +indexable+
- attr_accessor :indexable
- # The current version of the page. The old version is always (#version -
- # 1).
- #
- # Class:: +properties+
- # ID:: +version+
- attr_accessor :version
- # An array of complete tags that will appear in the HTML <HEAD> section.
- # Can be used to specify additional CSS, <META> tags, or even JavaScript on
- # a per-page basis. Currently unused.
- #
- # Class:: +properties+
- # ID:: +html-headers+
- attr_accessor :html_headers
- # The entropy of the page. This is a ratio of the number of lines changed
- # in the file vs. the total number of lines in the file. This value is
- # currently unused. (And, sad to say, I don't remember why I included it.
- # However, it's an interesting value that may be useful in spam fighting
- # techniques. It is currently stored in the meta-data, but that may change
- # moving forward.)
- #
- # Class:: +properties+
- # ID:: +entropy+
- attr_reader :entropy
- # The edit comment for the current revision of the page.
- #
- # Class:: +properties+
- # ID:: +edit-comment+
- attr_accessor :edit_comment
-
- # The header content of the page. This is static content (in either Wiki or
- # HTML formats) that appears before the editable contents of the page. If
- # both this and Wiki-level header content are specified, this will appear
- # *after* the Wiki-level header content.
- #
- # Class:: +page+
- # ID:: +header+
- attr_accessor :header
- # The footer content of the page. This is static content (in either Wiki or
- # HTML formats) that appears before the editable contents of the page. If
- # both this and Wiki-level footer content are specified, this will appear
- # *before* the Wiki-level footer content.
- #
- # Class:: +page+
- # ID:: +footer+
- attr_accessor :footer
- # The editable unformatted Wiki content of the page.
- #
- # Class:: +page+
- # ID:: +content+
- attr_accessor :content
-
- # Creates a Ruwiki page. This must be created from the canonical export
- # hash.
- def initialize(exported = {})
-# @remote_host = init[:remote_host]
-# @remote_addr = init[:remote_addr]
-
- ruwiki = exported['ruwiki']
- @content_version = ruwiki['content-version'] || Ruwiki::CONTENT_VERSION
- @ruwiki_version = ruwiki['version'] || Ruwiki::VERSION
-
- props = exported['properties']
- @title = props['title']
- @topic = props['topic'] || "NewTopic"
- @project = props['project'] || "Default"
- @creator = props['creator'] || ""
- @creator_ip = props['creator-ip'] || "UNKNOWN"
- @create_date = props['create-date'] || Time.now
- @editor = props['editor'] || ""
- @editor_ip = props['editor-ip'] || "UNKNOWN"
- @edit_date = props['edit-date'] || Time.now
- @edit_comment = props['edit-comment'] || ""
- @editable = props['editable']
- @editable = true if @editable.nil?
- @indexable = props['indexable']
- @indexable = true if @indexable.nil?
- @entropy = props['entropy'] || 0
- @html_headers = props['html-headers'] || []
- @version = props['version'] || 0
-
- page = exported['page']
- @header = page['header'] || ""
- @content = page['content'] || ""
- @footer = page['footer'] || ""
-
- # Fix the possibility that the content might be an array of chunks.
- @content = @content.join("") if @content.kind_of?(Array)
-
- @content.gsub!(/\r/, "")
- end
-
- # Outputs the HTML version of the page.
- def to_html(markup)
- # Normalise the content, first
- @content.gsub!(/\r/, "")
- markup.parse(@content, @project)
- end
-
- # Provides the canonical export hash.
- def export
- {
- 'ruwiki' => {
- 'content-version' => Ruwiki::CONTENT_VERSION,
- 'version' => Ruwiki::VERSION
- },
- 'properties' => {
- 'title' => @title,
- 'topic' => @topic,
- 'project' => @project,
- 'creator' => @creator,
- 'creator-ip' => @creator_ip,
- 'create-date' => @create_date,
- 'editor' => @editor,
- 'editor-ip' => @editor_ip,
- 'edit-date' => @edit_date,
- 'edit-comment' => @edit_comment,
- 'editable' => @editable,
- 'indexable' => @indexable,
- 'entropy' => @entropy,
- 'html-headers' => @html_header,
- 'version' => @version
- },
- 'page' => {
- 'header' => @header,
- 'content' => @content,
- 'footer' => @footer
- },
- }
- end
-
- NULL_PAGE = {
- 'ruwiki' => {
- 'content-version' => Ruwiki::CONTENT_VERSION,
- 'version' => Ruwiki::VERSION
- },
- 'properties' => { },
- 'page' => { },
- }
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/servlet.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/servlet.rb
deleted file mode 100644
index 19feddf..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/servlet.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'webrick'
-
-class Ruwiki
- class Servlet < WEBrick::HTTPServlet::AbstractServlet
- def initialize(config)
- @config = config
- end
-
- # Converts a POST into a GET.
- def do_POST(req, res)
- do_GET(req, res)
- end
-
- def do_GET(req, res)
- # Generate the reponse handlers for Ruwiki from the request and response
- # objects provided.
- wiki = Ruwiki.new(Ruwiki::Handler.from_webrick(req, res))
-
- # Configuration defaults to certain values. This overrides the defaults.
- wiki.config = $config unless $config.nil?
- wiki.config.logger = @config.logger
- wiki.run
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/template.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/template.rb
deleted file mode 100644
index 1acbbab..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/template.rb
+++ /dev/null
@@ -1,331 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file is originally from rdoc by Dave Thomas (dave@pragprog.com).
-#
-# $Id$
-#++
-
- # Ruwiki templating, based originally on RDoc's "cheap-n-cheerful" HTML page
- # template system, which is a line-oriented, text-based templating system.
- #
- # Templates can contain:
- #
- # * The directive !INCLUDE!, which will include the next template from the
- # provided list. This is processed before any template substitution, so
- # repeating and optional blocks work on the values within the template
- # substitution.
- # * Substitutable variable values between percent signs (<tt>%key%</tt>).
- # Optional variable values can be preceded by a question mark
- # (<tt>%?key%</tt>).
- # * Label values between hash marks (<tt>#key#</tt>). Optional label values
- # can be preceded by a question mark (<tt>#?key#</tt>).
- # * Links (<tt>HREF:ref:name:</tt>).
- # * Repeating substitution values (<tt>[:key| stuff :]</tt>). The value of
- # +key+ may be an integer value or a range (in which case key will be used
- # as an iterator, providing the current value of key on successive values),
- # an array of scalar values (substituting each value), or an array of
- # hashes (in which case it works like repeating blocks, see below). These
- # must NOT be nested. Note that integer value counting is one-based.
- # * Optional substitution values (<tt>[?key| stuff ?]</tt> or <tt>[!key|
- # stuff ?]</tt>. These must NOT be nested.
- # * Repeating blocks:
- # START:key
- # ... stuff
- # END:key
- # * Optional blocks:
- # IF:key
- # ... stuff
- # ENDIF:key
- # or:
- # IFNOT:key
- # ... stuff
- # ENDIF:key
- #
- # When generating the output, a hash of values is provided and an optional
- # hash of labels is provided. Simple variables are resolved directly from the
- # hash; labels are resolved as Symbols from the label hash or are otherwise
- # treated as variables. Labels are always resolved from a single label hash.
- #
- # The +key+ for repeating blocks (one-line or multi-line) must be an array of
- # hashes. The repeating block will be generated once for each entry. Blocks
- # can be nested arbitrarily deeply.
- #
- # Optional blocks will only be generated if +key+ has a non-nil value, or if
- # +key+ has a nil value in an IFNOT block.
- #
- # Usage: Given a set of templates <tt>T1</tt>, <tt>T2</tt>, etc.
- #
- # values = { "name" => "Dave", "state" => "TX" }
- # fr = { :name => "Nom", :state => "Etat" }
- # en = { :name => "Name", :state => "State" }
- # t = TemplatePage.new(T1, T2, T3)
- #
- # res = ""
- # t.process(res, values, fr)
- # t.process(res, values, en)
- #
-class Ruwiki::TemplatePage
- BLOCK_RE = /^(IF|IFNOT|ENDIF|START|END):(\w+)?/
- HREF_RE = /HREF:(\w+?):(\w+?):/
- LABEL_RE = /#(\?)?(\w+?)#/
- VARIABLE_RE = /%(\?)?(\w+?)%/
- IFLINE_RE = /\[([?!])(\w+?)\|(.*?)\?\]/
- BLOCKLINE_RE = /\[:(\w+?)\|(.*?):\]/
-
- # A context holds a stack of key/value pairs (like a symbol table). When
- # asked to resolve a key, it first searches the top of the stack, then the
- # next level, and so on until it finds a match (or runs out of entries).
- class Context
- def initialize
- @stack = []
- end
-
- def push(hash)
- @stack.push(hash)
- end
-
- def pop
- @stack.pop
- end
-
- # Find a scalar value, throwing an exception if not found. This method is
- # used when substituting the %xxx% constructs
- def find_scalar(key)
- @stack.reverse_each do |level|
- return level[key] unless level[key].kind_of?(Array)
- end
- raise "Template error: can't find variable '#{key}'."
- end
-
- # Lookup any key in the stack of hashes
- def lookup(key)
- @stack.reverse_each do |level|
- return level[key] unless level[key].nil?
- end
- nil
- end
- end
-
- # Simple class to read lines out of a string
- class LineReader
- attr_reader :lines
- def initialize(lines)
- @lines = lines
- end
-
- # read the next line
- def read
- @lines.shift
- end
-
- # Return a list of lines up to the line that matches a pattern. That last
- # line is discarded.
- def read_up_to(pattern)
- res = []
- while line = read
- if pattern.match(line)
- return LineReader.new(res)
- else
- res << line
- end
- end
- raise "Missing end tag in template: #{pattern.source}"
- end
-
- # Return a copy of ourselves that can be modified without affecting us
- def dup
- LineReader.new(@lines.dup)
- end
- end
-
- # +templates+ is an array of strings containing the templates. We start at
- # the first, and substitute in subsequent ones where the string
- # <tt>!INCLUDE!</tt> occurs. For example, we could have the overall page
- # template containing
- #
- # <html><body>
- # <h1>Master</h1>
- # !INCLUDE!
- # </body></html>
- #
- # and substitute subpages in to it by passing [master, sub_page]. This
- # gives us a cheap way of framing pages
- def initialize(*templates)
- result = "!INCLUDE!"
- templates.each { |content| result.sub!(/!INCLUDE!/, content) }
- @lines = LineReader.new(result.split(/\r?\n/))
- end
-
- attr_reader :lines
-
- # Render the templates, storing the result on +output+ using the method
- # <tt><<</tt> The <tt>value_hash</tt> contains key/value pairs used to
- # drive the substitution (as described above). The <tt>label_hash</tt>
- # contains key/value pairs used to drive the substitution of labels (see
- # above).
- def process(output, value_hash, message_hash = {})
- @context = Context.new
- @message = message_hash
- output << sub(@lines.dup, value_hash).tr("\000", '\\')
- output
- end
-
- # Substitute a set of key/value pairs into the given template. Keys with
- # scalar values have them substituted directly into the page. Those with
- # array values invoke <tt>substitute_array</tt> (below), which examples a
- # block of the template once for each row in the array.
- #
- # This routine also copes with the <tt>IF:</tt>_key_ directive, removing
- # chunks of the template if the corresponding key does not appear in the
- # hash, and the START: directive, which loops its contents for each value
- # in an array
- def sub(lines, values)
- @context.push(values)
- skip_to = nil
- result = []
-
- while line = lines.read
- mv = line.match(BLOCK_RE)
-
- if mv.nil?
- result << expand(line.dup)
- next
- else
- cmd = mv.captures[0]
- tag = mv.captures[1]
- end
-
- case cmd
- when "IF", "IFNOT"
- raise "#{cmd}: must have a key to test." if tag.nil?
-
- test = @context.lookup(tag).nil?
- test = (cmd == "IF") ? test : (not test)
- lines.read_up_to(/^ENDIF:#{tag}/) if test
- when "ENDIF"
- nil
- when "START"
- raise "#{cmd}: must have a key." if tag.nil?
-
- body = lines.read_up_to(/^END:#{tag}/)
- inner = @context.lookup(tag)
- raise "unknown tag: #{tag}" unless inner
- raise "not array: #{tag}" unless inner.kind_of?(Array)
- inner.each { |vals| result << sub(body.dup, vals) }
- result << "" # Append the missing \n
- else
- result << expand(line.dup)
- end
- end
-
- @context.pop
-
- result.join("\n")
- end
-
- # Given an individual line, we look for %xxx%, %?xxx%, #xxx#, #?xxx#,
- # [:key| xxx :], [?key| stuff ?], [!key| stuff ?] and HREF:ref:name:
- # constructs, substituting as appropriate.
- def expand(line)
- # Generate a cross-reference if a reference is given. Otherwise, just
- # fill in the name part.
- line = line.gsub(HREF_RE) do
- ref = @context.lookup($1)
- name = @context.find_scalar($2)
-
- if ref and not ref.kind_of?(Array)
- %Q(<a href="#{ref}">#{name}</a>)
- else
- name
- end
- end
-
- # Look for optional content.
- line = line.gsub(IFLINE_RE) do
- type = $1
- name = $2
- stuff = $3
-
- case type
- when '?'
- test = @context.lookup(name)
- when '!'
- test = (not @context.lookup(name))
- end
-
- if test
- stuff
- else
- ""
- end
- end
-
- # Look for repeating content.
- line = line.gsub(BLOCKLINE_RE) do |match|
- name = $1
- stuff = $2
-
- val = @context.lookup(name)
- s = ""
- case val
- when nil
- nil
- when Fixnum
- val.times { |i| s << stuff.sub(/%#{name}%/, "#{i + 1}") }
- when Range
- val.each { |i| s << stuff.sub(/%#{name}%/, "#{i}") }
- when Array
- if not val.empty? and val[0].kind_of?(Hash)
- val.each do |v|
- @context.push(v)
- s << expand(stuff)
- @context.pop
- end
- else
- val.each { |e| s << stuff.sub(/%#{name}%/, "#{e}") }
- end
- end
- s
- end
-
- # Substitute in values for #xxx# constructs.
- line = line.gsub(LABEL_RE) do
- mandatory = $1.nil?
- key = $2.intern
- val = @message[key]
-
- if val.nil?
- raise "Template error: can't find label '#{key}'." if mandatory
- ""
- else
- "#{val}".tr('\\', "\000")
- end
- end
-
- # Substitute in values for %xxx% constructs. This is made complex
- # because the replacement string may contain characters that are
- # meaningful to the regexp (like \1)
- line = line.gsub(VARIABLE_RE) do
- mandatory = $1.nil?
- key = $2
- val = @context.lookup(key)
-
- if val.nil?
- raise "Template error: can't find variable '#{key}'." if mandatory
- ""
- else
- "#{val}".tr('\\', "\000")
- end
- end
-
- line
- rescue Exception => e
- raise "Error in template: #{e}\nOriginal line: #{line}\n#{e.backtrace[0]}"
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki.rb
deleted file mode 100644
index a060c75..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Ruwiki's Wiki markup class. This will convert the Wiki markup known by
- # Ruwiki (defined by Token classes). The algorithm is as follows:
- #
- # 1. For each known Token class, match each instance of it in the content
- # stream. Replace each instance in the content stream with a Token
- # marker: TOKEN_x or \TOKEN_x, where x is a digit representing the
- # Token. (\TOKEN_x is a special case of token matching. See
- # Ruwiki::Markup::Token for more information.) Store the Token for
- # later processing.
- # 2. Go back through the content, replacing each instance of \TOKEN_x
- # with the Token's defined restore value (which should be the same
- # value as was originally matched).
- # 3. Go through the content, replacing each instance of TOKEN_x with the
- # Token's defined replacement value.
- # 4. Go through the tokens, in reverse, and execute the post replacement
- # routine defined by the Token. (This may be necessary to collapse
- # consecutive HTML structures.)
- # 5. Return the parsed content and the collected metadata.
- #
- # == Tokens
- # Look at Ruwiki::Markup::Token describes how to create Token objects.
- class Wiki
- def parse(content, project)
- content = content.dup
- tokens = []
- project ||= @default_project
-
- Token.tokenlist.each do |token|
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, project, @backend, @script, @message, @title)
- tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{tokens.size - 1}"
- else
- "TOKEN_#{tokens.size - 1}"
- end
- end
- end
-
- replaced = []
- s = true
- loop do
- break if replaced.size >= tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].restore
- }
-
- s = content.gsub!(/TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].replace
- }
- end
-
- token_classes = tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
-
- content
- end
-
- attr_accessor :default_project
- attr_accessor :script
- attr_accessor :backend
- attr_accessor :message
-
- # Creates the markup class.
- def initialize(default_project, script, title)
- @default_project = default_project
- @script = script
- @title = title
- end
- end
-end
-
-require 'ruwiki/wiki/tokens'
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens.rb
deleted file mode 100644
index d0e47fc..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens.rb
+++ /dev/null
@@ -1,136 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # The base Token class. All Token classes must inherit from Token and
- # *must* implement the following methods:
- #
- # [self.regexp] The regular expression that the Token will be
- # replacing.
- # [replace] The mechanism for replacing the Token with the desired
- # results.
- #
- # Token classes <i>should</i> implement the following method:
- # [self.rank] Default: <tt>5000</tt>. Affects the sort order.
- # Must return an integer.
- #
- # Token classes <i>may</i> implement the following methods:
- # [restore] Restores the token without replacement.
- # Implements the results of the escape character.
- # NOTE: each Token class is responsible for its own
- # restore. Tokens that are anchored to the
- # beginning of a line are the most likely to need
- # to reimplement this.
- # [self.post_replace] Performs any necessary massaging of the data. See
- # the implementation of Ruwiki::Wiki::Lists for
- # more information.
- class Token
- @@tokenlist = []
- @@sorted = false
-
- class << self
- # Tokens should define rank if they must be first or last in
- # processing. Otherwise, they are sorted in the order defined.
- def rank
- 5000
- end
-
- # The Wiki parsing routine uses Token.tokenlist to determine the
- # tokens that are processed, and the order in which they are
- # processed. See Token.rank for more information.
- def tokenlist
- unless @@sorted
- head = @@tokenlist.shift
- @@tokenlist.sort! { |a, b| a.rank <=> b.rank }
- @@tokenlist.unshift(head)
- sorted = true
- end
- @@tokenlist
- end
-
- def inherited(child_class) #:nodoc:
- @@tokenlist << Token if @@tokenlist.empty?
-
- # Make the child class post_replace a blank function because we
- # don't want to propogate the currently defined post_replace.
- # The current post_replace is specific to Token_Base only.
- class << child_class
- def self.post_replace(content)
- content
- end
- end
-
- @@tokenlist << child_class
- @@sorted = false
- end
-
- # The replacement regular expression.
- def regexp
- /TOKEN_(\d*)/
- end
- end
-
- # All Token classes must match this header signature if they define
- # #initialize.
- #
- # [match] The MatchData object for this Token.
- # [project] The project being processed.
- # [backend] The backend for the wiki. This is used to determine if
- # the page or project exists. The object passed must
- # respond to #project_exists?(project) and
- # #page_exists?(page, project).
- # [script] The URI to the script.
- # [message] The message hash for localized messages.
- # [title] The title of the Wiki.
- def initialize(match, project, backend, script, message, title)
- @match = match
- @project = project
- @backend = backend
- @script = script
- @message = message
- @title = title
- end
-
- # The replacement method. Uses @match to replace the token with the
- # appropriate values.
- def replace
- "TOKEN_#{@match[1]}"
- end
-
- # Restores the token without replacement. By default, replaces
- # "dangerous" HTML characters.
- def restore
- @match[0].gsub(/&/, "&amp;").gsub(/</, "&lt;").gsub(/>/, "&gt;")
- end
-
- # The content may need massaging after processing.
- def self.post_replace(content)
- content
- end
- end
- end
-end
-
- # Load the tokens from the ruwiki/wiki/tokens directory.
-tokens_dir = 'ruwiki/wiki/tokens'
-
-$LOAD_PATH.each do |path|
- target = "#{path}/#{tokens_dir}"
- if File.exists?(target) and File.directory?(target)
- Dir::glob("#{target}/*.rb") do |token|
- begin
- require token
- rescue LoadError
- nil
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/00default.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/00default.rb
deleted file mode 100644
index d57544f..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/00default.rb
+++ /dev/null
@@ -1,206 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-# $debug = File.open("output.txt", "wb")
-
-class Ruwiki::Wiki
- # The Paragraph Token class changes blank lines to <p> tags. This class,
- # under the current implementation, should be *first* in the Token list
- # after Token.
- class Paragraph < Ruwiki::Wiki::Token
- # This Token is #rank 0, because it should be first in the Token list.
- def self.rank
- 0
- end
-
- # Matches blank lines. %r{^$}
- def self.regexp
- %r{(^$)}
- end
-
- def replace
- %Q(</p><p class="rwtk_Paragraph">)
- end
-
- # Ensures that <p> won't be surrounded by <br> tags.
- def self.post_replace(content)
- content.gsub!(%r{\A}, '<p class="rwtk_Paragraph">')
- content.gsub!(%r{\z}, '</p>')
- content.gsub!(%r{\n(</p>)}, '\1')
- content.gsub!(%r{(<p[^>]*>)\n}, '\1')
- content.gsub!(%r{(</p>)(<p[^>]*>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{<p[^>]*></p>}, '')
- content.gsub!(%r{^\n(<p[^>]*>)}, '\1')
- content
- end
- end
-
- # The Code Token class converts indented text to "unformatted" (<pre>)
- # text. This class should be *second* in the Token list.
- class Code < Ruwiki::Wiki::Token
- # This Token is #rank 1, because it should be second in the Token list.
- def self.rank
- 1
- end
-
- # Matches indented text. %r{^(\s+\S?.*)$}
- def self.regexp
- %r{^([ \t]+[^\n]*)\n}
- end
-
- # Replaces the text to <pre>content</pre>.
- def replace
- content = @match.captures[0]
- content.gsub!(/&/, '&amp;')
- content.gsub!(/</, '&lt;')
- content.gsub!(/>/, '&gt;')
-
- %Q{</p><pre class="rwtk_Code">#{content}</pre>\n}
- end
-
- # Converts cases of %r{</pre>(\n|<br ?/?>)<pre>} to \1.
- def self.post_replace(content)
- content.gsub!(%r{</pre>((\n)*</p>(\n)*)?<pre[^>]*>}, "\n")
- content.gsub!(%r{</pre>(\n|<br ?/?>)?<pre[^>]*>}, '\1')
- content.gsub!(%r{<p[^>]*>(<pre[^>]*>)}, '\1')
- content.gsub!(%r{</pre></p>}, '</pre>')
-# content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content
- end
- end
-
- RE_URI_SCHEME = %r{[-a-z0-9+.]{3,}?:}
- RE_URI_PATH = %r{[^\s<>\]]}
- RE_URI_TEXT = %r{[^\]]*}
-
- # Converts URLs in the form of [url] to numbered links.
- class NumberedLinks < Ruwiki::Wiki::Token
- class << self
- def increment
- @count ||= 0
- @count += 1
- end
-
- def reset
- @count = 0
- end
- end
-
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\]}
- end
-
- def replace
- extlink = @match.captures[0]
-
- name = "[#{NumberedLinks.increment}]"
-
- %Q{<a class="rwtk_NumberedLinks" href="#{extlink}">#{name}</a>}
- end
- end
-
- class Image < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- RE_IMAGE_OPTIONS=%r{([^=]+)=("[^"]+"|[^ ]+)}
-
- def self.regexp
- %r{\[image\s*:\s*(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)(\s+[^\]]+)?\]}
- end
-
- def replace
- options = { 'src' => %Q("#{@match.captures[0]}") }
- groups = @match.captures[1]
- unless groups.nil?
- groups.scan(RE_IMAGE_OPTIONS).each { |g| options[g[0].strip] = g[1].strip }
- end
-
- unless options['numbered'].nil? or options['numbered'] == "false"
- options['title'] = %Q("[#{NumberedLinks.increment}]")
- options.delete('numbered')
- end
-
- options['title'] ||= options['alt']
- options['title'] ||= options['src']
- options['alt'] ||= options['title']
-
- ss = ""
- options.keys.sort.map { |kk| ss << %Q( #{kk}=#{options[kk]}) }
-
- %Q{<img class="rwtk_Image"#{ss} />}
- end
- end
-
- # Converts URLs in the form of [url name] to named links.
- class NamedLinks < Ruwiki::Wiki::Token
- def self.rank
- 3
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\s+(#{RE_URI_TEXT})\]}
- end
-
- def replace
- extlink = @match.captures[0]
- name = @match.captures[1]
-
- %Q{<a class="rwtk_NamedLinks" href="#{extlink}">#{name}</a>}
- end
- end
-
- # Converts URLs to links where the "name" of the link is the URL itself.
- class ExternalLinks < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{\b(#{RE_URI_SCHEME}#{RE_URI_PATH}+)}
- end
-
- def replace
- extlink = @match.captures[0]
-
- %Q{<a class="rwtk_ExternalLinks" href="#{extlink}">#{extlink}</a>}
- end
- end
-
- # Creates a horizontal rule.
- class HRule < Ruwiki::Wiki::Token
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def replace
- %Q(<hr class="rwtk_HRule" />)
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(<p[^>]*>)*(<hr[^ />]* ?/?>)(</p>)*}, '\1')
- content.gsub!(%r{\n<hr />}, "</p>\n<hr />")
- content.gsub!(%r{<hr ?/?>\n<br ?/?>}, "<hr />")
- content.gsub!(%r{(\n|<br ?/?>)?<hr>(\n|<br ?/?>)?}, "<hr />")
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/01wikilinks.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/01wikilinks.rb
deleted file mode 100644
index fed48d4..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/01wikilinks.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # This provides the basic WikiWord match. This supports WikiWord,
- # CPlusPlus, ThisIsALink, and C_Plus_Plus.
- RE_WIKI_WORDS = %r{[[:upper:]][\w_]*(?:[[:lower:]]+[[:upper:]_]|[[:upper:]_]+[[:lower:]])[\w_]*}
- # This provides wikipedia format matches, e.g., [[wikipedia links]]. The
- # only restriction on words in this format is that they must NOT begin
- # with an underscore ('_').
- RE_WIKIPEDIA_WORDS = %r{\[\[([^_].*?)\]\]}
- # This provides the basic Wiki Project match.
- RE_PROJECT_WORD = %r{[[:upper:]][[:lower:]]+}
-
- # This provides the Wiki view link format:
- VIEW_LINK = %Q[<a class="rwtk_WikiLink" href="%s">%s</a>]
- EDIT_LINK = %Q[<span class="rwtk_EditWikiLink">%s</span><a class="rwtk_WikiLink" href="%s">?</a>]
-
- # Creates a crosslink for a Project::WikiPage.
- class ProjectCrossLink < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::(#{RE_WIKI_WORDS})}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic.gsub(/_/, ' ')}"]
- else
- EDIT_LINK % ["#{project}::#{topic.gsub(/_/, ' ')}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a crosslink for a Project::WikiPage using a Wikipedia link
- # format.
- class ProjectCrossLinkWikipedia < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::#{RE_WIKIPEDIA_WORDS}}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic}"]
- else
- EDIT_LINK % ["#{project}::#{topic}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to the project index from ::Project.
- class ProjectIndex < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{(\B|\\)::(#{RE_PROJECT_WORD})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- project = @match.captures[1]
-
- if @backend.page_exists?('ProjectIndex', project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/ProjectIndex", project]
- else
- if @backend.project_exists?(project)
- EDIT_LINK % [project, "#{@script}/#{project}/ProjectIndex/_edit"]
- else
- EDIT_LINK % [project, "#{@script}/#{project}/_create"]
- end
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project.
- class WikiLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\b|\\)(#{RE_WIKI_WORDS})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic.gsub(/_/, ' ')]
- else
- EDIT_LINK % [topic.gsub(/_/, ' '), "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project using a Wikipedia
- # link format.
- class WikipediaLinks < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(\B|\\)#{RE_WIKIPEDIA_WORDS}\B}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- ALT_TEXT = %r{(.+)\|(.+)}o
-
- def replace
- captures = @match.captures
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- at = ALT_TEXT.match(topic)
-
- if not at.nil?
- topic = at.captures[1]
- link = CGI.escape(at.captures[0])
- end
-
- if @backend.page_exists?(link, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic]
- else
- EDIT_LINK % [topic, "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/02actions.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/02actions.rb
deleted file mode 100644
index fd0d5b8..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/02actions.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # Produces a list of topics.
- class TopicList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%topics\((#{Ruwiki::Wiki::RE_PROJECT_WORD})?\)$}
- end
-
- def replace
- project = @match.captures[0] || @project
-
- if @backend.project_exists?(project)
- topic_list = @backend.list_topics(project)
- else
- topic_list = []
- end
-
- if topic_list.empty?
- s = @message[:no_topics] % [project]
- else
- s = %Q(<h4 class="rwtk_Headings">#{@message[:topics_for_project] % [project]}</h4>\n<ul class="rwtk_Lists">\n)
- topic_list.each do |tt|
- s << %Q(<li class="rwtk_Lists">)
- s << VIEW_LINK % ["#{@script}/#{project}/#{tt}", "#{CGI::unescape(tt.gsub(/_/, ' '))}"]
- s << "</li>\n"
- end
- s << "</ul>\n"
- end
-
- s
- end
- end
-
- class ProjectList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%projects\(\)$}
- end
-
- def replace
- proj_list = @backend.list_projects
-
- s = %Q(<h4 class="rwtk_Headings">#{@message[:wiki_projects] % [@title]}</h4>\n<ul class="rwtk_Lists">\n)
- proj_list.each do |pp|
- s << %Q(<li class="rwtk_Lists">)
- s << VIEW_LINK % ["#{@script}/#{pp}/ProjectIndex", pp]
- s << %Q! <a href='#{@script}/#{pp}/_topics' class='rw_minilink'>#{@message[:project_topics_link]}</a>!
- s << "</li>\n"
- end
- s << "</ul>\n"
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/abbreviations.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/abbreviations.rb
deleted file mode 100644
index 3f80d83..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/abbreviations.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Converts abbreviations.
- class Abbreviations < Ruwiki::Wiki::Token
- ABBREVIATIONS = {
- "matz" => "Yukihiro Matsumoto",
- }
-
- def self.regexp
- %r!@\{([^\}]*)\}!
- end
-
- def replace
- k = @match.captures[0]
- if k.nil? or k.empty?
- data = %Q(<dl class="rwtk_Abbreviations">)
- ABBREVIATIONS.each do |k, v|
- data << %Q(<dt class="rwtk_Abbreviations">#{k}</dt><dd class="rwtk_Abbreviations">#{v}</dd>)
- end
- data << %Q(</dl>)
- else
- if ABBREVIATIONS.has_key?(k)
- data = ABBREVIATIONS[k]
- else
- data = @match[0]
- end
- end
- data
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/calendar.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/calendar.rb
deleted file mode 100644
index 88f52d9..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/calendar.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces a mini-calendar with dates as WikiWords.
- class Calendar < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?%calendar\((?:(today)|(\d+),\s*(\d+))(?:,\s*(#{RE_PROJECT_WORD}))?\)}
- end
-
- def self.make(year, month)
- result = []
- t = Time.local(year, month, 1)
- r = Array.new(t.wday, nil)
- r << 1
-
- 2.upto(31) do |i|
- break if Time.local(year, month, i).month != month
- r << i
- end
-
- r += Array.new((- r.size) % 7, nil)
-
- 0.step(r.size - 1, 7) do |i|
- result << r[i, 7]
- end
- result
- end
-
- def make_month_link(project, year, month, state = nil)
- ym = "%04d%02d" % [year, month]
- case state
- when :prev
- title = "&laquo; #{year}.#{month}"
- when :next
- title = "#{year}.#{month} &raquo;"
- else
- title = "#{project}::#{year}.#{month}"
- end
- url = "#{@script}/#{project}/#{ym}"
-
- if @backend.page_exists?(ym, project)
- VIEW_LINK % [url, title]
- else
- EDIT_LINK % [title, "#{url}/_edit"]
- end
- end
-
- def replace
- today = @match.captures[0]
- project = @match.captures[3] || @project
- now = Time.now
-
- if today.nil?
- year = @match.captures[1].to_i
- month = @match.captures[2].to_i
- else
- year = now.year
- month = now.month
- end
-
- if (year == now.year) and (month == now.month)
- show_today = now.day
- else
- show_today = nil
- end
-
- result = <<-"CALENDAR_HEAD"
-</p>
-<div class="rwtk_Calendar">
-<table class="rwtk_Calendar" summary="calendar for ::#{project}: #{year}.#{month}">
-<thead>
- CALENDAR_HEAD
-
- result << %Q{ <tr>\n<th colspan="7" class="rwtk_Calendar_current_month">}
- result << make_month_link(project, year, month)
- result << %Q{</th>\n </tr>\n <tr>\n<th colspan="2" class="rwtk_Calendar_prev_month">}
- result << make_month_link(project, year, month - 1, :prev)
- result << %Q{</th>\n<th colspan="3"></th>\n<th colspan="2" class="rwtk_Calendar_next_month">}
- result << make_month_link(project, year, month + 1, :next)
- result << "</th>\n"
-
- result << <<-"CALENDAR_HEAD2"
- </tr>
- <tr>
- <th class="rwtk_Calendar_weekend">Su</th>
- <th class="rwtk_Calendar_weekday">Mo</th>
- <th class="rwtk_Calendar_weekday">Tu</th>
- <th class="rwtk_Calendar_weekday">We</th>
- <th class="rwtk_Calendar_weekday">Th</th>
- <th class="rwtk_Calendar_weekday">Fr</th>
- <th class="rwtk_Calendar_weekend">Sa</th>
- </tr>
-</thead>
-<tbody>
- CALENDAR_HEAD2
-
- Calendar.make(year, month).each do |week|
- result << " <tr>\n"
- week.each do |day|
- if day.nil?
- result << %Q{ <td class="rwtk_Calendar_day"></td>\n}
- else
- date = "%04d%02d%02d" % [year, month, day]
- # Add the ability to create pages based on date here.
- if show_today == day
- result << %Q{ <td class="rwtk_Calendar_today">}
- else
- result << %Q{ <td class="rwtk_Calendar_day">}
- end
- if @backend.page_exists?(date, project)
- result << VIEW_LINK % ["#{@script}/#{project}/#{date}", day]
- else
- result << EDIT_LINK % [day, "#{@script}/#{project}/#{date}/_edit"]
- end
- result << %Q{</td>\n}
- end
- end
- result << " </tr>\n"
- end
-
- result << %Q(</tbody>\n</table>\n</div>\n<p class="rwtk_Paragraph">)
- result
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*>(\s*</?div(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?table(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?t(?:head|body|r)(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*<t[hd].+?</t[hd]>\s*)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/headings.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/headings.rb
deleted file mode 100644
index cfc3001..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/headings.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts headings.
- class Headings < Ruwiki::Wiki::Token
-# def self.rank
-# 5
-# end
-
- def self.regexp
- %r{^\\?(=+)\s+(.*)}
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def replace
- level = @match.captures[0].count("=")
- content = @match.captures[1]
- level = 6 if level > 6
- %Q(<h#{level} class="rwtk_Headings">#{content}</h#{level}>)
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(</h\d>)\n}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{(</h\d>)</p>\n<p>}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{<p[^>]*>(<h\d[^>]*>)}, '\1')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/lists.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/lists.rb
deleted file mode 100644
index 1615c2c..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/lists.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Produces Lists
- class Lists < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?([*#]+)\s+(.*)$}
- end
-
- def replace
- indent = @match.captures[0].scan(/./).map { |ee| ee == "*" ? 'ul' : 'ol' }
- content = @match.captures[1]
-
- pre = ''
- post = ''
- indent.each { |elem| pre << %Q(<#{elem} class="rwtk_Lists">) }
- indent.reverse_each { |elem| post << %Q(</#{elem}>) }
- %Q(#{pre}<li class="rwtk_Lists">#{content}</li>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- RE_NESTED_LISTS = %r{</[uo]l>\s*<[uo]l[^>]*>}
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*><([uo]l[^>]*)>}, '<\1>')
- content.gsub!(%r{</([uo]l)></p>}, '</\1>')
- content.gsub!(RE_NESTED_LISTS, '') while content =~ RE_NESTED_LISTS
- content
- end
- end
-
- # Produces block quotes.
- class Blockquotes < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((:+)|(>+))(\s+.*)$}
- end
-
- def replace
- content = @match.captures[3]
-
- if @match.captures[2].nil?
- char = ':'
- cite = ''
- else
- char = '>'
- cite = ' type="cite"'
- end
- indent = @match.captures[0].count(char)
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<blockquote#{cite} class="rwtk_Blockquotes">)
- post << %Q(</blockquote>)
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1].gsub(/^>/, '&gt;')
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</blockquote>(\n|<br ?/?>)?<blockquote[^>]*>}, '')
- content.gsub!(%r{(</?blockquote[^>]*>\n?)\s*}, '\1')
- content.gsub!(%r{</blockquote>(<blockquote[^>]*>)+}, '\1')
- content
- end
- end
-
- # Produces definition lists. Does not completely work correctly.
- class Definitions < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(;+)\s+(.+?)\s+:\s+(.*)}
- end
-
- def replace
- definition = @match.captures[2]
- term = @match.captures[1]
- indent = @match.captures[0].count(';')
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<dl class="rwtk_Definitions">)
- post << %Q(</dl>)
- end
- %Q(#{pre}<dt class="rwtk_Definitions">#{term}</dt><dd class="rwtk_Definitions">#{definition}</dd>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</dl>(\n|<br ?/?>)?<dl[^>]*>}, '')
- content.gsub!(%r{</dl>(<dl[^>]*>)+}, '\1')
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/rubylists.rb b/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/rubylists.rb
deleted file mode 100644
index 520bedf..0000000
--- a/ruwiki/tags/release-0.8.0/lib/ruwiki/wiki/tokens/rubylists.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Convert ruby-talk mailing list references (e.g., [ruby-talk:12345])
- # into named links.
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- # Convert ruby-core/ext/dev/list/math mailing list references (e.g.,
- # [ruby-core:12345]) into named links.
- class OtherRubyLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-(list|doc|core|dev|ext|math):(\d+)\]}
- end
-
- def replace
- ln, lm = @match.captures[0..1]
- %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-#{ln}/#{lm}">#{@match[0]}</a>)
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/ruwiki.cgi b/ruwiki/tags/release-0.8.0/ruwiki.cgi
deleted file mode 100644
index f8905c5..0000000
--- a/ruwiki/tags/release-0.8.0/ruwiki.cgi
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-begin
- require 'ruwiki'
-rescue LoadError
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib"
- require 'ruwiki'
-end
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-wiki.config.webmaster = "webmaster@domain.com"
-
-# wiki.config.debug = false
-# wiki.config.title = "Ruwiki"
-# wiki.config.default_page = "ProjectIndex"
-# wiki.config.default_project = "Default"
- # This next defaults to :flatfiles for Ruby 1.8.1 or earlier and to :yaml for
- # Ruby 1.8.2 or later.
-# wiki.config.storage_type = :flatfiles
-# wiki.config.storage_options[wiki.config.storage_type][:data_path] = "./data/"
-wiki.config.storage_options[wiki.config.storage_type][:extension] = "ruwiki"
-# wiki.config.template_path = "./templates/"
-# wiki.config.template_set = "default"
-# wiki.config.css = "ruwiki.css"
-# wiki.config.time_format = "%H:%M:%S"
-# wiki.config.date_format = "%Y.%m.%d"
-# wiki.config.datetime_format = "%Y.%m.%d %H:%M:%S"
-
-wiki.run
diff --git a/ruwiki/tags/release-0.8.0/ruwiki_servlet b/ruwiki/tags/release-0.8.0/ruwiki_servlet
deleted file mode 100644
index 1c835a8..0000000
--- a/ruwiki/tags/release-0.8.0/ruwiki_servlet
+++ /dev/null
@@ -1,245 +0,0 @@
-#!/usr/bin/env ruby
-
- # Customize this if you put the RuWiki files in a different location.
-require 'webrick'
-
-begin
- require 'ruwiki'
-rescue LoadError
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib"
- require 'ruwiki'
-end
-
-require 'ruwiki/servlet'
-require 'ruwiki/lang/en'
-require 'ruwiki/lang/de'
-require 'ruwiki/lang/es'
-
-require 'optparse'
-require 'ostruct'
-
-copyright_banner = <<-"COPYRIGHT"
-Ruwiki #{Ruwiki::VERSION}
- Copyright © 2002 - 2004, Digikata and HaloStatue
-
- http://rubyforge.org/projects/ruwiki/
-
- Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-
-Licensed under the same terms as Ruby.
-
-$Id$
-COPYRIGHT
-
- # This is for the WEBrick version of Ruwiki. This has been abstracted to
- # accept a Config global variable to reconfigure Ruwiki after initial
- # creation.
-$config = Ruwiki::Config.new
-
- # Because the servlet can be started from the command-line, provide defaults
- # for all possible configuration options.
-opts = OpenStruct.new
-opts.port = 8808
-opts.addresses = []
-opts.mount = '/'
-opts.do_log = true
-opts.log_dest = $stderr
-opts.threads = 1
-opts.language = Ruwiki::Lang::EN
-
- # Ruwiki::Config options.
-opts.webmaster = 'webmaster@domain.com'
-opts.debug = false
-opts.title = "Ruwiki"
-opts.default_page = "ProjectIndex"
-opts.default_project = "Default"
-opts.template_path = "./templates/"
-opts.template_set = "default"
-opts.css = "ruwiki.css"
-opts.time_format = "%H:%M:%S"
-opts.date_format = "%Y.%m.%d"
-opts.datetime_format = "%Y.%m.%d %H:%M:%S"
-
-# if RUBY_VERSION >= "1.8.2"
-# opts.storage_type = :yaml
-# else
-# opts.storage_type = :flatfiles
-# end
- # Temporarily disabled the above.
-opts.storage_type = :flatfiles
-
-opts.storage_options = Hash.new { |h, k| h[k] = {} }
-opts.storage_options[opts.storage_type][:data_path] = "./data/"
-opts.storage_options[opts.storage_type][:extension] = "ruwiki"
-
-ARGV.options do |o|
- o.banner = "Usage: #{File.basename($0)} [options]"
- o.separator ""
- o.separator "WEBrick options:"
- o.on('-P', '--port PORT', Numeric, 'Runs the Ruwiki servlet on the specified', 'port. Default 8808.') { |port|
- opts.port = port
- }
- o.on('-A', '--accept ADDRESS,ADDRESS,ADDRESS', Array, 'Restricts the Ruwiki servlet to accepting', 'connections from the specified address or', '(comma-separated) addresses. May be', 'specified multiple times. Defaults to all', 'addresses.') { |address|
- opts.addresses += address
- }
- o.on('-L', '--local', 'Restricts the Ruwiki servlet to accepting', 'only local connections (127.0.0.1).', 'Overrides any previous --accept addresses.') { |local|
- opts.addresses = ["127.0.0.1"]
- }
- o.on('-M', '--mount MOUNT-POINT', 'The relative URI from which Ruwiki ', 'will be accessible. Defaults to "/".') { |mp|
- opts.mount = mp
- }
- o.on('--[no-]log', 'Log WEBrick activity. Default is --log.') { |log|
- opts.do_log = log
- }
- o.on('--logfile LOGFILE', 'The file to which WEBrick logs are', 'written. Default is standard error.') { |lf|
- opts.log_dest = lf
- }
- o.on('-T', '--threads THREADS', Integer, 'Sets the WEBrick threadcount.') { |tc|
- opts.threads = tc
- }
- o.separator ""
- o.separator "Ruwiki options:"
- o.on('--language LANGUAGE', 'The interface language for Ruwiki.', 'Defaults to "en". May be "en", "de", or', '"es".') { |lang|
- case lang
- when 'en'
- opts.language = Ruwiki::Lang::EN
- when 'es'
- opts.language = Ruwiki::Lang::ES
- when 'de'
- opts.language = Ruwiki::Lang::DE
- end
- }
- o.on('--webmaster WEBMASTER', 'The Ruwiki webmaster email address.', 'Defaults to "webmaster@domain.com".') { |wm|
- opts.webmaster = wm
- }
- o.on('--[no-]debug', 'Turns on Ruwiki debugging. Defaults', 'to --no-debug.') { |d|
- opts.debug = d
- }
- o.on('--title TITLE', 'Provides the Ruwiki title. Default is', '"Ruwiki".') { |t|
- opts.title = t
- }
- o.on('--default-page PAGENAME', 'An alternate default page. Default is', '"ProjectIndex".') { |dp|
- opts.default_page = dp
- }
- o.on('--default-project PAGENAME', 'An alternate default project. Default is', '"Default".') { |dp|
- opts.default_project = dp
- }
- o.on('--template-path TEMPLATE_PATH', 'The location of Ruwiki templates. Default', 'is "./templates".') { |tp|
- opts.template_path = tp
- }
- o.on('--templates TEMPLATES', 'The name of the Ruwiki templates. Default', 'is "default".') { |tp|
- opts.template_set = tp
- }
- o.on('--css CSS_NAME', 'The name of the CSS file in the template', 'path. Default is "ruwiki.css".') { |css|
- opts.css = css
- }
- o.on('--storage-type TYPE', Ruwiki::KNOWN_BACKENDS, 'Select the storage type:', "#{Ruwiki::KNOWN_BACKENDS.join(", ")}") { |st|
- opts.storage_type = st
- opts.storage_options[opts.storage_type][:data_path] ||= "./data/"
- opts.storage_options[opts.storage_type][:extension] ||= "ruwiki"
- }
- o.on('--flatfiles-data-path PATH', 'The path where data files are stored.', 'Default is "./data".') { |fdp|
- opts.storage_options[:flatfiles][:data_path] = fdp
- opts.storage_options[:yaml][:data_path] = fdp
- opts.storage_options[:marshal][:data_path] = fdp
- }
- o.on('--flatfiles-extension EXT', 'The extension for data files.', 'Default is "ruwiki".') { |ext|
- opts.storage_options[:flatfiles][:extension] = ext
- opts.storage_options[:yaml][:extension] = ext
- opts.storage_options[:marshal][:extension] = ext
- }
-
- # TODO: Add options for time, date, and datetime formats.
- o.separator ""
- o.separator "General info:"
- o.on_tail('--help', 'Shows this text.') {
- $stderr.puts o
- exit
- }
- o.on_tail('--version', 'Shows the version of Ruwiki.') {
- $stderr.puts copyright_banner
- exit
- }
- o.parse!
-end
-
- # Configuration defaults to certain values. This overrides the defaults. The
- # webmaster.
-$config.webmaster = opts.webmaster
-$config.debug = opts.debug
-$config.title = opts.title
-$config.default_page = opts.default_page
-$config.default_project = opts.default_project
-$config.storage_type = opts.storage_type
-$config.storage_options[opts.storage_type] = opts.storage_options[opts.storage_type]
-$config.template_path = opts.template_path
-$config.template_set = opts.template_set
-$config.css = opts.css
-$config.time_format = opts.time_format
-$config.date_format = opts.date_format
-$config.datetime_format = opts.datetime_format
-$config.language = opts.language
-
- # If the list of accepted addresses is not empty, provide IP-based
- # restrictions.
-if not opts.addresses.empty?
- localonly = proc do |sock|
- if not opts.addresses.include?(sock.peeraddr[3])
- msg = "Rejected peer address #{sock.peeraddr[3]}. Connections are only accepted from: #{opts.addresses.join(", ")}."
- raise WEBrick::ServerError, msg
- end
- end
-else
- localonly = nil
-end
-
-if opts.do_log
- if opts.log_dest = $stderr
- dest = $stderr
- opts.log_dest = "stderr"
- else
- dest = File.open(opts.log_dest, "wb+")
- end
- logger = WEBrick::Log.new(dest, WEBrick::Log::DEBUG)
-else
- logger = nil
-end
-
-banner = <<-"BANNER"
-#{copyright_banner}
-
-WEBrick options:
- Port #{opts.port}
- Accepted Addresses #{opts.addresses.join(", ")}
- Mount Point #{opts.mount}
- Logging? #{opts.do_log}
- Log Destination #{opts.log_dest}
- Threads #{opts.threads}
-
-Ruwiki options:
- Webmaster #{opts.webmaster}
- Debugging? #{opts.debug}
- Title #{opts.title}
- Default Project #{opts.default_project}
- Default Page #{opts.default_page}
- Template Path #{opts.template_path}
- Template Set #{opts.template_set}
- CSS Source #{opts.css}
-
- Storage Type #{opts.storage_type}
- Data Path #{opts.storage_options[opts.storage_type][:data_path]}
- Extension #{opts.storage_options[opts.storage_type][:extension]}
-
-BANNER
-
-banner.each { |b| logger.info(b) } unless logger.nil?
-
-server = WEBrick::HTTPServer.new(:Port => opts.port.to_i,
- :StartThreads => opts.threads.to_i,
- :AcceptCallback => localonly,
- :Logger => logger)
-$config.logger = logger
-server.mount(opts.mount, Ruwiki::Servlet)
-trap("INT") { server.shutdown; exit }
-server.start
diff --git a/ruwiki/tags/release-0.8.0/ruwiki_servlet.bat b/ruwiki/tags/release-0.8.0/ruwiki_servlet.bat
deleted file mode 100644
index 32012f7..0000000
--- a/ruwiki/tags/release-0.8.0/ruwiki_servlet.bat
+++ /dev/null
@@ -1,17 +0,0 @@
-@echo off
-REM Ruwiki 0.8.0
-REM Copyright © 2002 - 2004, Digikata and HaloStatue
-REM Alan Chen (alan@digikata.com)
-REM Austin Ziegler (ruwiki@halostatue.ca)
-REM
-REM Licensed under the same terms as Ruby.
-REM $Id$
-REM
-if "%OS%"=="Windows_NT" goto WinNT
-ruby -x "ruwiki_servlet" %1 %2 %3 %4 %5 %6 %7 %8 %9
-goto done
-:WinNT
-title Ruwiki
-ruby -x "ruwiki_servlet" %*
-goto done
-:done
diff --git a/ruwiki/tags/release-0.8.0/templates/default/body.tmpl b/ruwiki/tags/release-0.8.0/templates/default/body.tmpl
deleted file mode 100644
index 2f3c10f..0000000
--- a/ruwiki/tags/release-0.8.0/templates/default/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.8.0/templates/default/content.tmpl b/ruwiki/tags/release-0.8.0/templates/default/content.tmpl
deleted file mode 100644
index 63b638a..0000000
--- a/ruwiki/tags/release-0.8.0/templates/default/content.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.8.0/templates/default/controls.tmpl b/ruwiki/tags/release-0.8.0/templates/default/controls.tmpl
deleted file mode 100644
index 1137336..0000000
--- a/ruwiki/tags/release-0.8.0/templates/default/controls.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_header">
- <form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- <!-- Right-hand tabs must go in reverse order! -->
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10">
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.8.0/templates/default/edit.tmpl b/ruwiki/tags/release-0.8.0/templates/default/edit.tmpl
deleted file mode 100644
index 02f21e4..0000000
--- a/ruwiki/tags/release-0.8.0/templates/default/edit.tmpl
+++ /dev/null
@@ -1,26 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_navbar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_navbar_righttab" id="rw_editing_tab"><strong><em>#label_editing#</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0/templates/default/error.tmpl b/ruwiki/tags/release-0.8.0/templates/default/error.tmpl
deleted file mode 100644
index a3887b2..0000000
--- a/ruwiki/tags/release-0.8.0/templates/default/error.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0/templates/default/footer.tmpl b/ruwiki/tags/release-0.8.0/templates/default/footer.tmpl
deleted file mode 100644
index 2f0fdbc..0000000
--- a/ruwiki/tags/release-0.8.0/templates/default/footer.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_footer">
- <form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- <!-- Right-hand tabs must go in reverse order! -->
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10">
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.8.0/templates/default/ruwiki.css b/ruwiki/tags/release-0.8.0/templates/default/ruwiki.css
deleted file mode 100644
index 5c612e8..0000000
--- a/ruwiki/tags/release-0.8.0/templates/default/ruwiki.css
+++ /dev/null
@@ -1,285 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_footer
-{
- position: absolute;
- width: 100%;
- bottom: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_footer { position: fixed; }
-
-body > div#rw_footer > .rw_navbar { position: fixed; bottom: 0; }
-body > div#rw_footer > .rw_navbar > div { position: relative; top: -2em; }
-
-body
-{
- margin: 0.5em;
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_navbar
-{
- width: 100%;
- margin: 0;
- padding: 0.1em;
- font-size: 0.7em;
- border: 1px solid black;
- color: white;
- background-color: #27C;
- height: 0.5em;
- z-index: 2;
-}
-
-.rw_navbar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_navbar a:visited
-{
- color: #2E7;
- font-weight: normal;
- border-bottom: 1px dashed #2E7;
-}
-
-.rw_navbar a:hover
-{
- text-decoration: none;
-}
-
-.rw_navbar_tab
-{
- float: left;
- background-color: #27C;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_navbar_tab:hover
-{
- background-color: #49E;
-}
-
-.rw_navbar_righttab
-{
- float: right;
- padding-left: 0.8em;
- padding-top: 0.3em;
- padding-right: 0.8em;
- border: 1px solid #059;
- background-color: #27C;
- margin: 0 0.3em;
- height: 2em;
-}
-
-.rw_navbar_righttab:hover
-{
- background-color: #49E;
-}
-
-.rw_content
-{
- clear: both;
- margin-top: 2em;
- margin-left: 3em;
- margin-right: 3em;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #27C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #27C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab { background-color: #C72; }
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- background-color: #999;
- border: 1px solid black;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
-
diff --git a/ruwiki/tags/release-0.8.0/templates/default/save.tmpl b/ruwiki/tags/release-0.8.0/templates/default/save.tmpl
deleted file mode 100644
index 04069b1..0000000
--- a/ruwiki/tags/release-0.8.0/templates/default/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.8.0/templates/sidebar/body.tmpl b/ruwiki/tags/release-0.8.0/templates/sidebar/body.tmpl
deleted file mode 100644
index 2f3c10f..0000000
--- a/ruwiki/tags/release-0.8.0/templates/sidebar/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.8.0/templates/sidebar/content.tmpl b/ruwiki/tags/release-0.8.0/templates/sidebar/content.tmpl
deleted file mode 100644
index 1d3ca9c..0000000
--- a/ruwiki/tags/release-0.8.0/templates/sidebar/content.tmpl
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.8.0/templates/sidebar/controls.tmpl b/ruwiki/tags/release-0.8.0/templates/sidebar/controls.tmpl
deleted file mode 100644
index 6e12b22..0000000
--- a/ruwiki/tags/release-0.8.0/templates/sidebar/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_titlebar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_titlebar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0/templates/sidebar/edit.tmpl b/ruwiki/tags/release-0.8.0/templates/sidebar/edit.tmpl
deleted file mode 100644
index 2604b01..0000000
--- a/ruwiki/tags/release-0.8.0/templates/sidebar/edit.tmpl
+++ /dev/null
@@ -1,26 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_titlebar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_titlebar_tab" id="rw_editing_tab"><strong><em>#label_editing#</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content_edit">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0/templates/sidebar/error.tmpl b/ruwiki/tags/release-0.8.0/templates/sidebar/error.tmpl
deleted file mode 100644
index 5a2882e..0000000
--- a/ruwiki/tags/release-0.8.0/templates/sidebar/error.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0/templates/sidebar/footer.tmpl b/ruwiki/tags/release-0.8.0/templates/sidebar/footer.tmpl
deleted file mode 100644
index f43eb32..0000000
--- a/ruwiki/tags/release-0.8.0/templates/sidebar/footer.tmpl
+++ /dev/null
@@ -1,22 +0,0 @@
-<div class="rw_footer">
- <form class="rw_footer_tab" action="_search">
- <div>
- <input class="rw_search_box" type="text" name="q" size="10">
- </div>
- <div>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- </div>
- </form>
- <div class="rw_footer_tab">
- <dl>
- <dt>%page_project%::</dt>
- <dd><a href="%cgi_url%/%page_project%/_topics">#label_topics#</a><br />
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </dd>
- </div>
- <div class="rw_footer_tab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.8.0/templates/sidebar/ruwiki.css b/ruwiki/tags/release-0.8.0/templates/sidebar/ruwiki.css
deleted file mode 100644
index 5e9cf4f..0000000
--- a/ruwiki/tags/release-0.8.0/templates/sidebar/ruwiki.css
+++ /dev/null
@@ -1,336 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
-.rw_titlebar
-{
- margin: 0 auto;
- height: 0.5em;
-}
-
- /* Normal styling from here on out. */
-body
-{
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_titlebar
-{
- font-size: 0.7em;
- border: 1px solid #059;
- color: white;
- background-color: #5C9;
- height: 0.5em;
- width: 100%;
-}
-
-.rw_titlebar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_titlebar a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_titlebar a:hover
-{
- text-decoration: none;
-}
-
-.rw_titlebar_tab
-{
- float: left;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_titlebar_tab:hover
-{
- background-color: #4E9;
-}
-
-div.rw_footer
-{
- position: fixed;
- left: 72%;
- width: 20%;
- height: 100%;
- padding: 0.2em;
- padding-top: 0.5em;
-//background-color: #95C;
- font-size: 0.9em;
-}
-
-.rw_footer
-{
-}
-
-.rw_footer a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_footer a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_footer a:hover
-{
- text-decoration: none;
-}
-
-.rw_footer_tab
-{
- color: yellow;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0.3em;
- min-height: 2em;
- clear: both;
-}
-
-.rw_footer_tab div
-{
- text-align: right;
-}
-
-div#rw_content
-{
- padding: 50px 0 0 0;
- margin-left: 0;
- voice-family: "\"}\""; /* fake out IE5/Win */
- voice-family: inherit;
- margin-left: 16px;
-}
-
-body > div#rw_content
-{
- margin-left: 0;
-}
-
-.rw_content
-{
- padding-top: 0;
- margin-left: 3em;
- width: 65%;
- float: left;
-}
-
-.rw_content_edit
-{
- width: 90%;
- margin: 0 auto;
- padding: 2em;
- padding-top: 0;
- float: left;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #59C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #59C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #59C;
- margin: 0.1em;
-}
-
-.rw_search_box
-{
- border: 1px dotted #59C;
- width: 100%;
- margin: 0.1em;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab
-{
- background-color: #C72;
- text-align: right;
- margin-right: 2em;
- float: right;
-}
-
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- background-color: #999;
- border: 1px solid black;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.8.0/templates/sidebar/save.tmpl b/ruwiki/tags/release-0.8.0/templates/sidebar/save.tmpl
deleted file mode 100644
index 7c4c31c..0000000
--- a/ruwiki/tags/release-0.8.0/templates/sidebar/save.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-<div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.8.0/templates/simple/body.tmpl b/ruwiki/tags/release-0.8.0/templates/simple/body.tmpl
deleted file mode 100644
index b3281d0..0000000
--- a/ruwiki/tags/release-0.8.0/templates/simple/body.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.8.0/templates/simple/content.tmpl b/ruwiki/tags/release-0.8.0/templates/simple/content.tmpl
deleted file mode 100644
index 1ba8ef7..0000000
--- a/ruwiki/tags/release-0.8.0/templates/simple/content.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.8.0/templates/simple/controls.tmpl b/ruwiki/tags/release-0.8.0/templates/simple/controls.tmpl
deleted file mode 100644
index 29cdf3a..0000000
--- a/ruwiki/tags/release-0.8.0/templates/simple/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <a href="%cgi_url%/%page_project%/">%page_project%</a>
- &raquo;
- %page_topic%
- [?editable|<a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">[#label_edit#]</a>?]
-</div>
diff --git a/ruwiki/tags/release-0.8.0/templates/simple/edit.tmpl b/ruwiki/tags/release-0.8.0/templates/simple/edit.tmpl
deleted file mode 100644
index b427114..0000000
--- a/ruwiki/tags/release-0.8.0/templates/simple/edit.tmpl
+++ /dev/null
@@ -1,24 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <strong>%page_topic%</strong>
- &raquo;
- <strong>%page_project%</strong>
- [<strong><em>#label_editing#</em></strong>]
-</div>
-
-<div class="rw_content">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0/templates/simple/error.tmpl b/ruwiki/tags/release-0.8.0/templates/simple/error.tmpl
deleted file mode 100644
index ac898ea..0000000
--- a/ruwiki/tags/release-0.8.0/templates/simple/error.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- |
- <strong><em>%name%</em></strong>
-</div>
-<div class="rw_content">
-<h1>%name%</h1>
-<p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
-<p>%backtrace%</p>
-</div>
diff --git a/ruwiki/tags/release-0.8.0/templates/simple/footer.tmpl b/ruwiki/tags/release-0.8.0/templates/simple/footer.tmpl
deleted file mode 100644
index dcd65ef..0000000
--- a/ruwiki/tags/release-0.8.0/templates/simple/footer.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<form class="rw_navbar" action="_search">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- |
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>,
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- |
- <input class="rw_search_box" type="text" name="q" size="10">
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
-</form>
diff --git a/ruwiki/tags/release-0.8.0/templates/simple/ruwiki.css b/ruwiki/tags/release-0.8.0/templates/simple/ruwiki.css
deleted file mode 100644
index 0c80c74..0000000
--- a/ruwiki/tags/release-0.8.0/templates/simple/ruwiki.css
+++ /dev/null
@@ -1,181 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #fafafa;
-}
-
-.rw_navbar
-{
- font-weight: bold;
- font-size: 1.1em;
- padding: 0.3em;
-}
-
-.rw_navbar a
-{
- border-bottom: 1px dashed black;
- font-weight: bold;
-}
-.rw_navbar a:visited
-{
- color: maroon;
- border-bottom: 1px dashed maroon;
-}
-.rw_navbar a:hover { background-color: #afafaf; }
-
-.rw_content
-{
- background-color: white;
- border: 1px dashed grey;
- padding: 0.5em;
- margin-left: 1em;
- margin-right: 1em;
-}
-
-.rw_edit_content
-{
- border: 1px solid black;
- padding: 0.3em;
- width: 95%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px solid black;
- padding: 0.3em;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px solid black;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form { }
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px solid black;
-}
-
-.rw_pagelink { text-decoration: none; }
-.rw_projectxlink { }
-.rw_projectindex { }
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title { }
-
-.rw_edit_format div
-{
-}
-
-.rw_search_button
-{
- border: 1px solid black;
-}
-
-.rw_search_box
-{
- border: 1px solid black;
-}
-
-.rw_search_box:hover { }
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_saved_page_announcement { }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- background-color: #EEE;
- border: 1px solid black;
-}
-.rwtk_Image { border: none; }
-.rwtk_NumberedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_NamedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_ExternalLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_RubyTalkLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_OtherRubyLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dashed grey; }
-.rwtk_WikiLink { text-decoration: none; }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.8.0/templates/simple/save.tmpl b/ruwiki/tags/release-0.8.0/templates/simple/save.tmpl
deleted file mode 100644
index 51de9f4..0000000
--- a/ruwiki/tags/release-0.8.0/templates/simple/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.8.0/tests/harness-cgi.rb b/ruwiki/tags/release-0.8.0/tests/harness-cgi.rb
deleted file mode 100644
index a0e9604..0000000
--- a/ruwiki/tags/release-0.8.0/tests/harness-cgi.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'harness'
-
-ENV["REQUEST_METHOD"] = "HEAD"
-
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_type = :flatfiles
-$wiki.config.storage_options[:flatfiles][:data_path] = "../data"
-$wiki.config.storage_options[:flatfiles][:extension] = "ruwiki"
-$wiki.config.template_path = "../templates/"
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.8.0/tests/harness.rb b/ruwiki/tags/release-0.8.0/tests/harness.rb
deleted file mode 100644
index 3e65272..0000000
--- a/ruwiki/tags/release-0.8.0/tests/harness.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-$LOAD_PATH.unshift("../lib")
-
-ENV["REQUEST_METHOD"] = "HEAD"
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_type = :flatfiles
-$wiki.config.storage_options[:flatfiles][:data_path] = "../data"
-$wiki.config.storage_options[:flatfiles][:extension] = "ruwiki"
-$wiki.config.template_path = "../templates/"
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.8.0/tests/tc_backend_flatfile.rb b/ruwiki/tags/release-0.8.0/tests/tc_backend_flatfile.rb
deleted file mode 100644
index 6b9969b..0000000
--- a/ruwiki/tags/release-0.8.0/tests/tc_backend_flatfile.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-require 'fileutils'
-
-class TestBackendFlatfiles < Test::Unit::TestCase
- def setup
- @ffopts = { :data_path => "./test/data", :extension => nil }
-
- # generate a database
- raise "Setup Error: #{@ffopts[:data_path]} exists" if File.exists?(@ffopts[:data_path])
-
- @flatbase = {
- 'Proj1' => ['ProjectIndex:all projects must have this',
- 'P1TopicOne:this is the content',
- 'P1TopicTwo:more content'],
- 'Proj2' => ['ProjectIndex:all projects must have this',
- 'P2TopicOne:this is the content',
- 'P2TopicTwo:more content',
- 'P2TopicThree:even more more content']
- }
-
- @flatbase.each do |key, val|
- prjdir = "#{@ffopts[:data_path]}/#{key}"
- FileUtils.mkdir_p(prjdir) rescue nil
- val.each do |topcon|
- topic, content = topcon.split(":")
- File.open("#{prjdir}/#{topic}", "w") { |fh| fh.puts "page!content: #{content}" }
- end
- end
-
- @backend = nil
- @pg = nil
- end
-
- def teardown
- # remove testing flatabase
- FileUtils.rm_rf(@ffopts[:data_path])
- Dir.rmdir("./test") # ugly but it works
- end
-
- def test_list_projects
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- # should be ['Proj1', 'Proj2']
- assert_equal(@flatbase.keys, @backend.list_projects)
- end
-
- def test_list_topics
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- @flatbase.keys.sort.each do |proj|
- got_topics = @backend.list_topics(proj)
- exp_topics = @flatbase[proj].map { |ent| ent.split(':')[0] }
- assert_equal(exp_topics.sort, got_topics.sort)
- end
- end
-
- # test simple one word lookups
- # need to add more complex search strings
- def test_search_project
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- assert_equal({'ProjectIndex' => 1,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 0 }.to_a.sort,
- @backend.search_project('Proj1', 'this').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 0,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'more').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'topic').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'content').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P2TopicOne' => 0,
- 'P2TopicTwo' => 1,
- 'P2TopicThree' => 2 }.to_a.sort,
- @backend.search_project('Proj2', 'more').to_a.sort)
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/tests/tc_bugs.rb b/ruwiki/tags/release-0.8.0/tests/tc_bugs.rb
deleted file mode 100644
index 4f6b3d0..0000000
--- a/ruwiki/tags/release-0.8.0/tests/tc_bugs.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-
-# see if we can reproduce the LicenseandAuthor hang
-# described in bug id 147 on rubyforge
-class TC_LicenseAndAuthorHang < Test::Unit::TestCase
- def setup
- @ffopts = { :data_path => "../data" }
-
- @backend = nil
- @pg = nil
- end
-
- # load "to the metal"
- def test_ffload
- assert_nothing_raised do
- @backend = ::Ruwiki::Backend::Flatfiles.new(@ffopts)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.load('LicenseAndAuthorInfo.ruwiki', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-
- # abstract backend retreive
- def test_beload
- @backend = nil
- assert_nothing_raised do
- mock_ruwiki = OpenStruct.new
- mock_ruwiki.config = OpenStruct.new
- mock_ruwiki.config.message = {}
- mock_ruwiki.config.storage_options = { :flatfiles => @ffopts }
-
- @backend = ::Ruwiki::BackendDelegator.new(mock_ruwiki, :flatfiles)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.retrieve('LicenseAndAuthorInfo', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-end
-
-# if __FILE__ == $0
-# ObjectSpace.each_object { |o| tests << o if o.kind_of?(Class) }
-# tests.delete_if { |o| !o.ancestors.include?(Test::Unit::TestCase) }
-# tests.delete_if { |o| o == Test::Unit::TestCase }
-
-# tests.each { |test| Test::Unit::UI::Console::TestRunner.run(test) }
-# end
diff --git a/ruwiki/tags/release-0.8.0/tests/tc_template.rb b/ruwiki/tags/release-0.8.0/tests/tc_template.rb
deleted file mode 100644
index 3a7f0ab..0000000
--- a/ruwiki/tags/release-0.8.0/tests/tc_template.rb
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'test/unit'
-require 'harness-cgi'
-
- class TestTemplates < Test::Unit::TestCase
- def test_include
- a = "a!INCLUDE!c"
- b = "b"
- t = Ruwiki::TemplatePage.new(a, b)
- assert_equal(["abc"], t.lines.lines)
- end
-
- def test_variables
- a = "a%b%c"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.process("", v))
- end
-
- def test_optional_variables
- a = "a%b%%?c%d"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.process("", v))
-
- v["c"] = "c"
- assert_equal("abcd", t.process("", v))
- end
-
- def test_labels
- a = "a#b#c"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.process("", v, m))
- end
-
- def test_optional_labels
- a = "a#b##?c#d"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.process("", v, m))
-
- m[:c] = "c"
- assert_equal("abcd", t.process("", v, m))
- end
-
- def test_hrefs
- a = "HREF:a:b:"
- t = Ruwiki::TemplatePage.new(a)
- v = { "b" => "b" }
-
- assert_equal("b", t.process("", v))
-
- s = ""
- v["a"] = "link"
- assert_equal(%Q(<a href="link">b</a>), t.process("", v))
- end
-
- def test_repeat_subst
- v1 = { "a" => 3 }
- v2 = { "a" => 2...4 }
- v3 = { "a" => -4...-2 }
- v4 = { "a" => [3, 1, 4, 1, 5, 9] }
- v5 = { "a" => [{ "a" => 3 }, { "a" => 1 }, { "a" => 4 }, { "a" => 1 }, { "a" => 5 }, { "a" => 9 }] }
-
- a = "[:a|xy:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("xyxyxy", t.process("", v1))
- assert_equal("xyxy", t.process("", v2))
- assert_equal("xyxy", t.process("", v3))
- assert_equal("xyxyxyxyxyxy", t.process("", v4))
- assert_equal("xyxyxyxyxyxy", t.process("", v5))
-
- a = "[:a|%a%:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("123", t.process("", v1))
- assert_equal("23", t.process("", v2))
- assert_equal("-4-3", t.process("", v3))
- assert_equal("314159", t.process("", v4))
- assert_equal("314159", t.process("", v5))
- end
-
- def test_optional_subst
- v1 = { "a" => "a" }
- v2 = { "a" => nil }
- a1 = "[?a|xy?]"
- a2 = "[!a|xy?]"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
-
- assert_equal("xy", t1.process("", v1))
- assert_equal("", t1.process("", v2))
- assert_equal("", t2.process("", v1))
- assert_equal("xy", t2.process("", v2))
- end
-
- def test_repeat_block
- a1 = "START:a\nxy\nEND:a"
- a2 = "START:a\nx%b%y\nEND:a"
- a3 = "START:\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- v = { "a" => [{ "b" => 3 }, { "b" => 1 }, { "b" => 4 }, { "b" => 1 }, { "b" => 5 }, { "b" => 9 }] }
-
- assert_equal("xy\nxy\nxy\nxy\nxy\nxy\n", t1.process("", v))
- assert_equal("x3y\nx1y\nx4y\nx1y\nx5y\nx9y\n", t2.process("", v))
- assert_raises(RuntimeError) { t3.process("", v) }
- end
-
- def test_optional_block
- a1 = "IF:a\nxy\nENDIF:a"
- a2 = "IF:\nxy\nEND:"
- a3 = "IFNOT:a\nxy\nENDIF:a"
- a4 = "IFNOT:\nxy\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- t4 = Ruwiki::TemplatePage.new(a4)
- v1 = { "a" => true }
- v2 = { "a" => nil }
-
- assert_equal("xy", t1.process("", v1))
- assert_equal("", t1.process("", v2))
- assert_raises(RuntimeError) { t2.process("", v1) }
- assert_equal("", t3.process("", v1))
- assert_equal("xy", t3.process("", v2))
- assert_raises(RuntimeError) { t4.process("", v1) }
- end
- end
diff --git a/ruwiki/tags/release-0.8.0/tests/tc_tokens.rb b/ruwiki/tags/release-0.8.0/tests/tc_tokens.rb
deleted file mode 100644
index a8639b5..0000000
--- a/ruwiki/tags/release-0.8.0/tests/tc_tokens.rb
+++ /dev/null
@@ -1,327 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.1
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'test/unit'
-require 'harness-cgi'
-
-class TokenTestCases < Test::Unit::TestCase
- def setup
- @mrw = MockRuwiki.new
- end
-
- class MockRuwiki
- def initialize
- @project = "Default"
- @tokens = []
- @script = "<uri>"
- @message = Hash.new { |h, k| h[k] = "#{k.inspect}" }
- @title = "Ruwiki"
- end
-
- def __tokenize(content, token)
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, @project, $wiki.backend, @script, @message, @title)
- @tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{@tokens.size - 1}"
- else
- "TOKEN_#{@tokens.size - 1}"
- end
- end
- content
- end
-
- def __replace(content)
- replaced = []
- s = true
- loop do
- break if replaced.size >= @tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].restore
- end
-
- s = content.gsub!(/TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].replace
- end
- end
- content
- end
-
- def __post_replace(content)
- token_classes = @tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
- content
- end
-
- end
-
- def __process(token, content, tokenized, replaced, result)
- assert_equal(tokenized, content = @mrw.__tokenize(content, token), "Tokenization failure.")
- assert_equal(replaced, content = @mrw.__replace(content), "Replacement failure.")
- assert_equal(result, content = @mrw.__post_replace(content), "Post-replace failure.")
- end
-
- def __display(token, content)
- p tokenized = @mrw.__tokenize(content.dup, token)
- p replaced = @mrw.__replace(tokenized.dup)
- p result = @mrw.__post_replace(replaced.dup)
- end
-
- def test_Paragraph
- token = Ruwiki::Wiki::Paragraph
- content = "\nABC\n\nabc\n"
- tkv = "TOKEN_0\nABC\nTOKEN_1\nabc\n"
- rpv = %Q(</p><p class="rwtk_Paragraph">\nABC\n</p><p class="rwtk_Paragraph">\nabc\n)
- res = %Q(<p class="rwtk_Paragraph">ABC</p>\n<p class="rwtk_Paragraph">abc</p>)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Image
- token = Ruwiki::Wiki::Image
- content = "[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_0"
- rpv = %Q(<img class="rwtk_Image" alt="http://www.halostatue.ca/graphics/maple_leaf.gif" src="http://www.halostatue.ca/graphics/maple_leaf.gif" title="http://www.halostatue.ca/graphics/maple_leaf.gif" />)
- res = rpv
-
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_1"
- content = %Q([image : http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" title="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="Maple Leaf" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_2"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true])
- rpv = %Q(<img class="rwtk_Image" alt="[1]" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[1]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_3"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true alt="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[2]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- content = "\[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_4"
- rpv = content
- res = content
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Code
- content = " line 1\n line 2\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_0TOKEN_1line 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2</pre>\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
-
- content = " line 1\n line 2\n \n\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_2TOKEN_3TOKEN_4\nline 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\n</p><pre class="rwtk_Code"> </pre>\n\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2\n </pre>\n\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NumberedLinks
- token = Ruwiki::Wiki::NumberedLinks
- Ruwiki::Wiki::NumberedLinks.reset
- content = "[http://www.ruby-lang.org] \\[http://www.rubyforge.org]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
- res = %Q{<a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NamedLinks
- token = Ruwiki::Wiki::NamedLinks
- content = "[http://www.ruby-lang.org Ruby] \\[http://www.rubyforge.org RubyForge]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
- res = %Q{<a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ExternalLinks
- token = Ruwiki::Wiki::ExternalLinks
- content = "http://www.ruby-lang.org \\http://www.rubyforge.org"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
- res = %Q{<a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_HRule
- token = Ruwiki::Wiki::HRule
- content = "----\n\\----"
- tkv = "TOKEN_0\n\\TOKEN_1"
- rpv = %Q(<hr class="rwtk_HRule" />\n----)
- res = %Q(<hr class="rwtk_HRule" />\n----)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLink
- token = Ruwiki::Wiki::ProjectCrossLink
- content = "Ruwiki::ChangeLog \\Ruwiki::To_Do Ruwiki::NotExist \\Ruwiki::NotExist"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLinkWikipedia
- token = Ruwiki::Wiki::ProjectCrossLinkWikipedia
- content = "Ruwiki::[[ChangeLog]] \\Ruwiki::[[To_Do]] Ruwiki::[[Does Not Exist]] \\Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 Ruwiki::[[_invalid]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectIndex
- token = Ruwiki::Wiki::ProjectIndex
- content = "::Ruwiki \\::Ruwiki ::Newproject \\::Newproject"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikiLinks
- token = Ruwiki::Wiki::WikiLinks
- content = "ProjectIndex \\ProjectIndex AustinZiegler \\AustinZiegler Alan_Chen \\Alan_Chen"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikipediaLinks
- token = Ruwiki::Wiki::WikipediaLinks
- content = "[[ProjectIndex]] \\[[ProjectIndex]] [[Austin Ziegler]] \\[[Austin Ziegler]] [[_Alan Chen]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 [[_Alan Chen]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Abbreviations
- token = Ruwiki::Wiki::Abbreviations
- content = "@{matz}\n@{}\n\\@{matz}"
- tkv = "TOKEN_0\nTOKEN_1\n\\TOKEN_2"
- rpv = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
- res = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Headings
- token = Ruwiki::Wiki::Headings
- content = "= header 1\n== header 2\n=== header 3\n==== header 4\n===== header 5\n====== header 6\n======= header 7->6\n\\== noheader 2\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\nTOKEN_6\n\\TOKEN_7\n"
- rpv = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n== noheader 2\n)
- res = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n<p class="rwtk_Paragraph">== noheader 2\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Blockquotes
- token = Ruwiki::Wiki::Blockquotes
- content = ": level 1\n:: level 2\n::: level 3\n: level 1, para 2\n\\: not a blockquote\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<blockquote class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n: not a blockquote\n)
- res = %Q(<blockquote class="rwtk_Blockquotes">level 1<blockquote class="rwtk_Blockquotes">level 2<blockquote class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n: not a blockquote\n)
- __process(token, content, tkv, rpv, res)
-
- content = "> level 1\n>> level 2\n>>> level 3\n> level 1, para 2\n\\> not a blockquote\n"
- tkv = "TOKEN_5\nTOKEN_6\nTOKEN_7\nTOKEN_8\n\\TOKEN_9\n"
- rpv = %Q(<blockquote type="cite" class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- res = %Q(<blockquote type="cite" class="rwtk_Blockquotes">level 1<blockquote type="cite" class="rwtk_Blockquotes">level 2<blockquote type="cite" class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Definitions
- token = Ruwiki::Wiki::Definitions
- content = "; word1 : val1\n;; word2 : val2\n;;; word3 : val3\n; word1/2 : val1/2\n\\; not-a-word : not-a-val\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd></dl></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl></dl>\n<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
- res = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
-
-# __display(token, content)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Lists
- content = "* level 1\n** level 2\n*** level 3\n*** level 3, item 2\n** level 2, item 2\n* level 1, item 2\n\\* not an item\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\n\\TOKEN_6\n"
- rpv = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ul></ul>\n<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- res = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ul><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n## level 2\n### level 3\n### level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_7\nTOKEN_8\nTOKEN_9\nTOKEN_10\nTOKEN_11\nTOKEN_12\n\\TOKEN_13\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ol><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n*# level 2\n*** level 3\n*#* level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_14\nTOKEN_15\nTOKEN_16\nTOKEN_17\nTOKEN_18\nTOKEN_19\n\\TOKEN_20\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ol></ul>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
- end
-
-
- def test_RubyTalkLinks
- token = Ruwiki::Wiki::RubyTalkLinks
- content = "[ruby-talk:12345] \\[ruby-talk:12345]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
- res = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_OtherRubyLinks
- token = Ruwiki::Wiki::OtherRubyLinks
- content = "[ruby-list:123] \\[ruby-list:123] [ruby-doc:123] \\[ruby-doc:123] [ruby-core:123] \\[ruby-core:123] [ruby-dev:123] \\[ruby-dev:123] [ruby-ext:123] \\[ruby-ext:123] [ruby-math:123] \\[ruby-math:123]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5 TOKEN_6 \\TOKEN_7 TOKEN_8 \\TOKEN_9 TOKEN_10 \\TOKEN_11"
- rpv = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
- res = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
-
- __process(token, content, tkv, rpv, res)
- end
-end
diff --git a/ruwiki/tags/release-0.8.0/tests/testall.rb b/ruwiki/tags/release-0.8.0/tests/testall.rb
deleted file mode 100755
index 35bb8c9..0000000
--- a/ruwiki/tags/release-0.8.0/tests/testall.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-puts "Checking for test cases:"
-Dir['tc*.rb'].each do |testcase|
- puts "\t#{testcase}"
- require testcase
-end
-puts " "
diff --git a/ruwiki/tags/release-0.9.0/Rakefile b/ruwiki/tags/release-0.9.0/Rakefile
deleted file mode 100644
index e1739e4..0000000
--- a/ruwiki/tags/release-0.9.0/Rakefile
+++ /dev/null
@@ -1,207 +0,0 @@
-#! /usr/bin/env rake
-$LOAD_PATH.unshift('lib')
-
-require 'rubygems'
-require 'rake/gempackagetask'
-require 'ruwiki'
-require 'ruwiki/utils'
-require 'ruwiki/utils/manager'
-require 'zlib'
-
-DISTDIR = "ruwiki-#{Ruwiki::VERSION}"
-TARDIST = "../#{DISTDIR}.tar.gz"
-
-DATE_RE = %r<(\d{4})[./-]?(\d{2})[./-]?(\d{2})(?:[\sT]?(\d{2})[:.]?(\d{2})[:.]?(\d{2})?)?>
-
-if ENV['RELEASE_DATE']
- year, month, day, hour, minute, second = DATE_RE.match(ENV['RELEASE_DATE']).captures
- year ||= 0
- month ||= 0
- day ||= 0
- hour ||= 0
- minute ||= 0
- second ||= 0
- ReleaseDate = Time.mktime(year, month, day, hour, minute, second)
-else
- ReleaseDate = nil
-end
-
-desc "Run Ruwiki unit tests."
-task :test do |t|
- require 'test/unit/testsuite'
- require 'test/unit/ui/console/testrunner'
-
- runner = Test::Unit::UI::Console::TestRunner
-
- $LOAD_PATH.unshift('tests')
- $stderr.puts "Checking for test cases:" if t.verbose
- Dir['tests/tc_*.rb'].each do |testcase|
- $stderr.puts "\t#{testcase}" if t.verbose
- load testcase
- end
-
- suite = Test::Unit::TestSuite.new("Ruwiki Tests")
-
- ObjectSpace.each_object(Class) do |testcase|
- suite << testcase.suite if testcase < Test::Unit::TestCase
- end
-
- runner.run(suite)
-end
-
-task :clean_data do
- Dir["data/**/*"].each do |file|
- FileUtils.rm_f(file) if file =~ /(?:rdiff|lock|~)$/
- end
-end
-
-desc "Build the default Ruwiki deployment package."
-task :package_data => [ :clean_data ] do
- Ruwiki::Utils::Manager.package(".", ".", nil, false)
-end
-
-task :make_readonly do
- data = nil
- Dir["data/**/*.ruwiki"].each do |file|
- File.open(file, "rb") { |f| data = f.read }
- FileUtils.cp(file, "#{file}.orig")
- if data =~ %r{properties!editable:}o
- data.gsub!(%r{^properties!editable:[ \t].*?$}, "properties!editable:\tfalse")
- else
- data << "properties!editable:\tfalse\n"
- end
- File.open(file, "wb") { |out| out.write(data) }
- end
-end
-
-task :clean_readonly do
- Dir["data/**/*.ruwiki"].each do |file|
- orig = "#{file}.orig"
- FileUtils.mv(orig, file) if File.exists?(orig)
- end
-end
-
-spec = Gem::Specification.new do |s|
- s.name = %q(ruwiki)
- s.version = Ruwiki::VERSION
- s.summary = %q{A simple, extensible, and fast Wiki-clone.}
-
- s.add_dependency('diff-lcs', '~> 1.1.2')
- s.add_dependency('archive-tar-minitar', '~> 0.5.1')
-
- s.has_rdoc = true
- s.rdoc_options = ["--title", "Ruwiki - An Extensible Wiki", "--main", "Readme.tarfile", "--line-numbers"]
- s.extra_rdoc_files = %w(Readme.tarfile Readme.rubygems)
-
- s.bindir = 'bin'
- s.executables = Dir['bin/**/*'].delete_if do |item|
- item =~ %r{(?:\bCVS\b|\.svn\b|[Rr]akefile|install.rb$|~$|gem(?:spec)?$)}
- end.map { |item| item.gsub(%r{^bin/}, "") }
- s.autorequire = %q{ruwiki}
- s.require_paths = %w{lib}
-
- s.test_files = %w{tests/testall.rb}
-
- files = Dir["**/*"].delete_if do |item|
- item =~ %r{\bCVS\b |
- \.svn\b |
- \.bak$ |
- [Rr]akefile |
- install\.rb$ |
- ~$ |
- gem(spec)?$ |
- lib/archive |
- lib/diff |
- \.ruwiki\.orig$}x
- end
- files << "ruwiki.pkg"
- s.files = files
-
- s.author = %q{Austin Ziegler and Alan Chen}
- s.email = %q{ruwiki-discuss@rubyforge.org}
- s.rubyforge_project = %q(ruwiki)
- s.homepage = %q{http://ruwiki.rubyforge.org/}
-
- description = []
- File.open("Readme.rubygems") do |file|
- file.each do |line|
- line.chomp!
- break if line.empty?
- description << "#{line.gsub(/\[\d\]/, '')}"
- end
- end
- s.description = description[2..-1].join(" ")
-end
-desc "Build the RubyGem for Ruwiki."
-task :gem => [ :test ]
-task :gem => [ :update_version ]
-task :gem => [ :package_data ]
-task :gem => [ :make_readonly ]
-Rake::GemPackageTask.new(spec) do |g|
- g.need_tar = false
- g.need_zip = false
- g.package_dir = ".."
-end
-
-VERSION_STRING_RE = %r{\\?%RV#%}
-
-desc "Update the version of Ruwiki to #{Ruwiki::VERSION} in documentation files."
-task :update_version do
- FileList["data/**/*.ruwiki", "Readme*"].to_a.each do |file|
- data = File.read(file)
- data.gsub!(VERSION_STRING_RE) do |match|
- if match[0] == '\\'
- match
- else
- Ruwiki::VERSION
- end
- end
- File.open(file, "wb") { |f| f.write(data) }
- end
-end
-
-desc "Build a Ruwiki .tar.gz distribution."
-task :tar => [ TARDIST ]
-file TARDIST => [ :test, :update_version ] do |t|
- current = File.basename(Dir.pwd)
- Dir.chdir("..") do
- begin
- files = Dir["#{current}/**/*"].select { |dd| dd !~ %r{(?:/CVS/?|~$)} }
- files.delete_if { |dd| dd =~ %r{Rakefile} }
- files.map! do |dd|
- mtime = ReleaseDate || File.stat(dd).mtime
- ddnew = dd.gsub(/^#{current}/, DISTDIR)
- if File.directory?(dd)
- { :name => ddnew, :mode => 0755, :dir => true, :mtime => mtime }
- else
- if dd =~ %r{bin/}
- mode = 0755
- else
- mode = 0644
- end
- data = File.read(dd)
- { :name => ddnew, :mode => mode, :data => data, :size => data.size,
- :mtime => mtime }
- end
- end
-
- ff = File.open(t.name.gsub(%r{^\.\./}o, ''), "wb")
- gz = Zlib::GzipWriter.new(ff)
- tw = Archive::Tar::Minitar::Writer.new(gz)
-
- files.each do |entry|
- if entry[:dir]
- tw.mkdir(entry[:name], entry)
- else
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
- end
- end
- ensure
- tw.close if tw
- gz.close if gz
- end
- end
-end
-
-desc "Build everything."
-task :default => [ :tar, :gem, :clean_readonly ]
diff --git a/ruwiki/tags/release-0.9.0/Readme.rubygems b/ruwiki/tags/release-0.9.0/Readme.rubygems
deleted file mode 100644
index 240fe57..0000000
--- a/ruwiki/tags/release-0.9.0/Readme.rubygems
+++ /dev/null
@@ -1,86 +0,0 @@
-Ruwiki %RV#%
-------------
-Ruwiki is a simple, extensible Wiki-clone written in Ruby. It supports both
-CGI and WEBrick interfaces, templates, and CSS formatting. This Wiki differs
-from most other Wikis in that it supports project namespaces, so that two
-topics may be named the same for differing projects without colliding or
-having to resort to odd naming conventions. Please see the ::Ruwiki project in
-the running Wiki for more information. Ruwiki %RV#% has German and Spanish
-translations available.
-
-Upgrading
----------
-Ruwiki %RV#% has a flatfile format that is incompatible with older versions of
-Ruwiki. If you are upgrading from one of these versions, you must use the
-bin/convert. The simple case will be (assuming that your data files are in
-./data):
-
- % convert ./data
-
-The convert utility is automatically installed by RubyGems.
-
-Requirements
-------------
-Ruwiki currently requires:
- * Ruby 1.8
- * Diff::LCS 1.2.0
- * Archive::Tar::Minitar 0.5.1
-
-The YAML backend requires Ruby 1.8.2 after preview2. You should have been
-prompted to load these dependencies on installation.
-
-Quick Start (WEBrick Readonly)
-------------------------------
-1. Type:
-
- % ruwiki_servlet --gem-data
-
-2. Point your web browser to <http://localhost:8808/>.
-
-Quick Start (CGI)
------------------
-1. Create a directory in a place that your webserver can execute CGI programs
- and type:
-
- % ruwiki install cgi,data --to <directory>
-
-2. Ensure that ruwiki.cgi is executable on your webserver.
-3. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Create a directory to store your data and templates and type:
-
- % ruwiki install data --to <directory>
-
-2. Type:
-
- % ruwiki_servlet
-
-3. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of Ruwiki
-without editing the servlet; use ruwiki_servlet --help for more information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-Credits
--------
-* This software includes portions of Diff::LCS by Austin Ziegler, available
- for download from the Ruwiki RubyForge project:
- [http://rubyforge.org/projects/ruwiki/]
-* Portions of this software are derived from Dave Thomas's RDoc system, now
- part of the Ruby distribution.
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen].
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández].
-
-$Id$
diff --git a/ruwiki/tags/release-0.9.0/Readme.tarfile b/ruwiki/tags/release-0.9.0/Readme.tarfile
deleted file mode 100644
index a3f4ea6..0000000
--- a/ruwiki/tags/release-0.9.0/Readme.tarfile
+++ /dev/null
@@ -1,65 +0,0 @@
-Ruwiki %RV#%
-------------
-Ruwiki is a simple, extensible Wiki-clone written in Ruby. It supports both
-CGI and WEBrick interfaces, templates, and CSS formatting. This Wiki differs
-from most other Wikis in that it supports project namespaces, so that two
-topics may be named the same for differing projects without colliding or
-having to resort to odd naming conventions. Please see the ::Ruwiki project in
-the running Wiki for more information. Ruwiki %RV#% has German and Spanish
-translations available.
-
-Upgrading
----------
-Ruwiki %RV#% has a flatfile format that is incompatible with versions of
-Ruwiki older than 0.8.0. If you are upgrading from one of these versions, you
-must use the bin/convert. The simplest case will be (assuming that your data
-files are in ./data):
-
- % bin/convert ./data
-
-Requirements
-------------
-Ruwiki currently requires:
- * Ruby 1.8
- * Diff::LCS 1.2.0
- * Archive::Tar::Minitar 0.5.1
-
-The YAML backend requires Ruby 1.8.2 after preview2. Portions of Diff::LCS and
-Archive::Tar::Minitar have been included in this version of Ruwiki.
-
-Quick Start (CGI)
------------------
-1. Place the Ruwiki directory in a place that your webserver can execute CGI
- programs and ensure that ruwiki.cgi is executable on your webserver.
-2. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Run bin/ruwiki_servlet (ruby bin/ruwiki_servlet under Windows).
-2. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of Ruwiki
-without editing the servlet; use ruwiki_servlet --help for more information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-Credits
--------
-* This software includes portions of Diff::LCS and Archive::Tar::Minitar by
- Austin Ziegler, available for download from the Ruwiki RubyForge project:
- [http://rubyforge.org/projects/ruwiki/]
-* Portions of this software are derived from Dave Thomas's RDoc system, now
- part of the Ruby distribution.
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen].
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández].
-
-$Id$
diff --git a/ruwiki/tags/release-0.9.0/contrib/enscript-token.rb b/ruwiki/tags/release-0.9.0/contrib/enscript-token.rb
deleted file mode 100644
index 08c2018..0000000
--- a/ruwiki/tags/release-0.9.0/contrib/enscript-token.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# This token by Javier Fontan <jfontan@pc3d.cesga.es>.
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-require "open3"
-
-class Ruwiki::Wiki::CodeColor < Ruwiki::Wiki::Token
- def self.rank
- 0
- end
-
- def self.regexp
- %r<\{\{\{(?::(\w+)\b)?(.*?)\}\}\}>m
- end
-
- def replace
- cap = @match.captures
-
- if cap[0].nil?
- language = "ruby"
- else
- language = cap[0]
- end
-
- text = cap[1]
-
- i, o, e = Open3.popen3("enscript -B --color=emacs -Whtml -E#{language} -o -")
- i.print text
- i.close
-
- re_script = %r{(<pre>.*?</pre>)}mio
- c = o.readlines[1..-1].join("\n")
- re_script.match(c).captures[0]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<pre>\n}im, '<pre class="rwtk_CodeColor>')
- content.gsub!(%r{\n</pre>}im, '</pre>')
- content.gsub!(%r{<font color="(.+?)">}im, '<span style="color: \1">')
- content.gsub!(%r{</font>}im, '</span>')
- content.gsub!(%r{<B>}i, '<b>')
- content.gsub!(%r{</B}i, '</b>')
- content
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/contrib/rublog_integrator.rb b/ruwiki/tags/release-0.9.0/contrib/rublog_integrator.rb
deleted file mode 100644
index 504d9d6..0000000
--- a/ruwiki/tags/release-0.9.0/contrib/rublog_integrator.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This integrator based on work by Chad Fowler.
-#
-# $Id$
-#++
-
-# NOTE: This is not currently compatible with Ruwiki 0.8.0
-#
-# require 'ruwiki/wiki/handler'
-
-class Ruwiki::RubLogHandler < Ruwiki::Wiki::Handler
- def initialize(entries)
- @entries = entries
- end
-
- def page_exists?(page, project)
-# puts "pP: #{page}, #{project}"
- matches = @entries.find_entries_with_root_name(page)
- matches.each { |entry| return true if(entry.dir_name =~ /#{project}/) }
- false
- end
-
- def project_exists?(project)
- true
- end
-
- def script_url
-# request.environment['SCRIPT_NAME']
-# !!SMELL!!
- ENV['SCRIPT_NAME']
- end
-end
-
- # An experimental convertor for Ruwiki
-class RuwikiConvertor < BaseConvertor
- handles "wiki"
-
- def get_title(f)
- title = "---Untitled---"
- loop do
- line = f.gets
- if(line =~ /^topic: (\S+)/) then
- title = $1
- elsif(line =~ /^\#EHDR/) then
- return title
- end
- end
- end
-
- def convert_html(file_entry, f, all_entries)
- title = get_title(f)
- markup = Ruwiki::Wiki.new('Default', Ruwiki::RubLogHandler.new(all_entries))
- body = markup.parse(f.readlines.join("\n"), file_entry.dir_name)
- HTMLEntry.new(title, body, self)
- end
-
- # FIXME: Need to check this one
- def convert_plain(file_name, f, all_entries)
- f.read
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/data/Default/ProjectIndex.ruwiki b/ruwiki/tags/release-0.9.0/data/Default/ProjectIndex.ruwiki
deleted file mode 100644
index 28807a7..0000000
--- a/ruwiki/tags/release-0.9.0/data/Default/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,48 +0,0 @@
-page!content: = Ruwiki
- Ruwiki is a simple, extensible Wiki written in Ruby. It supports both
- CGI and \WEBrick interfaces, templates, and CSS formatting.
- Additionally, it supports project namespaces, so that two pages can be
- named the same for differing projects without colliding or odd naming
- conventions. Please see the ::Ruwiki project for more information.
-
- Ruwiki is also an internationalised Wiki, although more testing,
- especially testing with multibyte character encodings and Unicode
- (UTF-8) is required. There are German and Spanish localisations of the
- messages included with the Ruwiki distribution.
-
- The current version is %RV#%. Enhancements and changes include:
- * a deployment system, whereby Ruwiki deployments can be installed from a package manager like that used for RPA (rpa-base) or \RubyGems (see Ruwiki::RuwikiUtilities);
- * support for Ruwiki as a Windows service on NT, 2000, XP, and 2003 systems;
- * demotion of YAML and Marshal storage types to formats of the Flatfiles storage type;
- * external user authentication (currently to \RubyForge only);
- * antispam efforts including robot and IP exclusion and URL redirection (see Ruwiki::[[Antispam]]); and
- * protection against cross-site scripting (XSS) attacks with HTML and CSS cleaning.
- The full list of changes can be found in Ruwiki::ChangeLog, with
- discussions of various features in Ruwiki::WikiMarkup,
- Ruwiki::Configuring_Ruwiki, and Ruwiki::Extending_Ruwiki.
-
- If you are upgrading from a version of Ruwiki older than 0.8.0, please
- read Ruwiki::RuwikiUtilities.
-
- Certain Ruwiki \APIs are considered stable at this point, others will
- be changing leading up to 1.0. Some of this is discussed in
- Ruwiki::To_Do, with further architectural discussions in
- Ruwiki::[[Roadmap]].
-
- %projects()
-
- Please review ::Tutorial and ::Ruwiki if you are unfamiliar with the
- concept of Wikis in general. If you want to play with \WikiFormatting
- for Ruwiki, use the Ruwiki::SandBox.
-
- [http://rubyforge.org/projects/ruwiki Ruwiki development] is hosted at
- [http://rubyforge.org RubyForge]. The current release of Ruwiki can
- always be [http://rubyforge.org/frs/?group_id=84 downloaded] from
- \RubyForge or the development (unstable) version can be obtained from
- CVS.
-properties!project: Default
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/Antispam.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/Antispam.ruwiki
deleted file mode 100644
index 4ec9379..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/Antispam.ruwiki
+++ /dev/null
@@ -1,64 +0,0 @@
-page!content: = Ruwiki %RV#% Antispam
- Wiki-spam, like email spam, is a major problem. Ruwiki is going to have
- extensive configurable tools for fighting spam. As it is, there are
- several tools built into Ruwiki to assist in the fight against these
- pond scum, but the tool development is certainly not complete.
-
- == External URI Redirection
- Although this will not greatly assist in the reduction of wiki spam,
- all external \URIs are redirected through an URI on Google that is
- designed specifically to remove \PageRank from links. The mechanism
- currently works on all manually-specified external \URIs and is not
- configurable without changing the URI tokenisation code. Thus, links
- that are generated by \[ruby-talk:12345] will not be redirected through
- Google, but direct links will be.
-
- In future versions of Ruwiki, it will be possible to configure \URIs to
- be excluded from the redirect code, but it is not possible to do so at
- this time.
-
- As noted, this will not necessarily reduce wiki spam, but it will deny
- spammers the entire benefit of spamming a wiki implemented with Ruwiki.
-
- == Reacting to Spammers and Robots
- Ruwiki %RV#% includes the ability to present alternative versions of
- itself to certain user agents and/or IP addresses based on a list. In
- the future, both the lists and the faces presented will be configurable
- (highly configurable, at that -- watch this space), but in this version
- of Ruwiki, there are three possible versions to be displayed:
- # Normal Ruwiki. This is a normally displayable and editable wiki.
- # Read-only Ruwiki. This is displayed to benign robots and users who have demonstrated that they cannot be trusted with edit access. The primary effect is to make command pages neither indexable, archivable, nor link-followable, and to remove certain links from visibility for these user agents.
- # Forbidden Ruwiki. The user gets an HTTP response of 403 Forbidden. This is displayed to malign (email-collecting) robots and users who have demonstrated that they are malicious and bent upon defacing the wiki.
-
- While Ruwiki provides these lists, and provides an extensive list of
- both malign and benign robots, it is up to the administrators of the
- wiki to ensure that they are kept up to date.
-
- The lists themselves are &ldquo;extended&rdquo; Ruby regular
- expressions, one optional expression to a line. Spaces are not
- significant and comments are allowed. If you want to recognise a space
- in your regular expression, do so either with a character class ([ ]) or
- the whitespace meta-character (\s). Hash marks must be escaped (\#) or
- they will be treated as comment markers. Blank or comment-only lines are
- ignored. All other lines will be joined together.
-
- foo
- bar
-
- becomes:
-
- %r{foo|bar}x
-
- The file are stored in the data directory for the running instance of
- Ruwiki (e.g., <tt>./data</tt>):
-
- ./data/agents.banned
- ./data/agents.readonly
- ./data/hostip.banned
- ./data/hostip.readonly
-properties!project: Ruwiki
-properties!title: Antispam
-properties!topic: Antispam
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/BugTracking.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/BugTracking.ruwiki
deleted file mode 100644
index 5f24cc7..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/BugTracking.ruwiki
+++ /dev/null
@@ -1,32 +0,0 @@
-page!content: = Ruwiki %RV#% Bug Tracking
- This page is for tracking bugs in Ruwiki. Only bugs from recent
- distributions are tracked. In addition to this source-based bug
- tracking, there is the [http://rubyforge.org RubyForge]
- [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug
- tracker] for Ruwiki.
-
- Those interested in Ruwiki development may also find the Ruwiki::To_Do
- list and the Ruwiki::[[Roadmap]] useful. The format of the bug list is
- &ldquo;version: description&rdquo;.
-
- == Open Bugs
- The version number is the version in which the bug was first reported.
- * 0.6.2: Not all formatting is applied consistently. The token rankings may need adjusting. Eivind Eklund has suggested a scheme that may help with this, but it will require architectural adjustment and will probably slow things down.
-
- ----
- == Closed Bugs
- The version number is the version in which the bug was fixed.
- * 0.9.0: Fixed a problem with old page edits being applied inappropriately.
- * 0.8.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=707&group_id=84&atid=407 Sub-Numbered bullets don&rsquo;t increment]. Fixed a list numbering problem. I think that lists are a bit slower now, but they are completely accurate.
- * 0.7.0: Fixed a link detection problem in \[wikiword] format. Thanks to [mailto:eivind@FreeBSD.org Eivind Eklund] for the patch.
- * 0.7.0: Fixed a problem with &lt;pre&gt; paragraph detection and generation.
- * 0.7.0: Fixed a problem with &lt;p&gt; generation.
- * 0.7.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=197&group_id=84&atid=407 Run-away ruby on some links in default distribution]. This may be related to a runaway header problem that was reported to me on IRC some time back that I believe has been fixed. Please advise.
- * 0.6.1: Projects aren&rsquo;t created appropriately.
- * 0.6.1: Saving without editing (or repost) appears to cause problems. A fix has been applied to attempt to address this. Pages that have not been changed will not be saved.
-properties!project: Ruwiki
-properties!title: BugTracking
-properties!topic: BugTracking
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/ChangeLog.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/ChangeLog.ruwiki
deleted file mode 100644
index 01ba1b6..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/ChangeLog.ruwiki
+++ /dev/null
@@ -1,101 +0,0 @@
-page!content: = Ruwiki %RV#% ChangeLog
- Uncompleted to-do items can be found in To_Do. Bugs in Ruwiki are
- tracked in BugTracking.
-
- == 0.9.0
- * Created a Ruwiki deployment system. Various steps were required to accomplish this:
- ** Moved executable files to bin/ for better packaging; moved core servlet code and other utilities to Ruwiki::Utils namespace.
- ** Renamed bin/convert to bin/ruwiki_convert. This will ultimately be moved into the ruwiki command.
- ** Refactored Flatfile format (section!\item:<Tab>value) to Ruwiki::Exportable, loosened the format restrictions to allow for either section!\item:<Tab>value or section!\item:<Space>value.
- ** Incorporated Ruwiki::Exportable into Ruwiki::Config to allow for the saving of configuration files.
- ** Incorporated Ruwiki::Exportable into Ruwiki::\Utils::ServletRunner to allow for the saving of configuration files.
- ** Added Ruwiki manager code for installation and management of Ruwiki deployments.
- ** Added code for running the Ruwiki servlet as a Windows service on Win32. (Currently minimally tested and unworking.)
- ** Added --central to bin/ruwiki_servlet, to run a read-only instance of Ruwiki using the centralised data from RPA or \RubyGems.
- * Removed YAML and Marshal storage types as separate classes and incorporated them as formats of the Flatfiles storage type. Added the 'format' option to the Flatfiles storage_options hash.
- * Added draft \APIs for authentication, robot exclusion, IP exclusion, and HTML cleaning.
- ** Implemented initial authentication for \RubyForge. It verifies a user against their current \RubyForge cookie.
- ** Implemented known robot list. It may require further refinement. It contains two classes of robots:
- *** Read-only: known to be good (like the Googlebot) or neutral (most other crawlers). They are permitted to read, index, and follow links on all non-command pages.
- *** Banned: known to be bad, essentially spam-crawlers. These robots will uniformly get a 403 Forbidden result.
- ** Implemented IP exclusion list. It may require further refinement. It contains two classes of IPs:
- *** Read-only: IP addresses that are not permitted to edit the wiki. They will be treated as read-only robot exclusion.
- *** Banned: known to be bad, essentially spam-crawlers. These IPs will uniformly get a 403 Forbidden result.
- ** HTML cleaning has been implemented.
- *** HTML entities &amp;, &lt;, and &gt; will be escaped.
- *** Only HTML tags and attributes from a &ldquo;known good&rdquo; list will be passed through unchanged.
- *** CSS properties display and visibility will be silently eliminated from embedded HTML.
- *** Although (mostly) valid XHTML is generated, Ruwiki does not currently support tags or attributes in namespaces. If and when this is enabled, it will be enabled on a namespace-by-namespace basis.
- * External URLs are redirected through a single point through the Google PageRank remover URI \http://www.google.com/url?sa=D&q=<em>uri</em>. There is no whitelisting for URIs at this point.
- * Added a Rakefile for packaging. Currently incomplete.
- * Modified the default template style to remove the bottom control bar, as it was blocking the last bit of text on some pages in lesser browsers.
- * Updated more documentation.
- * Added a message facility so that non-error messages can be communicated to the user.
- * Fixed a bug with submitting an old version of the code with an expired lock reverting changes. The changed versions are now merged automatically and re-presented to the user. It's a simplistic merge, to be improved in a later version of Ruwiki. A message is displayed to the user.
- * Modified searching for empty strings so that instead of throwing an error, a message is displayed to the user.
-
- == 0.8.0
- * AC: Added topic list (_topics) and project list (_projects) controls on templates and backend.
- * AZ: Added %topics() and %projects() tokens. See WikiMarkup for details.
- * AC: Added simple search on back-end (both project and global); search strings must be validated and cleansed before being sent to the back-end (the back-end must prepare the string for its own search mechanism). The back-end is wholly responsible for the searching of the pages.
- * AC: Added \RecentChanges list to backend and controls.
- * AZ: Changed default for Ruwiki::Config#storage_options[:flatfiles][:extension] to <tt>ruwiki</tt>.
- * AZ: Topic backlink search: searches for mentions of the topic in the other topics of the project.
- * AZ: New templating engine: The Rdoc templating engine has been greatly enhanced in preparation for some changes that will happen surrounding antispam capabilities.
- * AZ: Multiple flatfile-based backend support: tagged file (&ldquo;flatfiles&rdquo;), YAML (&ldquo;yaml&rdquo;), and Marshal (&ldquo;marshal&rdquo;).
- * AZ: A converter utility between backends.
- * AZ: Defined a canonical, extensible page transport format.
- * AZ: Defined a canonical, format-independent diff format.
- * AZ: Fixed list numbering problem. Modified lists to allow for mixed lists. See WikiMarkup for restrictions.
- * AZ: Removed automatic image conversion for \URIs that look like images. Now, images must be specified with the \[image:uri] format. See WikiMarkup for more details.
- * AZ: Fixed minor bugs in several tokens.
- * AZ: New look! Ruwiki now sports a new default look with CSS and template changes.
- * AZ: New look! Ruwiki has a &ldquo;simple&rdquo; template set.
- * AZ: New look! Ruwiki has a &ldquo;sidebar&rdquo; template set.
- * AZ: Fixed a long-standing bug with code tokens.
-
- == 0.7.0
- * Changed the tokenization API so that the #post_replace call is made at the Token class level instead of the instance level.
- * Improved HTML code generation.
- * Added servlet runner batch files for Windows. They <strong>will</strong> require modification to run properly.
- * Added %calendar(...) support. See WikiMarkup for more information.
-
- == 0.6.2
- * Removed dependencies on Ruwiki from a number of classes (Ruwiki::Backend, Ruwiki::Backend::Flatfiles, Ruwiki::Page, Ruwiki::Wiki, Ruwiki::Wiki::Tokens, and various tokens).
- * Ruwiki now initializes a \Ruwiki::BackendDelegator, which creates the requisite Ruwiki::Backend instance with Ruwiki::Config#storage_options.
- * Added German (Christian Neukirchen &lt;cneukirchin@yahoo.de&gt;) and Spanish translations (Mauricio Fernández &lt;batsman.geo@yahoo.com&gt;).
-
- == 0.6.1
- * Changed Ruwiki::Config#data_path to Ruwiki::Config#storage_options[:flatfiles][:data_path]. This represents a generalisation of storage type options so that the Ruwiki::Config object is not polluted with storage type options. Ruwiki::Config#storage_options keys should be the same Ruby Symbol as is used in Ruwiki::Config#storage_type.
- * Added Ruwiki::Config#storage_options[:flatfiles][:extension], based on a request by Chad Fowler. This allows you to have Project/\TopicFile actually stored as Project/\TopicFile.wiki if Ruwiki::Config#storage_options[:flatfiles][:extension] is set to <tt>wiki</tt>. The default for Ruwiki::Config#storage_options[:flatfiles][:extension] is <tt>nil</tt>.
- * Fixed incorrect references. I had been incorrectly attributing [http://sourceforge.net/projects/rdoc-wiki RDoc Wiki] to Dave Thomas. \RDoc Wiki is by Michael Neumann. However, the project I pulled from <strong>is</strong> by Dave Thomas, but it&rsquo;s [http://sourceforge.net/projects/rublog RubLog]. Apologies to both developers.
- * Added RuwikiTemplatingLibrary documentation.
- * Internationalized messages, except for the templating library.
- * Added configuration API for future work surrounding features. The existing wiki is mostly feature complete. Additional features (such as access controls) will be added through the feature interface.
- * Fixed project creation.
- * Fixed problems with \WikiWord links.
- * Added Wikipedia-style Wiki links (\[[list of words]]).
- * Fixed a potential problem with re-posted data or saving without editing.
- * Added the ability to put commands in the URL.
-
- == 0.6.0
- * Added Ruby mailing list reference support (e.g., \[ruby-talk:12345]).
- * Reorganised the code (again) to better support alternative frontends. Based, in part, on [http://sourceforge.net/projects/rublog RubLog] by Dave Thomas. (Reference corrected in 0.6.1.)
- * Added a [http://www.webrick.org WEBrick] servlet interface. Based, in part, on the \WEBrick servlet interface provided with \RubLog by Chad Fowler.
- * Added templates, using the [http://rdoc.sourceforge.net RDoc] template.rb library.
- * Changed the default topic to be \ProjectIndex instead of \DefaultProject.
- * Added a new \WikiWord format, \Wiki_Word_with_Spaces.
- * Completed lots of Ruwiki documentation.
- * Updated the save page.
- * Fixed a problem with the linking of project specific pages.
-
- == 0.5.0
- * Reorganized the code significantly to be easier to edit and extend.
- * Added abbreviation capabilities.
- * Cleaned up a lot of tokenizing code.
-properties!project: Ruwiki
-properties!title: ChangeLog
-properties!topic: ChangeLog
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/Configuring_Ruwiki.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/Configuring_Ruwiki.ruwiki
deleted file mode 100644
index bfb3c3b..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/Configuring_Ruwiki.ruwiki
+++ /dev/null
@@ -1,150 +0,0 @@
-page!content: = Configuring Ruwiki %RV#%
- Ruwiki is configured similarly as both a CGI and a \WEBrick servlet.
- The biggest distinction is that because the Wiki servlet is created
- after the \WEBrick server is created (during the dispatch to the
- servlet), it is necessary to configure the wiki with a global
- Ruwiki::Config object stored in Ruwiki::Servlet.config. This must be a
- valid Ruwiki::Config object. In the examples below,
- <em>wiki.config</em> may be simply considered a random Ruwiki::Config
- object.
-
- > This has changed in Ruwiki 0.9.0 from a global configuration object
- > named $config.
-
- : Additional configuration options will be added from time to time. The
- : form for specifying configuration may be changed prior to 1.0.
-
- If you are looking for discussion on templates, this has been moved to
- Extending_Ruwiki.
-
- == Ruwiki Configuration Options
- === wiki.config.title
- This configuration option names the Wiki; by default this is
- <tt>Ruwiki</tt>. This affects the display of the home link and the
- &lt;title&gt; element of pages.
-
- === wiki.config.webmaster
- The email address for the webmaster. This is used in generating error
- reports that can be emailed to the wiki&rsquo;s webmaster.
-
- === wiki.config.language
- This sets the internationalisation mechanism. It must be one of the
- known two-letter ISO language codes or a module under Ruwiki::Lang
- matching that description. See Extending_Ruwiki for more information.
- Ruwiki's default language is English ('en'), but there are translations
- for Spanish ('es') and German ('de') included. Localization is
- currently per wiki instance. In a servlet environment, this may mean
- that only a single language is recognised.
-
- === wiki.config.default_page, wiki.config.default_project
- These options indicate what will happen when the wiki&rsquo;s URL is
- specified without any parameters (the default page in the default
- project is opened), when a topic is specified without a project (the
- topic is opened in the default project), and when a project is
- specified without a topic (the default page is opened in the project).
-
- === wiki.config.storage_type, wiki.config.storage_options
- <tt>wiki.config.storage_type</tt> specifies the back-end storage
- mechanism as a Ruby Symbol. Currently, <tt>'flatfiles'</tt>,
- is supported. See Extending_Ruwiki for more information.
-
- <tt>wiki.config.storage_options</tt> is a hash of option hashes for
- each known storage type known to the Wiki. This must use the same
- Symbol as <tt>wiki.config.storage_type</tt> as the top-level hash key.
-
- ==== ...storage_options['flatfiles']['data-path']
- The directory in which the wiki files will be found. By default, this
- is &ldquo;<tt>./data/</tt>&rdquo;.
-
- ==== ...storage_options['flatfiles']['format']
- Specifies the storage format for the flatfiles backend. The default
- format is 'exportable', but may be set to 'yaml' or 'marshal' as well.
- The 'yaml' format will not work reliably with versions of Ruby before
- 1.8.2 preview 3.
-
- ==== ...storage_options['flatfiles']['extension']
- The extension of the wiki files. By default, this is
- &ldquo;ruwiki&rdquo;. For those upgrading from a version of Ruwiki
- before 0.8.0, note that you must explicitly set this value to
- <tt>nil</tt> if you wish to have no extension.
-
- === wiki.config.template_path
- This specifies the paths where the Wiki templates will be found. The
- process running the Wiki must have read access to the template_path.
-
- === wiki.config.template_set, wiki.config.css
- These two options indicate which template set will be used. Three
- template sets are provided in the release package:
- &ldquo;default&rdquo;, &ldquo;simple&rdquo;, and &ldquo;sidebar&rdquo;.
- The only CSS file used initially is &ldquo;ruwiki.css&rdquo;. Templates
- work such that they will be found in
- <em>template_path</em>/<em>template_set</em>. All CSS files are loaded
- from the template set directory and emitted as part of the output
- stream.
-
- : The bad side of this is that the CSS never caches on the client side
- : as it would if it were a separate file. However, as templates may not
- : be in a web-accessible directory, this is necessary.
-
- === wiki.config.time_format, wiki.config.date_format, wiki.config.datetime_format
- When the wiki displays date or time values, these formats are used.
- They are not currently accessible by tokens.
-
- === wiki.config.debug
- Adds additional information to the (rare) error reports. Defaults to
- <tt>false</tt>.
-
- === wiki.config.logger
- Sets or returns the logger. The logger, if set, must respond to the
- same methods as WEBrick::Logger.
-
- === wiki.config.auth_mechanism
- The authentication mechanism name as a String. Corresponds to a
- filename that will be found in ruwiki/auth. The authenticator must have
- a single class method, +authenticate+, which accepts the +request+, the
- +response+, and the +auth_options+. This API is a draft API and is
- likely to change in future versions of Ruwiki. In this version of
- Ruwiki, only one authentication mechanism will be found -- for dealing
- with authenticating users already logged into RubyForge.
-
- === wiki.config.auth_options
- Options for the authentication mechanism as a Hash. This will be passed
- to the authenticator defined in wiki.config.auth_mechanism. The
- <tt>auth_options</tt> are a single-level hash. They may be stored in
- the Ruwiki configuration file as:
-
- ruwiki-config!auth-options: default!user: pgsqluser
- default!pass: pgsqlpass
-
- == Ruwiki Servlet Options
- Most, if not all, of the configuration above can be achieved through
- command-line options of the ruwiki servlet.
-
- === Servlet Command-Line Options
- ; -P, --port <em>PORT</em> : Runs the Ruwiki servlet on the specified port. Default 8808.
- ; -A, --accept <em>ADDRESSES</em> : Restricts the Ruwiki servlet to accepting connections from the specified address or (comma-separated) addresses. May be specified multiple times. Defaults to all addresses.
- ; -L, --local : Restricts the Ruwiki servlet to accepting only local connections (127.0.0.1). Overrides any previous --accept addresses.
- ; -M, --mount <em>MOUNT_POINT</em> : The relative URI from which Ruwiki will be accessible. Defaults to &ldquo;/&rdquo;.
- ; --[no-]log : Log \WEBrick activity. Default is --log.
- ; --logfile <em>LOGFILE</em> : The file to which \WEBrick logs are written. Default is standard error.
- ; -T, --threads <em>THREADS</em> : Sets the \WEBrick threadcount.
-
- === Ruwiki Command-Line Options
- ; --language <em>LANGUAGE</em> : The interface language for Ruwiki. Defaults to &ldquo;en&rdquo;. May be &ldquo;en&rdquo;, &ldquo;de&rdquo;, or &ldquo;es&rdquo;.
- ; --webmaster <em>WEBMASTER</em> : The Ruwiki webmaster email address. Defaults to &ldquo;webmaster@domain.com&rdquo;.
- ; --[no-]debug : Turns on Ruwiki debugging. Defaults to --no-debug.
- ; --title <em>TITLE</em> : Provides the Ruwiki title. Default is &ldquo;Ruwiki&rdquo;.
- ; --default-page <em>PAGENAME</em> : An alternate default page. Default is &ldquo;\ProjectIndex&rdquo;.
- ; --default-project <em>PAGENAME</em> : An alternate default project. Default is &ldquo;Default&rdquo;.
- ; --template-path <em>TEMPLATE_PATH</em> : The location of Ruwiki templates. Default is &ldquo;./templates&rdquo;.
- ; --templates <em>TEMPLATES</em> : The name of the Ruwiki templates. Default is &ldquo;default&rdquo;.
- ; --css <em>CSS_NAME</em> : The name of the <acronym title="Cascading Style Sheets">CSS</acronym> file in the template path. Default is &ldquo;ruwiki.css&rdquo;.
- ; --storage-type <em>TYPE</em> : Select the storage type: flatfiles, yaml, marshal
- ; --flatfiles-data-path <em>PATH</em> : The path where data files are stored. Default is &ldquo;./data&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
- ; --flatfiles-extension <em>EXT</em> : The extension for data files. Default is &ldquo;ruwiki&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
-properties!project: Ruwiki
-properties!title: Configuring_Ruwiki
-properties!topic: Configuring_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/Extending_Ruwiki.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/Extending_Ruwiki.ruwiki
deleted file mode 100644
index fbc89b8..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/Extending_Ruwiki.ruwiki
+++ /dev/null
@@ -1,316 +0,0 @@
-page!content: = Extending Ruwiki %RV#%
- Ruwiki is relatively easily extended to support new features. There are
- four primary ways in which Ruwiki can be extended or modified by the
- end user: templates, translating Ruwiki messages and labels, markup
- tokens, and creating new backends.
-
- == Templates
- Templating is done with a heavily modified version of the \RDoc
- template.rb library included in the distribution of Ruwiki. The
- templating library allows for nested templates, and this is used
- extensively in Ruwiki. This library is documented in
- RuwikiTemplatingLibrary.
-
- There are four major templates: content, edit, save, and error. Each of
- these has a slightly different combination of template files used, and
- this means that there are different sets of variables available.
-
- The major templates are &ldquo;composite templates&rdquo; that are
- defined as follows:
- ; content or search : body.tmpl, content.tmpl, controls.tmpl, footer.tmpl
- ; edit or preview : body.tmpl, edit.tmpl
- ; save : body.tmpl, save.tmpl, controls.tmpl, footer.tmpl
- ; error : body.tmpl, error.tmpl
-
- === Common Variables
- The following template variables are presented for all composite
- templates.
- ; <tt>%css_link%</tt> : The contents of the CSS file for the template set.
- ; <tt>%home_link%</tt> : A link to the root page of the Wiki.
- ; <tt>%editable%</tt> : A boolean value to mark the page as editable or not. Used in a conditional block in the templates.
- ; <tt>%cgi_url%</tt> : The URL for the Wiki.
- ; <tt>%content%</tt> : The formatted content of the current page.
- ; <tt>%page_project%</tt> : The project for the current page.
- ; <tt>%page_raw_topic%</tt> : The topic for the current page, escaped for safe transmission over the web.
- ; <tt>%page_topic%</tt> : The printable topic for the current page.
- ; <tt>%url_project%</tt> : The URL to the current page&rsquo;s project.
- ; <tt>%url_topic_search%</tt> : The URL to search for the current topic in the current project.
- ; <tt>%link_topic_search%</tt> : A link to the current topic search.
-
- === Variables for :content, :save, :search, :edit, :preview
- ; <tt>%message%</tt> : A message presented at the top of the Wiki when Ruwiki needs to inform the user of something that is not an error.
-
- === Variables for :content, :save, :search
- ; <tt>%wiki_title%</tt> : The title of the Wiki.
- ; <tt>%label_topic_or_search%</tt> : Either <tt>#topic#</tt> or <tt>#search#</tt>.
- ; <tt>%page_topic_name%</tt> : The same as <tt>%page_topic%</tt>.
-
- === Variables for :edit, :preview
- ; <tt>%wiki_title%</tt> : The title of the Wiki with a tag to indicate that the page is being edited.
- ; <tt>%page_content%</tt> : The content of the page.
- ; <tt>%page_version%</tt> : The current version number of the page.
- ; <tt>%unedited_page_content%</tt> : The formatted, unedited content of the page.
- ; <tt>%pre_page_content%</tt> : A Web-escaped form of the page content.
- ; <tt>%edit_comment%</tt> : The current edit comment.
-
- === Variables for :error
- ; <tt>%wiki_title%</tt> : The title of the Wiki with an error message.
- ; <tt>%name%</tt> : The name of the error.
- ; <tt>%backtrace%</tt> : The backtrace of the error.
- ; <tt>%backtrace_email%</tt> : The backtrace of the error formatted for sending by email.
- ; <tt>%webmaster%</tt> : The email address of the webmaster.
-
- == Translating Ruwiki Messages
- : NOTE: The mechanism for specifying language may be changed in a
- : future version of Ruwiki, although the internationalisation mechanism
- : will not be changing.
-
- Ruwiki is internationalized. This method sets the Ruwiki error messages
- (and a few other messages) to the specified language Module. The
- language Module must have a constant Hash called <tt>Message</tt>
- containing a set of symbols and localized versions of the messages
- associated with them.
-
- If the file <em>ruwiki/lang/es.rb</em> contains the module
- <tt>Ruwiki::Lang::ES</tt>, the messages for RSS could be localized to
- Spanish thus:
-
- require 'ruwiki/lang/es'
- ...
- wiki.config.language = Ruwiki::Lang::ES
-
- Localization is currently per wiki instance. In a servlet environment,
- this may mean that only a single language is recognised.
-
- It is recommended that the hash be created with a default proc that
- reports unknown message keys.
-
- Message = Hash.new { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
-
- == Extending Ruwiki Markup
-
- : <strong>WARNING:</strong> These \APIs will change in Ruwiki 0.9.0,
- : replacing the instance variables @project, @backend, and @script with
- : a Handler object. There may be other changes as well.
-
- Ruwiki&rsquo;s WikiMarkup can be extended by creating a new
- Ruwiki::Wiki::Token. Tokens will be automatically loaded if they are
- placed in <em>ruwiki/wiki/tokens</em>.
-
- It is recommended that new tokens be added to the test cases in
- <tt>tests/tc_tokens.rb</tt>.
-
- The following Ruwiki::Wiki::Token class will convert strings in the
- forms of \[ruby-talk:12345] to links.
-
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- === Known Instance Variables
- ==== @match
- The match data for this token instance is is kept in @match. This is
- what will be used in #replace and #restore.
-
- ==== @project
- The project being processed.
-
- ==== @backend
- The Backend for the wiki. If you are using Ruwiki tokenizers outside of
- Ruwiki, this does not need to be a \BackendDelegator, but can be the
- direct Backend (which expects less information).
-
- ==== @script
- The URI to the script.
-
- ==== @message
- The message hash for displaying localised messages.
-
- ==== @title
- The title of the wiki instance.
-
- === Required Methods
- ==== ::regexp
- Ruwiki tokens are matched only through regular expression matches. As
- shown in the example above, the regular expression for ruby-talk
- mailing list posts is <tt>%r{\[ruby-\talk:(\d+)\]}</tt>. The purpose of
- the ::regexp method is to return the regexp for matching.
-
- For most inline matches, Ruwiki will ensure that the escape character
- (\) works automatically. For whole-line matches, it is necessary to
- match the escape character manually and provide a #restore method.
-
- As an example, the \HRule class implements these methods.
-
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- It may also be necessary to match escapes manually on inline matches
- that must be along word boundaries where the regular expression
- includes characters that normally match word boundaries. The project
- index match (e.g., \::Ruwiki) regular expression does this
- <tt>%r{(\B|\\)::([A-Z][a-z]+)}</tt>.
-
- ==== #replace
- This returns the formatted token. In the \RubyTalkLinks class above,
- the matched regular expression will be replaced with a hyperlink. The
- text of the hyperlink will be the matched text; the target of the
- hyperlink will include the first captured value.
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
-
- === Optional Methods
- ==== ::rank
- By default, a token will be processed in the order created. Tokens may
- be given a specific rank to ensure that they are processed in a
- particular order. The default rank is <tt>9999</tt>.
-
- ==== #restore
- Restores the token without replacement. Implements the results of the
- escape character. Each Token class is responsible for its own
- restoration. As noted in #regexp, whole-line tokens are most likely to
- need a #restore implementation.
-
- ==== ::post_replace
- Performs any necessary massaging of the data. The Lists token uses this
- to ensure that lists are collapsed together; the Paragraph token uses
- this to ensure that there are no empty paragraph tag pairs
- (&lt;p&gt;&lt;/p&gt;).
-
- : <strong>Note:</strong> This has been changed from Ruwiki 0.6.x.
- : Plugins written for the Ruwiki 0.6.x Token API will need to be
- : modified so that this is defined as:
-
- def self.post_replace
- ...
- end
-
- : as opposed to:
-
- def post_replace
- ...
- end
-
- == Extending Ruwiki Backends
- Ruwiki can support varying backends, as the backend interface has been
- abstracted completely from the data store. The backend
- <strong>must</strong>:
-
- # reside in <em>ruwiki/backends/</em> as <em>backend_name</em>.rb.
- # be registered by adding the <em>backend_name</em> as a symbol (e.g., :<em>backend_name</em>) to Ruwiki::KNOWN_BACKENDS.
- # inherit from Ruwiki::Backend.
- # exist as Ruwiki::Backend::<em>\Backend_name</em>.
-
- === Required Methods
- ==== #initialize(storage_options)
- The backend may only obtain its configuration information from an
- option hash provided by the \BackendDelegate. This is obtained from
- <tt>wiki.config.options[backend]</tt>. If a configuration error is
- detected during initialization, the backend should raise the
- \Ruwiki::Backend exception class \BackendError. This would be done
- with:
-
- raise Ruwiki::Backend::BackendError.new([:message_symbol, [message_parameters]])
-
- Backend writers should add appropriate messages to the
- <em>lang/en.rb</em> at a minimum. The \BackendDelegator will detect
- this and report the results appropriately.
-
- ==== #load(topic, project)
- The backend will be provided the name of the topic and project. It must
- return the selected page as a hash of hashes. The hash must match that
- of \Ruwiki::Page#export. It will be passed as the parameter to
- \Ruwiki:::Page.new.
-
- ==== #store(page)
- This method must store the provided Ruwiki::Page object. Current Ruwiki
- backend implementations store the Ruwiki::Page#export hash. This method
- is responsible for calling the private method Backend#make_diff and
- adding the result to the list of diffs for the page.
-
- ===== Backend#make_diff(oldpage, newpage)
- This method expects two page objects, or their Ruwiki::Page#export
- representation. It will return a hash representing the difference set
- between the two pages.
-
- ==== #obtain_lock(page, time, expire, address = 'UKNOWN')
- Obtains an exclusive lock on the page. The \BackendDelegator is called
- with the page, the address, and a timeout which is provided. The time
- is provided by the call to the BackendDelegate, and the expire is also
- provided by the call to the BackendDelegate which is given a timeout
- value (by default 600 seconds). If the lock is still in effect, a
- second call to #obtain_lock should renew the timeout on the lock.
-
- ==== #release_lock(page, address = 'UNKNOWN')
- Releases the exclusive lock on the page. The lock should not be released
- unless the IP address on the lock is the same or the lock has expired.
-
- ==== #project_exists?(project)
- Returns <tt>true</tt> if the project exists.
-
- ==== #page_exists?(topic, project = 'Default')
- Returns <tt>true</tt> if the page exists within the specified project.
-
- ==== #create_project(project)
- Attempts to create the project.
-
- ==== #search_project(project, search_string)
- String search all topic names and content in a project and return a
- hash of topic hits:
-
- topicname => hits
-
- ==== #list_projects
- Return an array of all projects.
-
- ==== #list_topics(project)
- Return an array of all topics within the project.
-
- === Future Methods
- Note that these methods are currently optional (they are not yet called
- from Ruwiki), but will become required moving forward as the functions
- are implemented in Ruwiki.
-
- ==== #destroy(page)
- Removes the page from the wiki. This should <strong>not</strong> remove
- the change history of the topic (in the event that the page has been
- removed maliciously). There will be a separate method to remove the
- page history.
-
- ==== #destroy_project(project)
- Attempts to destroy the project.
-
- === Optional Methods
- These methods are completely optional. They are guarded in the
- \BackendDelegate by a call to #respond_to?().
-
- ==== #global_search(search_string)
- The global search in the backend delegate is by default implemented as
- a looping search through all projects. A backend may have a more
- efficient backend global search mechanism. If the backend responds to
- #global_search, then the \BackendDelegate will use this method.
-properties!project: Ruwiki
-properties!title: Extending_Ruwiki
-properties!topic: Extending_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/LicenseAndAuthorInfo.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
deleted file mode 100644
index 5d1c20e..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
+++ /dev/null
@@ -1,29 +0,0 @@
-page!content: = Ruwiki Licence
- Ruwiki is copyright &copy; 2002 - 2004 [mailto:alan@digikata.com Alan
- Chen] and [mailto:ruwiki@halostatue.ca Austin Ziegler].
-
- Ruwiki is provided free of use and without any warranty express or
- implied. You may use, distribute, or modify Ruwiki under the conditions
- of Ruby&rsquo;s licence or the [http://www.gnu.org/copyleft/gpl.html
- GNU General Public Licence].
-
- * Ruwiki includes a modified version of rdoc/template.rb originally by Dave Thomas for use in \RDoc.
-
- == Translations
- * Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen] on 2003.10.22, with corrections by Mauricio Fern&aacute;ez. Note that the initial template translations (./templates/de/) were done via \AltaVista Babelfish and should not be blamed on Christian.
- * Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fern&aacute;ndez] on 2003.10.22. Note that the initial template translations (./templates/es/) were done via \AltaVista Babelfish and should not be blamed on Mauricio.
-
- == Austin&rsquo;s Other Projects
- Austin has also released several other projects available on the RAA that you may be interested in:
- * [http://raa.ruby-lang.org/list.rhtml?name=mime-types MIME::Types], \RubyForge [http://rubyforge.org/projects/mime-types project].
- * [http://raa.ruby-lang.org/list.rhtml?name=pdf-writer PDF::Writer], \RubyForge [http://rubyforge.org/projects/ruby-pdf project].
- * [http://raa.ruby-lang.org/list.rhtml?name=text-format Text::Format], \RubyForge [http://rubyforge.org/projects/text-format project].
- * [http://raa.ruby-lang.org/list.rhtml?name=trans-simple Transaction::Simple], \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=uninheritable Uninheritable], Transaction::Simple&rsquo;s \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=diff-lcs Diff::LCS], Ruwiki&rsquo;s \RubyForge [http://rubyforge.org/projects/ruwiki project].
-properties!project: Ruwiki
-properties!title: LicenseAndAuthorInfo
-properties!topic: LicenseAndAuthorInfo
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/ProjectIndex.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/ProjectIndex.ruwiki
deleted file mode 100644
index e370528..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,83 +0,0 @@
-page!content: = Ruwiki %RV#%
- This is the \ProjectIndex page for Ruwiki. For any given project, the
- \ProjectIndex topic will be the default topic for plain project links.
-
- == Features and Information
- * This wiki supports a variety of WikiFeatures that you may be interested in. The rules for WikiMarkup are similar to some other wikis, but there are a few unique markup capabilities in Ruwiki.
- * Configuring_Ruwiki is simple.
- * Extending_Ruwiki is almost as simple.
- * What you need to know for using Ruwiki's [[Antispam]] capabilities.
- * Who wrote Ruwiki? Read the LicenseAndAuthorInfo.
-
- == Requirements
- Ruwiki currently requires Ruby 1.8, Diff::LCS 1.1.2 and
- Archive::Tar::Minitar 0.5.1. These packages are included in the
- <em>packages/</em> directory in the
- <code>ruwiki-0.9.0-full.tar.gz</code> form of the distribution.
-
- The YAML backend requires Ruby 1.8.2 preview 3 or later.
-
- == Upgrading
- Ruwiki %RV#% has a flatfile format that is incompatible with versions
- of Ruwiki older than Ruwiki 0.8.0. If you are upgrading from one of
- these versions, you must use the bin/ruwiki_convert. The simple case
- will be (assuming that your data files are in ./data):
-
- % ruwiki_convert ./data
-
- The ruwiki_convert utility is automatically installed by \RubyGems and
- RPA. See RuwikiUtilities for more information. Note that this utility
- will probably be incorporated into the main Ruwiki utility in a future
- version.
-
- == Getting Started
- There are some differences between the startup of <tt>.tar.gz</tt>,
- \RubyGems, and RPA installations of Ruwiki.
-
- === \QuickStart (Read-only: \RubyGem and RPA Installation Only)
- Run:
- % ruwiki_servlet --central
-
- Point your web browser to \http://localhost:8808/.
-
- === \QuickStart (CGI)
- # Install the Ruwiki CGI (<tt>ruwiki.cgi</tt>) program in a place where your webserver can execute it.
- #* <strong>\RubyGem:</strong> <tt>ruwiki install cgi,data --to <em>directory</em></tt>
- #* <strong><tt>.tar.gz</tt>:</strong> Extract the Ruwiki directory to that directory. <tt>cp bin/ruwiki.cgi .</tt> <em>or</em> <tt>copy bin\ruwiki.cgi .</tt>
- # Point your web browser to the appropriate URL.
-
- === \QuickStart (\WEBrick)
- # Install the Ruwiki servlet or data.
- #* <strong>\RubyGem:</strong> <tt>ruwiki install data --to <em>directory</em></tt> <em>or</em> <tt>ruwiki install servlet,data --to <em>directory</em></tt>
- #* <strong><tt>.tar.gz</tt>:</strong> Extract the Ruwiki directory.
- # Run <tt>ruwiki_servlet</tt>. Under the <tt>.tar.gz</tt>, this would be <tt>bin/ruwiki_servlet</tt> <em>or</em> <tt>ruby bin\ruwiki_servlet</tt>
- # Point your web browser to \http://localhost:8808/.
-
- == Support
- * Troubles with Ruwiki? See TroubleShooting for some suggestions. Have a new problem? Add it to the main [http://ruwiki.rubyforge.org/ruwiki.cgi/Ruwiki/TroubleShooting TroubleShooting] page.
- * Subscribe to [http://rubyforge.org/mailman/listinfo/ruwiki-discuss ruwiki-discuss] ([http://rubyforge.org/pipermail/ruwiki-discuss/ archives]).
- * You can also use the [http://rubyforge.org/forum/?group_id=84 Ruwiki Public Forum] or the on \RubyForge.
-
- == Tracking Ruwiki Development
- The development progress of Ruwiki is kept primarily in the wiki
- itself, but the services of [http://rubyforge.org RubyForge] are used
- as well.
- * The BugTracking page in Ruwiki keeps track of open and closed bugs in Ruwiki. Bugs can also be found in the \RubyForge [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug tracker] and [http://rubyforge.org/tracker/?atid=408&group_id=84&func=browse Support Requests].
- * The To_Do list keeps track of major development goals for Ruwiki. Items for this list can be found on \RubyForge in [http://rubyforge.org/tracker/?atid=410&group_id=84&func=browse Feature Requests] and [http://rubyforge.org/tracker/?atid=409&group_id=84&func=browse Patches].
- * There is a mailing list to track CVS changes: [http://rubyforge.org/mailman/listinfo/ruwiki-checkin ruwiki-checkin] ([http://rubyforge.org/pipermail/ruwiki-checkin/ archives]).
-
- == Different Features?
- If this wiki doesn&rsquo;t have the right combination of features, (or if it
- just doesn&rsquo;t feel right) try these other Ruby-based Wikis:
-
- * [http://pimwiki.rubyforge.org/ PIMWiki]
- * [http://instiki.rubyforge.org/ Instiki]
- * [http://www.walrus-ruby.org/amrita/cgi-bin/aswiki/aswiki.cgi Amrita Wiki]
- * [http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=top RWiki]
- * [http://www.xpsd.com/MiniRubyWiki MiniRubyWiki]
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/Roadmap.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/Roadmap.ruwiki
deleted file mode 100644
index 50e311b..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/Roadmap.ruwiki
+++ /dev/null
@@ -1,224 +0,0 @@
-page!content: = Ruwiki %RV#%: The Road Ahead
- This roadmap is accurate as of the release of 0.9.0.
-
- What lies ahead for Ruwiki? The To_Do list will give a detailed list
- of what is to follow, but this list is not the roadmap. There is no
- clear indication of the reason for &mdash; and in some cases, the
- meaning of &mdash; the items on the list. The intention of this
- document is to expand on that list. As items are completed, they will
- be removed from this document.
-
- == A Note About Targets
- Ruwiki development is not proceeding as quickly as I would prefer, but
- it is continuing steadily. I am at times choosing to delay releases
- and bypass some versions because there are other pressing concerns; I
- am definitely aiming for quality here, not for timeliness.
-
- == Development Inputs
- The primary driver of development on Ruwiki is the needs of a few
- groups of people. First, both Alan and Austin use or will use Ruwiki
- at work. There are particular needs that both have. Austin will be
- replacing an installation of \PhpWiki with an installation of Ruwiki
- sometime in early 2005.
-
- Second, [http://www.rubygarden.org/ruby RubyGarden], and
- [http://www.rubyforge.org RubyForge], and the
- [http://rpa.rubygarden.org <acronym title="Ruby Production Archive">RPA</acronym>]
- have expressed an intention to replace the Perl-based \UseMod wiki
- with a Ruby-based wiki. The popular and easy-to-use Instiki
- (&ldquo;there is no step 3&rdquo;) is not an ideal choice for either
- because they either require or prefer a CGI-based wiki. Ruwiki has the
- desired level of performance and implemenation simplicity that
- impresses both groups, and it is the current preferred choice. Thus,
- the needs of both websites factor highly into the goals for Ruwiki.
-
- Third, Austin gave a talk on Ruwiki at \RubyConf 2004. Many of the
- features in the current release come from a development effort leading
- up to the talk and in the weeks following.
-
- Last, and certainly not least, feature requests and bug reports are a
- factor. One of the things that changed in Ruwiki 0.8.0 was the look
- and feel; admittedly, the look and feel in earlier versions was a bit
- garish, designed to fit in with a particular website more than be a
- general wiki theme. Users complained, and we changed this. The
- continual spam defacement of the \RubyGarden wiki suggested several
- possible improvements that could be made in Ruwiki to fight wiki spam;
- initial work has been implemented in Ruwiki 0.9.0 and more work
- remains. Additionally, Ruwiki is the first wiki with built-in
- deployment support for package management systems (such as \RubyGems
- and rpa-base), although Instiki has been modified for RPA by the RPA
- team to support limited installation in RPA locations.
-
- == Ruwiki 0.10.0: &ldquo;Are You Being Served?&rdquo;
- Ruwiki 0.8.0 introduced an incompatible change in the way that page
- diffs were stored, so users were advised to remove any existing .rdiff
- files. This isn&rsquo;t as problematic as it may sound, as until
- 0.10.0, there is no way to actually view the page diffs from Ruwiki
- itself.
-
- In Ruwiki 0.7.0, a new token was introduced: %calendar(). The concept
- here is a sound one that can be extended to make token addition
- easier. Currently, it is necessary for token writers to create their
- own regular expressions. The &ldquo;function token&rdquo; will be
- added &mdash; although the form may not be
- &ldquo;%<em>function-name</em>&rdquo; &mdash; that will work with
- either a line replacement or a word replacement so that the regular
- expression does not need to be written. Tests for the replacement will
- still need to be written, but standardizing new custom tokens will be
- a good thing.
-
- Chad Fowler&rsquo;s port of \RubLog&rsquo;s vector search will
- probably be added to this version.
-
- The presence of static HTML content (headers and footers) per page has
- been accounted for in Ruwiki 0.8.0, but it will not be displayed.
- Further, there is currently no way to specify or display static
- content for the wiki or the project. (A related problem here is that
- projects do not have any properties. This will become important as
- projects should be able to be marked private within a wiki in the
- future.)
-
- The purpose of the \WikiWikiWeb is to provide a collaborative,
- community knowledge editing environment. Unfortunately, the pondscum
- known as spammers have figured out that the \WikiWikiWeb provides a
- positive Google \PageRank, and having their links on our Wikis is
- benefits them. Just as they don&rsquo;t care about filling our
- mailboxes with junk, they don&rsquo;t care about defacing our
- community knowledge. Ruwiki 0.10.0 provides additional antispam
- defences.
-
- The \RecentChanges mechanism will be updated to make it possible to
- see the \GlobalRecentChanges list.
-
- The most significant change in Ruwiki 0.10.0 will be the modification
- of the request pipeline. This will not be visible to the end user, but
- it will be significant to users who wish to extend Ruwiki. Currently,
- Ruwiki processes all commands in ruwiki.rb. In Ruwiki 0.10.0, this
- will be changed to a dispatch mechanism, where Action objects are
- introduced, and ruwiki.rb dispatches requests to Action objects.
-
- <table summary="Pipeline" style="border: 1px solid black"><tr><td>
- +---------+ +-------------------+
- | Request |--------->| Authorize Request |
- +---------+ +-------------------+
- |
- v
- +-------------------+
- | Configure Ruwiki |
- +-------------------+
- |
- v
- +-------------------+
- | Parse Request |
- +-------------------+
- |
- v
- +-------------------+
- | Perform Action |
- +-------------------+
- |
- v
- +-------------------+
- | Prepare Response |
- +-------------------+
- |
- v
- +--------+ +----+--------------+
- | Page |<----------| Send Page |
- +--------+ +-------------------+
- </td></tr></table>
-
- The diagram above shows the general pipeline. The difference is that
- the action will be its own object. In general, it will need to know
- how to process certain URL formats.
-
- In the process of defining the action objects, \ActionCards will be
- created. Below is an example \ActionCard for the default action,
- <tt>_show</tt>. In \ActionCards, everything is relative to the Ruwiki
- root URI. Important to note is that \ActionCards are an ideal: they may
- not represent something that can be accomplished for 0.10.0, 0.11.0,
- or even 1.0. They do, however, represent the ultimate target.
-
- Ruwiki does some implicit URI rewriting in the general form of:
-
- <table summary="Ruwiki URI rewriting" style="border: 1px solid black; border-collapse: collapse">
- <tr><th style="border: 1px solid black">URI</th><th style="border: 1px solid black">Rewritten URI</th></tr>
- <tr><td style="border: 1px solid black">/</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Action</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action</td></tr>
- <tr><td style="border: 1px solid black">/Topic</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/</td><td style="border: 1px solid black">/Project/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/Action</td><td style="border: 1px solid black">/Project/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action</td></tr>
- <tr><td style="border: 1px solid black">/Project/Topic</td><td style="border: 1px solid black">/Project/Topic/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/Topic/Action</td><td style="border: 1px solid black">/Project/Topic/Action</td></tr>
- </table>
-
- <table summary="_show Action Card" style="border: 1px solid black"><tr><td>
- === Action: Show [_show] <strong>DEFAULT</strong>
- The Show action is the default action that will be performed when
- there is no action specified. Without any arguments, the latest
- version of the page will be displayed.
-
- ==== Action Arguments
- ; ?r=<em>revision</em> : Show the specified revision of the page.
- ; ?r : Show the list of revisions known to the page.
- ; ?r=<em>revision1</em>:<em>revision2</em> : Shows the difference of revision1 and revision2 for the page.
- ; ?r=:<em>revision</em> : Shows the difference between the current page and the specified revision.
- ; ?d=<em>yyyymmdd[:hh[mm[ss]]]</em> : Shows the last revision from at or before the specified date and time. If time is not specified, it is assumed to be 23:59:59.
-
- ==== Interaction Notes
- Without arguments, _show generates pages pages that are editable and
- indexable (<meta name="robots" content="index,follow,archive">). If
- any argument is specified, the page is still editable, but not
- indexable (<meta name="robots" content="noindex,nofollow,noarchive">).
- </td></tr></table>
-
- == Ruwiki 0.11.0: &ldquo;What&rsquo;s My Line?&rdquo;
- The antispam techniques introduced in 0.9.0 are positive steps in the
- fight against wiki defacement. They are hopefully effective, too. The
- problem is that because 0.9.0 doesn&rsquo;t offer users or user
- authentication, there&rsquo;s no way of safely allowing the edit of
- the antispam lists. Thus, to allow this and other potentially
- dangerous actions, a user and capability framework will be added to
- Ruwiki. This framework will allow for user identification,
- authentication, and authorization to indicate what users are allowed
- to perform what actions.
-
- Authenticated users will be able to bypass blacklist checking; thus,
- if &ldquo;msn.com&rdquo; is blocked, &ldquo;joe.blog@msn.com&rdquo;
- could still authenticate with Ruwiki and edit the pages. Some users
- will be able to manage user permissions (including user management),
- edit antispam lists, etc.
-
- Other actions will be added, including the ability to rename topics
- and move topics between projects. In both cases, the topic change
- history must be maintained.
-
- The documentation for Ruwiki will be substantially complete with this
- version, lacking only specific information on the features that will
- be added in Ruwiki 1.0.0.
-
- == Ruwiki 1.0.0: &ldquo;Yes, Minister&rdquo;
- A combined strength and weakness of Ruwiki is that it currently does
- little to protect against arbitrary HTML being inserted into the
- current topic. The allowed subset of HTML should be restricted to a
- safe subset to prevent cross-site-scripting attacks.
-
- Pages and projects have properties: we need to provide the ability to
- edit those properties. Part of the properties that should be editable
- include whether a page is frozen &mdash; this means that the page is
- no longer editable by any user (unless it is unfrozen) and is
- effectively a plain HTML page. Other properties include the static
- header and footer information in a page or project.
-
- Modern Wikis require an RSS feed. Ruwiki will provide one.
-
- == The Future: &ldquo;Yes, Prime Minister&rdquo;
- Ruwiki 1.0.0 does not represent the end of the line for Ruwiki, but
- what the future holds is unclear. We&rsquo;ll see what the future
- brings.
-properties!project: Ruwiki
-properties!title: Roadmap
-properties!topic: Roadmap
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
deleted file mode 100644
index d738c18..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
+++ /dev/null
@@ -1,155 +0,0 @@
-page!content: = Ruwiki %RV#% Templating
- Ruwiki uses a heavily modified version of the \RDoc
- &ldquo;cheap-n-cheerful&rdquo; HTML page template system. This a
- line-oriented, text-based templating system.
-
- == Templates
- Templates in the templating system are essentially plain strings with
- particular references to templating keys or an include directive.
-
- The template interacts with value and message hashes provided by
- Ruwiki. The keys known to the templates expected by Ruwiki are
- detailed in Extending_Ruwiki. Nested key references are found from the
- inside-out. That is, the closest resolving key to the current level is
- found, not the furthest resolving key.
-
- === Including Other Templates
- Templates may include other templates to any arbitrary level by using
- the <tt>!INCLUDE!</tt> directive. When the \TemplatePage is created,
- an array of template strings are provided; these will be used to
- satisfy <tt>!INCLUDE!</tt> directives. If there are not enough
- template strings provided, <tt>!INCLUDE!</tt> won&rsquo;t be
- translated.
-
- : This may change before Ruwiki reaches 1.0, so that templates are
- : named instead of iterated.
-
- === Simple Template Keys
- Strings of the format <tt>%<em>key</em>%</tt> or
- <tt>%?<em>key</em>%</tt> are simple template keys. <em>key</em> is
- looked up in the provided value hash and is presented as the string
- value of the result. <tt>%key%</tt> template keys are mandatory; if
- the key is not found in the value hash, an exception will be raised.
- <tt>%?key%</tt> template keys are optional; if they key is not found
- in the value hash, an empty string (&ldquo;&rdquo;) will be used.
-
- === Labels
- Strings of the format <tt>#<em>key</em>#</tt> or
- <tt>#?<em>key</em>#</tt> are labels. <em>key</em> is looked up in the
- provided message hash as a Symbol (e.g.,
- <tt><em>key</em>.intern</tt>). As with simple template keys,
- <tt>#key#</tt> labels are mandatory and <tt>#?key#</tt> labels are
- optional.
-
- === Links
- Strings of the format <tt>HREF:\ref:name</tt> will become HTML links.
- Both <em>ref</em> and <em>name</em> are keys to be looked up.
- <em>name</em> is mandatory; an exception will be raised if it is not
- found.
-
- === Control Structures
- The templating library supports both looping and conditional control
- structures in both single-line and multi-line forms. Single-line
- control structures <strong>may not</strong> be nested; multi-line
- control structures <strong>may</strong> be nested arbitrarily deeply.
-
- ==== Looping Control Structures
- There are two forms of looping control structures.
-
- [:key|stuff:]
-
- START:key
- ... stuff ...
- END:key
-
- ===== Single-Line Looping
- [:key|stuff:]
-
- The value of <em>key</em> may be <tt>nil</tt>, an integer value, a
- range, or an array. When <em>key</em> represents:
- # <tt>nil</tt>, the looping structure will be replaced with an empty string.
- # An integer, <em>stuff</em> will be repeated <em>key</em> times. Values from 1 to <em>key</em> will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # A range, <em>stuff</em> will be repeated once for each successive value in the range of <em>key</em>. Each value will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # An array, the behaviour will differ depending on the contents of the array.
- ## If the array contains hashes, the behaviour is the same as a multi-line looping construct. See below for details.
- ## Otherwise, the template iterates through the array, providing each value to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
-
- As an example, if we have:
-
- "[:b|%b% ]"
-
- # <tt>val["b"] = 3 -> "1&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = (0..2) -> "0&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = ["a", "B"] -> "a&nbsp;B&nbsp;"</tt>
-
- ==== Multi-Line Looping
- START:key
- ... stuff ....
- END:key
-
- The value of <tt>key</tt> must be an array of hashes. <tt>... stuff
- ...</tt> will be repeated once for each entry in the array. The hashes
- will be passed as nested value hashes.
-
- %a% [:b|%a% ]%a%
-
- When the above template string is run with the following hash:
-
- val["a"] = 1
- val["b"] = [ { "a" => 2 }, { "a" => 3 } ]
-
- The result is:
-
- 1 2 3 1
-
- The behaviour is the same for multi-line blocks.
-
- ==== Conditional Block Keys
- IF:key
- ... stuff ...
- ENDIF:key
-
- The block between <tt>\IF:key</tt> and <tt>\ENDIF:key</tt> will be included in
- the output only if the corresponding key is set in the value hash.
-
- == Example
- Given the set of templates T1, T2, and T3 (shown below), here&rsquo;s how we would
- use the templating system.
-
- values = { "name" => "Dave", "state" => "TX" }
- t = TemplatePage.new(T1, T2, T3)
- File.open(name, w) { |f| t.process(f, values) }
-
- or:
-
- <!-- Source -->
- val1 = { "name" => "Dave", "state" => "TX" }
- val2 = { "name" => "Dave" }
- msgs = { }
- res = ""
- t.process(res, values, msgs)
-
- <!-- T1 -->
- Templates can subsitute a wide variety of values.
- !INCLUDE!
-
- <!-- T2 -->
- Name: %name% !INCLUDE!
-
- <!-- T3 -->
- IF:state
- State: %state%
- ENDIF:state
-
- The result will be:
-
- Name: Dave
- State: TX
-
- Name: Dave
-properties!project: Ruwiki
-properties!title: RuwikiTemplatingLibrary
-properties!topic: RuwikiTemplatingLibrary
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/RuwikiUtilities.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/RuwikiUtilities.ruwiki
deleted file mode 100644
index aef7e1f..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/RuwikiUtilities.ruwiki
+++ /dev/null
@@ -1,156 +0,0 @@
-page!content: = Ruwiki %RV#% Utilities
- Ruwiki %RV#% provides two utilities and three sample programs for
- deployment.
-
- == Managing Ruwiki Deployments
- A major change to the way that Ruwiki %RV#% works as compared to
- versions of Ruwiki 0.8.0 or earlier is that Ruwiki %RV#% supports being
- installed in a central location by one of the two major packaging
- systems available for Ruby (\RubyGems and RPA). Managing these
- deployments is accomplished with the utility appropriately enough named
- <tt>ruwiki</tt>, stored in the directory of the distribution.
-
- This utility has little value for users of the standalone release
- (either of the versions packaged in tarfiles or zipfiles), but is
- developed because packaging systems present a particular challenge to
- Ruwiki, as simply running &ldquo;ruwiki_servlet&rdquo; with no
- arguments will look for the data files and the template files relative
- to the current directory. With \RubyGems, though, this would require
- that the user specify something like:
-
- ruwiki_servlet \
- --template-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.9.0/templates \
- --flatfiles-data-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.9.0/data
-
- This is not the preferred option because Wiki installations may be
- private and the /usr/local directory is a system-wide shared
- directory. Additionally, since Ruwiki works as a CGI, the system
- shared data and template paths will not be generally accessible (and
- should not be world-writeable!) to CGI executables.
-
- This utility also encapsulates Win32 service management through
- Win32::Service for the \WEBrick servlet runner.
-
- === <tt>ruwiki <command> [<em>parameters</em>]</tt>
- The <tt>ruwiki</tt> utility will recognise four different commands on
- all platforms and a fourth command on Windows. These commands are:
-
- ; help : Displays general help or command-specific help.
- ; install : Installs the default deployment package.
- ; package : Packages a Ruwiki installation.
- ; unpackage : Unpackages a Ruwiki installation.
- ; service : Manages a Win32::Service for Ruwiki.
-
- ==== <tt>ruwiki help commands</tt>
- The list of known commands can be displayed by providing this command.
-
- % ruwiki help commands
- ==== <tt>ruwiki help <command></tt>
- The help for the named command (one of install, package, unpackage, or
- service) will be displayed upon providing this command to the ruwiki
- utility.
-
- % ruwiki help install
- ==== <tt>ruwiki install [<em>OPTIONS</em>] [<em>--to DEST</em>]
- Creates a new Ruwiki instance in the current directory or the directory
- specified by the <tt>--to</tt> option. By default, the data, template,
- and a default configuration file are installed to the destination
- directory. OPTIONS may be one of the following:
-
- ; servlet : Installs the Ruwiki WEBrick servlet stub.
- ; service : Installs the Ruwiki Win32::Service stub.
- ; cgi : Installs the Ruwiki CGI script model.
- ; data : Default; installs the Ruwiki default data, templates, and configuraiton file.
-
- Installation option names can be disabled with a dash (&lsquo;-&rsquo;)
- or the word &lsquo;no&rsquo;, making &lsquo;-data&rsquo; and
- &lsquo;nodata&rsquo; functionally equivalent.
-
- % ruwiki install cgi data
- ==== <tt>ruwiki package [<em>SOURCE</em>] [<em>--output PACKAGE</em>|<em>-o PACKAGE</em>] [<em>--replace</em>]</tt>
- Packages the Ruwiki files (data, templates, and executables) from the
- specified source or the current directory into the specified output
- package (or &ldquo;./ruwiki.pkg&rdquo;). If the SOURCE is a ruwiki
- configuration file (e.g., &ldquo;ruwiki.conf&rdquo;), then that will be
- used to determine the location and name of the data and template
- directories.
-
- Specify <tt>--replace</tt> to replace the existing output package. If
- an output package is specified that already exists, then <tt>ruwiki
- package</tt> will refuse to output to the file unless
- <tt>--replace</tt> is specified. If an output package is not specified
- and <tt>--replace</tt> is not specified, then an incremental package
- will be generated (e.g., &ldquo;./ruwiki-1.pkg&rdquo;).
-
- : NOTE: The packaging process will normalize the data and templates
- : directory names to be relative to the unpacking directory. They will
- : NEVER be absolute paths.
-
- % ruwiki package
- ==== <tt>ruwiki unpackage [<em>SOURCE</em>] [<em>--output DIRECTORY</em>|<em>-o DIRECTORY</em>]</tt>
- Unpackages the provided Ruwiki package (default "./%1$s") into the
- specified directory (default ".").
-
- % ruwiki unpackage
- ==== <tt>ruwiki service <command> <NAME> [<em>command-options</em>]</tt>
- Manages a Ruwiki WEBrick servlet as a Win32 service (with the
- assistance of
- [http://raa.ruby-lang.org/list.rhtml?name=win32-service win32-service]).
- This works in ways similar to a daemon on Unix. The sub-commands
- available to <tt>ruwiki service</tt> are:
- ===== <tt>ruwiki service install NAME [DESCRIPTION] [options]</tt>
- Installs the Ruwiki WEBrick servlet as the named Win32 service.
- <tt>install</tt> accepts an optional description (all non-options will
- be included in the description). The options for <tt>install</tt> are:
- ; --rubybin RUBYPATH : The path to the Ruby binary.
- ; --exec SERVICEPATH : The path to the service executable.
- ; --home PATHTOHOME : The path to the home directory.
- ===== <tt>ruwiki service start NAME</tt>
- Starts the named Ruwiki service.
- ===== <tt>ruwiki service stop NAME</tt>
- Stops the named Ruwiki service.
- ===== <tt>ruwiki service delete NAME</tt>
- Deletes the named Ruwiki service.
-
- : NOTE: This command can probably be used to manage other Win32
- : services that respond to the appropriate commands.
-
- == Upgrading and Converting: ruwiki_convert
- : This section was formerly a separate entry in the Wiki entitled
- : &ldquo;Upgrading and Converting&rdquo;.
-
- The flatfile backend format in Ruwiki %RV#% is not compatible with that
- of versions of Ruwiki earlier than 0.8.0. There are a number of
- reasons for this, but because of this and that there are now three
- different backend formats, Ruwiki now has a converter utility between
- backends.
-
- There are two other incompatibilities of note:
- # Ruwiki now defaults to &ldquo;ruwiki&rdquo; as an extension (e.g., \ProjectIndex.ruwiki) to the storage files. This is, of course, is something that can be modified with a configuration option, but you may find it desirable to rename your files to match this naming convention.
- # The rdiff format is incompatible. It is recommended that you remove all .rdiff files from your data directory before using Ruwiki.
-
- === ruwiki_convert [options] <directory>+
- The converter utility will work on all files in a directory and its
- subdirectories.
-
- When a file is encountered, it will be examined to be a known form of a
- Ruwiki backend (marshal, yaml, flatfiles, or "old" flatfiles). If the
- file is not one of these forms, then the file is skipped. Otherwise, it
- is converted to the specified format. By default, the converted files
- will be backed up.
-
- ==== ruwiki_convert Options
- ; --format=FORMAT : Converts encountered files (regardless of the current format), to the specified format. Default is yaml. Allowed formats are: yaml marshal flatfiles
- ; --[no-]backup : Create backups of upgraded files. Default is --backup.
- ; --backup-extension=EXTENSION : Specify the backup extension. Default is "~", which is appended to the data filename.
- ; --extension=EXTENSION : Specifies the extension of Ruwiki data files. The default is .ruwiki
- ; --no-extension : Indicates that the Ruwiki data files have no extension.
- ; --quiet : Runs quietly. Default is to run with normal messages.
- ; --verbose : Runs with full messages. Default is to run with normal messages.
- ; --help : Shows this text.
-properties!project: Ruwiki
-properties!title: RuwikiUtilities
-properties!topic: RuwikiUtilities
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/SandBox.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/SandBox.ruwiki
deleted file mode 100644
index dfe4911..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/SandBox.ruwiki
+++ /dev/null
@@ -1,8 +0,0 @@
-page!content: This page is intended for users to play with freely to practice
- their \WikiFormatting.
-properties!project: Ruwiki
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/To_Do.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/To_Do.ruwiki
deleted file mode 100644
index 38242fd..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/To_Do.ruwiki
+++ /dev/null
@@ -1,50 +0,0 @@
-page!content: = Ruwiki %RV#% To Do Tracking
- Completed to-do items can be found in the ChangeLog. Bugs in Ruwiki
- are tracked in BugTracking.
-
- == Well-Defined To Do Items
- === Ruwiki 0.10.0
- ; Versioning : complete the change history interface. Change history is currently stored in a file <em>topic[.extension]</em>.rdiff. There is no way to display the change history at this point.
- ; Action objects : Actions will be generalised to pull the processing out of the main ruwiki.rb inasmuch as is possible.
- ; Function tokens : generalize the %&lt;function-name&gt;[(&lt;args&gt;)] calling method so that function tokens can be created without having to create a custom regular expression.
- ; Search work : There is further search work required. The current mechanism is effective, but inefficient, as it must load and convert each file in a project to a page and then search selectively within that page. The search mechanism must be improved.
- ; Frozen content : make it so that frozen content can be provided on a per-page or Wiki basis. Will provide both headers and footers. <strong>Note:</strong> Ruwiki 0.9.0 will only provide the ability to present the information, not create or modify it.
- ; Blacklisting : Allow the specification of an allow/deny list for \IPs or hostnames, aimed at blocking known spammers. Entries in this list can be permanent or temporary (e.g., &ldquo;* DENY&rdquo;, &ldquo;spammer.com DENY UNTIL 20040723&rdquo;, &ldquo;139.244.33.25 ALLOW&rdquo;).
- ; External URL redirection : Add whitelisting of known good external URIs.
- ; \GlobalRecentChanges : Recent changes for all projects.
- ;
- === Ruwiki 0.11.0
- ; Authentication : complete authentication to provide for a standard Ruwiki authentication mechanism, not just an external API. This may require changes to the existing external API. Allows for user creation and authentication. Authenticate users bypass blacklist checking; thus, if &ldquo;msn.com&rdquo; is blocked, joe.blog@msn.com could still authenticate with Ruwiki and edit the pages.
- ; Topic renaming : add the ability to rename a topic within a project. Topic change history should be maintained.
- ; Topic moving : add the ability to move and/or rename a topic between projects. Topic change history should be maintained.
- ; Complete documentation : Complete the documentation of Ruwiki.
- ; Antispam : Allow the on-line editing of antispam lists to authenticated and authorised users.
- === Ruwiki 1.0.0
- ; RSS Feed : Ruwiki must be able to offer \RecentChanges and \GlobalRecentChanges as RSS feeds. This may not be ideal with the current \RecentChanges format. It may be easier to move to a two-stage \RecentChanges format.
- ; Static content : Allow the creation and editing of static content.
- ; Frozen pages : provide the ability to freeze content in place; the page is no longer &ldquo;wiki&rdquo; editable and is effectively a plain HTML page.
- ; Page properties : provide the ability to generally edit the properties of a given page.
-
- == General Future To Do Items
- ; E-mail gateway : accept topic appends via e-mail.
- ; alternative backends : access other wiki data storage, or other formats, e.g. e-mail boxes in mh or mbox formats
- ; bug tracker backend : with alternate markup
- ; add setup and user config methods : for backend plugin classes, then we can use them with an interactive or gui tool frontend to setup data storage backends. The user might have to run as root or other user with database create permissions.
- ; add id="" to various markup elements (make id specific to topic) : Later we can allow users to tweak a page using uploaded css fragments which might get appended onto the standard css contents.
- ; ruby action : upload a ruby code fragment to add a smart &ldquo;action&rdquo; to that wiki page. Need some sort of security + approval system to handle this safely.
- ; Preview button : add a preview button to the save page.
- ; Alternative templating systems : not as high priority now that there&rsquo;s a real templating system in place.
- ; Alternative markup systems : potentially allow \RedCloth (Textile) and/or \BlueCloth (Markdown) to be processed for a page. This could be implemented as a %function.
- ; Project/topic security : allow certain projects to be restricted/authenticated for read/write based on user.
- ; Track last <em>n</em> links/topics : ?
- ; Write a markup debugger : ?
- ; Validate topic formatting from cgi : ?
- ; Validate project from cgi : ?
- ; Project-based backend : Allow different projects to have different backends.
- ; Arbitrary-depth project namespace support : Foo::Bar::\BazPage.
-properties!project: Ruwiki
-properties!title: To_Do
-properties!topic: To_Do
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/TroubleShooting.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/TroubleShooting.ruwiki
deleted file mode 100644
index 7ccfde4..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/TroubleShooting.ruwiki
+++ /dev/null
@@ -1,32 +0,0 @@
-page!content: = Ruwiki %RV#%
- = Ruwiki %RV#% Troubleshooting Tips
- Following are some tips contributed by users of Ruwiki. Remember:
- Ruwiki currently requires Ruby version 1.8; the YAML backend requires
- Ruby version 1.8.2 or the latest CVS of Ruby 1.9.
-
- == No such file or directory
- (Unix systems only.) If you get something like:
-
- % ./ruwiki_servlet
- : no such file or directory
-
- run the following in the Ruwiki directory:
-
- % find . | xargs dos2unix
-
- The developers of Ruwiki do what they can to ensure that Ruwiki is
- distributed in a way that works well for both Unix and Windows
- systems, but this will occasionally cause problems.
-
- == undefined method
- % ./ruwiki_servlet
- ./ruwiki_servlet:64: undefined method `[]=' for nil (NameError)
-
- This may appear if you are running Ruby 1.6. Ruwiki requires Ruby 1.8
- or higher; certain features require Ruby 1.8.2 preview 3 or better.
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/WikiFeatures.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/WikiFeatures.ruwiki
deleted file mode 100644
index e47ffdd..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/WikiFeatures.ruwiki
+++ /dev/null
@@ -1,16 +0,0 @@
-page!content: Ruwiki is a [http://www.ruby-lang.org Ruby]-based wiki. It is
- ideal for personal or small team use.
-
- Ruwiki:
- * Uses the [http://www.ruby-lang.org Ruby] language.
- * Runs quickly and easily as a CGI or \WEBrick servlet.
- * Uses a simple templating system and CSS for presentation.
- * Has flatfile storage with simple versioning.
- * Offers project namespaces. Different projects can have the same topic names and not collide. Thus, \Default::ReadMe and \Project::ReadMe are two different pages.
- * Offers a calendar for date-based collaborative editing.
-properties!project: Ruwiki
-properties!title: WikiFeatures
-properties!topic: WikiFeatures
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Ruwiki/WikiMarkup.ruwiki b/ruwiki/tags/release-0.9.0/data/Ruwiki/WikiMarkup.ruwiki
deleted file mode 100644
index 3480564..0000000
--- a/ruwiki/tags/release-0.9.0/data/Ruwiki/WikiMarkup.ruwiki
+++ /dev/null
@@ -1,260 +0,0 @@
-page!content: = Ruwiki Markup
- A [http://c2.com/cgi/wiki Wiki] obeys certain formatting rules to make
- it easy to format text without needing to know HTML. This Wiki obeys
- the following rules by default. Because Ruwiki is extensible, there may
- be additional formatting rules. These rules are those rules that apply
- as of Ruwiki %RV#%.
-
- == \WikiWords, \WikiProjects, Calendars, and External Resources
- While reading stuff on this Wiki, you will see some words mashed
- together with capitalisation (like \WikiWords). While this may seem odd
- at first, this feature allows internal links to be created across the
- Wiki.
-
- There are several allowable forms for \WikiWords.
- # Two or more words concatenated directly. Each word must begin with a capital letter and be followed by zero or more lowercase letters. Thus, \FooBar, \CPlusPlus, and \AbC are all valid \WikiWords, but ABC is not.
- # Two or more words concatenated with underscores. The first word must begin with a capital letter. This makes \Foo_Bar, \C_Plus_Plus, and \A_b_C valid \WikiWords. These \WikiWords will be displayed with spaces instead of underscores. \C_Plus_Plus will be displayed as &ldquo;C Plus Plus&rdquo;.
- # One or more words contained in double square brackets. This the form supported by [http://wikipedia.com/ Wikipedia], and looks like \[[A Wiki Phrase]]. These links will be displayed exactly as entered between the brackets.
- # One or more words contained in double square brackets with display text separated by a vertical bar. These \WikiWords look like \[[A Wiki Phrase|but show this text]]. The link will be to the page &ldquo;A Wiki Phrase&rdquo; and &ldquo;but show this text&rdquo; will be the hyperlink.
-
- If a \WikiWord is found that does not have a page defining the
- \WikiWord, then the word will be shown with a hyperlink question mark
- following it, allowing the \WikiWord to be created.
-
- === \WikiProjects
- This Wiki supports &ldquo;projects.&rdquo; Within each project, a given
- \WikiWord is unique. Thus, if you have a Default project and a Ruwiki
- project, you can have two pages called \ReadMe. Any given \WikiWord
- refers only to topics within its project. That is, if I have \WikiWord
- in the \ReadMe topic of the Default project, it will refer to the
- \WikiWord topic of the Default project. (Another term for this
- capability is &ldquo;namespaces.&rdquo;)
-
- A cross-project link is composed of the project&rsquo;s name, two colons
- (::), and the \WikiWord desired. Thus, from \Default::ReadMe, I can
- have \Ruwiki::ReadMe as a link. The project index can be referred to
- with \::Project. This is the same as doing \Project::ProjectIndex.
- Thus, \::Ruwiki becomes ::Ruwiki, which is the same as
- \Ruwiki::ProjectIndex (Ruwiki::ProjectIndex).
-
- === Project Lists and Topic Lists
- The list of known projects may be listed with the %projects() token;
- the list of known topics for the current project may be listed with the
- %topics() link. An arbitrary project may be provided to the %topics()
- token, as in %topics(Default).
-
- %topics(Default)
-
- %projects()
-
- === Calendars
- Ruwiki supports a miniature calendar. Future versions of Ruwiki will
- allow for calendar aggregation. Using the %calendar function, a
- calendar section will be generated:
-
- %calendar(<year>, <month>[, <project>])
- %calendar(today[, <project>])
-
- %calendar accepts either the English word &ldquo;today&rdquo; (displaying the
- calendar for the current month and year) or a specific month and year
- for display. A calendar for the specified month will be generated
- where each date in the month is treated as a \WikiWord (as are the
- links to the current month, the previous month, and the next month)
- ready for display or editing. As with all other \WikiWord links in
- Ruwiki, a project may be specified in %calendar, making
- &ldquo;%calendar(today, Ruwiki)&rdquo; different from &ldquo;%calendar(today, Default)&rdquo;.
-
- %calendar(today)
- %calendar(1999, 08, Default)
-
- === External Resources
- Ruwiki behaves intelligently about resources external to the Wiki
- itself.
-
- ==== External Links
- \URLs to external resources are automatically detected for web
- addresses, FTP addresses, newsgroups, and email links. They are
- automatically converted to clickable \URLs. Be aware that some things
- that look like URL schemas may be make clickable but are not really
- \URLs.
-
- * \http://www.ruby-lang.org becomes http://www.ruby-lang.org
-
- \URLs may be named with the [url name] syntax. If the name is omitted,
- the URL will be numbered. Numbering is contained to within the page.
-
- * \[http://www.rubygarden.org RubyGarden] becomes [http://www.rubygarden.org RubyGarden].
- * \[http://www.halostatue.ca] and \[http://www.halostatue.ca/ruby] become [http://www.halostatue.ca] and [http://www.halostatue.ca/ruby].
-
- ==== Images
- : <strong>Changed in Ruwiki 0.8.0!</strong>
-
- In preparation for the anti-wiki-spam features of Ruwiki 0.9.0, it has
- been necessary to remove the ability for \URLs to be converted into
- inline images automatically. Inline images are now created with the
- image markup format, generally of the format \[image:URI options]. The
- <em>options</em> format is generally the same format as an HTML
- attribute (<em>name="value"</em>; the quotes are optional for
- single-word option values) and any valid HTML attribute is also a
- valid <em>option</em>. There is one special <em>option</em>,
- <tt>numbered</tt>. This value, if set to any other value than &ldquo;false&rdquo;,
- will set the <tt>title</tt> of the image to a numbered link.
-
- If the <tt>title</tt> attribute is not specified, it will be set from
- the <tt>alt</tt> attribute (if specified) or the image&rsquo;s URL. If the
- <tt>alt</tt> attribute is not specified, it will be set from the
- <tt>title</tt> attribute.
-
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif] [image:http://www.halostatue.ca/graphics/maple_leaf.gif]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true] [image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"]
-
- ==== Ruby Mailing Lists
- If a Ruby mailing list message tag is provided, it will be converted appropriately.
-
- * \[ruby-talk:12345] will become [ruby-talk:12345]
- * \[ruby-core:12345] will become [ruby-core:12345]
- * \[ruby-doc:12345] will become [ruby-doc:12345]
-
- == Headings and Lists
- === Headings
- Use equals signs (=) for headings. Up to six equals signs can be used
- for HTML headings 1 - 6.
-
- \===== Heading five<br />
- \====== Heading six
- ===== Heading five
- ====== Heading six
-
- === Lists
- ==== Bulleted Lists
- Use asterisks (*) to create bulleted lists. More asterisks means more
- levels.
-
- \* level 1<br />
- \** level 2<br />
- \*** level 3
-
- * level 1
- ** level 2
- *** level 3
-
- ==== Numbered Lists
- Use hash marks (#) for numbered lists. More hash marks means deeper
- levels.
-
- \# level 1<br />
- \## level 2<br />
- \### level 3<br />
- \### level 3.2<br />
- \## level 2.2<br />
- \# level 1.2
-
- # level 1
- ## level 2
- ### level 3
- ### level 3.2
- ## level 2.2
- # level 1.2
-
- ==== Definition Lists
- Definitions can be created similar to other lists. Unlike &ldquo;standard&rdquo;
- lists, though, definition lists have both the term and the definition.
- They are specified like so. As with other lists, repeating the first
- item (;) will increase the indentation level. The browser may not
- respect this.
-
- \; term : definition<br />
- \;; term2 : definition<br />
- \;;; term3 : definition
-
- ; term : definition
- ;; term2 : definition
- ;;; term3 : definition
- == Paragraph Formatting
- === Rules
- Four or more dashes ("----") on a line by itself makes a horizontal
- rule, like so:
-
- \----
- ----
- === Paragraphs
- A blank line (it may have whitespace on it) marks a new paragraph. All
- other lines are joined together (excepting headers, lists, and rules).
-
- This line is a new paragraph.
-
- === Block Indent Paragraphs
- Paragraphs can be indented by beginning the paragraph with one or more
- colons (:).
-
- \: Indent Level 1<br />
- \:: Indent Level 2<br />
- \::: Indent Level 3
-
- : Indent Level 1
- :: Indent Level 2
- ::: Indent Level 3
-
- Paragraphs may be indented as &ldquo;cites&rdquo; by using one or more
- greater-than signs (>) at the beginning of the line.
-
- \> Indent Level 1<br />
- \>> Indent Level 2<br />
- \>>> Indent Level 3
-
- > Indent Level 1
- >> Indent Level 2
- >>> Indent Level 3
-
- === Code
- Text that is indented will be presented as formatted in a monospaced
- font. The only change is to escape HTML entities &lt; (&amp;lt;), &gt;
- (&amp;gt;), and &amp; (&amp;amp;).
-
- def replace
- content = @match[1]
- %Q{<pre>#{content}</pre>}
- end
-
- == Miscellaneous Formatting
- === HTML
- The Ruwiki engine currently passes through HTML without changes. Thus,
- &lt;strong&gt;strong&lt;/strong&gt; would be shown as
- <strong>strong</strong>. <strong><em>Note:</em></strong> This
- capability could be very dangerous as it could expose the Wiki to
- cross-site scripting (XSS) vulnerabilities. This will be remedied
- prior to the 1.0 release of Ruwiki.
-
- === Abbreviations
- Certain abbreviations may be known to the Wiki. While there is not yet
- any way for a user to query what abbreviations are known, if the
- abbreviations are told to the users, they may be used. Abbreviations
- are presented with @{key}, where <em>key</em> is the abbreviation
- desired. This Wiki, for example, knows that \@{matz} means &ldquo;@{matz}&rdquo;.
- The special form \@{} will produce the current list of known
- abbreviations. Unknown abbreviations will simply be put back into the
- data stream unchanged. Thus, \@{unknownkey} results in @{unknownkey}.
-
- ==== Known Abbreviations
- @{}
-
- === Preventing Formatting
- If you wish to prevent a word or sequence from being interpreted, put
- a backslash (\) in front of it. This works on all formatting options
- except paragraph positioning. Thus, if I want to prevent a \WikiWord
- from being turned into a hyperlink, I need to backslash it:
- \\WikiWord.
-
- === Other Possible Considerations
- I&rsquo;m looking at adding styles similar to what is shown on the Wiki
- below.
-
- * http://www.pmichaud.com/wiki/PmWiki/WikiStyles
-properties!project: Ruwiki
-properties!title: WikiMarkup
-properties!topic: WikiMarkup
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Tutorial/AddingPages.ruwiki b/ruwiki/tags/release-0.9.0/data/Tutorial/AddingPages.ruwiki
deleted file mode 100644
index c405b70..0000000
--- a/ruwiki/tags/release-0.9.0/data/Tutorial/AddingPages.ruwiki
+++ /dev/null
@@ -1,15 +0,0 @@
-page!content: = Adding Pages
- To add a new page to Ruwiki, all you need to do is come up with a
- meaningful title, turn it into a \WikiWord (see Ruwiki::WikiMarkup) and
- Ruwiki will automatically recognise it as a reference to a page that
- does not yet exist.
-
- At the end of the new \WikiWord is a hyperlinked question mark;
- clicking on this will open the edit page for the new \WikiWord in
- Ruwiki.
-properties!project: Tutorial
-properties!title: AddingPages
-properties!topic: AddingPages
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Tutorial/AddingProjects.ruwiki b/ruwiki/tags/release-0.9.0/data/Tutorial/AddingProjects.ruwiki
deleted file mode 100644
index 6f27415..0000000
--- a/ruwiki/tags/release-0.9.0/data/Tutorial/AddingProjects.ruwiki
+++ /dev/null
@@ -1,15 +0,0 @@
-page!content: = Adding Projects
- To add a new project to Ruwiki, all you need to do is come up with a
- meaningful one-word name, and then turn it into a project link, e.g.,
- \::Project. Projects may <strong>only</strong> be a single word &mdash;
- they are not normal \WikiWords (see Ruwiki::WikiMarkup for details).
- Ruwiki will recognise this as a project that does not yet exist. At the
- end of the Project link is a hyperlinked question mark; clicking on
- this will open the \Project::ProjectIndex in Ruwiki for editing and
- create the new project.
-properties!project: Tutorial
-properties!title: AddingProjects
-properties!topic: AddingProjects
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Tutorial/ProjectIndex.ruwiki b/ruwiki/tags/release-0.9.0/data/Tutorial/ProjectIndex.ruwiki
deleted file mode 100644
index 25aaefd..0000000
--- a/ruwiki/tags/release-0.9.0/data/Tutorial/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,10 +0,0 @@
-page!content: = Ruwiki %RV#% Tutorial
- This tutorial is incomplate.
-
- %topics(Tutorial)
-properties!project: Tutorial
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/Tutorial/SandBox.ruwiki b/ruwiki/tags/release-0.9.0/data/Tutorial/SandBox.ruwiki
deleted file mode 100644
index 0488031..0000000
--- a/ruwiki/tags/release-0.9.0/data/Tutorial/SandBox.ruwiki
+++ /dev/null
@@ -1,8 +0,0 @@
-page!content: This page is intended for users to play with freely to practice
- their \WikiFormatting.
-properties!project: Tutorial
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.0/data/agents.banned b/ruwiki/tags/release-0.9.0/data/agents.banned
deleted file mode 100644
index 93500d9..0000000
--- a/ruwiki/tags/release-0.9.0/data/agents.banned
+++ /dev/null
@@ -1,60 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of User Agent strings which will be greeted
-# with "403 Forbidden" responses by Ruwiki. These are generally known email
-# harvesters or link directory builders for reciprocal link partners. These
-# may also be robots that routinely ignore the robots.txt file.
-#
-# This list is generated from a wide variety of sources including:
-# * http://www.clockwatchers.com/robots_list.html
-# * http://searchenginewatch.com/webmasters/article.php/2167991
-# * http://www.neilgunton.com/spambot_trap/
-# * http://www.robotstxt.org/wc/active/all.txt
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# foo
-# bar
-#
-# becomes:
-#
-# %r{foo|bar}x
-#++
-
- # Known email harvesters
-(?i:^nicerspro)
-(?i:^teleport)
-^CherryPicker
-^Crescent # Crescent Internet ToolPak
-^EmailCollector
-^EmailSiphon
-^EmailWolf
-^ExtractorPro
-^Microsoft\sURL
-^WebEMailExtrac
-
- # Link directory builders.
-^LinkWalker
-^Zeus.*Webster
-
- # Strongly suspected spoofed user agents from spam harvesters. These user
- # agents have been reported patterns by other antispam fighters.
-^[A-Z]+$
-^Internet\sExplore\s5.x
-^Mozilla.*NEWT
-^Mozilla\/4.0$
-MSIECrawler
diff --git a/ruwiki/tags/release-0.9.0/data/agents.readonly b/ruwiki/tags/release-0.9.0/data/agents.readonly
deleted file mode 100644
index e7168c5..0000000
--- a/ruwiki/tags/release-0.9.0/data/agents.readonly
+++ /dev/null
@@ -1,321 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of User Agent strings which will be given
-# readonly versions of the wiki instance.
-#
-# This list is generated from a wide variety of sources including:
-# * http://www.clockwatchers.com/robots_list.html
-# * http://searchenginewatch.com/webmasters/article.php/2167991
-# * http://www.neilgunton.com/spambot_trap/
-# * http://www.robotstxt.org/wc/active/all.txt
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# foo
-# bar
-#
-# becomes:
-#
-# %r{foo|bar}x
-#++
-
-(?:^.*HTTrack)
-(?:^.*LWP)
-(?:^Digimarc)
-(?:ChristCrawler.com|ChristCrawler@ChristCENTRAL.com)
-(?:Net|Web)Mechanic
-(?:PerlCrawler|Xavatoria)/
-(?:pjspider|PortalJuice.com)
-(?:spider_monkey|mouse.house)
-(?:tach_bw|Black\sWidow)
-(?:topiclink|TLSpider)
-(?i:(?-i:ComputingSite\s)?Robi)
-(?i:^curl)
-(?i:^googlebot)
-(?i:^gulliver) # NorthernLight
-(?i:^Scooter) # Altavista
-(?i:^w[@a]pSpider)
-(?i:infoseek) # InfoSeek
-^ABCdatos\sBotLink # http://www.abcdatos.com/botlink/
-^AITCSRobot/
-^anthill
-^appie
-^Arachnoidea # Euroseek
-^Arachnophilia
-^arale
-^araneo
-^AraybOt
-^ArchitextSpider # Excite, WebCrawler
-^ariadne
-^arks
-^Ask\s?Jeeves/Teoma
-^ASpider/
-^ATN_Worldwide
-^Atomz
-^AURESYS/
-^BackRub/
-^BaySpider
-^bbot
-^Big\sBrother
-^Bjaaland
-^BlackWidow
-^borg-bot/
-^(?i:boxseabot)
-^BSpider/
-^CACTVS\sChemistry\sSpider
-^calif
-^Checkbot/
-^cienciaficcion.net
-^CMCM/
-^combine
-(?i:^confuzzledbot)
-^CoolBot
-^cosmos
-^crawlpaper
-^cusco
-^cyberspyder
-(?i:^cydralspider)
-^desert\s?realm
-^Deweb
-^Die\sBlinde\sKuh
-^dienstspider/
-^digger
-^Digger
-^DIIbot
-^dlw3robot/
-^DNAbot/
-^downloadexpress
-^DragonBot
-^Duppies
-^dwcp
-^ebiness
-^ecollector
-^EIT-Link-Verifier-Robot/
-^elfinbot
-^Emacs-w3/
-^EMC\sSpider
-(?i:^esculapio)
-^ESI
-^esther
-^Evliya\sCelebi
-^explorersearch
-^fast # Fast/AllTheWeb
-^fastcrawler
-^FDSE
-^FELIX\s?IDE
-^fido
-^Fish-Search-Robot
-^fouineur
-^Freecrawl
-^FunnelWeb-
-^gammaSpider
-^gazz
-^gcreep
-^gestalttIconoclast/
-^Getterrobo-?Plus
-^GetURL\.rexx
-^golem
-^grabber
-^griffon
-^Gromit
-^gulper
-^hambot
-^havIndex
-^HKU\sWWW\sRobot
-^Hometown\sSpider\sPro
-^Hämähäkki
-^hotwired
-^htdig
-^htmlgobble
-^IAGENT/
-^iajabot
-^IBM_Planetwide
-^image\.kapsi\.net
-^IncyWincy
-^Informant
-^InfoSpiders
-^INGRID/
-^inspectorwww
-^Internet\sCruiser\sRobot
-^irobot
-^Iron33
-^IsraeliSearch/
-^JavaBee
-^JBot
-^jcrawler
-^jobo
-^Jobot/
-^JoeBot/
-^JubiiRobot/
-^jumpstation
-^Katipo/
-^KDD-Explorer
-^KIT-Fireball # Fireball.de
-^ko_yappo_robot
-^label-grabber
-^LabelGrab/
-^larbin
-^legs
-^Linkidator
-^LinkScan\s(?:Server|Workstation)
-^Lockon
-^logo\.gif\scrawler
-^logo_gif_crawler
-^Lycos_Spider_(T-Rex) # Lycos
-^M/
-^Magpie/
-^marvin
-^mattie
-^mediafox
-^MerzScope
-^MindCrawler
-^moget
-^MOMspider/
-^Monster
-^Motor
-^Mozilla/3\.01\s(Win95;\sI) # InfoSeek
-^Mozilla\/3.0.+Indy\sLibrary
-^msnbot
-^muncher
-(?i:^muninn)
-^MuscatFerret
-^MwdSearch
-^NDSpider/
-^NEC-MeshExplorer
-^Nederland.zoek
-^Net.Vampire
-^NetCarta
-^NetScoop
-^newscan-online
-^NHSEWalker/
-^Nomad
-^NorthStar
-^NPBot # Detects IP violations(?)
-^ObjectsSearch
-^Occam
-^Openbot # OpenFind
-^Openfind
-^Orbsearch
-^PackRat
-^pageboy
-^parasite
-^patric
-^PBWF
-^pegasus
-^Peregrinator-Mathematics/
-^PGP-KA/
-^phpdig
-^piltdownman
-^Pimptrain
-^Pioneer
-^Plucker
-^PlumtreeWebAccessor
-^Poppi/
-^PortalBSpider
-^psbot
-^Raven
-^Resume\sRobot
-^RHCS
-^RixBot
-^Road\s?Runner
-^Robbie
-^RoboCrawl
-^robofox
-^Robot\sdu\sCRIM
-^Robozilla/
-^root/
-^Roverbot
-^RuLeS/
-^SafetyNet\sRobot
-^Search-AU
-^searchprocess
-^searchterms\.it
-^Senrigan
-^SG-Scout
-^Shagseeker
-^Shai'Hulud
-^sharp-info-agent
-^SimBot
-^Site\sValet
-^sitecheck
-^SiteTech-Rover
-^SLCrawler
-^Sleek\sSpider
-^Slurp # Inktomi, AOL
-^snooper
-^solbot
-^speedy
-^SpiderBot
-^spiderline
-^SpiderMan
-^SpiderView
-^ssearcher
-^suke
-^suntek
-(?i:http://www.sygol.com)
-^T-H-U-N-D-E-R-S-T-O-N-E
-^Tarantula/
-^tarspider
-^TechBOT
-^Templeton
-^TeomaAgent # Teoma
-^TITAN
-^titin
-^TurnitinBot # Plagiarism detector
-^UCSD-Crawler
-^UdmSearch
-^udmsearch
-^Ukonline
-^uptimebot
-^URL\sSpider\sPro
-^urlck
-^Valkyrie
-^verticrawl
-^Victoria
-^vision-search
-^void-bot
-^Voyager
-^VWbot_K
-^w3index
-^W3M2/
-^w3mir
-^WebBandit
-^webcatcher
-^WebCopier
-^WebCopy
-^WebFetcher/
-^weblayers/
-^WebLinker/
-^WebMoose
-^webquest
-^WebReaper
-^webs
-^webspider
-^webvac
-^webwalk
-^WebWalker
-^WebWatch
-^wget
-^whowhere
-^winona
-^wired-digital-newsbot/
-^wlm
-^WOLP
-^WWWC
-^WWWWanderer
-^XGET
-^ZyBorg # WiseNut/LookSmart
diff --git a/ruwiki/tags/release-0.9.0/data/hostip.banned b/ruwiki/tags/release-0.9.0/data/hostip.banned
deleted file mode 100644
index 3817fcb..0000000
--- a/ruwiki/tags/release-0.9.0/data/hostip.banned
+++ /dev/null
@@ -1,30 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of User Agent strings which will be greeted
-# with "403 Forbidden" responses by Ruwiki. These are generally known email
-# harvesters or link directory builders for reciprocal link partners. These
-# may also be robots that routinely ignore the robots.txt file.
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will be
-# joined together:
-#
-# 192\.168\.0\..*
-# 127\.0\.0\..*
-#
-# becomes:
-#
-# %r{192\.168\.0\..*|127\.0\.0\..*}
-#++
diff --git a/ruwiki/tags/release-0.9.0/data/hostip.readonly b/ruwiki/tags/release-0.9.0/data/hostip.readonly
deleted file mode 100644
index 83be2c4..0000000
--- a/ruwiki/tags/release-0.9.0/data/hostip.readonly
+++ /dev/null
@@ -1,28 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of User Agent strings which will be given
-# readonly versions of the wiki instance.
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# 192\.168\.0\..*
-# 127\.0\.0\..*
-#
-# becomes:
-#
-# %r{192\.168\.0\..*|127\.0\.0\..*}
-#++
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki.rb
deleted file mode 100644
index ff4d76f..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki.rb
+++ /dev/null
@@ -1,622 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-class Ruwiki
- VERSION = '0.9.0'
- CONTENT_VERSION = 2
-end
-
-require 'cgi'
-require 'ruwiki/handler'
-require 'ruwiki/auth'
-require 'ruwiki/template'
-require 'ruwiki/lang/en' # Default to the English language.
-require 'ruwiki/config'
-require 'ruwiki/backend'
-require 'ruwiki/wiki'
-require 'ruwiki/page'
-
- # = Ruwiki
- # Ruwiki is a simple, extensible Wiki written in Ruby. It supports both
- # CGI and WEBrick interfaces, templates, and CSS formatting. Additionally,
- # it supports project namespaces, so that two pages can be named the same
- # for differing projects without colliding or having to resort to odd
- # naming conventions. Please see the ::Ruwiki project in the running Wiki
- # for more information. Ruwiki 0.9.0 has German and Spanish translations
- # available.
- #
- # == Quick Start (CGI)
- # 1. Place the Ruwiki directory in a place that your webserver can execute
- # CGI programs and ensure that ruwiki.cgi is executable on your webserver.
- # 2. Point your web browser to the appropriate URL.
- #
- # == Quick Start (WEBrick)
- # 1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
- # 2. Point your web browser to <http://localhost:8808/>.
- #
- # == Configuration
- # There are extensive configuration options available. The Ruwiki WEBrick
- # servlet offers command-line options that simplify the configuration of
- # Ruwiki without editing the servlet; use ruwiki_servlet --help for more
- # information.
- #
- # == Copyright
- # Copyright:: Copyright © 2002 - 2004, Digikata and HaloStatue, Ltd.
- # Authors:: Alan Chen (alan@digikata.com)
- # Austin Ziegler (ruwiki@halostatue.ca)
- # Licence:: Ruby's
-class Ruwiki
- ALLOWED_ACTIONS = %w(edit create)
- EDIT_ACTIONS = %w(save cancel)
- EDIT_VARS = %w(newpage version edcomment q)
- RESERVED = ['save', 'preview', 'cancel', EDIT_VARS].flatten
-
- # Returns the current configuration object.
- attr_reader :config
- # Returns the current Response object.
- attr_reader :response
- # Returns the current Request object.
- attr_reader :request
- # Returns the current Markup object.
- attr_reader :markup
- # Returns the current Backend object.
- attr_reader :backend
- # Sets the configuration object to a new configuration object.
- def config=(cc)
- raise self.message[:config_not_ruwiki_config] unless cc.kind_of?(Ruwiki::Config)
- @config = cc
- self.config!
- end
-
- def config!
- @markup.default_project = @config.default_project
- @markup.message = self.message
- end
-
- def load_config(filename)
- @config = Ruwiki::Config.read(filename)
- self.config!
- end
-
- # The message hash.
- def message
- @config.message
- end
-
- # Initializes Ruwiki.
- def initialize(handler)
- @request = handler.request
- @response = handler.response
-
- @config = Ruwiki::Config.new
-
- @path_info = @request.determine_request_path || ''
-
- @type = nil
- @error = {}
-
- @markup = Ruwiki::Wiki.new(@config.default_project,
- @request.script_url,
- @config.title)
- end
-
- # Initializes the backend for Ruwiki.
- def set_backend
- @backend = BackendDelegator.new(self, @config.storage_type)
- @markup.backend = @backend
- # Load the blacklists here because I don't as of yet know where else
- # to put them. :(
- @banned_agents = load_blacklist('agents.banned')
- @banned_hostip = load_blacklist('hostip.banned')
- @readonly_agents = load_blacklist('agents.readonly')
- @readonly_hostip = load_blacklist('hostip.readonly')
- end
-
- def load_blacklist(filename)
- data = []
- filename = File.join(@config.storage_options[@config.storage_type]['data-path'], filename)
- ii = '^'
- jj = /^#{ii}/o
- File.open(filename, 'rb') do |f|
- f.each do |line|
- line.gsub!(%r{^\s*#.*$}, '')
- line.strip!
- if line.empty?
- data << nil
- else
- if line =~ jj
- data << "(?:#{line}\n)"
- else
- data << line
- end
- end
- end
- end
- data.compact!
- if data.empty?
- nil
- else
- Regexp.new(data.join("|"), Regexp::EXTENDED)
- end
- end
-
- def check_useragent
- addr = @request.environment['REMOTE_ADDR']
- user = @request.environment['HTTP_USER_AGENT']
-
- if user.nil? or user.empty?
- :forbidden
- elsif @banned_hostip and addr and addr =~ @banned_hostip
- :forbidden
- elsif @banned_agents and user =~ @banned_agents
- :forbidden
- elsif @readonly_hostip and addr and addr =~ @readonly_hostip
- :read_only
- elsif @readonly_agents and user =~ @readonly_agents
- :read_only
- else
- :clean
- end
- end
-
- # Runs the steps to process the wiki.
- def run
- @config.verify
- set_backend
- set_page
- process_page
- render
- rescue Exception => ee
- render(:error, ee)
- ensure
- output
- end
-
- # Initializes current page for Ruwiki.
- def set_page
- path_info = @path_info.split(%r{/}, -1).map { |ee| ee.empty? ? nil : ee }
-
- if path_info.size == 1 or (path_info.size > 1 and path_info[0])
- raise self.message[:invalid_path_info_value] % [@path_info] unless path_info[0].nil?
- end
-
- # path_info[0] will ALWAYS be nil.
- path_info.shift
-
- case path_info.size
- when 0 # Safety check.
- nil
- when 1 # /PageTopic OR /_edit
- set_page_name_or_action(path_info[0])
- when 2 # /Project/ OR /Project/PageTopic OR /Project/_edit OR /Project/create
- @project = path_info.shift
- set_page_name_or_action(path_info[0])
- else # /Project/PageTopic/_edit OR /Project/diff/3,4 OR something else.
- @project = path_info.shift
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- else
- @topic = item
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- end
- end
- end
-
-# @request.each_parameter { |key, val| puts "#{key} :: #{val.class}" }
-
- @project ||= @config.default_project
- @topic ||= @config.default_page
- end
-
- PROJECT_LIST_ITEM = %[%1$s (a href='\\%2$s/%1$s/_topics' class='rw_minilink')%3$s\\</a\\>]
-
- # Processes the page through the necessary steps. This is where the edit,
- # save, cancel, and display actions are present.
- def process_page
- content = nil
- formatted = false
-
- @page = Ruwiki::Page.new(@backend.retrieve(@topic, @project))
- @type = :content
-
- agent_ok = check_useragent
- case agent_ok
- when :read_only
- @page.editable = false
- case @action
- when 'edit', 'save', 'preview', 'cancel', 'search'
- @page.indexable = false
- end
- when :forbidden
- forbidden
- return
- else
- unless @config.auth_mechanism.nil?
- @auth_token = Ruwiki::Auth[@config.auth_mechanism].authenticate(@request, @response, @config.auth_options)
- @page.editable = @auth_token.permissions['edit']
- end
- end
-
- # TODO Detect if @action has already been set.
- @action ||= @request.parameters['action'].downcase if @request.parameters['action']
- @action ||= 'save' if @request.parameters['save']
- @action ||= 'cancel' if @request.parameters['cancel']
- @action ||= 'preview' if @request.parameters['preview']
-
- unless @page.editable
- case @action
- when 'edit', 'save', 'preview', 'cancel'
- @action = 'show'
- end
- end
-
- case @action
- when 'search'
- # get, validate, and cleanse the search string
- # TODO: add empty string rejection.
- srchstr = validate_search_string(@request.parameters['q'])
- if not srchstr.nil?
- srchall = @request.parameters['a']
-
- @page.editable = false
- @page.indexable = false
-
- @page.content = self.message[:search_results_for] % [srchstr]
- @page.topic = srchstr || ""
-
- unless srchall.nil?
- hits = @backend.search_all_projects(srchstr)
- else
- hits = @backend.search_project(@page.project, srchstr)
- end
-
- # turn hit hash into content
- hitarr = []
- # organize by number of hits
- hits.each { |key, val| (hitarr[val] ||= []) << key }
-
- rhitarr = hitarr.reverse
- maxhits = hitarr.size
- rhitarr.each_with_index do |tarray, rnhits|
- next if tarray.nil? or tarray.empty?
- nhits = maxhits - rnhits - 1
-
- if nhits > 0
- @page.content << "\n== #{self.message[:number_of_hits] % [nhits]}\n* "
- @page.content << tarray.join("\n* ")
- end
- end
-
- @type = :search
- else
- @sysmessage = self.message[:no_empty_search_string] % [ @page.project, @page.topic ]
- @type = :content
- end
- when 'topics'
- if @backend.project_exists?(@page.project)
- topic_list = @backend.list_topics(@page.project)
- else
- topic_list = []
- end
-
- @page.editable = false
-
- # todo: make this localized
- if topic_list.empty?
- @page.content = self.message[:no_topics] % [@page.project]
- else
- topic_list.map! do |tt|
- uu = CGI.unescape(tt)
- if (uu != tt) or (tt =~ /^[A-Z][a-z]+$/)
- "[[#{CGI.unescape(tt)}]]"
- else
- tt
- end
- end
- @page.content = <<EPAGE
-= #{self.message[:topics_for_project] % [@page.project]}
-* #{topic_list.join("\n* ")}
-EPAGE
- end
-
- @type = :content
- when 'projects'
- proj_list = @backend.list_projects
-
- @page.editable = false
-
- if proj_list.empty?
- @page.content = self.message[:no_projects]
- else
- # TODO make this localized
- proj_list.map! { |proj| PROJECT_LIST_ITEM % [ proj, @request.script_url, self.message[:project_topics_link] ] }
- @page.content = <<EPAGE
-= #{self.message[:wiki_projects] % [@config.title]}
-* ::#{proj_list.join("\n* ::")}
-EPAGE
- end
-
- content = @page.to_html(@markup)
- content.gsub!(%r{\(a href='([^']+)/_topics' class='rw_minilink'\)}, '<a href="\1/_topics" class="rw_minilink">') #'
- content.gsub!(%r{\\&lt;}, '<')
- content.gsub!(%r{\\&gt;}, '>')
- formatted = true
- @type = :content
- when 'edit', 'create'
- # Automatically create the project if it doesn't exist or if the
- # action is 'create'.
- @backend.create_project(@page.project) if @action == 'create'
- @backend.create_project(@page.project) unless @backend.project_exists?(@page.project)
- @page.creator = @auth_token.name if @action == 'create' and @auth_token
- @page.indexable = false
- @lock = @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR']) rescue nil
-
- if @lock.nil?
- @type = :content
- @sysmessage = self.message[:page_is_locked]
- else
- content = nil
- formatted = true
- @type = :edit
- end
- when 'save', 'preview'
- np = @request.parameters['newpage'].gsub(/\r/, '').chomp
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.editor_ip = @request.environment['REMOTE_ADDR']
- @page.indexable = false
-
- save_ver = @backend.retrieve(@page.topic, @page.project)['properties']['version'].to_i
- sent_ver = @request.parameters['version'].to_i
-
- if sent_ver < save_ver
- @type = :edit
-
- np = np.split($/)
- content_diff = Diff::LCS.sdiff(np, @page.content.split($/), Diff::LCS::ContextDiffCallbacks)
- content_diff.reverse_each do |hunk|
- case hunk
- when Array
- hunk.reverse_each do |diff|
- case diff.action
- when '+'
-# np.insert(diff.old_position, "+#{diff.new_element}")
- np.insert(diff.old_position, "#{diff.new_element}")
- when '-'
- np.delete_at(diff.old_position)
-# np[diff.old_position] = "-#{diff.old_element}"
- when '!'
- np[diff.old_position] = "-#{diff.old_element}"
- np.insert(diff.old_position + 1, "+#{diff.new_element}")
- end
- end
- when Diff::LCS::ContextChange
- case hunk.action
- when '+'
- np.insert(hunk.old_position, "#{hunk.new_element}")
-# np.insert(hunk.old_position, "+#{hunk.new_element}")
- when '-'
- np.delete_at(hunk.old_position)
-# np[diff.old_position] = "-#{hunk.old_element}"
- when '!'
- np[hunk.old_position] = "-#{hunk.old_element}"
- np.insert(hunk.old_position + 1, "+#{hunk.new_element}")
- end
- end
- end
- @page.content = np.join("\n")
-
- edc = @request.parameters['edcomment']
- unless (edc.nil? or edc.empty? or edc == "*")
- @page.edit_comment = edc
- end
-
- @sysmessage = self.message[:not_editing_current_version] % [ @page.project, @page.topic ]
- else
- if @action == 'save'
- @page.editor = @auth_token.name if @auth_token
- op = @page.content
- else
- op = nil
- end
-
- if (np == op) and (@action == 'save')
- @type = :content
- else
- @page.content = np
- edc = @request.parameters['edcomment']
- unless (edc.nil? or edc.empty? or edc == "*")
- @page.edit_comment = edc
- end
-
- if @action == 'save'
- @type = :save
- @page.version = @request.parameters['version'].to_i + 1
- @backend.store(@page)
-
- # hack to ensure that Recent Changes are updated correctly
- if @page.topic == 'RecentChanges'
- recent = Ruwiki::Page.new(@backend.retrieve(@page.topic, @page.project))
- @page.content = recent.content
- end
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- else
- @type = :preview
- @lock = @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR'])
- content = nil
- formatted = true
- end
- end
- end
- when 'cancel'
-# @page.topic = @request.parameters['topic']
-# @page.project = @request.parameters['project']
-# @page.version = @request.parameters['version'].to_i
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- @type = :content
- else
- # TODO AZ: This should probably return a 501 Not Implemented or some
- # other error unless @action.nil?
- nil
- end
- content = @page.to_html(@markup) if not formatted
- rescue Exception => ee # rescue for def process_page
- @type = :error
- if ee.kind_of?(Ruwiki::Backend::BackendError)
- name = "#{self.message[:error]}: #{ee.to_s}"
- else
- name = "#{self.message[:complete_utter_failure]}: #{ee.to_s}"
- end
- @error[:name] = CGI.escapeHTML(name)
- @error[:backtrace] = ee.backtrace.map { |el| CGI.escapeHTML(el) }.join("<br />\n")
- content = nil
- ensure
- @content = content
- end # def process_page
-
- # Renders the page.
- def render(*args)
- if args.empty?
- type = @type
- error = @error
- else
- raise ArgumentError, self.message[:render_arguments] unless args.size == 2
- type = args[0]
- error = {
- :name => Ruwiki.clean_entities(args[1].inspect),
- :backtrace => args[1].backtrace.join("<br />\n")
- }
- @page = Ruwiki::Page.new(Ruwiki::Page::NULL_PAGE)
- end
-
- @rendered_page = ""
- values = {
- "css_link" => @config.css_link,
- "home_link" => %Q(<a href="#{@request.script_url}">#{@config.title}</a>),
- "cgi_url" => @request.script_url,
- "content" => @content,
- }
-
- if @page.nil?
- values["page_project"] = ""
- values["page_raw_topic"] = ""
- values["page_topic"] = ""
- values["editable"] = false
- values["indexable"] = false
- else
- values["page_project"] = @page.project
- values["page_raw_topic"] = @page.topic
- values["page_topic"] = CGI.unescape(@page.topic)
- values["editable"] = @page.editable
- values["indexable"] = @page.indexable
- end
-
- values["url_project"] = %Q(#{values["cgi_url"]}/#{values["page_project"]})
- values["url_topic_search"] = %Q(#{values["url_project"]}/_search?q=#{values["page_topic"]})
- values["link_topic_search"] = %Q(<a href='#{values["url_topic_search"]}'><strong>#{values["page_topic"]}</strong></a>)
- values["message"] = @sysmessage unless @sysmessage.nil?
-
- case type
- when :content, :save, :search
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}" if @page.nil?
- values["wiki_title"] ||= "#{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["label_topic_or_search"] = self.message[:label_topic]
- values["page_topic_name"] = values["page_topic"]
- if type == :content or type == :search
- template = TemplatePage.new(@config.template(:body), @config.template(:content), @config.template(:controls), @config.template(:footer))
- if type == :search
- values["label_topic_or_search"] = self.message[:label_search]
- else
- values["page_topic"] = values["link_topic_search"]
- end
- else
- # action type was save
- values["page_topic"] = values["link_topic_search"]
- template = TemplatePage.new(@config.template(:body), @config.template(:save), @config.template(:controls), @config.template(:footer))
- end
- when :edit, :preview
- template = TemplatePage.new(@config.template(:body), @config.template(:edit))
- values["wiki_title"] = "#{self.message[:editing]}: #{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_content"] = @page.content
- values["page_version"] = @page.version.to_s
- values["unedited_page_content"] = @page.to_html(@markup)
- values["pre_page_content"] = CGI.escapeHTML(@page.content)
- if @request.parameters["edcomment"].nil? or @request.parameters["edcomment"].empty?
- values["edit_comment"] = "*"
- else
- values["edit_comment"] = @request.parameters["edcomment"]
- end
- when :error
- template = TemplatePage.new(@config.template(:body), @config.template(:error))
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}"
- values["name"] = error[:name]
- values["backtrace"] = error[:backtrace]
- values["backtrace_email"] = error[:backtrace].gsub(/<br \/>/, '')
- values["webmaster"] = @config.webmaster
- end
-
- template.to_html(values, :messages => @config.message,
- :output => @rendered_page)
- end
-
- # Outputs the page.
- def output
- return if @response.written?
-# if @request.environment["HTTP_ACCEPT"] =~ %r{application/xhtml\+xml}
-# @response.add_header("Content-type", "application/xhtml+xml")
-# else
- @response.add_header("Content-type", "text/html")
-# end
- @response.add_header("Cache-Control", "max_age=0")
- @response.write_headers
- @response << @rendered_page
- end
-
- def forbidden
- protocol = @request.environment["SERVER_PROTOCOL"] || "HTTP/1.0"
- @response.write_status "#{protocol} 403 FORBIDDEN\nDate: #{CGI::rfc1123_date(Time.now)}\n\n"
- end
-
- # nil if string is invalid
- def validate_search_string(instr)
- return nil if instr.empty?
-
- modstr = instr.dup
-
- #TODO: add validation of modstr
- return modstr
- end
-
- def self.clean_entities(data)
- data.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;')
- end
-
-private
- RE_ACTION = %r{^_([[:lower:]]+)$}
-
- def set_page_name_or_action(item)
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- else
- @topic = item
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/auth.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/auth.rb
deleted file mode 100644
index ab4c923..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/auth.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Auth
- class << self
- def [](name)
- @delegate ||= {}
-
- if @delegate.has_key?(name)
- @delegate[name]
- else
- require "ruwiki/auth/#{name}"
- @delegate[name] = Ruwiki::Auth.const_get(name.capitalize)
- end
- end
- end
-
- class Token
- def initialize(name = nil, groups = [], permissions = {})
- @user_name = name
- @groups = groups
- @permissions = permissions
- end
-
- def found?
- not @user_name.nil?
- end
-
- def name
- @user_name
- end
-
- def member?(unix_group_name)
- @groups.include?(unix_group_name)
- end
-
- def groups
- @groups
- end
-
- def allowed?(action)
- @permission[action]
- end
-
- def permissions
- @permissions
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/auth/gforge.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/auth/gforge.rb
deleted file mode 100644
index 70895a1..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/auth/gforge.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-begin
- require 'gforge_auth'
-rescue LoadError
- class GForgeAuthenticator
- class AuthenticationResult
- def initialize(name = nil, groups = [])
- @user_name = name
- @groups = groups
- end
-
- def found?
- not @user_name.nil?
- end
-
- def user_name
- raise "No session associated with the given key was found" unless found?
- @user_name
- end
-
- def member?(unix_group_name)
- raise "No session associated with the given key was found" unless found?
- @groups.include?(unix_group_name)
- end
-
- def groups
- raise "No session associated with the given key was found" unless found?
- @groups
- end
- end
-
- def self.authenticate(sessionkey, options = {})
- sql = %Q(SELECT user_name FROM users u, user_session us WHERE us.session_hash = '#{sessionkey}' AND us.user_id = u.user_id;)
- res = %x{psql -q -t -U #{options['user']} #{options['pass']} -c \"#{sql}\"}
- rows = res.split(/\n/)
- return AuthenticationResult.new if rows.size != 1
-
- user_name = rows[0].strip
- sql = %Q(SELECT unix_group_name FROM groups g, users u, user_group ug WHERE u.user_name = '#{user_name}' AND ug.user_id = u.user_id AND g.group_id = ug.group_id)
-
- res = %x(psql -q -t -U #{options['user']} #{options['pass']} -c \"#{sql}\")
- groups = []
- res.split(/\n/).each {|row| groups << row.strip }
- AuthenticationResult.new(user_name, groups)
- end
- end
-end
-
-class Ruwiki::Auth::Gforge < Ruwiki::Auth
- def self.authenticate(request, response, options = {})
- options['user'] = options['user'].gsub!(%r{^(\w+)}, '\1')
- options['pass'] = options['pass'].gsub!(%r{^(\w+)}, '\1')
- session_key = request.cookies['session_ser'].value[0].split(%r{-\*-})[-1]
- token = GForgeAuthenticator.authenticate(session_key, options)
- token = Ruwiki::Auth::Token.new(token.user_name, token.groups)
- token.permissions.default = true if token.found?
- rescue
- token = Ruwiki::Auth::Token.new
- token.permissions.default = false
- ensure
- return token
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/backend.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/backend.rb
deleted file mode 100644
index 59947f8..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/backend.rb
+++ /dev/null
@@ -1,318 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-begin
- if defined?(Gem::Cache)
- require_gem 'diff-lcs', '~> 1.1.2'
- else
- require 'diff/lcs'
- end
-rescue LoadError => ex
- $stderr.puts ex.message
- raise
-end
-
-class Ruwiki
- # The list of known backends.
- KNOWN_BACKENDS = %w(flatfiles)
-
- # The Ruwiki backend delegator. Ruwiki will always instantiate a version
- # of this class which delegates the actual method execution to the Backend
- # class. Error handling is handled by capturing (and possibly forwarding)
- # exceptions raised by the delegate class.
- class BackendDelegator
- def initialize(ruwiki, backend)
- @message = ruwiki.config.message
- @time_format = ruwiki.config.time_format || "%H:%M:%S"
- @date_format = ruwiki.config.date_format || "%Y.%m.%d"
- @datetime_format = ruwiki.config.datetime_format || "#{@date_format} #{@time_format}"
- options = ruwiki.config.storage_options
- options['default-page'] = ruwiki.config.default_page
-
- unless Ruwiki::KNOWN_BACKENDS.include?(backend)
- raise RuntimeError, @message[:backend_unknown] % [backend]
- end
-
- beconst = backend.capitalize
-
- require "ruwiki/backend/#{backend}"
-
- beoptions = options[backend]
- @delegate = Ruwiki::Backend.const_get(beconst).new(beoptions)
- rescue Ruwiki::Backend::BackendError => ex
- if ex.kind_of?(Array)
- raise Ruwiki::Backend::BackendError.new(nil), @message[ex.reason[0]] % ex.reason[1]
- else
- raise
- end
- end
-
- # Retrieve the specified topic and project page. Calls Backend#load
- # after verifying that the project exists.
- def retrieve(topic, project = 'Default')
- unless page_exists?(topic, project)
- exported = Ruwiki::Page::NULL_PAGE.dup
- exported['properties'] = {
- 'title' => topic,
- 'topic' => topic,
- 'project' => project,
- 'create-date' => Time.now,
- 'edit-date' => Time.now,
- 'editable' => true,
- 'indexable' => true,
- 'entropy' => 0.0,
- 'html-headers' => [],
- 'version' => 0
- }
- exported['page'] = {
- 'header' => nil,
- 'footer' => nil
- }
-
- if project_exists?(project)
- exported['page']['content'] = ""
- else
- exported['page']['content'] = @message[:project_does_not_exist] % [project]
- end
- return exported
- end
-
- return @delegate.load(topic, project)
- rescue Ruwiki::Backend::InvalidFormatError => ex
- raise Ruwiki::Backend::BackendError.new(nil), @message[:page_not_in_backend_format] % [project, topic, @delegate.class]
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_read_topic] % [project, topic]
- rescue Exception => ex
- mm = [project, topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_retrieve_topic] % mm
- end
-
- # Stores the specified topic and project page.
- def store(page)
- @delegate.store(page)
-
- # update change page
- begin
- recent_changes = nil
- if (page.topic == 'RecentChanges')
- recent_changes = page.dup
- else
- recent_changes = Page.new(retrieve('RecentChanges', page.project))
- end
-
- changeline = "\n; #{page.editor_ip} (#{Time.now.strftime(@datetime_format)}), #{page.topic} : #{page.edit_comment}"
-
- # add changeline to top of page
- recent_changes.content = changeline + (recent_changes.content || "")
- @delegate.store(recent_changes)
- rescue Exception => ex
- raise "Couldn't save RecentChanges\n#{ex.backtrace}"
- end
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_store_topic] % [page.project, page.topic]
- rescue Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_store_topic] % mm
- end
-
- # Destroys the specified topic and project page.
- def destroy(page)
- @delegate.destroy(page)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_destroy_topic] % [page.project, page.topic]
- rescue Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_destroy_topic] % mm
- end
-
- # Releases the lock on the page.
- def release_lock(page, address = 'UNKNOWN')
- time = Time.now.to_i
- @delegate.release_lock(page, time, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_release_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:error_releasing_lock] % mm
- end
-
- # Attempts to obtain a lock on the page. The lock
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- time = Time.now.to_i
- expire = time + timeout
- @delegate.obtain_lock(page, time, expire, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_obtain_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:error_creating_lock] % mm
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- @delegate.project_exists?(project)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- @delegate.page_exists?(topic, project)
- end
-
- # Attempts to create the project.
- def create_project(project)
- @delegate.create_project(project)
- rescue Ruwiki::Backend::ProjectExists => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:project_already_exists] % [project]
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_create_project] % [project]
- rescue Exception => ex
- mm = [project, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_create_project] % mm
- end
-
- # Attempts to destroy the project.
- def destroy_project(project)
- @delegate.destroy_project(project)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_destroy_project] % [project]
- rescue Exception => ex
- mm = [project, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_destroy_project] % mm
- end
-
- def search_all_projects(searchstr)
- if @delegate.respond_to?(:search_all_projects)
- @delegate.search_all_projects(searchstr)
- else
- search_all_projects_default(searchstr)
- end
- end
-
- # Attempts to search all projects. This is the default
- # search_all_projects used unless the delegate implements
- # a specialized search_all_projects.
- def search_all_projects_default(searchstr)
- hits = {}
- list_projects.each do |project|
- lhits = search_project(project, searchstr)
- # Transform the keys from project local to global links.
- lhits.each { |key, val| hits["#{project}::#{key}"] = val }
- end
- hits
- end
-
- # Attempts to search a project
- def search_project(project, searchstr)
- #TODO: Validate searchstr is a safe regexp?
- @delegate.search_project(project, searchstr)
- rescue Exception => ex
- mm = [project, searchstr, ex.class, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:search_project_fail] % mm
- end
-
- # Return an array of projects
- def list_projects
- @delegate.list_projects
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_list_projects]
- rescue Exception => ex
- mm = ['', %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_list_projects] % mm
- end
-
- # Return an array of projects
- def list_topics(projname)
- @delegate.list_topics(projname)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_list_topics] % [projname]
- rescue Exception => ex
- mm = [projname, ex.message]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_list_topics] % mm
- end
- end
-
- # The Ruwiki backend abstract class and factory.
- class Backend
- class ProjectExists < RuntimeError #:nodoc:
- end
- class InvalidFormatError < RuntimeError #:nodoc:
- end
- class BackendError < RuntimeError #:nodoc:
- attr_reader :reason
-
- def initialize(reason, *args)
- if @reason.respond_to?(:message)
- @reason = reason.message
- else
- @reason = reason
- end
- end
- end
- def initialize(storage_options)
- end
-
- private
- NL_RE = %r{\n} #:nodoc:
-
- def map_diffset(diffset)
- diffset.map do |hunk|
- if hunk.kind_of?(Array)
- hunk.map { |change| change.to_a }
- else
- hunk.to_a
- end
- end
- end
-
- # Creates the current diff object. This is made from two
- # Ruwiki::Page#export hashes.
- def make_diff(oldpage, newpage)
- oldpage = oldpage.export if oldpage.kind_of?(Ruwiki::Page)
- newpage = newpage.export if newpage.kind_of?(Ruwiki::Page)
-
- diff = Hash.new
-
- newpage.keys.sort.each do |sect|
- newpage[sect].keys.sort.each do |item|
- oldval = oldpage[sect][item]
- newval = newpage[sect][item]
-
- case [sect, item]
- when ['properties', 'html-headers']
- # Protect against NoMethodError.
- oldval ||= []
- newval ||= []
- val = Diff::LCS.sdiff(oldval, newval, Diff::LCS::ContextDiffCallbacks)
- when ['ruwiki', 'content-version'], ['properties', 'version'],
- ['properties', 'entropy']
- val = Diff::LCS.sdiff([oldval], [newval], Diff::LCS::ContextDiffCallbacks)
- when ['properties', 'create-date'], ['properties', 'edit-date']
- val = Diff::LCS.sdiff([oldval.to_i], [newval.to_i], Diff::LCS::ContextDiffCallbacks)
- else
- # Protect against NoMethodError.
- val = Diff::LCS.sdiff(oldval.to_s.split(NL_RE), newval.to_s.split(NL_RE), Diff::LCS::ContextDiffCallbacks)
- end
-
- (diff[sect] ||= {})[item] = map_diffset(val) unless val.nil? or val.empty?
- end
- end
-
- diff_hash = {
- 'old_version' => oldpage['properties']['version'],
- 'new_version' => newpage['properties']['version'],
- 'edit-date' => newpage['properties']['edit-date'].to_i,
- 'editor-ip' => newpage['properties']['editor-ip'],
- 'editor' => newpage['properties']['editor'],
- 'diff' => diff
- }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/backend/flatfiles.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/backend/flatfiles.rb
deleted file mode 100644
index 7194095..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/backend/flatfiles.rb
+++ /dev/null
@@ -1,217 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Flatfiles < Ruwiki::Backend
- # Initializes the Flatfiles backend. The known options for the Flatfiles
- # backend are documented below.
- #
- # data-path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # format:: The format of the files in the backend. By default,
- # this is 'exportable', a tagged data format produced by
- # Ruwiki::Exportable; alternative formats are 'yaml'
- # (::YAML.dump) and 'marshal' (::Marshal.dump).
- # default-page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- @data_path = options['data-path'] || File.join(".", "data")
- @extension = options['extension']
- @format = case options['format']
- when 'exportable', nil
- Ruwiki::Exportable
- when 'yaml'
- ::YAML
- when 'marshal'
- ::Marshal
- end
-
- if @extension.nil?
- @extension_re = /$/
- else
- @extension_re = /\.#{@extension}$/
- end
-
- @default_page = options['default-page'] || "ProjectIndex"
- if not (File.exists?(@data_path) and File.directory?(@data_path))
- raise Ruwiki::Backend::BackendError.new([:flatfiles_no_data_directory, [@data_path]])
- end
-
- super
- end
-
- # Destroys the topic page.
- def destroy(page)
- pf = page_file(page.topic, page.project)
- File.unlink(pf) if File.exists?(pf)
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- pd = project_directory(project)
- File.exists?(pd) and File.directory?(pd)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- pf = page_file(topic, project)
- project_exists?(project) and File.exists?(pf)
- end
-
- # Tries to create the project.
- def create_project(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::ProjectExists if File.exists?(pd)
- Dir.mkdir(pd)
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # String search all topic names and content in a project and
- # return a hash of topic hits.
- def search_project(project, searchstr)
- re_search = Regexp.new(searchstr, Regexp::IGNORECASE)
-
- hits = Hash.new { |hh, kk| hh[kk] = 0 }
- topic_list = list_topics(project)
-
- return hits if topic_list.empty?
-
- # search topic content
- topic_list.each do |topic|
- # search name
- hits[topic] += topic.scan(re_search).size
-
- # check content
- page = load(topic, project) rescue Ruwiki::Page::NULL_PAGE
- page['page'].each_value do |item|
- item = item.join("") if item.kind_of?(Array)
- item ||= ""
- hits[topic] += item.scan(re_search).size
- end
- end
-
- hits
- end
-
- def lock_okay?(page, time, address = 'UNKNOWN')
- lockokay = false
- lockfile = "#{page_file(page.topic, page.project)}.lock"
-
- if File.exists?(lockfile)
- data = File.read(lockfile).split(%r{!})
- # If the lock belongs to this address, we don't care how old it is.
- # Thus, release it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lockokay = true
- end
- end
-
- # Attempts to obtain a lock on the topic page. This must return the lock
- def obtain_lock(page, time, expire, address = 'UNKNOWN')
- lock = "#{address}!#{expire}"
-
- if lock_okay?(page, time, address)
- File.open("#{page_file(page.topic, page.project)}.lock", 'wb') { |lfh| lfh.puts lock }
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- lock
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, time, address = 'UNKNOWN')
- time = Time.now.to_i
- lockfile = "#{page_file(page.topic, page.project)}.lock"
-
- if lock_okay?(page, time, address)
- File.unlink(lockfile) if File.exists?(lockfile)
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- true
- end
-
- # list projects found in data path
- def list_projects
- Dir[File.join(@data_path, "*")].select do |dd|
- File.directory?(dd) and File.exist?(page_file(@default_page, File.basename(dd)))
- end.map { |dd| File.basename(dd) }
- end
-
- # list topics found in data path
- def list_topics(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::BackendError.new(:no_project) unless File.exist?(pd)
-
- Dir[File.join(pd, "*")].select do |ff|
- ff !~ /\.rdiff$/ and ff !~ /\.lock$/ and File.file?(ff) and ff =~ @extension_re
- end.map { |ff| File.basename(ff).sub(@extension_re, "") }
- end
-
- def project_directory(project) # :nodoc:
- File.join(@data_path, project)
- end
-
- def page_file(topic, project = 'Default') # :nodoc:
- if @extension.nil?
- File.join(project_directory(project), topic)
- else
- File.join(project_directory(project), "#{topic}.#{@extension}")
- end
- end
-
- def make_rdiff(page_file, new_page)
- diff_file = "#{page_file}.rdiff"
-
- old_page = self.class.load(pf) rescue Ruwiki::Page::NULL_PAGE
-
- diffs = []
- File.open(diff_file, 'rb') { |ff| diffs = Marshal.load(ff) } if File.exists?(diff_file)
- diffs << make_diff(old_page, new_page)
- changes = Marshal.dump(diffs)
-
- File.open(diff_file, 'wb') { |ff| ff << changes }
- end
-
- # Provides a HEADER marker.
- # Loads the topic page from disk.
- def load(topic, project)
- data = nil
- File.open(page_file(topic, project), 'rb') { |ff| data = ff.read }
-
- Ruwiki::Page::NULL_PAGE.merge(@format.load(data))
- rescue Ruwiki::Exportable::InvalidFormatError, TypeError, ArgumentError
- raise Ruwiki::Backend::InvalidFormatError
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = @format.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |ff| ff.puts newpage }
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/config.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/config.rb
deleted file mode 100644
index d01dca1..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/config.rb
+++ /dev/null
@@ -1,244 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # Ruwiki configuration.
-class Ruwiki::Config
- include Ruwiki::Exportable
-
- CONFIG_NAME = 'ruwiki.conf'
-
- exportable_group 'ruwiki-config'
- # Sets or returns the logger. The logger, if set, must respond to the same
- # methods as WEBrick::Logger.
- attr_accessor :logger
- # Sets or returns the time format whenever time is outputted in Ruwiki.
- # Default is <tt>%H:%M:%S</tt> (23:59:59).
- attr_accessor :time_format
- exportable :time_format
- # Sets or returns the date format whenever time is outputted in Ruwiki.
- # Default is <tt>%Y.%m.%d</tt> (2004.08.04).
- attr_accessor :date_format
- exportable :date_format
- # Sets or returns the date-time format whenever time is outputted in
- # Ruwiki. Default is <tt>%Y.%m.%d %H:%M:%S</tt> (2004.08.04 23:59:59).
- attr_accessor :datetime_format
- exportable :datetime_format
- # Adds additional information to the (rare) error reports. Defaults to
- # +false+.
- attr_accessor :debug
- exportable :debug
- # The default page for display when Ruwiki is called without any arguments.
- # Defaults to +ProjectIndex+
- attr_accessor :default_page
- exportable :default_page
- # The default project for display when Ruwiki is called without any
- # arguments or a project specification. Defaults to +Default+
- attr_accessor :default_project
- exportable :default_project
- # The authentication mechanism name as a String. Corresponds to
- # a filename that will be found in ruwiki/auth. The authenticator must
- # have a single class method, +authenticate+, which accepts the
- # +request+, the +response+, and the +#auth_options+. This API is
- # a draft API and is likely to change in future versions of Ruwiki. In
- # this version of Ruwiki, only one authentication mechanism will be
- # found -- for dealing with authenticating users already logged into
- # RubyForge.
- attr_accessor :auth_mechanism
- exportable :auth_mechanism
- # Options for the authentication mechanism as a Hash. This will be
- # passed to the authenticator defined in +#auth_mechanism+.
- attr_accessor :auth_options
- exportable :auth_options
- # The storage type as a String. Corresponds to a filename that will be
- # found in ruwiki/backend. NOTE: The yaml and marshal storage types have
- # been removed from Ruwiki 0.9.0, to be replaced with a single storage
- # type of Flatfiles. Now, the YAML and Marshal formats can be enabled by
- # setting options in the @storage_options field.
- attr_accessor :storage_type
- exportable :storage_type
- # The options for the specified storage type. This is a hash of hashes with
- # auto-vifification. See the storage type for available options.
- attr_reader :storage_options
- exportable :storage_options
- # The path for templates. Defaults to <tt>./templates/</tt>.
- attr_accessor :template_path
- exportable :template_path
- # The name of the Wiki. Defaults to <tt>ruwiki</tt>
- attr_accessor :title
- exportable :title
- # The email address of the webmaster for the Wiki. Defaults to +nil+.
- attr_accessor :webmaster
- exportable :webmaster
- # The name of the Ruwiki CSS file. Defaults to <tt>ruwiki.css</tt>.
- attr_accessor :css
- exportable :css
- # The template set. Templates are always named as
- # <template_path>/<template_set>/<template_name>. Template filename. Must
- # be reachable by File#read.
- attr_accessor :template_set
- exportable :template_set
- # Ruwiki is internationalized. This method sets the Ruwiki error
- # messages (and a few other messages) to the specified language Module.
- # The language Module must have a constant Hash called +Message+
- # containing a set of symbols and localized versions of the messages
- # associated with them.
- #
- # If the file 'ruwiki/lang/es.rb' contains the module
- # <tt>Ruwiki::Lang::ES</tt>, the error messages for RSS could be
- # localized to Español thus:
- #
- # require 'ruwiki/lang/es'
- # ...
- # wiki.config.language = Ruwiki::Lang::ES
- #
- # Localization is per wiki instance. In a servlet environment, this may
- # mean that only a single language is recognised.
- #
- # See Ruwiki::Lang::EN for more information.
- attr_accessor :language
- exportable :language
- # The message hash.
- attr_reader :message
-
- def language=(ll) #:nodoc:
- if ll.kind_of?(String)
- @language = Ruwiki::Lang::const_get(ll.upcase)
- else
- @language = ll
- end
- @message = @language::Message
- end
-
- # Returns the specified template as a string.
- def template(name)
- File.read(File.join(@template_path, @template_set, "#{name.to_s}.tmpl"))
- rescue Errno::ENOENT
- raise ConfigError, message[:no_template_found] % [name.inspect, @template_set]
- end
-
- # Returns the CSS stylesheet content for the Wiki. This previously
- # returned the <link> to the stylesheet, but instead returns a <style>
- # block in the head so that the CSS is kept with the template set, which
- # may be kept outside of the HTML area.
- def css_link
- %Q[<style type="text/css" media="screen,print">#{File.read(File.join(@template_path, @template_set, @css))}</style>]
- end
-
- # Creates a new configuration object.
- def initialize(exportable = {})
- rc = exportable['ruwiki-config'] || {}
- @debug = (rc['debug'] == "false") ? false : true
- @default_project = rc['default-project'] || "Default"
- @default_page = rc['default-page'] || "ProjectIndex"
- @auth_mechanism = rc['auth-mechanism'] || nil
-
- case rc['auth-options']
- when nil, ""
- @auth_options = {}
- else
- @auth_options = Ruwiki::Exportable.load(rc['auth-options'])['default']
- end
-
- case rc['storage-type']
- when nil, ""
- @storage_type = 'flatfiles'
- else
- @storage_type = rc['storage-type']
- end
-
- # in 'type!name:<Tab>value\n' format.
- if rc['storage-options'].nil? or rc['storage-options'].empty?
- @storage_options = Hash.new { |hh, kk| hh[kk] = {} }
- else
- @storage_options = Ruwiki::Exportable.load(rc['storage-options'])
- @storage_options.keys.each do |key|
- @storage_options[key] = @storage_options.delete(key)
- end
- end
- if @storage_options.empty?
- @storage_options[@storage_type]['extension'] = "ruwiki"
- @storage_options[@storage_type]['data-path'] = "./data"
- @storage_options[@storage_type]['format'] = "exportable"
- end
-
- @storage_options.each_value do |vv|
- if vv['extension'].nil? or vv['extension'].empty?
- vv['extension'] = "ruwiki"
- end
- if vv['data-path'].nil? or vv['data-path'].empty?
- vv['data-path'] = "./data"
- end
- end
-
- @template_path = rc['template-path'] || "./templates/"
- @template_set = rc['template-set'] || "default"
- @css = rc['css'] || "ruwiki.css"
- @webmaster = rc['webmaster']
- @title = rc['title'] || "Ruwiki"
- @time_format = rc['time-format'] || "%H:%M:%S"
- @date_format = rc['date-format'] || "%Y.%m.%d"
- @datetime_format = rc['datetime-format'] || "#{@date_format} #{@time_format}"
- case rc['language']
- when nil, ""
- self.language = Ruwiki::Lang::EN
- else
- self.language = Ruwiki::Lang::const_get(rc['language'].upcase)
- end
- end
-
- # Verifies that required configuration options are actually set. Right
- # now, it only checks the values that are defaulted to +nil+.
- def verify
- raise ConfigError, message[:no_webmaster_defined] if @webmaster.nil? or @webmaster.empty?
- raise ConfigError, message[:invalid_template_dir] % [@template_path] unless File.exists?(@template_path) and File.directory?(@template_path)
- tt = File.join(@template_path, @template_set)
- raise ConfigError, message[:no_template_set] % [@template_set] unless File.exists?(tt) and File.directory?(tt)
- end
-
- # Provides the canonical export hash.
- def export
- exportable = super
-
- rc = exportable['ruwiki-config']
-
- rc['auth-options'] = Ruwiki::Exportable.dump({ 'default' => rc['auth-options']})
-
- rc['storage-options'] = Ruwiki::Exportable.dump(rc['storage-options'])
- rc['storage-type'] = rc['storage-type'].to_s
- rc['language'] = "#{rc['language']}".sub(/^.*?::([A-Z]+)$/, '\1').downcase
- exportable
- end
-
- class << self
- def write(file, config)
- if file.respond_to?(:write)
- file.puts(config.dump)
- else
- File.open(file, 'wb') { |ff| ff.puts(config.dump) }
- end
- end
-
- def read(file)
- data = nil
- if file.respond_to?(:read)
- data = file.read
- else
- File.open(file, 'rb') { |ff| data = ff.read }
- end
- hash = Ruwiki::Exportable.load(data)
-
- Ruwiki::Config.new(hash)
- end
- end
-
- class ConfigError < StandardError; end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/exportable.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/exportable.rb
deleted file mode 100644
index c18290f..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/exportable.rb
+++ /dev/null
@@ -1,192 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # == Synopsis
- # Generalises a marshaling format that is easily read and edited by humans
- # and is relatively easy to manage by software. When an attribute is marked
- # #exportable, the name of the attribute is transformed and stored in
- # a two-level hash, e.g.:
- #
- # exportable_group 'group1'
- # exportable :var_1
- # exportable :var_2
- # exportable_group 'group2'
- # exportable :var_3
- # exportable :var_4
- #
- # Results in an exportable hash of:
- #
- # { 'group1' =>
- # { 'var-1' => @var1,
- # 'var-2' => @var2, },
- # 'group2' =>
- # { 'var-3' => @var3,
- # 'var-4' => @var4, }, }
- #
-module Ruwiki::Exportable
- class InvalidFormatError < RuntimeError; end
-
- class << self
- # Adds two methods and an attribute to the class that is including Exportable
- #
- # <tt>__exportables</tt>:: Contains the list of exportable symbols by group.
- # <tt>exportable_group</tt>:: Defines the current group for exportable
- # symbols. Default is 'default'.
- # <tt>exportable</tt>:: Accepts two arguments, the attribute being
- # exported and an option hash, containing the
- # values :name and :group, where :name
- # indicates the name of the attribute (so
- # that the default name transformation is
- # not applied) and :group overrides the
- # current #exportable_group. By default, the
- # name of the attribute is transformed such
- # that underscores are converted to dashes
- # (<tt>var_1</tt> becomes 'var-1').
- def append_features(mod)
- super
-
- class << mod
- attr_reader :__exportables
-
- define_method(:exportable_group) do |name|
- @__exportable_group = name || 'default'
- end
-
- define_method(:exportable) do |*symset|
- symbol = symset.shift
- options = symset.shift || {}
-
- @__exportables ||= {}
-
- options[:name] ||= symbol.to_s.gsub(/_/, '-')
- options[:group] ||= @__exportable_group || 'default'
-
- @__exportables[options[:group]] ||= {}
- @__exportables[options[:group]][options[:name]] = "@#{symbol.to_s}".intern
- end
- end
- end
-
- # Looks for comments. Comments may ONLY be on single lines.
- COMMENT_RE = %r{^#}
- # Looks for newlines
- NL_RE = %r{\n}
- # Looks for a line that indicates an exportable value. See #dump.
- HEADER_RE = %r{^([a-z][-a-z]+)!([a-z][-a-z]+):[ \t](.*)$}
- # Looks for an indented group indicating that the last group is
- # a multiline value.
- FIRST_TAB = %r{^[ \t]}
-
- # Dumps the provided exportable hash in the form:
- #
- # section!name:<Tab>Value
- # section!name:<Space>Value
- #
- # Multiline values are indented either one space or one tab:
- #
- # section!name:<Tab>Value Line 1
- # <Tab>Value Line 2
- # <Tab>Value Line 3
- # <Tab>Value Line 4
- #
- # All values in the exportable hash are converted to string
- # representations, so only values that can meaningfully be reinstantiated
- # from string representations should be stored in the exportable hash. It
- # is the responsibility of the class preparing the exportable hash
- # through Exportable#export to make the necessary transformations.
- def dump(export_hash)
- dumpstr = ""
-
- export_hash.keys.sort.each do |sect|
- export_hash[sect].keys.sort.each do |item|
- val = export_hash[sect][item].to_s.split(NL_RE).join("\n\t")
- dumpstr << "#{sect}!#{item}:\t#{val}\n"
- end
- end
-
- dumpstr
- end
-
- # Loads a buffer in the form provided by #dump into an exportable hash.
- # Skips comment lines.
- def load(buffer)
- hash = {}
- return hash if buffer.nil? or buffer.empty?
-
- # Split the buffer and eliminate comments.
- buffer = buffer.split(NL_RE).delete_if { |line| line =~ COMMENT_RE }
-
- if HEADER_RE.match(buffer[0]).nil?
- raise Ruwiki::Exportable::InvalidFormatError
- end
-
- sect = item = nil
-
- buffer.each do |line|
- line.chomp!
- match = HEADER_RE.match(line)
-
- # If there is no match, add the current line to the previous match.
- # Remove the leading \t, though.
- if match.nil?
- raise Ruwiki::Exportable::InvalidFormatError if FIRST_TAB.match(line).nil?
- hash[sect][item] << "\n#{line.gsub(FIRST_TAB, '')}"
- else
- sect = match.captures[0]
- item = match.captures[1]
- hash[sect] ||= {}
- hash[sect][item] = match.captures[2]
- end
- end
-
- hash
- end
- end
-
- # Converts #exportable attributes to an exportable hash, in the form:
- # { 'group1' =>
- # { 'var-1' => @var1,
- # 'var-2' => @var2, },
- # 'group2' =>
- # { 'var-3' => @var3,
- # 'var-4' => @var4, }, }
- #
- # Classes that #include Exportable are encouraged to override export to
- # ensure safe transformations of values. An example use might be:
- #
- # class TimeClass
- # include Ruwiki::Exportable
- #
- # def export
- # sym = super
- #
- # sym['default']['time'] = sym['default']['time'].to_i
- # sym
- # end
- #
- # In this way, the 'time' value is converted to an integer rather than the
- # default string representation.
- def export
- sym = {}
-
- self.class.__exportables.each do |group, gval|
- gname = group || @__exportable_group || 'default'
- gsym = {}
- gval.each do |name, nval|
- val = self.instance_variable_get(nval)
- gsym[name] = val unless val.nil?
- end
- sym[gname] = gsym
- end
-
- sym
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/handler.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/handler.rb
deleted file mode 100644
index c6a9375..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/handler.rb
+++ /dev/null
@@ -1,342 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Handler
- class << self
- # Generate a new Handler pair from a CGI request.
- def from_cgi(cgi, output_stream = $stdout)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::CGIRequest.new(cgi)
- o.response = Ruwiki::Handler::CGIResponse.new(cgi, output_stream)
- end
- end
-
- # Generate a new Handler pair from a WEBrick request.
- def from_webrick(req, res)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::WEBrickRequest.new(req)
- o.response = Ruwiki::Handler::WEBrickResponse.new(res)
- end
- end
- end
-
- # Returns the handler's request object.
- attr_accessor :request
- # Returns the handler's response object.
- attr_accessor :response
-
- # Creates the handler pair.
- def initialize(&block) #:yields: self
- @request = nil
- @response = nil
- yield self if block_given?
- end
-
- # Essentially a clone of WEBrick::Cookie for use with Ruwiki.
- class Cookie
- attr_reader :name
- attr_accessor :value
- attr_accessor :version
-
- FIELDS = %w(domain path secure comment max_age expires)
-
- FIELDS.each { |field| attr_accessor field.intern }
-
- def initialize(name, value)
- @name = name
- @value = value
- @version = 0 # Netscape Cookie
-
- FIELDS.each { |field| instance_variable_set("@#{field}", nil) }
-
- yield self if block_given?
- end
-
- def expires=(t) #:nodoc:
- @expires = if t.nil? or t.kind_of?(Time)
- t
- else
- Time.parse(t.to_s)
- end
- end
-
- def to_s
- ret = "#{@name}=#{@value}"
- ret << "; Version=#{@version.to_s}" if @version > 0
- ret << "; Domain=#{@domain}" if @domain
- ret << "; Expires=#{CGI::rfc1123_date(@expires)}" if @expires
- ret << "; Max-Age=#{CGI::rfc1123_date(@max_age)}" if @max_age
- ret << "; Comment=#{@comment}" if @comment
- ret << "; Path=#{@path}" if @path
- ret << "; Secure" if @secure
- ret
- end
- end
-
- # Represents an abstract incoming request. This insulates the rest of
- # the code from knowing whether parameters are passed as part of the
- # path, as parameters in the URL, or in some other fashion.
- class AbstractRequest
- def initialize(*args)
- end
- end
-
- # Handles all requests from web applications.
- #
- # Subclasses should provide:
- # @parameters:: Hash-like object that responds to #[] and #hash_key?]
- # @environment:: Hash-like object that responds to #[]
- class AbstractWebRequest < AbstractRequest
- # The parameters provided via the web request.
- attr_reader :parameters
- # The environment provided to the web request.
- attr_reader :environment
- # The request path.
- attr_reader :path
-
- # The list of cookies.
- attr_reader :cookies
-
- def each_parameter #:yields parameter, value:
- @parameters.each { |kk, vv| yield kk, vv }
- end
-
- def each_environment #:yields variable, value
- @environment.each { |kk, vv| yield kk, vv }
- end
-
- def each_cookie #:yields name, value:
- @cookies.each { |kk, vv| yield kk, vv }
- end
-
- # Return the URL of our server.
- def server_url
- res = "http://" # should detect whether we're in secure server mode.
- if @environment['HTTP_HOST']
- res << @environment['HTTP_HOST']
- else
- res << "#{@environment['SERVER_NAME']}:#{@environment['SERVER_PORT']}"
- end
- end
-
- # Return the URL of this script.
- def script_url
- server_url << @environment['SCRIPT_NAME'].to_s
- end
-
- # Return the URL of this request.
- def request_url
- res = script_url
- res << @environment['PATH_INFO'] if @environment['PATH_INFO']
- query = @environment['QUERY_STRING']
- res << "?#{@environment['QUERY_STRING']}" if query && !query.empty?
- res
- end
-
- # Convert a file path into a URL
- def make_url(project, path)
- "#{server_url}/#{project}/#{path}"
- end
-
- def determine_request_path
- @path = ""
- return @path if @environment['PATH_INFO'].nil?
- @path = @environment['PATH_INFO'].dup
- end
- end
-
- # Request for CGI-based activity to ruwiki.
- class CGIRequest < AbstractWebRequest
- def initialize(cgi, output_stream = $stdout)
- @environment = ENV
- @cgi = cgi
- @parameters = {}
- cgi.params.each { |kk, vv| @parameters[kk] = vv[0] }
- @cookies = {}
- cgi.cookies.each do |name, cookie|
- @cookies[name] = Ruwiki::Handler::Cookie.new(name, cookie.value) do |oc|
- oc.version = cookie.version if cookie.respond_to?(:version)
- oc.domain = cookie.domain
- oc.path = cookie.path
- oc.secure = cookie.secure
- oc.comment = cookie.comment if cookie.respond_to?(:comment)
- oc.expires = cookie.expires
- end
- end
- super
- end
- end
-
- # Request for WEBrick based servlet activity to ruwiki.
- class WEBrickRequest < AbstractWebRequest
- def initialize(req)
- @environment = req.meta_vars
- @parameters = req.query
- @cookies = {}
- req.cookies.each do |rqc|
- @cookies[rqc.name] = Ruwiki::Handler::Cookie.new(rqc.name, rqc.value) do |oc|
- oc.version = rqc.version
- oc.domain = rqc.domain
- oc.path = rqc.path
- oc.secure = rqc.secure
- oc.comment = rqc.comment
- oc.expires = rqc.expires
- oc.max_age = rqc.max_age
- end
- end
- super
- end
- end
-
- # Used to write responses in different execution environments such as
- # CGI and Webrick.
- #
- # If you want to create a new response object, you'll need to implement
- # #add_header, #write_headers, #write_cookies, and #<<.
- #
- # The Response object is instantiated with an output stream which must
- # supply +<<+ and +puts+ methods.
- class AbstractResponse
- # Add to the list of headers to be sent back to the client.
- def add_header(key, value)
- raise "Not implemented"
- end
-
- # Write the accumulated headers back to the client.
- def write_headers
- raise "Not implemented"
- end
-
- # Write the string to the client.
- def <<(string)
- raise "Not implemented"
- end
-
- def add_cookies(*cookies)
- cookies.each do |cookie|
- @cookies << cookie
- end
- end
-
- def write_cookies
- raise "Not implemented"
- end
-
- # output_stream must respond to #<< and #puts.
- def initialize(output_stream = $stdout)
- @headers = {}
- @cookies = []
- @written = false
- @status = nil
- @output_stream = output_stream
- end
-
- def written?
- @written
- end
- end
-
- # CGIResponse is the response object for CGI mode.
- class CGIResponse < AbstractResponse
- # output_stream must respond to #<< and #puts.
- def initialize(cgi, output_stream = $stdout)
- @cgi = cgi
- @done = {
- :headers => false,
- :cookies => false,
- :body => false
- }
- super(output_stream)
- end
-
- # Add the header pair for later output as a CGI header.
- def add_header(key, value)
- @headers[key] = value
- end
-
- # Write the headers to the stream. The headers can only be written
- # once.
- def write_headers
- return if @done[:headers]
- @headers.each { |key, value| @output_stream.puts "#{key}: #{value}\r\n" }
- write_cookies
- @output_stream.puts
- @done[:headers] = true
- end
-
- # Write the cookies to the stream. The cookies can only be written
- # once.
- def write_cookies
- return if @done[:cookies]
- @cookies.each do |cookie|
- @output_stream.puts "Set-Cookie: #{cookie.to_s}"
- end
- @done[:cookes] = true
- end
-
- # Output the string to the stream provided.
- def <<(string)
- @output_stream << string
- @written = true
- end
-
- def write_status(status)
- unless status.nil?
- @output_stream << status
- @written = true
- end
- end
- end
-
- # WEBrickResponse is the response object for WEBrick servlet mode.
- class WEBrickResponse < AbstractResponse
- def initialize(webrick_response)
- @response = webrick_response
- @cookies = []
- @done = {
- :headers => false,
- :cookies => false,
- :body => false
- }
- end
-
- def add_header(key, value)
- @response[key] = value
- end
-
- # Copy the cookies into the WEBrick::HTTPResponse cookies array.
- def write_cookies
- return if @done[:cookies]
- @cookies.each do |cookie|
- @response.cookies << cookie.to_s
- end
- @done[:cookes] = true
- end
-
- def write_headers
- write_cookies
- # Webrick will take care of this on its own.
- end
-
- def <<(string)
- @response.body << string.to_s
- @written = true
- end
-
- def write_status(status)
- unless status.nil?
- match = %r{^HTTP/(?:\d|\.)+ (\d+) .*}.match(status)
- @response.status = match.captures[0]
- @response.body << status
- @written = true
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/lang/de.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/lang/de.rb
deleted file mode 100644
index b9db0ef..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/lang/de.rb
+++ /dev/null
@@ -1,339 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Translation by Christian Neukirchen (chneukirchen@yahoo.de) on 22oct2003
-# Updated by Christian Neukirchen (purl.org/net/chneukirchen) on 27aug2004
-# Updated by Christian Neukirchen (purl.org/net/chneukirchen) on 09nov2004
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::DE is the German-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module DE
- Message = Hash.new { |hh, kk| hh[kk] = "Sprachdatei-FEHLER: Unbekannter Nachrichten-Typ #{k.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Unbekanntes Backend %1$s.",
- :cannot_create_project => "Kann %1$s nicht erstellen: %2$s",
- :cannot_destroy_project => "Kann %1$s nicht zerstören: %2$s",
- :cannot_destroy_topic => "Kann %1$s::%2$s nicht zerstören: %3$s",
- :cannot_obtain_lock => "Kann keine Sperre für %1$s::%2$s erhalten. Bitte in Kürze nochmal versuchen.",
- :cannot_release_lock => "Kann die Sperre für %1$s::%2$s nicht lösen. Bitte später nochmal versuchen.",
- :cannot_retrieve_topic => "Kann auf %1$s::%2$s nicht zugreifen: %3$s",
- :cannot_store_topic => "Kann %1$s::%2$s nicht speichern: %3$s",
- :cannot_list_topics => "Kann Themen für Projekt %1$s nicht auflisten: %2$s",
- :error_creating_lock => "Fehler beim Erzeugen der Sperre von %1$s::%2$s: %3$s",
- :error_releasing_lock => "Fehler beim Lösen der Sperre von %1$s::%2$s: %3$s",
- :flatfiles_no_data_directory => "Das Daten-Verzeichnis (%1$s) existiert nicht.",
- :no_access_list_projects => "Keine Berechtigung zum Auflisten der Projekte.",
- :no_access_list_topics => "Keine Berechtigung zum Auflisten der Themen von Projekt %1$s.",
- :no_access_to_create_project => "Keine Berechtigung um Projekt %1$s zu erzeugen.",
- :no_access_to_destroy_project => "Keine Berechtigung um Projekt %1$s zu zerstören.",
- :no_access_to_destroy_topic => "Keine Berechtigung um Thema %1$s::%2$s zu zerstören.",
- :no_access_to_read_topic => "Keine Berechtigung um Thema %1$s::%2$s zu lesen.",
- :no_access_to_store_topic => "Keine Berechtigung um Thema %1$s::%2$s zu speichern.",
- :page_not_in_backend_format => "%1$s::%2$s ist in einem von Backend %3$s nicht unterstütztem Format.",
- :project_already_exists => "Project %1$s existiert bereits.",
- :project_does_not_exist => "Project %1$s existiert nicht.",
- :search_project_fail => "Suche in Projekt %1$s nach Zeichenkette %2$s gescheitert.",
- :yaml_requires_182_or_higher => "YAML-Flatfile-Support existiert nur für Ruby 1.8.2 oder höher.",
- :not_editing_current_version => <<EOM ,
-Sie haben eine alte Version von %1$s::%2$s abgeschickt. Die Unterschiede
-zwischen ihrer und der jetzigen Version wurden kombiniert. Konfliktierende
-Zeilen zeigen beide Zeilen. Bitte gehen sie sicher, dass sie die gesammte
-Seite bearbeitet haben bevor sie nochmals speichern.
-EOM
- :no_empty_search_string => <<EOM ,
-Das Suchfeld darf nicht leer sein. Bitte etwas eingeben bevor der Suchknopf
-gedrückt wird.
-EOM
- :page_is_locked => "Die Seite ist bereits zur Bearbeitung gesperrt. Bitte warte ein paar Minuten und versuche es dann noch ein mal.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Die Konfiguration muss von Typ der Klasse Ruwiki::Config sein.",
- :invalid_template_dir => "Der angegebene Pfad für Schablonen (%1$s) existiert nicht oder ist kein Verzeichnis.",
- :no_template_found => "Keine Schablone %1$s im Schablonen-Set '%2$s' gefunden.",
- :no_template_set => "Es gibt kein Schablonen-Set '%1$s' im Schablonen-Pfad.",
- :no_webmaster_defined => "Konfigurations-Fehler: Kein Webmaster definiert.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fataler Fehler",
- :editing => "Editieren",
- :error => "Fehler",
- :invalid_path_info_value => "Fataler Fehler in der Web-Umgebung. PATH_INFO = %1$s",
- # Should this really get translated? --chris
- :render_arguments => "Ruwiki#render muss mit zwei oder mehr Argumenten aufgerufen werden.",
- :unknown_feature => "Unbekanntes Feature %1$s.",
- :topics_for_project => "Themen for Projekt ::%1$s",
- :project_topics_link => "(Themen)",
- :wiki_projects => "Projekte in %1$s",
- :no_projects => "Keine Projekte bekannt.",
- :no_topics => "Keine Themen in Projekt %1$s.",
- :search_results_for => "= Suchergebnisse für: %1$s",
- :number_of_hits => "%d Treffer",
-
- # Labels
- :label_search_project => "Durchsuche Projekt",
- :label_search_all => "Alles",
- :label_search => "Suche: ",
- :label_project => "Projekt: ",
- :label_topic => "Thema: ",
- :label_edit => "Editieren",
- :label_recent_changes => "Aktuelle Änderungen",
- :label_topics => "Themen",
- :label_projects => "Projekte",
- :label_editing => "Editieren",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Anmerkung: ",
- :label_comment_accelerator => "R",
- :label_save => "Speichern",
- :label_save_accelerator => "S",
- :label_cancel => "Abbrechen",
- :label_cancel_accelerator => "A",
- :label_preview => "Vorschau",
- :label_preview_accelerator => "V",
- :label_original_text => "Ursprüngliche Version",
- :label_raw => "Formatfrei",
- :label_formatted => "Formatiert",
- :label_send_report_by => "Schicken Sie dem Webmaster einen Report via Email.",
- :label_send_report => "Report schicken.",
- :label_saved_page => "Gespeicherte Seite: ",
-
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Benutzung: %1$s [Optionen] <Verzeichnis>+",
- :converter_format_desc => [ "Konvertiert gefundene Dateien (Jetziges",
- "Format egal) in das angegebene Format",
- "Standard ist flatfiles. Erlaubte",
- "Formate sind: yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Erzeugt Backups der aktualisierten",
- "Dateien. Standard ist --backup." ],
- :converter_backupext_desc => [ 'Gibt die Backup-Erweiterung an. Standard',
- 'ist "~", das dem Datendateinamen',
- 'angehängt wird.' ],
- :converter_backupext_error => "Die Backup-Erweiterung darf nicht leer sein.",
- :converter_extension_desc => [ "Gibt die Erweiterung der Ruwiki-",
- "Datendateien an. Standard ist .ruwiki" ],
- :converter_extension_error => "Die Erweiterung darf nicht leer sein.",
- :converter_noextension_desc => [ "Gibt an, dass Ruwiki-Datendateien",
- "keine Dateierweiterung haben." ],
- :converter_quiet_desc => [ "Still sein. Standard sind normale",
- "Mitteilungen." ],
- :converter_language_desc => [ "Sprache auf LANG setzen. Standard ist",
- "en (Englisch). Bekannte Sprachen sind:",
- "en es de" ],
- :converter_verbose_desc => [ "Gesprächig sein. Standard sind normale",
- "Mitteilungen." ],
- :converter_help_desc => [ "Diesen Text zeigen." ],
- :converter_num_arguments => "Fehler: Nicht genug Parameter.",
- :converter_directory => "Verzeichnis",
- :converter_converting_from => "Wandle von %1$s nach %2$s um... ",
- :converter_done => "fertig.",
- :converter_not_ruwiki => "Keine Ruwiki-Datei; übersprungen.",
- :converter_nosave_modified => "Kann veränderte Datei %1$s nicht speichern.",
- :converter_page_format_error => "Fehler: Kann Seitenformat nicht erkennen.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Unbekannter Befehl: %1$s",
- :manager_help_commands => <<EOH ,
-Es gibt diese 'ruwiki'-Befehle:
-
- ruwiki install Standard-Entwicklungspaket installieren.
- ruwiki package Ruwiki-Installation einpacken.
- ruwiki unpackage Ruwiki-Installation auspacken.
- ruwiki service Win32::Service für Ruwiki verwalten.
-
-EOH
- :manager_help_help => <<-EOH ,
-Diese Hilfsnachricht zeigt, wie man mehr Informationen zu diesem
-Kommandozeilenwerkzeug erhalten kann:
-
- ruwiki help commands Alle 'ruwiki' Befehle anzeigen.
- ruwiki help <BEFEHL> Hilfe zu <BEFEHL> zeigen.
- (e.g., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Fehlender Parameter für Option: %1$s",
- :manager_dest_not_directory => "Das Ziel (%1$s) ist kein Verzeichnis.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPTIONEN] [--to ZIEL]
-
-Erzeugt eine neue Ruwiki-Instanz. Standardmäßig installiert dies die Daten,
-Schablonen und eine Standard-Konfigurationsdatei im derzeitigen Verzeichnis.
-Das Ziel kann mit --to geändert werden, und was installiert werden soll mit
-der OPTIONEN-Liste. Die Elemente der OPTIONEN-Liste dürfen durch Leerzeichen,
-Komma oder Semikola getrennt werden. Daher haben
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-alle die gleiche Wirkung. Die Groß-/Kleinschreibung spielt keine Rolle.
-Die OPTIONEN sind:
-
- servlet # Den Ruwiki servlet stub installieren
- service # Den Ruwiki Win32::Service stub installieren
- CGI # Das Ruwiki CGI-Skript installieren
- data # Ruwiki-Daten, Schablonen, und Konfiguration installieren
-
-Optionen können durch voranstellen von '-' oder 'no' abgeschaltet werden:
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-Dies würde das CGI-Skript, nicht aber die Daten installieren.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [QUELL] [--output PAKET] [--replace]
- ruwiki package [QUELL] [-o PAKET] [--replace]
-
-Packt die Ruwiki-Dateien (Daten, Schablonen und Programme) vom angegebenen
-QUELL-Verzeichnis oder dem derzeitigen Verzeichnis in das angegebene Paket
-(oder "./%1$s"). Sollte QUELL eine Ruwuki-Konfigurationsdatei sein (z.B.
-"%2$s"), dann wird sie verwendet, um Ort und Name der Daten- und Schablonen-
-Verzeichnisse zu erfahren.
-
- MERKE: Der Einpack-Prozess normalisiert die Daten- und Schablonen-
- Verzeichnisnamen relativ zum Einpackverzeichnis. Es werden
- niemals absolute Pfade sein.
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [QUELL] [--output VERZEICHNIS]
- ruwiki unpackage [QUELL] [-o VERZEICHNIS]
-
-Entpackt das gegebene Rukwiki-Paket (Standard: "./%1$s") in das angebene
-Verzeichnis (oder ".").
-EOH
- :manager_service_broken => "Kann keinen Win32-Service verwalten, wenn Win32::Service nicht installiert ist.",
- :manager_service_lo_argcount => "Ungenügene Parameteranzahl: %1$s",
- :manager_service_hi_argcount => "Zu viele Parameter: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NAME [BESCHREIBUNG] [Optionen]
- ruwiki service start NAME
- ruwiki service stop NAME
- ruwiki service delete NAME
-
-Verwaltet das Ruwiki WEBrick servlet als Windows-Service. Der Service muss
-benannt (NAME) sein. install unterstützt folgende zusätzliche Optionen:
-
- --rubybin RUBYPFAD Der Pfad zum Ruby-Binärverzeichnis.
- --exec SERVICEPFAD Der Pfad zum Service-Programm.
- --home PFADNACHAHAUSE Der Pfad zum Heimverzeichnis.
-EOH
- :manager_package_exists => "Das Paket %1$s existiert bereits.",
- :manager_service_installed => "Service %1$s installiert.",
- :manager_one_moment => "Moment, %1$s ...",
- :manager_service_started => "Service %1$s gestartet.",
- :manager_service_stopped => "Service %1$s gestoppt.",
- :manager_service_deleted => "Service %1$s gelöscht.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Verwendung: %1$s [Optionen]",
- :runner_general_options => "Allgemeine Optionen:",
- :runner_saveconfig_desc => [ "Sichert die Konfiguration nach FILENAME",
- "und beendet. Falls FILENAME nicht",
- "gegben ist, wird die Standardkonfig-",
- "urationsdatei verwendet. Alle Optionen",
- "werden von der bestehenen Konfiguration",
- "und der Kommandozeile und gesichert.",
- "Das Servlet wird nicht gestartet.",
- "Der Standardname ist:" ],
- :runner_config_desc => [ "Standardkonfiguration von FILENAME",
- "statt der Standardkonfigurationsdatei",
- "lesen. Optionen die bislang gesetzt",
- "wurden werden zu den Werten, die in der",
- "Konfigurationsdatei stehen,",
- " zurückgesetzt." ],
- :runner_webrick_options => "WEBrick-Optionen:",
- :runner_port_desc => [ "Lässt das Ruwiki-Servlet auf dem gegebenen",
- "Port laufen. Standard: 8808." ],
- :runner_address_desc => [ "Schränkt das Ruwiki-Servlet so ein, dass",
- "es nur die (Komma-separierten) Adressen",
- "akzepiert. Kann mehrfach angegeben werden",
- "Standardmäßig wird nicht eingeschränkt." ],
- :runner_local_desc => [ "Lässt das Ruwiki-Servlet nur lokale",
- "Verbindungen akzeptieren (127.0.0.1).",
- "Hebt vorige -A Adressen auf." ],
- :runner_mountpoint_desc => [ "Die relative URI unter der Ruwiki",
- 'zugreifbar wird. Standard: "/".' ],
- :runner_log_desc => [ "Protokolliere WEBrick. Standard ist --log." ],
- :runner_logfile_desc => [ "Die Datei, in die das WEBrick-Protokoll",
- "geschrieben wird. Standard: Standard-",
- "fehlerausgabe." ],
- :runner_threads_desc => [ "Setzt den WEBrick-Threadcount." ],
- :runner_ruwiki_options => "Ruwiki-Optionen:",
- :runner_language_desc => [ 'Wählt die Oberflächensprache für Ruwiki.',
- 'Standard: "en". Kann "en", "de", oder',
- '"es" sein.' ],
- :runner_webmaster_desc => [ 'Die Ruwiki-Wwebmaster Email-Adresse.',
- 'Standard: "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Aktiviert Ruwuki-Debugging. Standard:',
- '--no-debug.' ],
- :runner_title_desc => [ 'Gibt den Ruwiki-Titel an. Standard ist',
- '"Ruwiki".' ],
- :runner_defaultpage_desc => [ 'Eine andere Standardseite. Standard ist',
- '"ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'Eine andere Standardprojektseite.',
- 'Standard ist "Default".' ],
- :runner_templatepath_desc => [ 'Ort, an dem Ruwiki-Schablonen sind.',
- 'Standard ist "./templates".' ],
- :runner_templatename_desc => [ 'Name der Ruwiki-Schablonen. Default',
- 'Standard ist "default".' ],
- :runner_cssname_desc => [ 'Name der CSS-Datei im Schablonenpfad',
- 'Standard ist "ruwiki.css".' ],
- :runner_storage_desc => [ 'Wähle den Speichertyp:' ],
- :runner_datapath_desc => [ 'Ort, an dem Datendateien gespeichert sind.',
- 'Standard ist "./data".' ],
- :runner_extension_desc => [ 'Dateierweiterung für Datendateien.',
- 'Standard ist "ruwiki".' ],
- :runner_central_desc => [ 'Lässt Ruwiki mit den Daten des Standard-',
- 'RubyGem-Orts laufen .' ],
- :runner_general_info => "Allgemeine Information:",
- :runner_help_desc => [ "Zeigt diesen Text an." ],
- :runner_version_desc => [ "Zeigt die Ruwuki-Version." ],
- :runner_rejected_address => "Adresse %1$s abgewiesen. Nur Verbindungen von %2$s werden akzeptiert.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-WEBrick-Optionen:
- Port %2$d
- Erlaubte Adressen %3$s
- Mount Point %4$s
- Protokollieren? %5$s
- Protokollpfad %6$s
- Threads %7$s
-
-Ruwiki-Options:
- Webmaster %8$s
- Debugging? %9$s
- Titel %10$s
- Standardprojekt %11$s
- Standardseite %12$s
- Schablonenpfad %13$s
- Schablone %14$s
- CSS-Datei %15$s
-
- Speichertyp %16$s
- Datenpfad %17$s
- Dateierweiterung %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/lang/en.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/lang/en.rb
deleted file mode 100644
index de0771a..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/lang/en.rb
+++ /dev/null
@@ -1,334 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::EN is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module EN
- Message = Hash.new { |hh, kk| hh[kk] = "Language ERROR: Unknown message key #{kk.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Backend %1$s is unknown.",
- :cannot_create_project => "Cannot create project %1$s: %2$s",
- :cannot_destroy_project => "Cannot destroy project %1$s: %2$s",
- :cannot_destroy_topic => "Cannot destroy %1$s::%2$s: %3$s",
- :cannot_obtain_lock => "Unable to obtain a lock on %1$s::%2$s. Try again shortly.",
- :cannot_release_lock => "Unable to release the lock on %1$s::%2$s. Try again shortly.",
- :cannot_retrieve_topic => "Cannot retrieve %1$s::%2$s: %3$s",
- :cannot_store_topic => "Cannot store %1$s::%2$s: %3$s",
- :cannot_list_topics => "Cannot list topics for project %1$s: %2$s",
- :error_creating_lock => "Error creating lock on %1$s::%2$s: %3$s",
- :error_releasing_lock => "Error releasing lock on %1$s::%2$s: %3$s",
- :flatfiles_no_data_directory => "The data directory (%1$s) does not exist.",
- :no_access_list_projects => "No permission to list projects.",
- :no_access_list_topics => "No permission to list topics in project %1$s.",
- :no_access_to_create_project => "No permission to create project %1$s.",
- :no_access_to_destroy_project => "No permission to destroy project %1$s::%2$s.",
- :no_access_to_destroy_topic => "No permission to destroy topic %1$s::%2$s.",
- :no_access_to_read_topic => "No permission to retrieve the %1$s::%2$s.",
- :no_access_to_store_topic => "No permission to store the %1$s::%2$s.",
- :page_not_in_backend_format => "%1$s::%2$s is not in the format supported by the backend %3$s.",
- :project_already_exists => "Project %1$s already exists.",
- :project_does_not_exist => "Project %1$s does not exist.",
- :search_project_fail => "Failure searching project %1$s with string %2$s.",
- :yaml_requires_182_or_higher => "YAML flatfile support exists only for Ruby version 1.8.2 or higher.",
- :not_editing_current_version => <<EOM ,
-You have submitted an old version of %1$s::%2$s. The differences between
-your version and the current version of this page have been merged.
-Conflicting lines have both lines shown. Please ensure that you have edited
-the entire page before saving again.
-EOM
- :no_empty_search_string => <<EOM ,
-The search field may not be empty. Please enter something in the search box
-before pressing the search button.
-EOM
- :page_is_locked => "The page is locked for editing. Please wait a few minutes and try again.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Configuration must be of class Ruwiki::Config.",
- :invalid_template_dir => "The specified path for templates (%1$s) does not exist or is not a directory.",
- :no_template_found => "No template of %1$s found in template set %2$s.",
- :no_template_set => "There is no template set '%1$s' in the template path.",
- :no_webmaster_defined => "Configuration error: Webmaster is unset.",
- # Miscellaneous messages.
- :complete_utter_failure => "Complete and Utter Failure",
- :editing => "Editing",
- :error => "Error",
- :invalid_path_info_value => "Something has gone seriously wrong with the web environment. PATH_INFO = %1$s",
- :render_arguments => "Ruwiki#render must be called with zero or two arguments.",
- :unknown_feature => "Unknown feature %1$s.",
- :topics_for_project => "Topics for Project ::%1$s",
- :project_topics_link => "(topics)",
- :wiki_projects => "Projects in %1$s",
- :no_projects => "No known projects.",
- :no_topics => "No topics in project %1$s.",
- :search_results_for => "= Search results for: %1$s",
- :number_of_hits => "%1$d Hits",
-
- # Labels
- :label_search_project => "Search Project",
- :label_search_all => "All",
- :label_search => "Search: ",
- :label_project => "Project: ",
- :label_topic => "Topic: ",
- :label_edit => "Edit",
- :label_recent_changes => "Recent Changes",
- :label_topics => "Topics",
- :label_projects => "Projects",
- :label_editing => "Editing",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Edit Comment: ",
- :label_comment_accelerator => "O",
- :label_save => "Save",
- :label_save_accelerator => "S",
- :label_cancel => "Cancel",
- :label_cancel_accelerator => "C",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Original Text",
- :label_raw => "Raw",
- :label_formatted => "Formatted",
- :label_send_report_by => "Send the Wiki maintainer a report by email.",
- :label_send_report => "Send report.",
- :label_saved_page => "Saved page: ",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Usage: %1$s [options] <directory>+",
- :converter_format_desc => [ "Converts encountered files (regardless",
- "of the current format), to the specified",
- "format. Default is flatfiles. Allowed",
- "formats are: yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Create backups of upgraded files.",
- "Default is --backup." ],
- :converter_backupext_desc => [ 'Specify the backup extension. Default',
- 'is "~", which is appended to the data',
- 'filename.' ],
- :converter_backupext_error => "The backup extension must not be empty.",
- :converter_extension_desc => [ "Specifies the extension of Ruwiki data",
- "files. The default is .ruwiki" ],
- :converter_extension_error => "The extension must not be empty.",
- :converter_noextension_desc => [ "Indicates that the Ruwiki data files",
- "have no extension." ],
- :converter_quiet_desc => [ "Runs quietly. Default is to run with",
- "normal messages." ],
- :converter_language_desc => [ "Sets the language to LANG. Defaults",
- "to en (English). Known languages",
- "are: en es de" ],
- :converter_verbose_desc => [ "Runs with full message. Default is to",
- "run with normal messages." ],
- :converter_help_desc => [ "Shows this text." ],
- :converter_num_arguments => "Error: not enough arguments.",
- :converter_directory => "directory",
- :converter_converting_from => "converting from %1$s to %2$s ... ",
- :converter_done => "done.",
- :converter_not_ruwiki => "not a Ruwiki file; skipping.",
- :converter_nosave_modified => "cannot save modified %1$s.",
- :converter_page_format_error => "Error: Cannot detect the page format.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Unknown command: %1$s",
- :manager_help_commands => <<EOH ,
-The commands known to 'ruwiki' are:
-
- ruwiki install Installs the default deployment package.
- ruwiki package Packages a Ruwiki installation.
- ruwiki unpackage Unpackages a Ruwiki installation.
- ruwiki service Manages a Win32::Service for Ruwiki.
-
-EOH
- :manager_help_help => <<-EOH ,
-This is a basic help message containing pointers to more information on how
-to use this command-line tool. Try:
-
- ruwiki help commands list all 'ruwiki' commands
- ruwiki help <COMMAND> show help on <COMMAND>
- (e.g., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Missing parameter for option: %1$s",
- :manager_dest_not_directory => "The destination (%1$s) is not a directory.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPTIONS] [--to DEST]
-
-Creates a new Ruwiki instance. By default this installs the data, templates,
-and a default configuration file to the current directory. The destination
-can be changed with the --to option, and what is installed can be specified
-with the OPTIONS list. The OPTIONS list may be space, comma, or semi-colon
-separated. Thus,
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-are all equivalent. The options may be specified in any case. The
-installation OPTIONS are:
-
- servlet # Installs the Ruwiki servlet stub
- service # Installs the Ruwiki Win32::Service stub
- CGI # Installs the Ruwiki CGI script
- data # Installs the Ruwiki data, templates, and configuration
-
-Options may be disabled with by prepending a dash or 'no':
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-These will install the CGI script but not the data.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [SOURCE] [--output PACKAGE] [--replace]
- ruwiki package [SOURCE] [-o PACKAGE] [--replace]
-
-Packages the Ruwiki files (data, templates, and executables) from the
-specified SOURCE or the current directory into the specified output package
-(or "./%1$s"). If the SOURCE is a ruwiki configuration file (e.g.,
-"%2$s"), then that will be used to determine the location and name of
-the data and template directories.
-
- NOTE: The packaging process will normalize the data and templates
- directory names to be relative to the unpacking directory. They
- will NEVER be absolute paths.
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [SOURCE] [--output DIRECTORY]
- ruwiki unpackage [SOURCE] [-o DIRECTORY]
-
-Unpackages the provided Ruwiki package (default "./%1$s") into the
-specified directory (default ".").
-EOH
- :manager_service_broken => "Cannot manage a Win32 service if Win32::Service is not installed.",
- :manager_service_lo_argcount => "Insufficient arguments: %1$s",
- :manager_service_hi_argcount => "Too many arguments: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NAME [DESCRIPTION] [options]
- ruwiki service start NAME
- ruwiki service stop NAME
- ruwiki service delete NAME
-
-Manages the Ruwiki WEBrick servlet as a Windows service. The service must be
-NAMEd. install supports the following additional options:
-
- --rubybin RUBYPATH The path to the Ruby binary.
- --exec SERVICEPATH The path to the service executable.
- --home PATHTOHOME The path to the home directory.
-EOH
- :manager_package_exists => "Package %1$s already exists.",
- :manager_service_installed => "%1$s service installed.",
- :manager_one_moment => "One moment, %1$s ...",
- :manager_service_started => "%1$s service started.",
- :manager_service_stopped => "%1$s service stopped.",
- :manager_service_deleted => "%1$s service deleted.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Usage: %1$s [options]",
- :runner_general_options => "General options:",
- :runner_saveconfig_desc => [ "Saves the configuration to FILENAME and",
- "exit. If FILENAME is not used, then the",
- "default configuration file will be",
- "used. All options will be read from the",
- "existing configuration file and the",
- "command-line and saved. The servlet",
- "will not start. The default name is:" ],
- :runner_config_desc => [ "Read the default configuration from",
- "FILENAME instead of the default config",
- "file. Options set until this point will",
- "be reset to the values from those read",
- "configuration file." ],
- :runner_webrick_options => "WEBrick options:",
- :runner_port_desc => [ "Runs the Ruwiki servlet on the specified",
- "port. Default 8808." ],
- :runner_address_desc => [ "Restricts the Ruwiki servlet to accepting",
- "connections from the specified address or",
- "(comma-separated) addresses. May be",
- "specified multiple times. Defaults to all",
- "addresses." ],
- :runner_local_desc => [ "Restricts the Ruwiki servlet to accepting",
- "only local connections (127.0.0.1).",
- "Overrides any previous -A addresses." ],
- :runner_mountpoint_desc => [ "The relative URI from which Ruwiki will",
- 'be accessible. Defaults to "/".' ],
- :runner_log_desc => [ "Log WEBrick activity. Default is --log." ],
- :runner_logfile_desc => [ "The file to which WEBrick logs are",
- "written. Default is standard error." ],
- :runner_threads_desc => [ "Sets the WEBrick threadcount." ],
- :runner_ruwiki_options => "Ruwiki options:",
- :runner_language_desc => [ 'The interface language for Ruwiki.',
- 'Defaults to "en". May be "en", "de", or',
- '"es".' ],
- :runner_webmaster_desc => [ 'The Ruwiki webmaster email address.',
- 'Defaults to "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Turns on Ruwiki debugging. Defaults',
- 'to --no-debug.' ],
- :runner_title_desc => [ 'Provides the Ruwiki title. Default is',
- '"Ruwiki".' ],
- :runner_defaultpage_desc => [ 'An alternate default page. Default is',
- '"ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'An alternate default project. Default is',
- '"Default".' ],
- :runner_templatepath_desc => [ 'The location of Ruwiki templates. Default',
- 'is "./templates".' ],
- :runner_templatename_desc => [ 'The name of the Ruwiki templates. Default',
- 'is "default".' ],
- :runner_cssname_desc => [ 'The name of the CSS file in the template',
- 'path. Default is "ruwiki.css".' ],
- :runner_storage_desc => [ 'Select the storage type:' ],
- :runner_datapath_desc => [ 'The path where data files are stored.',
- 'Default is "./data".' ],
- :runner_extension_desc => [ 'The extension for data files.',
- 'Default is "ruwiki".' ],
- :runner_central_desc => [ 'Runs Ruwiki with the data in the default',
- 'RubyGem location.' ],
- :runner_general_info => "General info:",
- :runner_help_desc => [ "Shows this text." ],
- :runner_version_desc => [ "Shows the version of Ruwiki." ],
- :runner_rejected_address => "Rejected peer address %1$s. Connections are only accepted from %2$s.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-WEBrick options:
- Port %2$d
- Accepted Addresses %3$s
- Mount Point %4$s
- Logging? %5$s
- Log Destination %6$s
- Threads %7$s
-
-Ruwiki options:
- Webmaster %8$s
- Debugging? %9$s
- Title %10$s
- Default Project %11$s
- Default Page %12$s
- Template Path %13$s
- Template Set %14$s
- CSS Source %15$s
-
- Storage Type %16$s
- Data Path %17$s
- Extension %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/lang/es.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/lang/es.rb
deleted file mode 100644
index 4a9ee2a..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/lang/es.rb
+++ /dev/null
@@ -1,339 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Mauricio Julio Fernández Pradier (batsman.geo@yahoo.com)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::ES is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module ES
- Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Identificador de mensaje desconocido: #{kk.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Backend %1$s desconocido.",
- :cannot_create_project => "No pudo crearse el proyecto %1$s: %2$s",
- :cannot_destroy_project => "No pudo borrarse el proyecto %1$s: %2$s",
- :cannot_destroy_topic => "No pudo borrarse %1$s::%2$s: %3$s",
- :cannot_obtain_lock => "No pudo obtenerse el cerrojo para %1$s::%2$s. Reinténtelo de nuevo en breve.",
- :cannot_release_lock => "No pudo liberarse el cerrojo para %1$s::%2$s. Reinténtelo de nuevo en breve.",
- :cannot_retrieve_topic => "No pudo obtenerse %1$s::%2$s: %3$s",
- :cannot_store_topic => "No pudo almacenarse %1$s::%2$s: %3$s",
- :cannot_list_topics => "No se pudo listar los temas del proyecto %1$s: %2$s",
- :error_creating_lock => "Error al crear el cerrojo para %1$s::%2$s: %3$s",
- :error_releasing_lock => "Error al liberar el cerrojo para %1s::%2$s: %3$s",
- :flatfiles_no_data_directory => "El directorio de datos (%1$s) no existe.",
- :no_access_list_projects => "Permiso denegado al listar los proyectos.",
- :no_access_list_topics => "Permiso denegado al listar los temas del proyecto %1$s.",
- :no_access_to_create_project => "Permiso denegado al crear el proyecto %1$s.",
- :no_access_to_destroy_project => "Permiso denegado al borrar el proyecto %1$s::%2$s.",
- :no_access_to_destroy_topic => "Permiso denegado al borrar el borrar el tema %1$s::%2$s.",
- :no_access_to_read_topic => "Permiso denegado al acceder a %1$s::%2$s.",
- :no_access_to_store_topic => "Permiso denegado al almacenar %1$s::%2$s.",
- :page_not_in_backend_format => "%1$s::%2$s no está en un formato soportado por el backend %3$s.",
- :project_already_exists => "El proyecto %1$s ya existe.",
- :project_does_not_exist => "El proyecto %1$s no existe.",
- :search_project_fail => "Error al buscar la cadena %2$s en el proyecto %1$s.",
- :yaml_requires_182_or_higher => "El soporte para archivos YAML sólo está disponible en Ruby versión 1.8.2 o superior.",
- :not_editing_current_version => <<EOM ,
-Ha enviado una versión antigua de %1$s::%2$s. Las diferencias entre su versión
-y la actual han sido fusionadas. En caso de conflicto, las líneas de ambas
-versiones serán mostradas. Asegúrese de editar la página en su totalidad
-antes de salvar de nuevo.
-EOM
- :no_empty_search_string => <<EOM ,
-El campo de búsqueda no puede estar vacío. Por favor introduzca el texto
-a buscar antes de pulsar sobre el botón de búsqueda.
-EOM
- :page_is_locked => "La pagina no puede ser editada al estar bloqueada en este momento. Por favor espere unos minutos y vuelva a intentar.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "La configuración debe ser de clase Ruwiki::Config.",
- :invalid_template_dir => "El path para plantillas (%1$s) no existe o no es un directorio.",
- :no_template_found => "No pudo encontrarse la plantilla para %1$s en el conjunto %2$s.",
- :no_template_set => "No pudo encontrarse el conjunto de plantillas '%1$s' en el path.",
- :no_webmaster_defined => "Error de configuración: Webmaster no está definido.",
- # Miscellaneous messages.
- :complete_utter_failure => "Error catastrófico",
- :editing => "Edición",
- :error => "Error",
- :invalid_path_info_value => "Algo huele a podrido en su entorno Web. PATH_INFO = %1$s",
- :render_arguments => "Ruwiki#render debe ser llamado con cero o dos argumentos.",
- :unknown_feature => "Característica desconocida: %1$s.",
- :topics_for_project => "Temas del Proyecto ::%1$s",
- :project_topics_link => "(temas)",
- :wiki_projects => "Proyectos en %1$s",
- :no_projects => "Ningún proyecto.",
- :no_topics => "El proyecto %1$s no tiene nigún tema.",
- :search_results_for => "= Resultados de la búsqueda de: %1$s",
- :number_of_hits => "%1$d Resultados",
-
- # Labels
- :label_search_project => "Buscar en projecto",
- :label_search_all => "Todo",
- :label_search => "Buscar: ",
- :label_project => "Proyecto: ",
- :label_topic => "Tema: ",
- :label_edit => "Editar",
- :label_recent_changes => "Cambios recientes",
- :label_topics => "Temas",
- :label_projects => "Proyectos",
- :label_editing => "Edición",
- :label_text => "Texto:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Editar Comentario: ",
- :label_comment_accelerator => "O",
- :label_save => "Salvar",
- :label_save_accelerator => "S",
- :label_cancel => "Cancelar",
- :label_cancel_accelerator => "C",
- :label_preview => "Previsualizar",
- :label_preview_accelerator => "P",
- :label_original_text => "Text Original",
- :label_raw => "Crudo",
- :label_formatted => "Formateado",
- :label_send_report_by => "Enviar notificación al administrador del Wiki por email.",
- :label_send_report => "Enviar notificación.",
- :label_saved_page => "Página salvada: ",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Modo de empleo: %1$s [opciones] <dir.>",
- :converter_format_desc => [ "Convertir los ficheros encontrados",
- "(independientemente de su formato), al",
- "formato especificado; por defecto ",
- "archivos planos. Formatos permitidos:",
- " yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Crear copias de seguridad de ficheros ",
- "actualizados. La opción por defecto es ",
- "--backup." ],
- :converter_backupext_desc => [ 'Especificar la extensión para las copias',
- 'de seguridad (por defecto "~") que se',
- 'añade al nombre del fichero de datos' ],
- :converter_backupext_error => [ "La extensión para copias de seguridad",
- "no debe estar vacía." ],
- :converter_extension_desc => [ "Especifica la extensión de los ficheros",
- "de datos de Ruwiki (por defecto .ruwiki)" ],
- :converter_extension_error => "La extensión no debe estar vacía.",
- :converter_noextension_desc => [ "Indica que los ficheros de datos de",
- "Ruwiki no tienen ninguna extensión." ],
- :converter_quiet_desc => [ "Ejecución silenciosa. Por defecto se ",
- "ejecuta con mensajes normales." ],
- :converter_language_desc => [ "Especifica el idioma a emplear con LANG.",
- "Por defecto 'en' (inglés).",
- "Idiomas disponibles: en es de" ],
- :converter_verbose_desc => [ "Información detallada de ejecución.",
- "Por defecto se ejecuta con un nivel de ",
- "detalle inferior." ],
- :converter_help_desc => [ "Mostrar este texto." ],
- :converter_num_arguments => "Error: número de argumentos insuficiente.",
- :converter_directory => "directorio",
- :converter_converting_from => "convertiendo de %1$s a %2$s ... ",
- :converter_done => "hecho.",
- :converter_not_ruwiki => "no es un fichero de Ruwiki; ignorando.",
- :converter_nosave_modified => "no pudo salvarse %1$s.",
- :converter_page_format_error => "Error: No pudo detectarse el formato de la página.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Comando desconocido: %1$s",
- :manager_help_commands => <<EOH ,
-Los comandos reconocidos por 'ruwiki' son:
-
- ruwiki install Instala el entorno por defecto.
- ruwiki package Empaqueta una instalación de Ruwiki.
- ruwiki unpackage Desempaqueta una instalación de Ruwiki.
- ruwiki service Gestiona un Win32::Service para Ruwiki.
-
-EOH
- :manager_help_help => <<-EOH ,
-Este es un mensaje de ayuda básico con referencias a información suplementaria
-relativa a esta herramienta de la línea de comandos. Intente:
-
- ruwiki help commands mostrar todos los comandos de ruwiki
- ruwiki help <COMANDO> mostrar ayuda sobre <COMANDO>
- (p.ej., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Falta parámetro para la opción: %1$s",
- :manager_dest_not_directory => "El destino (%1$s) no es un directorio.",
- :manager_service_broken => "No pudo crearse un servicio de Win32 al no estar instalado Win32::Service.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPCIONES] [--to DEST]
-
-Crea una instancia de Ruwiki. Por defecto, se instala los ficheros de datos,
-plantillas y la configuración por defecto en el directorio actual. El destino
-puede ser cambiado con la opción --to, y los elementos a instalar con la lista
-de OPCIONES, que puede ser delimitada por espacios, comas o puntos y comas.
-Así pues,
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-son equivalentes. Las opciones pueden especificarse en mayúsculas/minúsculas.
-Las opciones de instalación son:
-
- servlet # Instala el stub para el servlet Ruwiki
- service # Instala el stub para el Win32::Service Ruwiki
- CGI # Instala el script CGI Ruwiki
- data # Instala los datos, plantillas y configuración de Ruwiki
-
-Las opciones pueden deshabilitarse precediéndolas de un guión o 'no':
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-instalarán el script CGI pero no los datos.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [FUENTE] [--output PAQUETE] [--replace]
- ruwiki package [FUENTE] [-o PAQUETE] [--replace]
-
-Empaqueta los ficheros de Ruwiki (datos, plantillas y ejecutables) de la
-FUENTE especificada o el directorio actual en el archivo de salida
-especificado (o "../%1$s"). Si la FUENTE es un fichero de configuración
-de rukiwi (p.ej. "%2$s"), será empleado para determinar la localización
-y el nombre de los directorios de datos y plantillas.
-
- NOTA: El proceso de empaquetado normaliza los nombres de los
- ficheros de datos y plantillas para que sean relativos al
- directorio de desempaquetado. NUNCA serán paths absolutos.
-
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [FUENTE] [--output DIRECTORIO]
- ruwiki unpackage [FUENTE] [-o DIRECTORIO]
-
-Desempaqueta el paquete de Ruwiki provisto (por defecto "./%1$s")
-en el directorio indicado (por defecto ".").
-EOH
- :manager_service_lo_argcount => "Argumentos insuficientes: %1$s",
- :manager_service_hi_argcount => "Demasiados argumentos: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NOMBRE [DESCRIPCION] [opciones]
- ruwiki service start NOMBRE
- ruwiki service stop NOMBRE
- ruwiki service delete NOMBRE
-
-Gestiona el servlet Ruwiki para WEBrick como un servicio de Windows, bajo el
-NOMBRE indicado. install soporta además las opciones siguientes:
-
- --rubybin RUBYPATH Path del ejecutable Ruby.
- --exec SERVICEPATH Path del ejecutable del servicio.
- --home PATHTOHOME Path del directorio home.
-EOH
- :manager_package_exists => "El paquete %1$s ya existe.",
- :manager_service_installed => "Servicio %1$s instalado.",
- :manager_one_moment => "Un momento, %1$s ...",
- :manager_service_started => "Servicio %1$s iniciado.",
- :manager_service_stopped => "Servicio %1$s parado.",
- :manager_service_deleted => "Servicio %1$s borrado.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Modo de empleo: %1$s [opciones]",
- :runner_general_options => "Opciones generales:",
- :runner_saveconfig_desc => [ "Salvar la configuración en FILENAME y",
- "salir. Si no se emplea FILENAME, la",
- "configuración por defecto será usada.",
- "Todas las opciones serán leídas del",
- "fichero existente y de la línea de",
- "comandos y salvadas. El servlet no se",
- "arrancará. El nombre por defecto es:" ],
- :runner_config_desc => [ "Leer la configuración por defecto de",
- "FILENAME en vez del fichero por defecto",
- "Las opciones especificadas anteriormente",
- "serán sobrescritas" ],
- :runner_webrick_options => "Opciones de WEBrick:",
- :runner_port_desc => [ "Ejecutar el servlet Ruwiki en el puerto",
- "especificado; por defecto 8808." ],
- :runner_address_desc => [ "Aceptar únicamente conexiones desde las",
- "direcciones especificadas (separadas por",
- "comas). Puede usarse repetidamente. Por",
- "defecto todas las direcciones serán",
- "aceptadas" ],
- :runner_local_desc => [ "Aceptar únicamente conexiones locales",
- "(127.0.0.1). Anula las direcciones",
- "indicadas previamente en -A" ],
- :runner_mountpoint_desc => [ "URI relativo en el que Ruwiki estará",
- 'accesible. Por defecto "/".' ],
- :runner_log_desc => [ "Realizar log de la actividad de WEBrick.",
- "Por defecto se usa --log." ],
- :runner_logfile_desc => [ "Fichero en el que escribir los logs de",
- "WEBrick. Por defecto, el standard error." ],
- :runner_threads_desc => [ "Asigna al threadcount de WEBrick." ],
- :runner_ruwiki_options => "Opciones de Ruwiki:",
- :runner_language_desc => [ 'Idioma de la inferfaz de Ruwiki.',
- 'Por defecto "en". Puede ser "en", ',
- '"de", o "es".' ],
- :runner_webmaster_desc => [ 'Email del webmaster de Ruwiki.',
- 'Por defecto "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Activa debugging de Ruwiki. Por defecto',
- 'inhabilitado.' ],
- :runner_title_desc => 'Título del Ruwiki. Por defecto "Ruwiki".',
- :runner_defaultpage_desc => [ 'Página por defecto alternativa; por',
- 'defecto "ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'Proyecto por defecto. Por defecto',
- '"Default".' ],
- :runner_templatepath_desc => [ 'Localización de las plantillas.',
- 'Por defecto "./templates".' ],
- :runner_templatename_desc => [ 'Nombre de las plantillas. Por defecto',
- '"default".' ],
- :runner_cssname_desc => [ 'Nombre del fichero CSS en el directorio',
- 'de plantillas. Por defecto "ruwiki.css".' ],
- :runner_storage_desc => [ 'Tipo de almacenamiento:' ],
- :runner_datapath_desc => [ 'Path donde salvar los ficheros de datos.',
- 'Por defecto; "./data".' ],
- :runner_extension_desc => [ 'Extensión para ficheros de datos.',
- 'Por defecto "ruwiki".' ],
- :runner_central_desc => [ 'Ejecuta Ruwiki con los datos del',
- 'directorio RubyGem.' ],
- :runner_general_info => "Información general:",
- :runner_help_desc => [ "Muestra este texto." ],
- :runner_version_desc => [ "Muestra la versión de Ruwiki." ],
- :runner_rejected_address => "Dirección remota %1$s rechazada. Sólo se admiten conexiones desde %2$s.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-Opciones de WEBrick:
- Puerto %2$d
- Direcciones admitidas %3$s
- Punto de montaje %4$s
- Logging? %5$s
- Destino del log %6$s
- Hebras %7$s
-
-Opciones de Ruwiki:
- Webmaster %8$s
- Debugging? %9$s
- Título %10$s
- Proyecto por defecto %11$s
- Página por defecto %12$s
- Path para plantillas %13$s
- Conjunto de plantillas %14$s
- Fuente CSS %15$s
-
- Tipo de almacenamiento %16$s
- Path de datos %17$s
- Extensión %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/page.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/page.rb
deleted file mode 100644
index b246b3a..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/page.rb
+++ /dev/null
@@ -1,262 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # The page class for Ruwiki. The page defines the data and meta-data for a
- # page.
-class Ruwiki::Page
- include Ruwiki::Exportable
-
- exportable_group 'ruwiki'
- # Returns the content version of the page. If the page has a greater
- # content version than this version of Ruwiki does, we should probably
- # throw an exception, because attempting to save such a page will cause
- # a loss of data. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +content-version+
- attr_reader :content_version
- exportable :content_version
- # Returns the version of Ruwiki from which this page was generated.
- # Informational only. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +version+
- attr_reader :ruwiki_version
- exportable :ruwiki_version, :name => 'version'
-
- exportable_group 'properties'
- # Returns or sets the displayed title of the page, which may differ from
- # the topic of the page. As of Ruwiki 0.8.0, this is not currently used
- # and it may disappear.
- #
- # Class:: +properties+
- # ID:: +title+
- attr_accessor :title
- exportable :title
- # Returns or sets the topic of the page, which may differ from the
- # title. This is used to set the topic on a page being saved.
- #
- # Class:: +properties+
- # ID:: +topic+
- attr_accessor :topic
- exportable :topic
- # Returns or sets the project of the page, which may differ from the
- # title. This is used to set the project on a page being saved.
- #
- # Class:: +properties+
- # ID:: +project+
- attr_accessor :project
- exportable :project
- # Returns or sets the creator of the page. Unless we know the user
- # (through the authentication mechanism, only partially implemented for
- # Ruwiki 0.9.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +creator+
- attr_accessor :creator
- exportable :creator
- # Returns or sets the creator's IP address. This should always be set.
- # It will have a value of "UNKNOWN" on the off-chance that something
- # prevents this from working.
- #
- # Class:: +properties+
- # ID:: +creator-ip+
- attr_accessor :creator_ip
- exportable :creator_ip
- # Returns or sets the date of creation.
- #
- # Class:: +properties+
- # ID:: +create-date+
- attr_accessor :create_date
- exportable :create_date
- # Returns or sets the last editor of the page. Unless we know the user
- # (through the authentication mechanism, only partially implemented for
- # Ruwiki 0.9.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +editor+
- attr_accessor :editor
- exportable :editor
- # Returns or sets the last editor's IP address. This should always be
- # set. It will have a value of "UNKNOWN" on the off-chance that
- # something prevents this from working.
- #
- # Class:: +properties+
- # ID:: +editor-ip+
- attr_accessor :editor_ip
- exportable :editor_ip
- # Returns or sets the date of the last edit.
- #
- # Class:: +properties+
- # ID:: +edit-date+
- attr_accessor :edit_date
- exportable :edit_date
- # Indicates whether the page is editable. Non-editable pages are
- # effectively static pages.
- #
- # Class:: +properties+
- # ID:: +editable+
- attr_accessor :editable
- exportable :editable
- # Indicates whether the page is indexable. Non-indexable pages are
- # invisible to compliant web robots, and their links may not be
- # followed.
- #
- # Class:: +properties+
- # ID:: +indexable+
- attr_accessor :indexable
- exportable :indexable
- # The current version of the page. The old version is always (#version
- # - 1).
- #
- # Class:: +properties+
- # ID:: +version+
- attr_accessor :version
- exportable :version
- # An array of complete tags that will appear in the HTML <HEAD> section.
- # Can be used to specify additional CSS, <META> tags, or even JavaScript
- # on a per-page basis. Currently unused.
- #
- # Class:: +properties+
- # ID:: +html-headers+
- attr_accessor :html_headers
- exportable :html_headers
- # The entropy of the page. This is a ratio of the number of lines
- # changed in the file vs. the total number of lines in the file. This
- # value is currently unused. (And, sad to say, I don't remember why
- # I included it. However, it's an interesting value that may be useful
- # in spam fighting techniques. It is currently stored in the meta-data,
- # but that may change moving forward.)
- #
- # Class:: +properties+
- # ID:: +entropy+
- attr_reader :entropy
- exportable :entropy
- # The edit comment for the current revision of the page.
- #
- # Class:: +properties+
- # ID:: +edit-comment+
- attr_accessor :edit_comment
- exportable :edit_comment
-
- exportable_group 'page'
- # The header content of the page. This is static content (in either Wiki
- # or HTML formats) that appears before the editable contents of the
- # page. If both this and Wiki-level header content are specified, this
- # will appear *after* the Wiki-level header content.
- #
- # Class:: +page+
- # ID:: +header+
- attr_accessor :header
- exportable :header
- # The footer content of the page. This is static content (in either Wiki
- # or HTML formats) that appears before the editable contents of the
- # page. If both this and Wiki-level footer content are specified, this
- # will appear *before* the Wiki-level footer content.
- #
- # Class:: +page+
- # ID:: +footer+
- attr_accessor :footer
- exportable :footer
- # The editable unformatted Wiki content of the page.
- #
- # Class:: +page+
- # ID:: +content+
- attr_accessor :content
- exportable :content
-
- # Creates a Ruwiki page. This must be created from the canonical export
- # hash.
- def initialize(exported = {})
- ruwiki = exported['ruwiki']
- @content_version = (ruwiki['content-version'] || Ruwiki::CONTENT_VERSION).to_i
- @ruwiki_version = ruwiki['version'] || Ruwiki::VERSION
-
- props = exported['properties']
- @title = props['title']
- @topic = props['topic'] || "NewTopic"
- @project = props['project'] || "Default"
- @creator = props['creator'] || ""
- @creator_ip = props['creator-ip'] || "UNKNOWN"
- @create_date = Time.at((props['create-date'] || Time.now).to_i)
- @editor = props['editor'] || ""
- @editor_ip = props['editor-ip'] || "UNKNOWN"
- @edit_date = Time.at((props['edit-date'] || Time.now).to_i)
- @edit_comment = props['edit-comment'] || ""
- case props['editable']
- when "false"
- @editable = false
- else
- @editable = true
- end
- case props['indexable']
- when "false"
- @indexable = false
- else
- @indexable = true
- end
- @entropy = (props['entropy'] || 0).to_f
- @html_headers = props['html-headers'] || []
- @version = (props['version'] || 0).to_i
-
- page = exported['page']
- @header = page['header'] || ""
- @content = page['content'] || ""
- @footer = page['footer'] || ""
-
- # Fix the possibility that the content might be an array of chunks.
- @content = @content.join("") if @content.kind_of?(Array)
-
- @content.gsub!(/\r/, "")
- end
-
- # Outputs the HTML version of the page.
- def to_html(markup)
- # Normalise the content, first
- @content.gsub!(/\r/, "")
- markup.parse(@content, @project)
- end
-
- # Provides the canonical export hash.
- def export
- sym = super
-
- sym.each_key do |sect|
- if sect == 'ruwiki'
- sym[sect]['content-version'] = Ruwiki::CONTENT_VERSION
- sym[sect]['version'] = Ruwiki::VERSION
- else
- sym[sect].each_key do |item|
- case [sect, item]
- when ['properties', 'create-date'], ['properties', 'edit-date']
- sym[sect][item] = sym[sect][item].to_i
- when ['properties', 'editable'], ['properties', 'indexable']
- sym[sect][item] = (sym[sect][item] ? 'true' : 'false')
- else
- sym[sect][item] = sym[sect][item].to_s
- end
- end
- end
- end
-
- sym
- end
-
- NULL_PAGE = {
- 'ruwiki' => {
- 'content-version' => Ruwiki::CONTENT_VERSION,
- 'version' => Ruwiki::VERSION
- },
- 'properties' => { },
- 'page' => { },
- }
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/servlet.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/servlet.rb
deleted file mode 100644
index 373482e..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/servlet.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'webrick'
-
-class Ruwiki::Servlet < WEBrick::HTTPServlet::AbstractServlet
- class << self
- attr_accessor :config
- end
-
- def initialize(config)
- @config = config
- end
-
- # Converts a POST into a GET.
- def do_POST(req, res)
- do_GET(req, res)
- end
-
- def do_GET(req, res)
- # Generate the reponse handlers for Ruwiki from the request and response
- # objects provided.
- wiki = Ruwiki.new(Ruwiki::Handler.from_webrick(req, res))
-
- # Configuration defaults to certain values. This overrides the defaults.
- wiki.config = Ruwiki::Servlet.config unless Ruwiki::Servlet.config.nil?
- wiki.config!
- wiki.config.logger = @config.logger
- wiki.run
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/template.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/template.rb
deleted file mode 100644
index af26151..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/template.rb
+++ /dev/null
@@ -1,553 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file is originally from rdoc by Dave Thomas (dave@pragprog.com).
-#
-# $Id$
-#++
-require 'cgi'
-
- # Ruwiki templating, based originally on RDoc's "cheap-n-cheerful" HTML
- # page template system, which is a line-oriented, text-based templating
- # system.
- #
- # Templates can contain:
- #
- # * The directive !INCLUDE!, which will include the next template from the
- # provided list. This is processed before any template substitution, so
- # repeating and optional blocks work on the values within the template
- # substitution.
- # * Substitutable variable values between percent signs (<tt>%key%</tt>).
- # Optional variable values can be preceded by a question mark
- # (<tt>%?key%</tt>).
- # * Label values between hash marks (<tt>#key#</tt>). Optional label
- # values can be preceded by a question mark (<tt>#?key#</tt>).
- # * Links (<tt>HREF:ref:name:</tt>).
- # * Repeating substitution values (<tt>[:key| stuff :]</tt>). The value of
- # +key+ may be an integer value or a range (in which case key will be
- # used as an iterator, providing the current value of key on successive
- # values), an array of scalar values (substituting each value), or an
- # array of hashes (in which case it works like repeating blocks, see
- # below). These must NOT be nested. Note that integer value counting is
- # one-based.
- # * Optional substitution values (<tt>[?key| stuff ?]</tt> or <tt>[!key|
- # stuff ?]</tt>. These must NOT be nested.
- # * Repeating blocks:
- # START:key
- # ... stuff
- # END:key
- # * Optional blocks:
- # IF:key
- # ... stuff
- # ENDIF:key
- # or:
- # IFNOT:key
- # ... stuff
- # ENDIF:key
- #
- # When generating the output, a hash of values is provided and an optional
- # hash of labels is provided. Simple variables are resolved directly from
- # the hash; labels are resolved as Symbols from the label hash or are
- # otherwise treated as variables. Labels are always resolved from a single
- # message hash.
- #
- # The +key+ for repeating blocks (one-line or multi-line) must be an array
- # of hashes. The repeating block will be generated once for each entry.
- # Blocks can be nested arbitrarily deeply.
- #
- # Optional blocks will only be generated if the test is true. IF blocks
- # test for the presence of +key+ or that +key+ is non-+nil+; IFNOT blocks
- # look for the absence or +nil+ value of +key+. IFBLANK blocks test for
- # the absence, +nil+ value, or emptiness of +key+; IFNOTBLANK blocks test
- # for the presence of +key+ and that it is neither +nil+ nor empty.
- #
- # Usage: Given a set of templates <tt>T1</tt>, <tt>T2</tt>, etc.
- #
- # values = { "name" => "Dave", "state" => "TX" }
- # fr = { :name => "Nom", :state => "Etat" }
- # en = { :name => "Name", :state => "State" }
- # tt = TemplatePage.new(T1, T2, T3)
- #
- # res = ""
- # tt.process(res, values, fr)
- # tt.process(res, values, en)
- #
-class Ruwiki::TemplatePage
- BLOCK_RE = %r{^\s*(IF|IFNOT|IFBLANK|IFNOTBLANK|ENDIF|START|END):(\w+)?}
- HREF_RE = %r{HREF:(\w+?):(\w+?):}
- LABEL_RE = %r{#(\??)(-?)(\w+?)#}
- VARIABLE_RE = %r{%(\??)(-?)(\w+?)%}
- IFLINE_RE = %r{\[([?!])(\w+?)\|(.*?)\?\]}
- BLOCKLINE_RE = %r{\[:(\w+?)\|(.*?):\]}
- INCLUDE_RE = %r{!INCLUDE!}
-
- DDLB_RES = [
- [ :check, %r{%check:(\w+?)%} ],
- [ :date, %r{%date:(\w+?)%} ],
- [ :popup, %r{%popup:(\w+?):(\w+?)%} ],
- [ :ddlb, %r{%ddlb:(\w+?):(\w+?)%} ],
- [ :vsortddlb, %r{%vsortddlb:(\w+?):(\w+?)%} ],
- [ :radio, %r{%radio:(\w+?):(\w+?)%} ],
- [ :radioone, %r{%radioone:(\w+?):(\w+?)%} ],
- [ :input, %r{%input:(\w+?):(\d+?):(\d+?)%} ],
- [ :text, %r{%text:(\w+?):(\d+?):(\d+?)%} ],
- [ :pwinput, %r{%pwinput:(\w+?):(\d+?):(\d+?)%} ],
- [ :pair, %r{%pair(\d)?:([^:]+)(\w+?)%} ]
- ]
-
- # Nasty hack to allow folks to insert tags if they really, really want to
- OPEN_TAG = "\001"
- CLOSE_TAG = "\002"
- BR = "#{OPEN_TAG}br#{CLOSE_TAG}"
-
- # A Context holds a stack of key/value pairs (like a symbol table). When
- # asked to resolve a key, it first searches the top of the stack, then the
- # next level, and so on until it finds a match (or runs out of entries).
- class Context
- def initialize
- @stack = []
- end
-
- def push(hash)
- @stack.push(hash)
- end
-
- def pop
- @stack.pop
- end
-
- # Find a scalar value, throwing an exception if not found. This method is
- # used when substituting the %xxx% constructs
- def find_scalar_raw(key)
- @stack.reverse_each do |level|
- if level.has_key?(key)
- val = level[key]
- return val unless val.kind_of?(Array)
- end
- end
- raise "Template error: can't find variable '#{key}'."
- end
-
- def find_scalar(key)
- find_scalar_raw(key) || ''
- end
-
- # Lookup any key in the stack of hashes
- def lookup(key)
- @stack.reverse_each do |level|
- return level[key] if level.has_key?(key)
- end
- nil
- end
- end
-
- # Simple class to read lines out of a string
- class LineReader
- attr_reader :lines
- def initialize(lines)
- @lines = lines
- end
-
- # read the next line
- def read
- @lines.shift
- end
-
- # Return a list of lines up to the line that matches a pattern. That last
- # line is discarded.
- def read_up_to(pattern)
- res = []
- while line = read
- if pattern.match(line)
- return LineReader.new(res)
- else
- res << line
- end
- end
- raise "Missing end tag in template: #{pattern.source}"
- end
-
- # Return a copy of ourselves that can be modified without affecting us
- def dup
- LineReader.new(@lines.dup)
- end
- end
-
- # +templates+ is an array of strings containing the templates. We start at
- # the first, and substitute in subsequent ones where the string
- # <tt>!INCLUDE!</tt> occurs. For example, we could have the overall page
- # template containing
- #
- # <html><body>
- # <h1>Master</h1>
- # !INCLUDE!
- # </body></html>
- #
- # and substitute subpages in to it by passing [master, sub_page]. This
- # gives us a cheap way of framing pages
- def initialize(*templates)
- result = templates.shift.dup
- templates.each { |content| result.sub!(INCLUDE_RE, content) }
- @lines = LineReader.new(result.split(/\r?\n/))
- end
-
- attr_reader :lines
-
- def set_options(opts = {})
- @message = opts[:messages] || {}
- @output = opts[:output] || $stdout
- end
-
- # Render templates as HTML. Compatibility method for Rublog and
- # Rdoc.
- def write_html_on(op, value_hash, message_hash = {})
- to_html(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as HTML
- def to_html(value_hash, options = {})
- set_options(options)
- esc = proc { |str| CGI.escapeHTML(str) }
- @output << process(value_hash, esc)
- end
-
- # Render templates as TeX. Compatibility method for Rublog and
- # Rdoc.
- def write_tex_on(op, value_hash, message_hash = {})
- to_tex(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as TeX
- def to_tex(value_hash, options = {})
- set_options(options)
-
- esc = proc do |str|
- str.
- gsub(/&lt;/, '<').
- gsub(/&gt;/, '>').
- gsub(/&amp;/) { '\\&' }.
- gsub(/([$&%\#{}_])/) { "\\#$1" }.
- gsub(/>/, '$>$').
- gsub(/</, '$<$')
- end
- str = ""
-
- str << process(value_hash, esc)
- @output << str
- end
-
- # Render templates as plain text. Compatibility method for Rublog and
- # Rdoc.
- def write_plain_on(op, value_hash, message_hash = {})
- to_plain(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as plain text.
- def to_plain(value_hash, options = {})
- set_options(options)
- esc = proc {|str| str}
- @output << process(value_hash, esc)
- end
-
- # Render the templates. The The <tt>value_hash</tt> contains key/value
- # pairs used to drive the substitution (as described above). The
- # +escaper+ is a proc which will be used to sanitise the contents of the
- # template.
- def process(value_hash, escaper)
- @context = Context.new
- sub(@lines.dup, value_hash, escaper).
- tr("\000", '\\').
- tr(OPEN_TAG, '<').
- tr(CLOSE_TAG, '>')
- end
-
- # Substitute a set of key/value pairs into the given template. Keys with
- # scalar values have them substituted directly into the page. Those with
- # array values invoke <tt>substitute_array</tt> (below), which examples a
- # block of the template once for each row in the array.
- #
- # This routine also copes with the <tt>IF:</tt>_key_ directive, removing
- # chunks of the template if the corresponding key does not appear in the
- # hash, and the START: directive, which loops its contents for each value
- # in an array
- def sub(lines, values, escaper)
- @context.push(values)
- skip_to = nil
- result = []
-
- while line = lines.read
- mv = line.match(BLOCK_RE)
-
- if mv.nil?
- result << expand(line.dup, escaper)
- next
- else
- cmd = mv.captures[0]
- tag = mv.captures[1]
- end
-
- case cmd
- when "IF", "IFNOT", "IFNOTBLANK", "IFBLANK"
- raise "#{cmd}: must have a key to test." if tag.nil?
-
- val = @context.lookup(tag)
- case cmd # Skip lines if the value is...
- when "IF" # false or +nil+ (not false => true)
- test = (not val)
- when "IFBLANK" # +nil+ or empty
- test = (not (val.nil? or val.empty?))
- when "IFNOT"
- test = val
- when "IFNOTBLANK" #
- test = (val.nil? or val.empty?)
- end
- lines.read_up_to(/^\s*ENDIF:#{tag}/) if test
- when "ENDIF"
- nil
- when "START"
- raise "#{cmd}: must have a key." if tag.nil?
-
- body = lines.read_up_to(/^\s*END:#{tag}/)
- inner = @context.lookup(tag)
- raise "unknown tag: #{tag}" unless inner
- raise "not array: #{tag}" unless inner.kind_of?(Array)
- inner.each { |vals| result << sub(body.dup, vals, escaper) }
- result << "" # Append the missing \n
- else
- result << expand(line.dup, escaper)
- end
- end
-
- @context.pop
-
- result.join("\n")
- end
-
- # Given an individual line, we look for %xxx%, %?xxx%, #xxx#, #?xxx#,
- # [:key| xxx :], [?key| stuff ?], [!key| stuff ?] and HREF:ref:name:
- # constructs, substituting as appropriate.
- def expand(line, escaper)
- # Generate a cross-reference if a reference is given. Otherwise, just
- # fill in the name part.
- line = line.gsub(HREF_RE) do
- ref = @context.lookup($1)
- name = @context.find_scalar($2)
-
- if ref and not ref.kind_of?(Array)
- %Q(<a href="#{ref}">#{name}</a>)
- else
- name
- end
- end
-
- # Look for optional content.
- line = line.gsub(IFLINE_RE) do
- type = $1
- name = $2
- stuff = $3
-
- case type
- when '?'
- test = @context.lookup(name)
- when '!'
- test = (not @context.lookup(name))
- end
-
- if test
- stuff
- else
- ""
- end
- end
-
- # Look for repeating content.
- line = line.gsub(BLOCKLINE_RE) do |match|
- name = $1
- stuff = $2
-
- val = @context.lookup(name)
- ss = ""
- case val
- when nil
- nil
- when Fixnum
- val.times { |ii| ss << stuff.sub(/%#{name}%/, "#{ii + 1}") }
- when Range
- val.each { |ii| ss << stuff.sub(/%#{name}%/, "#{ii}") }
- when Array
- if not val.empty? and val[0].kind_of?(Hash)
- val.each do |vv|
- @context.push(vv)
- ss << expand(stuff, escaper)
- @context.pop
- end
- else
- val.each { |ee| ss << stuff.sub(/%#{name}%/, "#{ee}") }
- end
- end
- ss
- end
-
- # Substitute in values for #xxx# constructs.
- line = line.gsub(LABEL_RE) do
- mandatory = $1.nil?
- escaped = $2.nil?
- key = $3.intern
- val = @message[key]
-
- if val.nil?
- raise "Template error: can't find label '#{key}'." if mandatory
- ""
- else
- val = val.to_s
- val = escaper.call(val) if escaped
- val.tr('\\', "\000")
- end
- end
-
- # Substitute in values for %xxx% constructs. This is made complex
- # because the replacement string may contain characters that are
- # meaningful to the regexp (like \1)
- line = line.gsub(VARIABLE_RE) do
- mandatory = $1.nil?
- escaped = $2.nil?
- key = $3
- val = @context.lookup(key)
-
- if val.nil?
- raise "Template error: can't find variable '#{key}'." if mandatory
- ""
- else
- val = val.to_s
- val = escaper.call(val) if escaped
- val.tr('\\', "\000")
- end
- end
-
- # Substitute DDLB controls:
- DDLB_RES.each do |ddlb|
- line = line.gsub(ddlb[1]) do
- self.send(ddlb[0], Regexp.last_match.captures)
- end
- end
-
- line
- rescue Exception => ex
- raise "Error in template: #{ex}\nOriginal line: #{line}\n#{ex.backtrace[0]}"
- end
-
- def check(*args)
- value = @context.find_scalar_raw(args[0])
- checked = value ? " checked" : ""
- "<input type=\"checkbox\" name=\"#{name}\"#{checked}>"
- end
-
- def vsortddlb(*args)
- ddlb(*(args.dup << true))
- end
-
- def ddlb(*args)
- value = @context.find_scalar(args[0]).to_s
- options = @context.lookup(args[1])
- sort_on = args[2] || 0
-
- unless options and options.kind_of?(Hash)
- raise "Missing options #{args[1]} for ddlb #{args[0]}."
- end
-
- res = %Q(<select name="#{args[0]}">)
-
- sorted = options.to_a.sort do |aa, bb|
- if aa[0] == -1
- -1
- elsif bb[0] == -1
- 1
- else
- aa[sort_on] <=> bb[sort_on]
- end
- end
-
- sorted.each do |key, val|
- selected = (key.to_s == value) ? " selected" : ""
- res << %Q(<option value="#{key}"#{selected}>#{val}</option>)
- end
- res << "</select>"
- end
-
- def date(*args)
- yy = "#{argv[0]}_y"
- mm = "#{argv[0]}_m"
- dd = "#{argv[0]}_d"
- %Q<#{input(yy, 4, 4)}&nbsp;.&nbsp;#{input(mm, 2, 2)}&nbsp;.&nbsp;#{input(dd, 2, 2)}>
- end
-
- def radioone(*args)
- radio(*(args.dup << ""))
- end
-
- def radio(*args)
- value = @context.find_scalar(argv[0]).to_s
- options = @context.lookup(argv[1])
- br = argv[2] || "<br />"
-
- unless options and options.kind_of?(Hash)
- raise "Missing options #{args[1]} for radio #{args[0]}."
- end
-
- res = ""
- options.keys.sort.each do |key|
- val = options[key]
- checked = (key.to_s == value) ? " checked" : ""
- res << %Q(<label>
- <input type="radio" name="#{args[0]}"
- value="#{key}"#{checked}">#{val}</label>#{br})
- end
- res
- end
-
- def text(*args)
- value = @context.find_scalar(args[0]).to_s
- %Q(<textarea name="#{args[0]}" cols="#{args[1]}" rows="#{args[2]}">
-#{CGI.escapeHTML(value)}
-</textarea>)
- end
-
- def pwinput(*args)
- input(*(args.dup << "password"))
- end
-
- def input(*args)
- name = args[0]
- value = @context.find_scalar(name).to_s
- width = args[1]
- max = args[2]
- iptype = args[3] || "text"
- %Q(<input type="#{iptype}" name="#{name}" value="#{value}" size="#{width}" maxsize="#{max}">)
- end
-
- def popup(*args)
- url = CGI.escapeHTML(@context.find_scalar(args[0]).to_s)
- text = @context.find_scalar(args[1]).to_s
- %Q|<a href="#{url}" target="Popup" class="methodtitle" onClick="popup('#{url}'); return false;">#{text}</a>|
- end
-
- def pair(*args)
- label = args[0]
- name = args[1]
- colsp = args[2]
-
- value = @context.find_scalar(name).to_s
- value = case value
- when "true" then "Yes"
- when "false" then "No"
- else value
- end
- td = (colsp.nil? or colsp.empty?) ? "<td>" : %Q{<td colspan="#{colsp}">}
- "#{Html.tag(label)}#{td}#{value}</td>"
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/utils.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/utils.rb
deleted file mode 100644
index 26317b1..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/utils.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # So that Ruwiki doesn't have to be loaded in full to use the bloody thing.
-unless defined?(Ruwiki)
- class Ruwiki
- VERSION = "0.9.0"
- end
-end
-
-module Ruwiki::Utils
- RUN_PATH = Dir.pwd
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/utils/command.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/utils/command.rb
deleted file mode 100644
index ba7c060..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/utils/command.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # Implements the command pattern. Commands are used by the command-line
-class Ruwiki::Utils::CommandPattern
- class AbstractCommandError < Exception; end
- class UnknownCommandError < RuntimeError; end
- class CommandAlreadyExists < RuntimeError; end
- class MissingParameterError < ArgumentError
- def initialize(argument)
- @argument = argument
- end
-
- attr_reader :argument
- end
-
- class << self
- def add(command)
- command = command.new if command.kind_of?(Class)
-
- @commands ||= {}
- if @commands.has_key?(command.name)
- raise CommandAlreadyExists
- else
- @commands[command.name] = command
- end
-
- if command.respond_to?(:altname)
- unless @commands.has_key?(command.altname)
- @commands[command.altname] = command
- end
- end
- end
-
- def <<(command)
- add(command)
- end
-
- attr_accessor :default
- def default=(command) #:nodoc:
- if command.kind_of?(Ruwiki::Utils::CommandPattern)
- @default = command
- elsif command.kind_of?(Class)
- @default = command.new
- elsif @commands.has_key?(command)
- @default = @commands[command]
- else
- raise UnknownCommandError
- end
- end
-
- def command?(command)
- @commands.has_key?(command)
- end
-
- def command(command)
- if command?(command)
- @commands[command]
- else
- @default
- end
- end
-
- def [](cmd)
- self.command(cmd)
- end
-
- def default_ioe(ioe = {})
- ioe[:input] ||= $stdin
- ioe[:output] ||= $stdout
- ioe[:error] ||= $stderr
- ioe
- end
- end
-
- def [](args, opts = {}, ioe = {})
- call(args, opts, ioe)
- end
-
- def name
- raise AbstractCommandError
- end
-
- def call(args, opts = {}, ioe = {})
- raise AbstractCommandError
- end
-
- def help
- raise AbstractCommandError
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/utils/converter.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/utils/converter.rb
deleted file mode 100644
index 0261af8..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/utils/converter.rb
+++ /dev/null
@@ -1,297 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-
-module Ruwiki::Utils::Converter
- class << self
- TARGETS = %w(flatfiles yaml marshal)
-
- # Create the regular expressions that are used in Ruwiki 0.6.2
- OLD_HEADER_RE = /^\s*([a-z]+)\s*:\s*(.*)$/
- OLD_HEADER_END_RE = /^#EHDR$/
- DATA_HEADER_END_RE = /\A#EHDR\z/
- NL_RE = /\n/
-
- def with(obj)
- yield obj if block_given?
- end
-
- # Only allow this to be run once. Silently fail otherwise.
- def set_defaults
- return unless @options.nil?
- @options = OpenStruct.new
-
- with @options do |oo|
- oo.traverse_directories = true
- oo.backup_old_files = true
- oo.backup_extension = "~"
- oo.quiet = false
- oo.verbose = false
- oo.extension = 'ruwiki'
- oo.target_format = 'flatfiles'
- end
- end
-
- def message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def message(id)
- if @message[id].nil?
- []
- else
- @message[id]
- end
- end
-
- def display_options
- end
-
- def summary
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- set_defaults
-
- @input = input
- @output = output
- @error = error
-
- language = 'en'
- find_lang = argv.grep(%r{^--lang})
- find_lang.each do |ee|
- if ee =~ %r{^--lang=}
- language = ee.sub(%r{^--lang=}, '')
- else
- language = argv[argv.index(ee).succ]
- end
- end
-
- require "ruwiki/lang/#{language.downcase}"
- self.message = Ruwiki::Lang.const_get(language.upcase)
-
- argv.options do |opts|
- opts.banner = message(:converter_usage) % File.basename($0)
- opts.separator ''
- opts.on('--format=FORMAT', *message(:converter_format_desc)) do |ff|
- @options.target_format = ff
- end
- opts.on('--[no-]backup', *message(:converter_backup_desc)) do |bb|
- @options.backup_old_files = bb
- end
- opts.on('--backup-extension=EXTENSION', *message(:converter_backupext_desc)) do |ee|
- if ee.nil? or ee.empty?
- @error << message(:converter_backupext_error) << "\n" if ee.nil? or ee.empty?
- @error << "#{opts}\n"
- return 0
- end
- @options.backup_extension = ee
- end
- opts.on('--extension=EXTENSION', *message(:converter_extension_desc)) do |ee|
- if ee.nil? or ee.empty?
- @error << message(:converter_extension_error) << "\n" if ee.nil? or ee.empty?
- @error << "#{opts}\n"
- return 0
- end
- @options.extension = ee
- end
- opts.on('--no-extension', *message(:converter_noextension_desc)) do
- @options.extension = nil
- end
- opts.on('--lang=LANG', *message(:converter_language_desc)) do |lang|
- self.message = Ruwiki::Lang.const_get(lang.upcase)
- end
- opts.on('--quiet', *message(:converter_quiet_desc)) do |qq|
- @options.quiet = qq
- @options.verbose = (not qq)
- end
- opts.on('--verbose', *message(:converter_verbose_desc)) do |vv|
- @options.quiet = (not vv)
- @options.verbose = vv
- end
- opts.separator ''
- opts.on_tail('--help', *message(:converter_help_desc)) do
- @error << "#{opts}\n"
- return 0
- end
-
- opts.parse!
- end
-
- if argv.empty?
- @error << message(:converter_num_arguments) << "\n#{argv.options}\n" unless @options.quiet
- return 127
- end
-
- display_options if @options.verbose
-
- @options.target_format.capitalize!
- @options.target_format_class = Ruwiki::Backend.const_get(@options.target_format)
-
- argv.each { |file| process_file(file) }
-
- summary if not @options.quiet
- end
-
- # Process a single file.
- def process_file(file)
- if @options.backup_old_files
- return if file =~ /#{@options.backup_extension}/
- end
- @out << "#{file}: " unless @options.quiet
-
- if File.directory?(file) and @options.traverse_directories
- @out << message(:converter_directory) << "\n" unless @options.quiet
- Dir.chdir(file) { Dir['*'].each { |entry| process_file(entry) } }
- else
- begin
- page, page_format = load_page(file)
- @out << message(:converter_converting_from) % [ page_format, @options.target_format ] if @options.verbose
- save_page(file, page)
- @out << message(:converter_done) << "\n" unless @options.quiet
- rescue PageLoadException
- @out << message(:converter_not_ruwiki) << "\n" unless @options.quiet
- rescue PageSaveException
- @out << message(:cannot_nosave_modified) << "\n" % [ file ] unless @options.quiet
- end
- end
- end
-
- def load_page(file)
- data = File.read(file)
- page_format = nil
-
- if data =~ OLD_HEADER_END_RE
- page_format = 'OldFlatfiles'
-
- page = Ruwiki::Page::NULL_PAGE.dup
-
- unless data.empty?
- rawbuf = data.split(NL_RE).map { |ee| ee.chomp }
-
- loop do
- if rawbuf[0] =~ OLD_HEADER_END_RE
- rawbuf.shift
- break
- end
-
- match = OLD_HEADER_RE.match(rawbuf[0])
-
- unless match.nil?
- case match.captures[0]
- when 'topic'
- page['properties']['topic'] = match.captures[1]
- page['properties']['title'] = match.captures[1]
- when 'version'
- page['properties']['version'] = match.captures[1].to_i
- else
- nil
- end
- end
- rawbuf.shift
- end
-
- page['page']['content'] = rawbuf.join("\n")
-
- with page['properties'] do |pp|
- pp['project'] = File.basename(File.dirname(File.expand_path(file)))
- pp['editable'] = true
- pp['indexable'] = true
- pp['entropy'] = 0.0
- end
- end
- end
-
- # Try Marshal
- if page_format.nil?
- begin
- page = ::Marshal.load(data)
- page_format = 'Marshal'
- rescue Exception
- nil
- end
- end
-
- # Try YAML
- if page_format.nil?
- begin
- page = ::YAML.load(data)
- page_format = 'YAML'
- rescue Exception
- nil
- end
- end
-
- # Try the Flatfiles format
- if page_format.nil?
- begin
- page = Ruwiki::Backend::Flatfiles.load(data)
- page_format = 'Exportable'
- rescue Exception => ex
- nil
- end
- end
-
- if page_format.nil? # Cannot detect page type.
- @error << @message[:converter_page_format_error] << "\n"
- raise PageLoadException
- end
- [page, page_format]
- rescue PageLoadException
- raise
- rescue Exception => ex
- @error << %Q|#{ex.message}\n#{ex.backtrace.join("\n")}\n| if @options.verbose
- raise PageLoadException
- end
-
- def save_page(file, page)
- if @options.backup_extension != '~'
- backup = "#{file}.#{@options.backup_extension}"
- else
- backup = "#{file}#{@options.backup_extension}"
- end
-
- # Always backup the file -- we are transactional.
- FileUtils.cp(file, backup)
-
- if @options.target_format == 'Marshal'
- method = :print
- else
- method = :puts
- end
- File.open(file, 'wb') { |ff| ff.__send__(method, @options.target_format_class.dump(page)) }
- rescue Exception => ex
- FileUtils.mv(backup, file) if File.exists?(backup)
- @error << %Q|#{ex.message}\n#{ex.backtrace.join("\n")}\n| if @options.verbose
- raise PageSaveException
- ensure
- # If we aren't *supposed* to back up the file, then get rid of the
- # backup.
- if File.exists?(backup) and (not @options.backup_old_files)
- FileUtils.rm(backup)
- end
- end
-
- class PageLoadException < RuntimeError; end
- class PageSaveException < RuntimeError; end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/utils/manager.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/utils/manager.rb
deleted file mode 100644
index aa8f2a1..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/utils/manager.rb
+++ /dev/null
@@ -1,639 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-require 'stringio'
-require 'zlib'
-require 'ruwiki/exportable'
-require 'ruwiki/utils/command'
-require 'ruwiki/config'
-
-begin
- if defined?(Gem::Cache)
- require_gem 'archive-tar-minitar', '~> 0.5.1'
- else
- require 'archive/tar/minitar'
- end
-rescue LoadError => ex
- $stderr.puts ex.message
- raise
-end
-
-module Ruwiki::Utils::Manager
- DEFAULT_PACKAGE_NAME = 'ruwiki.pkg'
-
- def self.message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def self.message(id)
- @message[id]
- end
-
- class ManagerError < RuntimeError; end
-
- EXECUTABLES = %w(ruwiki.cgi ruwiki_servlet ruwiki_servlet.bat \
- ruwiki_servlet.cmd ruwiki_service.rb)
-
- class ManagerHelp < Ruwiki::Utils::CommandPattern
- def name
- "help"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- help_on = args.shift
- output = ""
-
- if Ruwiki::Utils::CommandPattern.command?(help_on)
- ioe[:output] << Ruwiki::Utils::CommandPattern[help_on].help
- elsif help_on == "commands"
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_help_commands)
- else
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_unknown_command) % [ help_on ] << "\n" % [ help_on ] unless help_on.nil? or help_on.empty?
- ioe[:output] << self.help
- end
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_help_help)
- end
- end
-
- class ManagerInstall < Ruwiki::Utils::CommandPattern
- def name
- "install"
- end
-
- def call(args, opts = {}, ioe = {})
- argv = []
-
- replace = false
- dest = "."
- name = nil
-
- while (arg = args.shift)
- case arg
- when '--to'
- dir = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if dir.nil?
- if File.exist?(dir)
- if not File.directory?(dir)
- raise ArgumentError, Ruwiki::Utils::Manager.message(:manager_dest_not_directory)
- end
- else
- FileUtils.mkdir_p(dir)
- end
- dest = dir
- when /;/o
- argv.push(*(arg.split(/;/o)))
- when /,/o
- argv.push(*(arg.split(/,/o)))
- else
- argv << arg
- end
- end
-
- options = { 'data' => true }
-
- while (arg = argv.shift)
- case arg
- when /^(?:-|no)(.*$)/
- options.delete($1)
- else
- options[arg] = true
- end
- end
-
- Ruwiki::Utils::Manager.install(dest, options)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_install_help)
- end
- end
-
- class ManagerPackage < Ruwiki::Utils::CommandPattern
- def name
- "package"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- argv = []
- replace = false
- dest = "."
- name = nil
-
- while (arg = args.shift)
- case arg
- when '--replace'
- replace = true
- when '-o', '--output'
- name = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if name.nil?
- dest = File.dirname(name)
- name = File.basename(name)
- else
- argv << arg
- end
- end
-
- if argv.size > 1
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_hi_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 1
- end
- source = argv.shift || "."
-
- Ruwiki::Utils::Manager.package(source, dest, name, replace)
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_package_help) % [ "./#{Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME}",
- Ruwiki::Config::CONFIG_NAME ]
- end
- end
-
- class ManagerUnpackage < Ruwiki::Utils::CommandPattern
- def name
- "unpackage"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- argv = []
- dir = "."
-
- while (arg = args.shift)
- case arg
- when '-o', '--output'
- dir = args.shift
- raise Ruwiki::Utils::CommandPatter::MissingParameterError.new(arg) if dir.nil? or not File.directory?(dir)
- else
- argv << arg
- end
- end
-
- if argv.size > 1
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_hi_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 1
- end
- source = argv.shift || Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME
-
- Ruwiki::Utils::Manager.unpackage(source, dir)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_unpackage_help) % [ "./#{Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME}" ]
- end
- end
-
- if RUBY_PLATFORM =~ /win32/
- class ManagerService < Ruwiki::Utils::CommandPattern
- def name
- "service"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
-
- if args.size < 2
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_lo_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 0
- end
-
- command = args.shift
- service = args.shift
-
- options ||= {}
- options[:service_name] = service
- options[:service_home] = File.expand_path(".")
-
- argv = []
- while (arg = args.shift)
- case arg
- when "--rubybin"
- options[:ruby_bin] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:ruby_bin].nil?
- when "--exec"
- options[:service_bin] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:service_bin].nil?
- when "--home"
- options[:service_home] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:service_home].nil?
- else
- argv << arg
- end
- end
-
- options[:service_desc] = args.join(" ") if args.size > 0
-
- case command
- when "install"
- options[:service_install] = true
- when "start"
- options[:service_start] = true
- when "stop"
- options[:service_stop] = true
- when "delete"
- options[:service_delete] = true
- else
- raise ArgumentError, Ruwiki::Utils::Manager.message(:manager_unknown_command) % [ command ]
- end
-
- Ruwiki::Utils::Manager.manage_windows_service(options, ioe)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_service_help)
- end
- end
- Ruwiki::Utils::CommandPattern << ManagerService
- end
-
- Ruwiki::Utils::CommandPattern << ManagerHelp
- Ruwiki::Utils::CommandPattern << ManagerInstall
- Ruwiki::Utils::CommandPattern << ManagerPackage
- Ruwiki::Utils::CommandPattern << ManagerUnpackage
- Ruwiki::Utils::CommandPattern.default = Ruwiki::Utils::CommandPattern["help"]
-
- class << self
- attr_accessor :shared
- attr_reader :ruwiki_servlet
- attr_reader :ruwiki_servlet_bat
- attr_reader :ruwiki_servlet_cmd
- attr_reader :ruwiki_service
- attr_reader :ruwiki_cgi
- attr_reader :ruwiki_pkg
- def shared=(shared)
- @shared = shared
- @ruwiki_servlet = File.join(@shared, "bin", "ruwiki_servlet")
- @ruwiki_servlet_bat = File.join(@shared, "bin", "ruwiki_servlet.bat")
- @ruwiki_servlet_cmd = File.join(@shared, "bin", "ruwiki_servlet.cmd")
- @ruwiki_service = File.join(@shared, "bin", "ruwiki_service.rb")
- @ruwiki_cgi = File.join(@shared, "bin", "ruwiki.cgi")
- @ruwiki_pkg = File.join(@shared, Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME)
- end
-
- def with(obj)
- yield obj if block_given?
- end
-
- def tar_files(list, name)
- ff = StringIO.new
- gz = Zlib::GzipWriter.new(ff)
- to = Archive::Tar::Minitar::Output.new(gz)
- list.each { |item| Archive::Tar::Minitar.pack_file(item, to) }
- data = ff.string
- group = {
- :name => name,
- :data => data,
- :mode => 0644,
- }
- return group
- rescue Exception => ex
- puts ex.message, ex.backtrace.join("\n")
- ensure
- to.close
- group[:size] = group[:data].size
- end
-
- def package(source, dest, name = nil, replace = false)
- # If the package name is nil, use the default name. If replace is
- # false, then append a number on the end if the file already exists.
- # Increment the number until we have a unique filename.
- if name.nil?
- pkg = File.join(dest, DEFAULT_PACKAGE_NAME)
- if File.exists?(pkg) and (not replace)
- pbn = "#{File.basename(DEFAULT_PACKAGE_NAME, '.pkg')}-%02d.pkg"
- ii = 1
- while File.exists?(pkg)
- pkg = File.join(dest, pbn % ii)
- ii += 1
- end
- end
- else
- pkg = File.join(dest, name)
- if File.exists?(pkg) and (not replace)
- raise ManagerError, Ruwiki::Utils::Manager.message(:manager_package_exists)
- end
- end
-
- files = []
-
- if File.directory?(source)
- Dir.chdir(source) do
- if File.exists?(Ruwiki::Config::CONFIG_NAME)
- cs = File.stat(Ruwiki::Config::CONFIG_NAME)
- files << {
- :name => Ruwiki::Config::CONFIG_NAME,
- :data => File.read(Ruwiki::Config::CONFIG_NAME),
- :mtime => cs.mtime,
- :mode => 0644,
- :size => cs.size
- }
- end
-
- EXECUTABLES.each do |ff|
- if File.exists?(ff)
- cs = File.stat(ff)
- files << {
- :name => ff,
- :data => File.read(ff),
- :mtime => cs.mtime,
- :mode => 0755,
- :size => cs.size
- }
- end
- end
-
- f_data = Dir["data/**/**"].select { |dd| dd !~ /CVS\// }
- f_data.unshift("data")
- f_data.map! do |dd|
- res = { :name => dd, :mode => 0644 }
- if File.directory?(dd)
- res[:mode] = 0755
- res[:dir] = true
- end
- res
- end
-
- f_tmpl = Dir["templates/**/**"].select { |tt| tt !~ /CVS\// }
- f_tmpl.unshift("templates")
- f_tmpl.map! do |tt|
- res = { :name => tt, :mode => 0644 }
- if File.directory?(tt)
- res[:mode] = 0755
- res[:dir] = true
- end
- res
- end
-
- files << tar_files(f_data, "data.pkg")
- files << tar_files(f_tmpl, "tmpl.pkg")
- end
- else
- stat = File.stat(source)
- files << {
- :name => File.basename(source),
- :data => File.read(source),
- :mtime => stat.mtime,
- :mode => 0644,
- :size => stat.size
- }
-
- EXECUTABLES.each do |ff|
- ff = File.join(File.dirname(source), ff)
- if File.exists?(ff)
- cs = File.stat(ff)
- files << {
- :name => ff,
- :data => File.read(ff),
- :mtime => cs.mtime,
- :mode => 0755,
- :size => cs.size
- }
- end
- end
-
- cc = Ruwiki::Exportable.load(files[0][:data])
- tp = cc['ruwiki-config']['template-path']
- tp = "./templates" if tp.nil? or tp.empty?
- so = cc['ruwiki-config']['storage-options']
-
- if so.nil? or so.empty?
- dp = "./data"
- else
- so = Ruwiki::Exportable.load(so)
- key = 'flatfiles'
- dp = so[key]['data-path']
- end
-
- dp = "./data" if dp.nil? or dp.empty?
- bndp = File.basename(dp)
- bntp = File.basename(tp)
-
- so[key]['data-path'] = bndp
- cc['ruwiki-config']['storage-options'] = Ruwiki::Exportable.dump(so)
- cc['ruwiki-config']['template-path'] = bntp
- files[0][:data] = Ruwiki::Exportable.dump(cc)
- files[0][:size] = files[0][:data].size
-
- Dir.chdir(File.dirname(dp)) do
- f_data = Dir["#{bndp}/**/**"].select { |dd| dd !~ /CVS\// }
- f_data.map! { |dd| { :name => dd, :mode => 0644 } }
- files << tar_files(f_data, "data.pkg")
- end
-
- Dir.chdir(File.dirname(tp)) do
- f_tmpl = Dir["#{bntp}/**/**"].select { |tt| tt !~ /CVS\// }
- f_tmpl.map! { |tt| { :name => tt, :mode => 0644 } }
- files << tar_files(f_tmpl, "tmpl.pkg")
- end
- end
-
- ff = File.open(pkg, "wb")
- gz = Zlib::GzipWriter.new(ff)
- tw = Archive::Tar::Minitar::Writer.new(gz)
-
- files.each do |entry|
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
- end
-
- nil
- rescue Exception => ex
- puts ex, ex.backtrace.join("\n")
- ensure
- tw.close if tw
- gz.close if gz
- end
-
- def unpackage(source, dest)
- ff = File.open(source, "rb")
- gz = Zlib::GzipReader.new(ff)
- Archive::Tar::Minitar::Input.open(gz) do |it|
- it.each do |entry|
- case entry.full_name
- when "data.pkg", "tmpl.pkg"
- pkg = StringIO.new(entry.read)
- pkgz = Zlib::GzipReader.new(pkg)
- Archive::Tar::Minitar::Input.open(pkgz) do |inner|
- inner.each { |item| inner.extract_entry(dest, item) }
- end
- else
- it.extract_entry(dest, entry)
- end
- end
- end
-
- nil
- end
-
- def install(dest, options = {})
- if options['servlet']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet, dest, :mode => 0755)
- if RUBY_PLATFORM =~ /win32/
- if File.exists?(Ruwiki::Utils::Manager.ruwiki_servlet_bat)
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet_bat, dest, :mode => 0755)
- end
- if File.exists?(Ruwiki::Utils::Manager.ruwiki_servlet_cmd)
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet_cmd, dest, :mode => 0755)
- end
- end
- end
-
- if RUBY_PLATFORM =~ /win32/ and options['service']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_service, dest, :mode => 0755)
- end
-
- if options['cgi']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_cgi, dest, :mode => 0755)
- end
-
- if options['data']
- unpackage(Ruwiki::Utils::Manager.ruwiki_pkg, dest)
- end
- end
-
- if RUBY_PLATFORM =~ /win32/
- begin
- require 'win32/service'
- require 'rbconfig'
- HasWin32Service = true
- rescue LoadError
- HasWin32Service = false
- end
-
- # The work here is based on Daniel Berger's Instiki Service Tutorial.
- # http://rubyforge.org/docman/view.php/85/107/instiki_service_tutorial.txt
- def manage_windows_service(options, ioe)
- raise Ruwiki::Utils::Manager.message(:manager_service_broken) unless HasWin32Service
-
- service_name = options[:service_name] || 'RuwikiSvc'
-
- if options[:service_install]
- service_home = options[:service_home]
-
- program = options[:service_bin]
- if program.nil? or program.empty?
- program = File.join(service_home, "ruwiki_service.rb")
- elsif program !~ %r{[/\\]}
- program = File.join(service_home, program)
- end
- program = %<"#{program}">
-
- ruby = options[:ruby_bin] || %<"#{File.join(Config::CONFIG['bindir'], 'ruby.exe')}">
-
- service_desc = options[:service_desc] || 'Ruwiki'
-
- binpath = "#{ruby} #{program}".tr('/', '\\')
-
- service = Win32::Service.new
- service.create_service do |svc|
- svc.service_name = service_name
- svc.display_name = service_desc
- svc.binary_path_name = binpath
- svc.dependencies = [] # Required because of a bug in Win32::Service
- end
- service.close
- ioe[:output] << Manager.manager(:manager_service_installed) % [ service_name ] << "\n"
- end
-
- if options[:service_start]
- Win32::Service.start(service_name)
- started = false
- while (not started)
- status = Win32::Service.status(service_name)
- started = (status.current_state == "running")
- break if started
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_one_moment) % [ status.current_state ] << "\n"
- sleep 1
- end
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_started) % [ service_name ] << "\n"
- end
-
- if options[:service_stop]
- Win32::Service.stop(service_name)
- stopped = false
- while (not stopped)
- status = Win32::Service.status(service_name)
- stopped = (status.current_state == "stopped")
- break if stopped
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_one_moment) % [ status.current_state ] << "\n"
- sleep 1
- end
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_stopped) % [ service_name ] << "\n"
- end
-
- if options[:service_delete]
- Win32::Service.stop(service_name) rescue nil
- Win32::Service.delete(service_name)
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_deleted) % [ service_name ] << "\n"
- end
- end
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- ioe = {
- :input => input,
- :output => output,
- :error => error
- }
-
- language = 'en'
- find_lang = argv.grep(%r{^--lang})
- find_lang.each do |ee|
- eepos = argv.index(ee)
- if ee =~ %r{^--lang=}
- language = ee.sub(%r{^--lang=}, '')
- else
- language = argv[eepos.succ]
- argv.delete_at(eepos.succ)
- end
- argv.delete_at(eepos)
- end
-
- require "ruwiki/lang/#{language.downcase}"
- Ruwiki::Utils::Manager.message = Ruwiki::Lang.const_get(language.upcase)
-
- command = Ruwiki::Utils::CommandPattern[(argv.shift or "").downcase]
- return command[argv, {}, ioe]
- rescue Ruwiki::Utils::CommandPattern::MissingParameterError => ee
- ioe[:error] << Ruwiki::Utils::Manager.message(:manager_missing_parameter) % [ ee.argument ] << "\n"
- return 1
- rescue ArgumentError, ManagerError => ee
- ioe[:error] << ee.message << "\n"
- return 1
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/utils/servletrunner.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/utils/servletrunner.rb
deleted file mode 100644
index db6bcfa..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/utils/servletrunner.rb
+++ /dev/null
@@ -1,295 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-require 'webrick'
-
-require 'ruwiki/utils'
-require 'ruwiki/exportable'
-require 'ruwiki/servlet'
-require 'ruwiki/lang/en'
-require 'ruwiki/lang/de'
-require 'ruwiki/lang/es'
-
-require 'optparse'
-require 'ostruct'
-
-module Ruwiki::Utils::ServletRunner
- COPYRIGHT = <<-"COPYRIGHT"
-Ruwiki #{Ruwiki::VERSION}
- Copyright © 2002 - 2004, Digikata and HaloStatue
-
- http://rubyforge.org/projects/ruwiki/
-
- Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-
-Licensed under the same terms as Ruby.
-
-$Id$
-COPYRIGHT
-
- class WEBrickConfig
- include Ruwiki::Exportable
-
- exportable_group 'webrick-config'
- attr_accessor :port
- exportable :port
- attr_accessor :addresses
- exportable :addresses
- attr_accessor :mount
- exportable :mount
- attr_accessor :do_log
- exportable :do_log
- attr_accessor :log_dest
- exportable :log_dest
- attr_accessor :threads
- exportable :threads
-
- def export
- hash = super
- sc = hash['webrick-config']
- sc['addresses'] = sc['addresses'].join(";")
- sc['do-log'] = (sc['do-log'] ? 'true' : 'false')
- hash
- end
-
- # Because the servlet can be started from the command-line, provide
- # defaults for all possible configuration options.
- def initialize(exported = {})
- sc = exported['webrick-config'] || {}
- @port = sc['port'] || 8808
- @mount = sc['mount'] || '/'
- @addresses = sc['addresses']
- @do_log = ((sc['do-log'] == 'false') ? false : true)
- @log_dest = sc['log-dest']
- @threads = sc['threads'] || 1
-
- if @addresses.nil? or @addresses.empty?
- @addresses = []
- else
- @addresses = @addresses.split(/;/)
- end
-
- if @log_dest.nil? or @log_dest.empty?
- @log_dest = "<STDERR>"
- end
- end
- end
-
- def self.message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def self.message(id)
- @message[id]
- end
-
- class << self
- # This is for the WEBrick version of Ruwiki. This has been abstracted to
- # accept a Config global variable to reconfigure Ruwiki after initial
- # creation.
- def read_config(filename)
- ch = {}
- if File.exists?(filename)
- File.open(filename, 'rb') { |ff| ch = Ruwiki::Exportable.load(ff.read) }
- end
-
- @sc = WEBrickConfig.new(ch)
- @rc = Ruwiki::Config.new(ch)
-
- if @rc.webmaster.nil? or @rc.webmaster.empty?
- @rc.webmaster = "webmaster@domain.tld"
- end
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- read_config(Ruwiki::Config::CONFIG_NAME)
-
- save_config = nil
-
- language = 'en'
- find_lang = argv.grep(%r{^--language})
- find_lang.each do |ee|
- if ee =~ %r{^--language=}
- language = ee.sub(%r{^--language=}, '')
- else
- language = argv[argv.index(ee).succ]
- end
- end
-
- require "ruwiki/lang/#{language.downcase}"
- @rc.language = Ruwiki::Lang.const_get(language.upcase)
- self.message = @rc.language
-
- argv.options do |oo|
- oo.banner = self.message(:runner_usage) % [ File.basename($0) ]
- oo.separator self.message(:runner_general_options)
- oo.on('--save-config [FILENAME]', *([ self.message(:runner_saveconfig_desc), Ruwiki::Config::CONFIG_NAME ].flatten)) { |fname|
- save_config = fname || Ruwiki::Config::CONFIG_NAME
- }
- oo.on('--config FILENAME', *self.message(:runner_config_desc)) { |fn|
- read_config(fn)
- }
- oo.separator ""
- oo.separator self.message(:runner_webrick_options)
- oo.on('-P', '--port PORT', Numeric, *self.message(:runner_port_desc)) { |port|
- @sc.port = port
- }
- oo.on('-A', '--accept ADDRESS,ADDRESS,ADDRESS', Array, *self.message(:runner_address_desc)) { |address|
- @sc.addresses += address
- }
- oo.on('-L', '--local', *self.message(:runner_local_desc)) {
- @sc.addresses = ["127.0.0.1"]
- }
- oo.on('-M', '--mount MOUNT-POINT', *self.message(:runner_mountpoint_desc)) { |mp|
- @sc.mount = mp
- }
- oo.on('--[no-]log', *self.message(:runner_log_desc)) { |log|
- @sc.do_log = log
- }
- oo.on('--logfile LOGFILE', *self.message(:runner_logfile_desc)) { |lf|
- @sc.log_dest = lf
- }
- oo.on('-T', '--threads THREADS', Integer, *self.message(:runner_threads_desc)) { |tc|
- @sc.threads = tc
- }
- oo.separator ""
- oo.separator self.message(:runner_ruwiki_options)
- oo.on('--language=LANGUAGE', *self.message(:runner_language_desc)) { |lang|
- nil
- }
- oo.on('--webmaster WEBMASTER', *self.message(:runner_webmaster_desc)) { |wm|
- @rc.webmaster = wm
- }
- oo.on('--[no-]debug', *self.message(:runner_debug_desc)) { |dd|
- @rc.debug = dd
- }
- oo.on('--title TITLE', *self.message(:runner_title_desc)) { |tt|
- @rc.title = tt
- }
- oo.on('--default-page PAGENAME', *self.message(:runner_defaultpage_desc)) { |dp|
- @rc.default_page = dp
- }
- oo.on('--default-project PAGENAME', *self.message(:runner_defaultproject_desc)) { |dp|
- @rc.default_project = dp
- }
- oo.on('--template-path TEMPLATE_PATH', *self.message(:runner_templatepath_desc)) { |tp|
- @rc.template_path = tp
- }
- oo.on('--templates TEMPLATES', *self.message(:runner_templatename_desc)) { |tp|
- @rc.template_set = tp
- }
- oo.on('--css CSS_NAME', *self.message(:runner_cssname_desc)) { |css|
- @rc.css = css
- }
- oo.on('--storage-type TYPE', Ruwiki::KNOWN_BACKENDS, *([self.message(:runner_storage_desc), Ruwiki::KNOWN_BACKENDS.join(", ")].flatten)) { |st|
- @rc.storage_type = st
- @rc.storage_options[@rc.storage_type]['data-path'] ||= "./data/"
- @rc.storage_options[@rc.storage_type]['extension'] ||= "ruwiki"
- }
- oo.on('--data-path PATH', *self.message(:runner_datapath_desc)) { |fdp|
- @rc.storage_options['flatfiles']['data-path'] = fdp
- }
- oo.on('--extension EXT', *self.message(:runner_extension_desc)) { |ext|
- @rc.storage_options['flatfiles']['data-path'] = fdp
- }
- if defined?(Gem::Cache)
- oo.separator ""
- oo.on('--central', *self.message(:runner_central_desc)) {
- gempath = Gem::Cache.from_installed_gems.search("ruwiki", "=#{Ruwiki::VERSION}").last.full_gem_path
- @rc.storage_type = 'flatfiles'
- @rc.storage_options['flatfiles']['data-path'] = "#{gempath}/data"
- @rc.storage_options['flatfiles']['extension'] = "ruwiki"
- @rc.storage_options['flatfiles']['format'] = "exportable"
- @rc.template_path = "#{gempath}/templates"
- @rc.template_set = "sidebar"
- }
- end
-
- # TODO: Add options for time, date, and datetime formats.
- oo.separator ""
- oo.separator self.message(:runner_general_info)
- oo.on_tail('--help', *self.message(:runner_help_desc)) {
- error << oo << "\n"
- return 0
- }
- oo.on_tail('--version', *self.message(:runner_version_desc)) {
- error << COPYRIGHT << "\n"
- return 0
- }
- oo.parse!
- end
-
- if save_config
- sc = @sc.export
- rc = @rc.export
- cf = sc.merge(rc)
-
- File.open(save_config, 'wb') { |ff| ff.puts Ruwiki::Exportable.dump(cf) }
- return 0
- end
-
- # If the list of accepted addresses is not empty, provide IP-based
- # restrictions.
- if not @sc.addresses.empty?
- localonly = lambda do |sock|
- if not @sc.addresses.include?(sock.peeraddr[3])
- raise WEBrick::ServerError, self.message(:runner_rejected_address) % [ sock.peeraddr[3], @sc.addresses.join(", ") ]
- end
- end
- else
- localonly = nil
- end
-
- if @sc.do_log
- if "<STDERR>" == @sc.log_dest
- dest = $stderr
- else
- dest = File.open(@sc.log_dest, "wb+")
- end
- logger = WEBrick::Log.new(dest, WEBrick::Log::DEBUG)
- else
- logger = nil
- end
-
- banner = self.message(:runner_banner) %
- [ Ruwiki::Utils::ServletRunner::COPYRIGHT, @sc.port,
- @sc.addresses.join(", "), @sc.mount, @sc.do_log, @sc.log_dest,
- @sc.threads, @rc.webmaster, @rc.debug, @rc.title,
- @rc.default_project, @rc.default_page, @rc.template_path,
- @rc.template_set, @rc.css, @rc.storage_type,
- @rc.storage_options[@rc.storage_type]['data-path'],
- @rc.storage_options[@rc.storage_type]['extension'] ]
-
- banner.each { |bb| logger.info(bb) } unless logger.nil?
-
- server = WEBrick::HTTPServer.new(:Port => @sc.port.to_i,
- :StartThreads => @sc.threads.to_i,
- :AcceptCallback => localonly,
- :Logger => logger)
- @rc.logger = logger
- Ruwiki::Servlet.config = @rc
-
- server.mount(@sc.mount, Ruwiki::Servlet)
- trap("INT") { server.shutdown; return }
- server.start
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki.rb
deleted file mode 100644
index 85f2c51..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
- # Ruwiki's Wiki markup class. This will convert the Wiki markup known by
- # Ruwiki (defined by Token classes). The algorithm is as follows:
- #
- # 1. For each known Token class, match each instance of it in the content
- # stream. Replace each instance in the content stream with a Token
- # marker: TOKEN_x or \TOKEN_x, where x is a digit representing the Token.
- # (\TOKEN_x is a special case of token matching. See
- # Ruwiki::Markup::Token for more information.) Store the Token for later
- # processing.
- # 2. Go back through the content, replacing each instance of \TOKEN_x with
- # the Token's defined restore value (which should be the same value as was
- # originally matched).
- # 3. Go through the content, replacing each instance of TOKEN_x with the
- # Token's defined replacement value.
- # 4. Go through the tokens, in reverse, and execute the post replacement
- # routine defined by the Token. (This may be necessary to collapse
- # consecutive HTML structures.)
- # 5. Return the parsed content and the collected metadata.
- #
- # == Tokens
- # Look at Ruwiki::Markup::Token describes how to create Token objects.
-class Ruwiki::Wiki
- def parse(content, project)
- content = clean(content)
- tokens = []
- project ||= @default_project
-
- Token.tokenlist.each do |token|
- content.gsub!(token.regexp) do |mm|
- match = Regexp.last_match
- tc = token.new(match, project, @backend, @script, @message, @title)
- tokens << tc
- if mm[0, 1] == '\\'
- "\\TOKEN_#{tokens.size - 1}"
- else
- "TOKEN_#{tokens.size - 1}"
- end
- end
- end
-
- replaced = []
- ss = true
- loop do
- break if replaced.size >= tokens.size
- break if ss.nil?
- ss = content.gsub!(/\\TOKEN_(\d+)/) { |mm|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].restore
- }
-
- ss = content.gsub!(/TOKEN_(\d+)/) { |mm|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].replace
- }
- end
-
- token_classes = tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
-
- content
- end
-
- attr_accessor :default_project
- attr_accessor :script
- attr_accessor :backend
- attr_accessor :message
-
- # Creates the markup class.
- def initialize(default_project, script, title)
- @default_project = default_project
- @script = script
- @title = title
- end
-
-private
- # Find HTML tags
- SIMPLE_TAG_RE = %r{<[^<>]+?>} # Ensure that only the tag is grabbed.
- HTML_TAG_RE = %r{\A< # Tag must be at start of match.
- (/)? # Closing tag?
- ([\w:]+) # Tag name
- (?:\s+ # Space
- ([^>]+) # Attributes
- (/)? # Singleton tag?
- )? # The above three are optional
- >}x
- ATTRIBUTES_RE = %r{([\w:]+)(=(?:\w+|"[^"]+?"|'[^']+?'))?}x
- STYLE_NOVD_RE = %r{(?:\s?(visibility|display):[^'";]+;?)}x
- ALLOWED_ATTR = %w(style title type lang dir class id cite datetime abbr) +
- %w(colspan rowspan compact start media)
- ALLOWED_HTML = %w(abbr acronym address b big blockquote br caption cite) +
- %w(code col colgroup dd del dfn dir div dl dt em h1 h2 h3) +
- %w(h4 h5 h6 hr i ins kbd li menu ol p pre q s samp small) +
- %w(span strike strong style sub sup table tbody td tfoot) +
- %w(th thead tr tt u ul var)
-
- # Clean the content of unsupported HTML and attributes. This includes
- # XML namespaced HTML. Sorry, but there's too much possibility for
- # abuse.
- def clean(content)
- content = content.gsub(SIMPLE_TAG_RE) do |tag|
- tagset = HTML_TAG_RE.match(tag)
-
- if tagset.nil?
- tag = Ruwiki.clean_entities(tag)
- else
- closer, name, attributes, single = tagset.captures
-
- if ALLOWED_HTML.include?(name.downcase)
- unless closer or attributes.nil?
- attributes = attributes.scan(ATTRIBUTES_RE).map do |set|
- if ALLOWED_ATTR.include?(set[0].downcase)
- if set[0] == 'style'
- set[1].gsub!(STYLE_NOVD_RE, '')
- end
- set.join
- else
- nil
- end
- end.compact.join(" ")
- tag = "<#{closer}#{name} #{attributes}#{single}>"
- else
- tag = "<#{closer}#{name}>"
- end
- else
- tag = Ruwiki.clean_entities(tag)
- end
- end
- tag.gsub(%r{((?:href|src)=["'])(#{Ruwiki::Wiki::RE_URI_SCHEME})}) { "#{$1}\\#{$2}" }
- end
- end
-end
-
-require 'ruwiki/wiki/tokens'
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens.rb
deleted file mode 100644
index 5ae48c1..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens.rb
+++ /dev/null
@@ -1,136 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # The base Token class. All Token classes must inherit from Token and
- # *must* implement the following methods:
- #
- # [self.regexp] The regular expression that the Token will be
- # replacing.
- # [replace] The mechanism for replacing the Token with the desired
- # results.
- #
- # Token classes <i>should</i> implement the following method:
- # [self.rank] Default: <tt>5000</tt>. Affects the sort order.
- # Must return an integer.
- #
- # Token classes <i>may</i> implement the following methods:
- # [restore] Restores the token without replacement.
- # Implements the results of the escape character.
- # NOTE: each Token class is responsible for its own
- # restore. Tokens that are anchored to the
- # beginning of a line are the most likely to need
- # to reimplement this.
- # [self.post_replace] Performs any necessary massaging of the data. See
- # the implementation of Ruwiki::Wiki::Lists for
- # more information.
- class Token
- @@tokenlist = []
- @@sorted = false
-
- class << self
- # Tokens should define rank if they must be first or last in
- # processing. Otherwise, they are sorted in the order defined.
- def rank
- 5000
- end
-
- # The Wiki parsing routine uses Token.tokenlist to determine the
- # tokens that are processed, and the order in which they are
- # processed. See Token.rank for more information.
- def tokenlist
- unless @@sorted
- head = @@tokenlist.shift
- @@tokenlist.sort! { |aa, bb| aa.rank <=> bb.rank }
- @@tokenlist.unshift(head)
- sorted = true
- end
- @@tokenlist
- end
-
- def inherited(child_class) #:nodoc:
- @@tokenlist << Token if @@tokenlist.empty?
-
- # Make the child class post_replace a blank function because we
- # don't want to propogate the currently defined post_replace.
- # The current post_replace is specific to Token_Base only.
- class << child_class
- def self.post_replace(content)
- content
- end
- end
-
- @@tokenlist << child_class
- @@sorted = false
- end
-
- # The replacement regular expression.
- def regexp
- /TOKEN_(\d*)/
- end
- end
-
- # All Token classes must match this header signature if they define
- # #initialize.
- #
- # [match] The MatchData object for this Token.
- # [project] The project being processed.
- # [backend] The backend for the wiki. This is used to determine if
- # the page or project exists. The object passed must
- # respond to #project_exists?(project) and
- # #page_exists?(page, project).
- # [script] The URI to the script.
- # [message] The message hash for localized messages.
- # [title] The title of the Wiki.
- def initialize(match, project, backend, script, message, title)
- @match = match
- @project = project
- @backend = backend
- @script = script
- @message = message
- @title = title
- end
-
- # The replacement method. Uses @match to replace the token with the
- # appropriate values.
- def replace
- "TOKEN_#{@match[1]}"
- end
-
- # Restores the token without replacement. By default, replaces
- # "dangerous" HTML characters.
- def restore
- Ruwiki.clean_entities(@match[0])
- end
-
- # The content may need massaging after processing.
- def self.post_replace(content)
- content
- end
- end
- end
-end
-
- # Load the tokens from the ruwiki/wiki/tokens directory.
-tokens_dir = 'ruwiki/wiki/tokens'
-
-$LOAD_PATH.each do |path|
- target = "#{path}/#{tokens_dir}"
- if File.exists?(target) and File.directory?(target)
- Dir::glob("#{target}/*.rb") do |token|
- begin
- require token
- rescue LoadError
- nil
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/00default.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/00default.rb
deleted file mode 100644
index b214758..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/00default.rb
+++ /dev/null
@@ -1,211 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-# $debug = File.open("output.txt", "wb")
-
-class Ruwiki::Wiki
- # The Paragraph Token class changes blank lines to <p> tags. This class,
- # under the current implementation, should be *first* in the Token list
- # after Token.
- class Paragraph < Ruwiki::Wiki::Token
- # This Token is #rank 0, because it should be first in the Token list.
- def self.rank
- 0
- end
-
- # Matches blank lines. %r{^$}
- def self.regexp
- %r{(^$)}
- end
-
- def replace
- %Q(</p><p class="rwtk_Paragraph">)
- end
-
- # Ensures that <p> won't be surrounded by <br> tags.
- def self.post_replace(content)
- content.gsub!(%r{\A}, '<p class="rwtk_Paragraph">')
- content.gsub!(%r{\z}, '</p>')
- content.gsub!(%r{\n(</p>)}, '\1')
- content.gsub!(%r{(<p[^>]*>)\n}, '\1')
- content.gsub!(%r{(</p>)(<p[^>]*>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{<p[^>]*></p>}, '')
- content.gsub!(%r{^\n(<p[^>]*>)}, '\1')
- content
- end
- end
-
- # The Code Token class converts indented text to "unformatted" (<pre>)
- # text. This class should be *second* in the Token list.
- class Code < Ruwiki::Wiki::Token
- # This Token is #rank 1, because it should be second in the Token list.
- def self.rank
- 1
- end
-
- # Matches indented text. %r{^(\s+\S?.*)$}
- def self.regexp
- %r{^([ \t]+[^\n]*)\n}
- end
-
- # Replaces the text to <pre>content</pre>.
- def replace
- content = Ruwiki.clean_entities(@match.captures[0])
-
- %Q{</p><pre class="rwtk_Code">#{content}</pre>\n}
- end
-
- # Converts cases of %r{</pre>(\n|<br ?/?>)<pre>} to \1.
- def self.post_replace(content)
- content.gsub!(%r{</pre>((\n)*</p>(\n)*)?<pre[^>]*>}, "\n")
- content.gsub!(%r{</pre>(\n|<br ?/?>)?<pre[^>]*>}, '\1')
- content.gsub!(%r{<p[^>]*>(<pre[^>]*>)}, '\1')
- content.gsub!(%r{</pre></p>}, '</pre>')
-# content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content
- end
- end
-
- RE_URI_SCHEME = %r{[-a-z0-9+.]{3,}?:}
- RE_URI_PATH = %r{[^\s<>\]]}
- RE_URI_TEXT = %r{[^\]]*}
-
- def self.redirect(uri)
- "http://www.google.com/url?sa=D;q=#{CGI.escape(uri)}"
- end
-
- # Converts URLs in the form of [url] to numbered links.
- class NumberedLinks < Ruwiki::Wiki::Token
- class << self
- def increment
- @count ||= 0
- @count += 1
- end
-
- def reset
- @count = 0
- end
- end
-
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\]}
- end
-
- def replace
- extlink = @match.captures[0]
-
- name = "[#{NumberedLinks.increment}]"
-
- %Q{<a class="rwtk_NumberedLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{name}</a>}
- end
- end
-
- class Image < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- RE_IMAGE_OPTIONS=%r{([^=]+)=("[^"]+"|[^ ]+)}
-
- def self.regexp
- %r{\[image\s*:\s*(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)(\s+[^\]]+)?\]}
- end
-
- def replace
- options = { 'src' => %Q("#{@match.captures[0]}") }
- groups = @match.captures[1]
- unless groups.nil?
- groups.scan(RE_IMAGE_OPTIONS).each { |gg| options[gg[0].strip] = gg[1].strip }
- end
-
- unless options['numbered'].nil? or options['numbered'] == "false"
- options['title'] = %Q("[#{NumberedLinks.increment}]")
- options.delete('numbered')
- end
-
- options['title'] ||= options['alt']
- options['title'] ||= options['src']
- options['alt'] ||= options['title']
-
- ss = ""
- options.keys.sort.map { |kk| ss << %Q( #{kk}=#{options[kk]}) }
-
- %Q{<img class="rwtk_Image"#{ss} />}
- end
- end
-
- # Converts URLs in the form of [url name] to named links.
- class NamedLinks < Ruwiki::Wiki::Token
- def self.rank
- 3
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\s+(#{RE_URI_TEXT})\]}
- end
-
- def replace
- extlink = @match.captures[0]
- name = @match.captures[1]
-
- %Q{<a class="rwtk_NamedLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{name}</a>}
- end
- end
-
- # Converts URLs to links where the "name" of the link is the URL itself.
- class ExternalLinks < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{\b(#{RE_URI_SCHEME}#{RE_URI_PATH}+)}
- end
-
- def restore
- @match[0]
- end
-
- def replace
- extlink = @match.captures[0]
-
- %Q{<a class="rwtk_ExternalLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{extlink}</a>}
- end
- end
-
- # Creates a horizontal rule.
- class HRule < Ruwiki::Wiki::Token
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def replace
- %Q(<hr class="rwtk_HRule" />)
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(<p[^>]*>)*(<hr[^ />]* ?/?>)(</p>)*}, '\1')
- content.gsub!(%r{\n<hr />}, "</p>\n<hr />")
- content.gsub!(%r{<hr ?/?>\n<br ?/?>}, "<hr />")
- content.gsub!(%r{(\n|<br ?/?>)?<hr>(\n|<br ?/?>)?}, "<hr />")
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/01wikilinks.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/01wikilinks.rb
deleted file mode 100644
index 442a201..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/01wikilinks.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # This provides the basic WikiWord match. This supports WikiWord,
- # CPlusPlus, ThisIsALink, and C_Plus_Plus.
- RE_WIKI_WORDS = %r{[[:upper:]][\w_]*(?:[[:lower:]]+[[:upper:]_]|[[:upper:]_]+[[:lower:]])[\w_]*}
- # This provides wikipedia format matches, e.g., [[wikipedia links]]. The
- # only restriction on words in this format is that they must NOT begin
- # with an underscore ('_').
- RE_WIKIPEDIA_WORDS = %r{\[\[([^_].*?)\]\]}
- # This provides the basic Wiki Project match.
- RE_PROJECT_WORD = %r{[[:upper:]][[:lower:]]+}
-
- # This provides the Wiki view link format:
- VIEW_LINK = %Q[<a class="rwtk_WikiLink" href="%s">%s</a>]
- EDIT_LINK = %Q[<span class="rwtk_EditWikiLink">%s</span><a class="rwtk_WikiLink" href="%s">?</a>]
-
- # Creates a crosslink for a Project::WikiPage.
- class ProjectCrossLink < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::(#{RE_WIKI_WORDS})}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic.gsub(/_/, ' ')}"]
- else
- EDIT_LINK % ["#{project}::#{topic.gsub(/_/, ' ')}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a crosslink for a Project::WikiPage using a Wikipedia link
- # format.
- class ProjectCrossLinkWikipedia < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::#{RE_WIKIPEDIA_WORDS}}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic}"]
- else
- EDIT_LINK % ["#{project}::#{topic}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to the project index from ::Project.
- class ProjectIndex < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{(\B|\\)::(#{RE_PROJECT_WORD})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- project = @match.captures[1]
-
- if @backend.page_exists?('ProjectIndex', project)
- VIEW_LINK % ["#{@script}/#{project}/ProjectIndex", project]
- else
- if @backend.project_exists?(project)
- EDIT_LINK % [project, "#{@script}/#{project}/ProjectIndex/_edit"]
- else
- EDIT_LINK % [project, "#{@script}/#{project}/_create"]
- end
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project.
- class WikiLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\b|\\)(#{RE_WIKI_WORDS})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic.gsub(/_/, ' ')]
- else
- EDIT_LINK % [topic.gsub(/_/, ' '), "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project using a Wikipedia
- # link format.
- class WikipediaLinks < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(\B|\\)#{RE_WIKIPEDIA_WORDS}\B}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- ALT_TEXT = %r{(.+)\|(.+)}o
-
- def replace
- captures = @match.captures
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- at = ALT_TEXT.match(topic)
-
- if not at.nil?
- topic = at.captures[1]
- link = CGI.escape(at.captures[0])
- end
-
- if @backend.page_exists?(link, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic]
- else
- EDIT_LINK % [topic, "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/02actions.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/02actions.rb
deleted file mode 100644
index 8ad0950..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/02actions.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # Produces a list of topics.
- class TopicList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%topics\((#{Ruwiki::Wiki::RE_PROJECT_WORD})?\)$}
- end
-
- def replace
- project = @match.captures[0] || @project
-
- if @backend.project_exists?(project)
- topic_list = @backend.list_topics(project)
- else
- topic_list = []
- end
-
- if topic_list.empty?
- ss = @message[:no_topics] % [project]
- else
- ss = %Q(<h4 class="rwtk_Headings">#{@message[:topics_for_project] % [project]}</h4>\n<ul class="rwtk_Lists">\n)
- topic_list.each do |tt|
- ss << %Q(<li class="rwtk_Lists">)
- ss << VIEW_LINK % ["#{@script}/#{project}/#{tt}", "#{CGI::unescape(tt.gsub(/_/, ' '))}"]
- ss << "</li>\n"
- end
- ss << "</ul>\n"
- end
-
- ss
- end
- end
-
- class ProjectList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%projects\(\)$}
- end
-
- def replace
- proj_list = @backend.list_projects
-
- ss = %Q(<h4 class="rwtk_Headings">#{@message[:wiki_projects] % [@title]}</h4>\n<ul class="rwtk_Lists">\n)
- proj_list.each do |pp|
- ss << %Q(<li class="rwtk_Lists">)
- ss << VIEW_LINK % ["#{@script}/#{pp}/ProjectIndex", pp]
- ss << %Q! <a href='#{@script}/#{pp}/_topics' class='rw_minilink'>#{@message[:project_topics_link]}</a>!
- ss << "</li>\n"
- end
- ss << "</ul>\n"
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/abbreviations.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/abbreviations.rb
deleted file mode 100644
index b928085..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/abbreviations.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Converts abbreviations.
- class Abbreviations < Ruwiki::Wiki::Token
- ABBREVIATIONS = {
- "matz" => "Yukihiro Matsumoto",
- }
-
- def self.regexp
- %r!@\{([^\}]*)\}!
- end
-
- def replace
- kk = @match.captures[0]
- if kk.nil? or kk.empty?
- data = %Q(<dl class="rwtk_Abbreviations">)
- ABBREVIATIONS.each do |kk, vv|
- data << %Q(<dt class="rwtk_Abbreviations">#{kk}</dt><dd class="rwtk_Abbreviations">#{vv}</dd>)
- end
- data << %Q(</dl>)
- else
- if ABBREVIATIONS.has_key?(kk)
- data = ABBREVIATIONS[kk]
- else
- data = @match[0]
- end
- end
- data
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/calendar.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/calendar.rb
deleted file mode 100644
index c78dc45..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/calendar.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces a mini-calendar with dates as WikiWords.
- class Calendar < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?%calendar\((?:(today)|(\d+),\s*(\d+))(?:,\s*(#{RE_PROJECT_WORD}))?\)}
- end
-
- def self.make(year, month)
- result = []
- tt = Time.local(year, month, 1)
- rr = Array.new(tt.wday, nil)
- rr << 1
-
- 2.upto(31) do |ii|
- break if Time.local(year, month, ii).month != month
- rr << ii
- end
-
- rr += Array.new((- rr.size) % 7, nil)
-
- 0.step(rr.size - 1, 7) do |ii|
- result << rr[ii, 7]
- end
- result
- end
-
- def make_month_link(project, year, month, state = nil)
- ym = "%04d%02d" % [year, month]
- case state
- when :prev
- title = "&laquo; #{year}.#{month}"
- when :next
- title = "#{year}.#{month} &raquo;"
- else
- title = "#{project}::#{year}.#{month}"
- end
- url = "#{@script}/#{project}/#{ym}"
-
- if @backend.page_exists?(ym, project)
- VIEW_LINK % [url, title]
- else
- EDIT_LINK % [title, "#{url}/_edit"]
- end
- end
-
- def replace
- today = @match.captures[0]
- project = @match.captures[3] || @project
- now = Time.now
-
- if today.nil?
- year = @match.captures[1].to_i
- month = @match.captures[2].to_i
- else
- year = now.year
- month = now.month
- end
-
- if (year == now.year) and (month == now.month)
- show_today = now.day
- else
- show_today = nil
- end
-
- result = <<-"CALENDAR_HEAD"
-</p>
-<div class="rwtk_Calendar">
-<table class="rwtk_Calendar" summary="calendar for ::#{project}: #{year}.#{month}">
-<thead>
- CALENDAR_HEAD
-
- result << %Q{ <tr>\n<th colspan="7" class="rwtk_Calendar_current_month">}
- result << make_month_link(project, year, month)
- result << %Q{</th>\n </tr>\n <tr>\n<th colspan="2" class="rwtk_Calendar_prev_month">}
- result << make_month_link(project, year, month - 1, :prev)
- result << %Q{</th>\n<th colspan="3"></th>\n<th colspan="2" class="rwtk_Calendar_next_month">}
- result << make_month_link(project, year, month + 1, :next)
- result << "</th>\n"
-
- result << <<-"CALENDAR_HEAD2"
- </tr>
- <tr>
- <th class="rwtk_Calendar_weekend">Su</th>
- <th class="rwtk_Calendar_weekday">Mo</th>
- <th class="rwtk_Calendar_weekday">Tu</th>
- <th class="rwtk_Calendar_weekday">We</th>
- <th class="rwtk_Calendar_weekday">Th</th>
- <th class="rwtk_Calendar_weekday">Fr</th>
- <th class="rwtk_Calendar_weekend">Sa</th>
- </tr>
-</thead>
-<tbody>
- CALENDAR_HEAD2
-
- Calendar.make(year, month).each do |week|
- result << " <tr>\n"
- week.each do |day|
- if day.nil?
- result << %Q{ <td class="rwtk_Calendar_day"></td>\n}
- else
- date = "%04d%02d%02d" % [year, month, day]
- # Add the ability to create pages based on date here.
- if show_today == day
- result << %Q{ <td class="rwtk_Calendar_today">}
- else
- result << %Q{ <td class="rwtk_Calendar_day">}
- end
- if @backend.page_exists?(date, project)
- result << VIEW_LINK % ["#{@script}/#{project}/#{date}", day]
- else
- result << EDIT_LINK % [day, "#{@script}/#{project}/#{date}/_edit"]
- end
- result << %Q{</td>\n}
- end
- end
- result << " </tr>\n"
- end
-
- result << %Q(</tbody>\n</table>\n</div>\n<p class="rwtk_Paragraph">)
- result
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*>(\s*</?div(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?table(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?t(?:head|body|r)(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*<t[hd].+?</t[hd]>\s*)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/headings.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/headings.rb
deleted file mode 100644
index cfc3001..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/headings.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts headings.
- class Headings < Ruwiki::Wiki::Token
-# def self.rank
-# 5
-# end
-
- def self.regexp
- %r{^\\?(=+)\s+(.*)}
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def replace
- level = @match.captures[0].count("=")
- content = @match.captures[1]
- level = 6 if level > 6
- %Q(<h#{level} class="rwtk_Headings">#{content}</h#{level}>)
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(</h\d>)\n}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{(</h\d>)</p>\n<p>}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{<p[^>]*>(<h\d[^>]*>)}, '\1')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/lists.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/lists.rb
deleted file mode 100644
index 1615c2c..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/lists.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Produces Lists
- class Lists < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?([*#]+)\s+(.*)$}
- end
-
- def replace
- indent = @match.captures[0].scan(/./).map { |ee| ee == "*" ? 'ul' : 'ol' }
- content = @match.captures[1]
-
- pre = ''
- post = ''
- indent.each { |elem| pre << %Q(<#{elem} class="rwtk_Lists">) }
- indent.reverse_each { |elem| post << %Q(</#{elem}>) }
- %Q(#{pre}<li class="rwtk_Lists">#{content}</li>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- RE_NESTED_LISTS = %r{</[uo]l>\s*<[uo]l[^>]*>}
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*><([uo]l[^>]*)>}, '<\1>')
- content.gsub!(%r{</([uo]l)></p>}, '</\1>')
- content.gsub!(RE_NESTED_LISTS, '') while content =~ RE_NESTED_LISTS
- content
- end
- end
-
- # Produces block quotes.
- class Blockquotes < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((:+)|(>+))(\s+.*)$}
- end
-
- def replace
- content = @match.captures[3]
-
- if @match.captures[2].nil?
- char = ':'
- cite = ''
- else
- char = '>'
- cite = ' type="cite"'
- end
- indent = @match.captures[0].count(char)
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<blockquote#{cite} class="rwtk_Blockquotes">)
- post << %Q(</blockquote>)
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1].gsub(/^>/, '&gt;')
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</blockquote>(\n|<br ?/?>)?<blockquote[^>]*>}, '')
- content.gsub!(%r{(</?blockquote[^>]*>\n?)\s*}, '\1')
- content.gsub!(%r{</blockquote>(<blockquote[^>]*>)+}, '\1')
- content
- end
- end
-
- # Produces definition lists. Does not completely work correctly.
- class Definitions < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(;+)\s+(.+?)\s+:\s+(.*)}
- end
-
- def replace
- definition = @match.captures[2]
- term = @match.captures[1]
- indent = @match.captures[0].count(';')
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<dl class="rwtk_Definitions">)
- post << %Q(</dl>)
- end
- %Q(#{pre}<dt class="rwtk_Definitions">#{term}</dt><dd class="rwtk_Definitions">#{definition}</dd>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</dl>(\n|<br ?/?>)?<dl[^>]*>}, '')
- content.gsub!(%r{</dl>(<dl[^>]*>)+}, '\1')
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/rubylists.rb b/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/rubylists.rb
deleted file mode 100644
index b765ad1..0000000
--- a/ruwiki/tags/release-0.9.0/lib/ruwiki/wiki/tokens/rubylists.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Convert ruby-talk mailing list references (e.g., [ruby-talk:12345])
- # into named links.
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
-# %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/#{lm}">#{@match[0]}</a>)
- end
- end
-
- # Convert ruby-core/ext/dev/list/math mailing list references (e.g.,
- # [ruby-core:12345]) into named links.
- class OtherRubyLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-(list|doc|core|dev|ext|math):(\d+)\]}
- end
-
- def replace
- ln, lm = @match.captures[0..1]
- %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-#{ln}/#{lm}">#{@match[0]}</a>)
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/ruwiki b/ruwiki/tags/release-0.9.0/ruwiki
deleted file mode 100644
index 251a140..0000000
--- a/ruwiki/tags/release-0.9.0/ruwiki
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'ruwiki/utils'
-require 'ruwiki/utils/manager'
-
- # RPA Maintainers: Change this to the appropriate location on installation.
- # This is the right place for RubyGems, basically.
-ss = "#{File.dirname(File.expand_path(__FILE__))}/.."
-
-Ruwiki::Utils::Manager.shared = ss
-
-exit Ruwiki::Utils::Manager.run(ARGV)
diff --git a/ruwiki/tags/release-0.9.0/ruwiki.cgi b/ruwiki/tags/release-0.9.0/ruwiki.cgi
deleted file mode 100644
index 2e1ebee..0000000
--- a/ruwiki/tags/release-0.9.0/ruwiki.cgi
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
-config_file = File.join(Dir.pwd, Ruwiki::Config::CONFIG_NAME)
-
-if File.exists?(config_file)
- wiki.load_config(config_file)
- config = Ruwiki::Config.read(config_file)
- if config.webmaster.nil? or config.webmaster.empty?
- config.webmaster = "webmaster@domain.tld"
- end
-else
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
- wiki.config.webmaster = "webmaster@domain.tld"
-
-# wiki.config.debug = false
-# wiki.config.title = "Ruwiki"
-# wiki.config.default_page = "ProjectIndex"
-# wiki.config.default_project = "Default"
- # This next defaults to 'flatfiles'. Conversion of the default data will
- # be necessary to use other formats.
-# wiki.config.storage_type = 'flatfiles'
-# wiki.config.storage_options[wiki.config.storage_type][:data_path] = "./data/"
- wiki.config.storage_options[wiki.config.storage_type][:extension] = "ruwiki"
-# wiki.config.template_path = "./templates/"
-# wiki.config.template_set = "default"
-# wiki.config.css = "ruwiki.css"
-# wiki.config.time_format = "%H:%M:%S"
-# wiki.config.date_format = "%Y.%m.%d"
-# wiki.config.datetime_format = "%Y.%m.%d %H:%M:%S"
-end
-
-wiki.config!
-wiki.run
diff --git a/ruwiki/tags/release-0.9.0/ruwiki.conf b/ruwiki/tags/release-0.9.0/ruwiki.conf
deleted file mode 100644
index 72e4cc6..0000000
--- a/ruwiki/tags/release-0.9.0/ruwiki.conf
+++ /dev/null
@@ -1,22 +0,0 @@
-ruwiki-config!auth-options:
-ruwiki-config!css: ruwiki.css
-ruwiki-config!date-format: %Y.%m.%d
-ruwiki-config!datetime-format: %Y.%m.%d %H:%M:%S
-ruwiki-config!debug: true
-ruwiki-config!default-page: ProjectIndex
-ruwiki-config!default-project: Default
-ruwiki-config!language: en
-ruwiki-config!storage-options: flatfiles!data-path: ./data
- flatfiles!extension: ruwiki
-ruwiki-config!storage-type: flatfiles
-ruwiki-config!template-path: ./templates/
-ruwiki-config!template-set: default
-ruwiki-config!time-format: %H:%M:%S
-ruwiki-config!title: Ruwiki
-ruwiki-config!webmaster: webmaster@domain.tld
-webrick-config!addresses:
-webrick-config!do-log: true
-webrick-config!log-dest: <STDERR>
-webrick-config!mount: /
-webrick-config!port: 8808
-webrick-config!threads: 1
diff --git a/ruwiki/tags/release-0.9.0/ruwiki_convert b/ruwiki/tags/release-0.9.0/ruwiki_convert
deleted file mode 100644
index 856a28c..0000000
--- a/ruwiki/tags/release-0.9.0/ruwiki_convert
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
- # Load all of the known backends.
-require 'ruwiki/utils'
-require 'ruwiki/backend/flatfiles'
-require 'ruwiki/utils/converter'
-
-exit Ruwiki::Utils::Converter.run(ARGV)
diff --git a/ruwiki/tags/release-0.9.0/ruwiki_service.rb b/ruwiki/tags/release-0.9.0/ruwiki_service.rb
deleted file mode 100644
index 57695de..0000000
--- a/ruwiki/tags/release-0.9.0/ruwiki_service.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'win32/service'
-require 'ruwiki/utils/servletrunner'
-
-class Ruwiki::Utils::Daemon < Win32::Daemon
- LOCATION = File.dirname(File.expand_path(__FILE__))
-
- def initialize
- @logfile = File.open(File.join(LOCATION, "ruwiki_service.log"), "ab+")
- rescue Exception => e
- File.open(File.join(LOCATION, "temp.log"), "a+") do |f|
- f.puts "Logfile error: #{e}"
- f.puts "Backtrace:\n#{e.backtrace.join(', ')}"
- end
- exit
- end
-
- def service_main
- ARGV.replace(["--config", File.join(LOCATION, Ruwiki::Config::CONFIG_NAME),
- "--logfile", File.join(LOCATION, "ruwiki_servlet.log")])
- Ruwiki::Utils::ServletRunner.run(ARGV, @logfile, @logfile, @logfile)
- rescue Exception => e
- file = LOCATION + '/temp.log'
- File.open(file, "a+") do |f|
- f.puts "Error: #{e}"
- f.puts "Backtrace: #{e.backtrace.join(', ')}"
- end
- exit
- end
-end
-
-daemon = Ruwiki::Utils::Daemon.new
-daemon.mainloop
diff --git a/ruwiki/tags/release-0.9.0/ruwiki_servlet b/ruwiki/tags/release-0.9.0/ruwiki_servlet
deleted file mode 100644
index 7fc5459..0000000
--- a/ruwiki/tags/release-0.9.0/ruwiki_servlet
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'ruwiki/utils/servletrunner'
-
-exit Ruwiki::Utils::ServletRunner.run(ARGV)
diff --git a/ruwiki/tags/release-0.9.0/templates/default/body.tmpl b/ruwiki/tags/release-0.9.0/templates/default/body.tmpl
deleted file mode 100644
index baaa259..0000000
--- a/ruwiki/tags/release-0.9.0/templates/default/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow,noarchive" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.9.0/templates/default/content.tmpl b/ruwiki/tags/release-0.9.0/templates/default/content.tmpl
deleted file mode 100644
index 7f662b2..0000000
--- a/ruwiki/tags/release-0.9.0/templates/default/content.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.0/templates/default/controls.tmpl b/ruwiki/tags/release-0.9.0/templates/default/controls.tmpl
deleted file mode 100644
index 8f855c2..0000000
--- a/ruwiki/tags/release-0.9.0/templates/default/controls.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_header">
- <form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- <!-- Right-hand tabs must go in reverse order! -->
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.9.0/templates/default/edit.tmpl b/ruwiki/tags/release-0.9.0/templates/default/edit.tmpl
deleted file mode 100644
index 9e5dbb5..0000000
--- a/ruwiki/tags/release-0.9.0/templates/default/edit.tmpl
+++ /dev/null
@@ -1,27 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_navbar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_navbar_righttab" id="rw_editing_tab"><strong><em>#label_editing#</em> #%page_version%</strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <div class="rw_content">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.0/templates/default/error.tmpl b/ruwiki/tags/release-0.9.0/templates/default/error.tmpl
deleted file mode 100644
index a3887b2..0000000
--- a/ruwiki/tags/release-0.9.0/templates/default/error.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.0/templates/default/footer.tmpl b/ruwiki/tags/release-0.9.0/templates/default/footer.tmpl
deleted file mode 100644
index 48146ea..0000000
--- a/ruwiki/tags/release-0.9.0/templates/default/footer.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_footer">
-<!--<form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- {!-- Right-hand tabs must go in reverse order! --}
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>-->
-</div>
diff --git a/ruwiki/tags/release-0.9.0/templates/default/ruwiki.css b/ruwiki/tags/release-0.9.0/templates/default/ruwiki.css
deleted file mode 100644
index cfe7bf6..0000000
--- a/ruwiki/tags/release-0.9.0/templates/default/ruwiki.css
+++ /dev/null
@@ -1,297 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_footer
-{
-/*position: absolute;
- width: 100%;
- bottom: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;*/
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_footer { position: fixed; }
-
-body > div#rw_footer > .rw_navbar { position: fixed; bottom: 0; }
-body > div#rw_footer > .rw_navbar > div { position: relative; top: -2em; }
-
-body
-{
- margin: 0.5em;
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_navbar
-{
- width: 100%;
- margin: 0;
- padding: 0.1em;
- font-size: 0.7em;
- border: 1px solid black;
- color: white;
- background-color: #27C;
- height: 0.5em;
- z-index: 2;
-}
-
-.rw_navbar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_navbar a:visited
-{
- color: #2E7;
- font-weight: normal;
- border-bottom: 1px dashed #2E7;
-}
-
-.rw_navbar a:hover
-{
- text-decoration: none;
-}
-
-.rw_navbar_tab
-{
- float: left;
- background-color: #27C;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_navbar_tab:hover
-{
- background-color: #49E;
-}
-
-.rw_navbar_righttab
-{
- float: right;
- padding-left: 0.8em;
- padding-top: 0.3em;
- padding-right: 0.8em;
- border: 1px solid #059;
- background-color: #27C;
- margin: 0 0.3em;
- height: 2em;
-}
-
-.rw_navbar_righttab:hover
-{
- background-color: #49E;
-}
-
-.rw_content
-{
- clear: both;
- margin-top: 2em;
- margin-left: 3em;
- margin-right: 3em;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- font-weight: bolder;
- clear: both;
- font-size: 90%;
- padding: 1em;
- margin-top: 3em;
- margin-left: 5em;
- margin-right: 5em;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #27C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #27C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab { background-color: #C72; }
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
-
diff --git a/ruwiki/tags/release-0.9.0/templates/default/save.tmpl b/ruwiki/tags/release-0.9.0/templates/default/save.tmpl
deleted file mode 100644
index 04069b1..0000000
--- a/ruwiki/tags/release-0.9.0/templates/default/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.0/templates/sidebar/body.tmpl b/ruwiki/tags/release-0.9.0/templates/sidebar/body.tmpl
deleted file mode 100644
index 2f3c10f..0000000
--- a/ruwiki/tags/release-0.9.0/templates/sidebar/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.9.0/templates/sidebar/content.tmpl b/ruwiki/tags/release-0.9.0/templates/sidebar/content.tmpl
deleted file mode 100644
index fa2d67e..0000000
--- a/ruwiki/tags/release-0.9.0/templates/sidebar/content.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.9.0/templates/sidebar/controls.tmpl b/ruwiki/tags/release-0.9.0/templates/sidebar/controls.tmpl
deleted file mode 100644
index 6e12b22..0000000
--- a/ruwiki/tags/release-0.9.0/templates/sidebar/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_titlebar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_titlebar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.0/templates/sidebar/edit.tmpl b/ruwiki/tags/release-0.9.0/templates/sidebar/edit.tmpl
deleted file mode 100644
index eb04395..0000000
--- a/ruwiki/tags/release-0.9.0/templates/sidebar/edit.tmpl
+++ /dev/null
@@ -1,27 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_titlebar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_titlebar_tab" id="rw_editing_tab"><strong><em>#label_editing#</em> #%page_version%</strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <div class="rw_content_edit">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.0/templates/sidebar/error.tmpl b/ruwiki/tags/release-0.9.0/templates/sidebar/error.tmpl
deleted file mode 100644
index 5a2882e..0000000
--- a/ruwiki/tags/release-0.9.0/templates/sidebar/error.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.0/templates/sidebar/footer.tmpl b/ruwiki/tags/release-0.9.0/templates/sidebar/footer.tmpl
deleted file mode 100644
index 6dfc390..0000000
--- a/ruwiki/tags/release-0.9.0/templates/sidebar/footer.tmpl
+++ /dev/null
@@ -1,22 +0,0 @@
-<div class="rw_footer">
- <form class="rw_footer_tab" action="_search">
- <div>
- <input class="rw_search_box" type="text" name="q" size="10" />
- </div>
- <div>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- </div>
- </form>
- <div class="rw_footer_tab">
- <dl>
- <dt>%page_project%::</dt>
- <dd><a href="%cgi_url%/%page_project%/_topics">#label_topics#</a><br />
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </dd>
- </div>
- <div class="rw_footer_tab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.9.0/templates/sidebar/ruwiki.css b/ruwiki/tags/release-0.9.0/templates/sidebar/ruwiki.css
deleted file mode 100644
index 0f2b4cc..0000000
--- a/ruwiki/tags/release-0.9.0/templates/sidebar/ruwiki.css
+++ /dev/null
@@ -1,347 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
-.rw_titlebar
-{
- margin: 0 auto;
- height: 0.5em;
-}
-
- /* Normal styling from here on out. */
-body
-{
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_titlebar
-{
- font-size: 0.7em;
- border: 1px solid #059;
- color: white;
- background-color: #5C9;
- height: 0.5em;
- width: 100%;
-}
-
-.rw_titlebar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_titlebar a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_titlebar a:hover
-{
- text-decoration: none;
-}
-
-.rw_titlebar_tab
-{
- float: left;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_titlebar_tab:hover
-{
- background-color: #4E9;
-}
-
-div.rw_footer
-{
- position: fixed;
- left: 72%;
- width: 20%;
- height: 100%;
- padding: 0.2em;
- padding-top: 0.5em;
-//background-color: #95C;
- font-size: 0.9em;
-}
-
-.rw_footer
-{
-}
-
-.rw_footer a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_footer a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_footer a:hover
-{
- text-decoration: none;
-}
-
-.rw_footer_tab
-{
- color: yellow;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0.3em;
- min-height: 2em;
- clear: both;
-}
-
-.rw_footer_tab div
-{
- text-align: right;
-}
-
-div#rw_content
-{
- padding: 50px 0 0 0;
- margin-left: 0;
- voice-family: "\"}\""; /* fake out IE5/Win */
- voice-family: inherit;
- margin-left: 16px;
-}
-
-body > div#rw_content
-{
- margin-left: 0;
-}
-
-.rw_content
-{
- padding-top: 0;
- margin-left: 3em;
- width: 65%;
- float: left;
-}
-
-.rw_content_edit
-{
- width: 90%;
- margin: 0 auto;
- padding: 2em;
- padding-top: 0;
- float: left;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- float: left;
- font-weight: bolder;
- font-size: 90%;
- padding: 0.5em;
- width: 65%;
- margin-top: 3em;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #59C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #59C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #59C;
- margin: 0.1em;
-}
-
-.rw_search_box
-{
- border: 1px dotted #59C;
- width: 100%;
- margin: 0.1em;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab
-{
- background-color: #C72;
- text-align: right;
- margin-right: 2em;
- float: right;
-}
-
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.9.0/templates/sidebar/save.tmpl b/ruwiki/tags/release-0.9.0/templates/sidebar/save.tmpl
deleted file mode 100644
index 7c4c31c..0000000
--- a/ruwiki/tags/release-0.9.0/templates/sidebar/save.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-<div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.9.0/templates/simple/body.tmpl b/ruwiki/tags/release-0.9.0/templates/simple/body.tmpl
deleted file mode 100644
index b3281d0..0000000
--- a/ruwiki/tags/release-0.9.0/templates/simple/body.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.9.0/templates/simple/content.tmpl b/ruwiki/tags/release-0.9.0/templates/simple/content.tmpl
deleted file mode 100644
index 2da5e62..0000000
--- a/ruwiki/tags/release-0.9.0/templates/simple/content.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content -->
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.0/templates/simple/controls.tmpl b/ruwiki/tags/release-0.9.0/templates/simple/controls.tmpl
deleted file mode 100644
index 29cdf3a..0000000
--- a/ruwiki/tags/release-0.9.0/templates/simple/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <a href="%cgi_url%/%page_project%/">%page_project%</a>
- &raquo;
- %page_topic%
- [?editable|<a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">[#label_edit#]</a>?]
-</div>
diff --git a/ruwiki/tags/release-0.9.0/templates/simple/edit.tmpl b/ruwiki/tags/release-0.9.0/templates/simple/edit.tmpl
deleted file mode 100644
index b42759d..0000000
--- a/ruwiki/tags/release-0.9.0/templates/simple/edit.tmpl
+++ /dev/null
@@ -1,25 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <strong>%page_topic%</strong>
- &raquo;
- <strong>%page_project%</strong>
- [<strong><em>#label_editing#</em> #%page_version%</strong>]
-</div>
-
-<div class="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
-</div>
diff --git a/ruwiki/tags/release-0.9.0/templates/simple/error.tmpl b/ruwiki/tags/release-0.9.0/templates/simple/error.tmpl
deleted file mode 100644
index ac898ea..0000000
--- a/ruwiki/tags/release-0.9.0/templates/simple/error.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- |
- <strong><em>%name%</em></strong>
-</div>
-<div class="rw_content">
-<h1>%name%</h1>
-<p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
-<p>%backtrace%</p>
-</div>
diff --git a/ruwiki/tags/release-0.9.0/templates/simple/footer.tmpl b/ruwiki/tags/release-0.9.0/templates/simple/footer.tmpl
deleted file mode 100644
index 2e7893b..0000000
--- a/ruwiki/tags/release-0.9.0/templates/simple/footer.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<form class="rw_navbar" action="_search">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- |
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>,
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- |
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
-</form>
diff --git a/ruwiki/tags/release-0.9.0/templates/simple/ruwiki.css b/ruwiki/tags/release-0.9.0/templates/simple/ruwiki.css
deleted file mode 100644
index 57d1a09..0000000
--- a/ruwiki/tags/release-0.9.0/templates/simple/ruwiki.css
+++ /dev/null
@@ -1,192 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #fafafa;
-}
-
-.rw_navbar
-{
- font-weight: bold;
- font-size: 1.1em;
- padding: 0.3em;
-}
-
-.rw_navbar a
-{
- border-bottom: 1px dashed black;
- font-weight: bold;
-}
-.rw_navbar a:visited
-{
- color: maroon;
- border-bottom: 1px dashed maroon;
-}
-.rw_navbar a:hover { background-color: #afafaf; }
-
-.rw_content
-{
- background-color: white;
- border: 1px dashed grey;
- padding: 0.5em;
- margin-left: 1em;
- margin-right: 1em;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- font-weight: bolder;
- font-size: 90%;
- padding: 0.5em;
- margin-left: 3em;
- margin-right: 3em;
-}
-
-
-.rw_edit_content
-{
- border: 1px solid black;
- padding: 0.3em;
- width: 95%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px solid black;
- padding: 0.3em;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px solid black;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form { }
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px solid black;
-}
-
-.rw_pagelink { text-decoration: none; }
-.rw_projectxlink { }
-.rw_projectindex { }
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title { }
-
-.rw_edit_format div
-{
-}
-
-.rw_search_button
-{
- border: 1px solid black;
-}
-
-.rw_search_box
-{
- border: 1px solid black;
-}
-
-.rw_search_box:hover { }
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_saved_page_announcement { }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { border: none; }
-.rwtk_NumberedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_NamedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_ExternalLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_RubyTalkLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_OtherRubyLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dashed grey; }
-.rwtk_WikiLink { text-decoration: none; }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.9.0/templates/simple/save.tmpl b/ruwiki/tags/release-0.9.0/templates/simple/save.tmpl
deleted file mode 100644
index 51de9f4..0000000
--- a/ruwiki/tags/release-0.9.0/templates/simple/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.0/tests/harness.rb b/ruwiki/tags/release-0.9.0/tests/harness.rb
deleted file mode 100644
index 80e7eeb..0000000
--- a/ruwiki/tags/release-0.9.0/tests/harness.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-ENV["REQUEST_METHOD"] = "HEAD"
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_type = 'flatfiles'
-
-dp = nil
-dp = "../data" if File.exists?("../data")
-dp = "./data" if File.exists?("./data")
-raise "Cannot find either ./data or ../data for tests. Aborting." if dp.nil?
-
-$wiki.config.storage_options['flatfiles']['data-path'] = dp
-$wiki.config.storage_options['flatfiles']['format'] = "exportable"
-$wiki.config.storage_options['flatfiles']['extension'] = "ruwiki"
-
-tp = nil
-tp = "../templates" if File.exists?("../templates")
-tp = "./templates" if File.exists?("./templates")
-raise "Cannot find either ./templates or ../templates for tests. Aborting." if tp.nil?
-
-$wiki.config.template_path = tp
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.9.0/tests/tc_backend_flatfile.rb b/ruwiki/tags/release-0.9.0/tests/tc_backend_flatfile.rb
deleted file mode 100644
index c3c815c..0000000
--- a/ruwiki/tags/release-0.9.0/tests/tc_backend_flatfile.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-require 'fileutils'
-
-class TestBackendFlatfiles < Test::Unit::TestCase
- def setup
- @ffopts = { 'data-path' => "./test/data", 'extension' => nil }
-
- # generate a database
- raise "Setup Error: #{@ffopts['data-path']} exists" if File.exists?(@ffopts['data-path'])
-
- @flatbase = {
- 'Proj1' => ['ProjectIndex:all projects must have this',
- 'P1TopicOne:this is the content',
- 'P1TopicTwo:more content'],
- 'Proj2' => ['ProjectIndex:all projects must have this',
- 'P2TopicOne:this is the content',
- 'P2TopicTwo:more content',
- 'P2TopicThree:even more more content']
- }
-
- @flatbase.each do |key, val|
- prjdir = "#{@ffopts['data-path']}/#{key}"
- FileUtils.mkdir_p(prjdir) rescue nil
- val.each do |topcon|
- topic, content = topcon.split(":")
- File.open("#{prjdir}/#{topic}", "w") do |fh|
- fh.puts "page!content:\x09#{content}"
- end
- end
- end
-
- @backend = nil
- @pg = nil
- end
-
- def teardown
- # remove testing flatabase
- FileUtils.rm_rf(@ffopts['data-path'])
- Dir.rmdir("./test") # ugly but it works
- end
-
- def test_list_projects
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- # should be ['Proj1', 'Proj2']
- assert_equal(@flatbase.keys, @backend.list_projects)
- end
-
- def test_list_topics
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- @flatbase.keys.sort.each do |proj|
- got_topics = @backend.list_topics(proj)
- exp_topics = @flatbase[proj].map { |ent| ent.split(':')[0] }
- assert_equal(exp_topics.sort, got_topics.sort)
- end
- end
-
- # test simple one word lookups
- # need to add more complex search strings
- def test_search_project
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- assert_equal({'ProjectIndex' => 1,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 0 }.to_a.sort,
- @backend.search_project('Proj1', 'this').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 0,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'more').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'topic').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'content').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P2TopicOne' => 0,
- 'P2TopicTwo' => 1,
- 'P2TopicThree' => 2 }.to_a.sort,
- @backend.search_project('Proj2', 'more').to_a.sort)
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/tests/tc_bugs.rb b/ruwiki/tags/release-0.9.0/tests/tc_bugs.rb
deleted file mode 100644
index 477cbeb..0000000
--- a/ruwiki/tags/release-0.9.0/tests/tc_bugs.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-
-# see if we can reproduce the LicenseandAuthor hang
-# described in bug id 147 on rubyforge
-class TC_LicenseAndAuthorHang < Test::Unit::TestCase
- def setup
- @ffopts = { }
- dp = nil
- dp = "../data" if File.exists?("../data")
- dp = "./data" if File.exists?("./data")
- raise "Cannot find either ./data or ../data for tests. Aborting." if dp.nil?
-
- @ffopts['data-path'] = dp
- @ffopts['format'] = 'exportable'
-
- @backend = nil
- @pg = nil
- end
-
- # load "to the metal"
- def test_ffload
- assert_nothing_raised do
- @backend = ::Ruwiki::Backend::Flatfiles.new(@ffopts)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.load('LicenseAndAuthorInfo.ruwiki', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-
- # abstract backend retreive
- def test_beload
- @backend = nil
- assert_nothing_raised do
- mock_ruwiki = OpenStruct.new
- mock_ruwiki.config = OpenStruct.new
- mock_ruwiki.config.message = {}
- mock_ruwiki.config.storage_options = { 'flatfiles' => @ffopts }
-
- @backend = ::Ruwiki::BackendDelegator.new(mock_ruwiki, 'flatfiles')
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.retrieve('LicenseAndAuthorInfo', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-end
-
-# if __FILE__ == $0
-# ObjectSpace.each_object { |o| tests << o if o.kind_of?(Class) }
-# tests.delete_if { |o| !o.ancestors.include?(Test::Unit::TestCase) }
-# tests.delete_if { |o| o == Test::Unit::TestCase }
-
-# tests.each { |test| Test::Unit::UI::Console::TestRunner.run(test) }
-# end
diff --git a/ruwiki/tags/release-0.9.0/tests/tc_exportable.rb b/ruwiki/tags/release-0.9.0/tests/tc_exportable.rb
deleted file mode 100644
index b067240..0000000
--- a/ruwiki/tags/release-0.9.0/tests/tc_exportable.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-class Ruwiki; end if __FILE__ == $0
-
-require 'ruwiki/exportable'
-require 'test/unit'
-
- class TCExportable < Test::Unit::TestCase
- class Exportable
- include Ruwiki::Exportable
-
- attr_accessor :a, :b, :long_name, :altname, :xform, :group2
- exportable :a
- exportable :long_name
- exportable :altname, :name => 'alt-name'
- exportable :group2, :group => 'group2'
- end
-
- def test_exportable
- __exportables = {
- 'default' => {
- 'a' => '@a'.intern,
- 'long-name' => '@long_name'.intern,
- 'alt-name' => '@altname'.intern,
- },
- 'group2' => {
- 'group2' => '@group2'.intern
- }
- }
- __values = {
- 'default' => {
- 'a' => 'a',
- 'long-name' => 'c',
- 'alt-name' => 'd',
- },
- 'group2' => { 'group2' => 'e' }
- }
- xx = nil
- ss = nil
- assert_nothing_raised do
- xx = Exportable.new
- xx.a = "a"
- xx.b = "b"
- xx.long_name = "c"
- xx.altname = "d"
- xx.xform = 22/7
- xx.group2 = "e"
- ss = xx.export
- end
- assert_equal(__exportables, xx.class.__exportables)
- assert_equal(__values, ss)
- end
- end
diff --git a/ruwiki/tags/release-0.9.0/tests/tc_template.rb b/ruwiki/tags/release-0.9.0/tests/tc_template.rb
deleted file mode 100644
index c4da672..0000000
--- a/ruwiki/tags/release-0.9.0/tests/tc_template.rb
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'test/unit'
-require 'harness'
-
-class TestTemplates < Test::Unit::TestCase
- def test_include
- a = "a!INCLUDE!c"
- b = "b"
- t = Ruwiki::TemplatePage.new(a, b)
- assert_equal(["abc"], t.lines.lines)
- end
-
- def test_variables
- a = "a%b%c"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.write_plain_on("", v))
- end
-
- def test_optional_variables
- a = "a%b%%?c%d"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.write_plain_on("", v))
-
- v["c"] = "c"
- assert_equal("abcd", t.write_plain_on("", v))
- end
-
- def test_labels
- a = "a#b#c"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.write_plain_on("", v, m))
- end
-
- def test_optional_labels
- a = "a#b##?c#d"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.write_plain_on("", v, m))
-
- m[:c] = "c"
- assert_equal("abcd", t.write_plain_on("", v, m))
- end
-
- def test_hrefs
- a = "HREF:a:b:"
- t = Ruwiki::TemplatePage.new(a)
- v = { "b" => "b" }
-
- assert_equal("b", t.write_plain_on("", v))
-
- s = ""
- v["a"] = "link"
- assert_equal(%Q(<a href="link">b</a>), t.write_plain_on("", v))
- end
-
- def test_repeat_subst
- v1 = { "a" => 3 }
- v2 = { "a" => 2...4 }
- v3 = { "a" => -4...-2 }
- v4 = { "a" => [3, 1, 4, 1, 5, 9] }
- v5 = { "a" => [{ "a" => 3 }, { "a" => 1 }, { "a" => 4 }, { "a" => 1 }, { "a" => 5 }, { "a" => 9 }] }
-
- a = "[:a|xy:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("xyxyxy", t.write_plain_on("", v1))
- assert_equal("xyxy", t.write_plain_on("", v2))
- assert_equal("xyxy", t.write_plain_on("", v3))
- assert_equal("xyxyxyxyxyxy", t.write_plain_on("", v4))
- assert_equal("xyxyxyxyxyxy", t.write_plain_on("", v5))
-
- a = "[:a|%a%:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("123", t.write_plain_on("", v1))
- assert_equal("23", t.write_plain_on("", v2))
- assert_equal("-4-3", t.write_plain_on("", v3))
- assert_equal("314159", t.write_plain_on("", v4))
- assert_equal("314159", t.write_plain_on("", v5))
- end
-
- def test_optional_subst
- v1 = { "a" => "a" }
- v2 = { "a" => nil }
- a1 = "[?a|xy?]"
- a2 = "[!a|xy?]"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
-
- assert_equal("xy", t1.write_plain_on("", v1))
- assert_equal("", t1.write_plain_on("", v2))
- assert_equal("", t2.write_plain_on("", v1))
- assert_equal("xy", t2.write_plain_on("", v2))
- end
-
- def test_repeat_block
- a1 = "START:a\nxy\nEND:a"
- a2 = "START:a\nx%b%y\nEND:a"
- a3 = "START:\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- v = { "a" => [{ "b" => 3 }, { "b" => 1 }, { "b" => 4 }, { "b" => 1 }, { "b" => 5 }, { "b" => 9 }] }
-
- assert_equal("xy\nxy\nxy\nxy\nxy\nxy\n", t1.write_plain_on("", v))
- assert_equal("x3y\nx1y\nx4y\nx1y\nx5y\nx9y\n", t2.write_plain_on("", v))
- assert_raises(RuntimeError) { t3.write_plain_on("", v) }
- end
-
- def test_optional_block
- a1 = "IF:a\nxy\nENDIF:a"
- a2 = "IF:\nxy\nEND:"
- a3 = "IFNOT:a\nxy\nENDIF:a"
- a4 = "IFNOT:\nxy\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- t4 = Ruwiki::TemplatePage.new(a4)
- v1 = { "a" => true }
- v2 = { "a" => nil }
-
- assert_equal("xy", t1.write_plain_on("", v1))
- assert_equal("", t1.write_plain_on("", v2))
- assert_raises(RuntimeError) { t2.write_plain_on("", v1) }
- assert_equal("", t3.write_plain_on("", v1))
- assert_equal("xy", t3.write_plain_on("", v2))
- assert_raises(RuntimeError) { t4.write_plain_on("", v1) }
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/tests/tc_tokens.rb b/ruwiki/tags/release-0.9.0/tests/tc_tokens.rb
deleted file mode 100644
index 39494b0..0000000
--- a/ruwiki/tags/release-0.9.0/tests/tc_tokens.rb
+++ /dev/null
@@ -1,335 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'test/unit'
-require 'harness'
-
-class TokenTestCases < Test::Unit::TestCase
- def setup
- @mrw = MockRuwiki.new
- end
-
- class MockRuwiki
- def initialize
- @project = "Default"
- @tokens = []
- @script = "<uri>"
- @message = Hash.new { |h, k| h[k] = "#{k.inspect}" }
- @title = "Ruwiki"
- end
-
- def __tokenize(content, token)
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, @project, $wiki.backend, @script, @message, @title)
- @tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{@tokens.size - 1}"
- else
- "TOKEN_#{@tokens.size - 1}"
- end
- end
- content
- end
-
- def __replace(content)
- replaced = []
- s = true
- loop do
- break if replaced.size >= @tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].restore
- end
-
- s = content.gsub!(/TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].replace
- end
- end
- content
- end
-
- def __post_replace(content)
- token_classes = @tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
- content
- end
-
- end
-
- def __process(token, content, tokenized, replaced, result)
- assert_equal(tokenized, content = @mrw.__tokenize(content, token), "Tokenization failure.")
- assert_equal(replaced, content = @mrw.__replace(content), "Replacement failure.")
- assert_equal(result, content = @mrw.__post_replace(content), "Post-replace failure.")
- end
-
- def __display(token, content)
- p tokenized = @mrw.__tokenize(content.dup, token)
- p replaced = @mrw.__replace(tokenized.dup)
- p result = @mrw.__post_replace(replaced.dup)
- end
-
- def test_Paragraph
- token = Ruwiki::Wiki::Paragraph
- content = "\nABC\n\nabc\n"
- tkv = "TOKEN_0\nABC\nTOKEN_1\nabc\n"
- rpv = %Q(</p><p class="rwtk_Paragraph">\nABC\n</p><p class="rwtk_Paragraph">\nabc\n)
- res = %Q(<p class="rwtk_Paragraph">ABC</p>\n<p class="rwtk_Paragraph">abc</p>)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Image
- token = Ruwiki::Wiki::Image
- content = "[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_0"
- rpv = %Q(<img class="rwtk_Image" alt="http://www.halostatue.ca/graphics/maple_leaf.gif" src="http://www.halostatue.ca/graphics/maple_leaf.gif" title="http://www.halostatue.ca/graphics/maple_leaf.gif" />)
- res = rpv
-
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_1"
- content = %Q([image : http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" title="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="Maple Leaf" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_2"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true])
- rpv = %Q(<img class="rwtk_Image" alt="[1]" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[1]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_3"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true alt="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[2]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- content = "\[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_4"
- rpv = content
- res = content
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Code
- content = " line 1\n line 2\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_0TOKEN_1line 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2</pre>\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
-
- content = " line 1\n line 2\n \n\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_2TOKEN_3TOKEN_4\nline 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\n</p><pre class="rwtk_Code"> </pre>\n\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2\n </pre>\n\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NumberedLinks
- token = Ruwiki::Wiki::NumberedLinks
- Ruwiki::Wiki::NumberedLinks.reset
- content = "[http://www.ruby-lang.org] \\[http://www.rubyforge.org]"
- tkv = "TOKEN_0 \\TOKEN_1"
- uri = CGI.escape("http://www.ruby-lang.org")
- rpv = %Q{<a class="rwtk_NumberedLinks" href="http://www.google.com/url?sa=D&q=#{uri}">[1]</a> [http://www.rubyforge.org]}
- res = %Q{<a class="rwtk_NumberedLinks" href="http://www.google.com/url?sa=D&q=#{uri}">[1]</a> [http://www.rubyforge.org]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NamedLinks
- token = Ruwiki::Wiki::NamedLinks
- content = "[http://www.ruby-lang.org Ruby] \\[http://www.rubyforge.org RubyForge]"
- tkv = "TOKEN_0 \\TOKEN_1"
- uri = CGI.escape("http://www.ruby-lang.org")
- rpv = %Q{<a class="rwtk_NamedLinks" href="http://www.google.com/url?sa=D&q=#{uri}">Ruby</a> [http://www.rubyforge.org RubyForge]}
- res = %Q{<a class="rwtk_NamedLinks" href="http://www.google.com/url?sa=D&q=#{uri}">Ruby</a> [http://www.rubyforge.org RubyForge]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ExternalLinks
- token = Ruwiki::Wiki::ExternalLinks
- content = "http://www.ruby-lang.org \\http://www.rubyforge.org"
- tkv = "TOKEN_0 \\TOKEN_1"
- uri = CGI.escape("http://www.ruby-lang.org")
- rpv = %Q{<a class="rwtk_ExternalLinks" href="http://www.google.com/url?sa=D&q=#{uri}">http://www.ruby-lang.org</a> http://www.rubyforge.org}
- res = %Q{<a class="rwtk_ExternalLinks" href="http://www.google.com/url?sa=D&q=#{uri}">http://www.ruby-lang.org</a> http://www.rubyforge.org}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_HRule
- token = Ruwiki::Wiki::HRule
- content = "----\n\\----"
- tkv = "TOKEN_0\n\\TOKEN_1"
- rpv = %Q(<hr class="rwtk_HRule" />\n----)
- res = %Q(<hr class="rwtk_HRule" />\n----)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLink
- token = Ruwiki::Wiki::ProjectCrossLink
- content = "Ruwiki::ChangeLog \\Ruwiki::To_Do Ruwiki::NotExist \\Ruwiki::NotExist"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLinkWikipedia
- token = Ruwiki::Wiki::ProjectCrossLinkWikipedia
- content = "Ruwiki::[[ChangeLog]] \\Ruwiki::[[To_Do]] Ruwiki::[[Does Not Exist]] \\Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 Ruwiki::[[_invalid]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectIndex
- token = Ruwiki::Wiki::ProjectIndex
- content = "::Ruwiki \\::Ruwiki ::Newproject \\::Newproject"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikiLinks
- token = Ruwiki::Wiki::WikiLinks
- content = "ProjectIndex \\ProjectIndex AustinZiegler \\AustinZiegler Alan_Chen \\Alan_Chen"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikipediaLinks
- token = Ruwiki::Wiki::WikipediaLinks
- content = "[[ProjectIndex]] \\[[ProjectIndex]] [[Austin Ziegler]] \\[[Austin Ziegler]] [[_Alan Chen]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 [[_Alan Chen]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Abbreviations
- token = Ruwiki::Wiki::Abbreviations
- content = "@{matz}\n@{}\n\\@{matz}"
- tkv = "TOKEN_0\nTOKEN_1\n\\TOKEN_2"
- rpv = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
- res = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Headings
- token = Ruwiki::Wiki::Headings
- content = "= header 1\n== header 2\n=== header 3\n==== header 4\n===== header 5\n====== header 6\n======= header 7->6\n\\== noheader 2\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\nTOKEN_6\n\\TOKEN_7\n"
- rpv = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n== noheader 2\n)
- res = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n<p class="rwtk_Paragraph">== noheader 2\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Blockquotes
- token = Ruwiki::Wiki::Blockquotes
- content = ": level 1\n:: level 2\n::: level 3\n: level 1, para 2\n\\: not a blockquote\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<blockquote class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n: not a blockquote\n)
- res = %Q(<blockquote class="rwtk_Blockquotes">level 1<blockquote class="rwtk_Blockquotes">level 2<blockquote class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n: not a blockquote\n)
- __process(token, content, tkv, rpv, res)
-
- content = "> level 1\n>> level 2\n>>> level 3\n> level 1, para 2\n\\> not a blockquote\n"
- tkv = "TOKEN_5\nTOKEN_6\nTOKEN_7\nTOKEN_8\n\\TOKEN_9\n"
- rpv = %Q(<blockquote type="cite" class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- res = %Q(<blockquote type="cite" class="rwtk_Blockquotes">level 1<blockquote type="cite" class="rwtk_Blockquotes">level 2<blockquote type="cite" class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Definitions
- token = Ruwiki::Wiki::Definitions
- content = "; word1 : val1\n;; word2 : val2\n;;; word3 : val3\n; word1/2 : val1/2\n\\; not-a-word : not-a-val\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd></dl></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl></dl>\n<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
- res = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
-
-# __display(token, content)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Lists
- content = "* level 1\n** level 2\n*** level 3\n*** level 3, item 2\n** level 2, item 2\n* level 1, item 2\n\\* not an item\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\n\\TOKEN_6\n"
- rpv = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ul></ul>\n<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- res = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ul><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n## level 2\n### level 3\n### level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_7\nTOKEN_8\nTOKEN_9\nTOKEN_10\nTOKEN_11\nTOKEN_12\n\\TOKEN_13\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ol><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n*# level 2\n*** level 3\n*#* level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_14\nTOKEN_15\nTOKEN_16\nTOKEN_17\nTOKEN_18\nTOKEN_19\n\\TOKEN_20\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ol></ul>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
- end
-
-
- def test_RubyTalkLinks
- token = Ruwiki::Wiki::RubyTalkLinks
- content = "[ruby-talk:12345] \\[ruby-talk:12345]"
- tkv = "TOKEN_0 \\TOKEN_1"
-# rpv = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
- rpv = %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
-# res = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
- res = %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_OtherRubyLinks
- token = Ruwiki::Wiki::OtherRubyLinks
- content = "[ruby-list:123] \\[ruby-list:123] [ruby-doc:123] \\[ruby-doc:123] [ruby-core:123] \\[ruby-core:123] [ruby-dev:123] \\[ruby-dev:123] [ruby-ext:123] \\[ruby-ext:123] [ruby-math:123] \\[ruby-math:123]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5 TOKEN_6 \\TOKEN_7 TOKEN_8 \\TOKEN_9 TOKEN_10 \\TOKEN_11"
- rpv = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
- res = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
-
- __process(token, content, tkv, rpv, res)
- end
-end
diff --git a/ruwiki/tags/release-0.9.0/tests/testall.rb b/ruwiki/tags/release-0.9.0/tests/testall.rb
deleted file mode 100755
index f2e9100..0000000
--- a/ruwiki/tags/release-0.9.0/tests/testall.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-$stderr.puts "Checking for test cases:"
-Dir['tc_*.rb'].each do |testcase|
- $stderr.puts "\t#{testcase}"
- load testcase
-end
-$stderr.puts " "
diff --git a/ruwiki/tags/release-0.9.1/Rakefile b/ruwiki/tags/release-0.9.1/Rakefile
deleted file mode 100644
index e1739e4..0000000
--- a/ruwiki/tags/release-0.9.1/Rakefile
+++ /dev/null
@@ -1,207 +0,0 @@
-#! /usr/bin/env rake
-$LOAD_PATH.unshift('lib')
-
-require 'rubygems'
-require 'rake/gempackagetask'
-require 'ruwiki'
-require 'ruwiki/utils'
-require 'ruwiki/utils/manager'
-require 'zlib'
-
-DISTDIR = "ruwiki-#{Ruwiki::VERSION}"
-TARDIST = "../#{DISTDIR}.tar.gz"
-
-DATE_RE = %r<(\d{4})[./-]?(\d{2})[./-]?(\d{2})(?:[\sT]?(\d{2})[:.]?(\d{2})[:.]?(\d{2})?)?>
-
-if ENV['RELEASE_DATE']
- year, month, day, hour, minute, second = DATE_RE.match(ENV['RELEASE_DATE']).captures
- year ||= 0
- month ||= 0
- day ||= 0
- hour ||= 0
- minute ||= 0
- second ||= 0
- ReleaseDate = Time.mktime(year, month, day, hour, minute, second)
-else
- ReleaseDate = nil
-end
-
-desc "Run Ruwiki unit tests."
-task :test do |t|
- require 'test/unit/testsuite'
- require 'test/unit/ui/console/testrunner'
-
- runner = Test::Unit::UI::Console::TestRunner
-
- $LOAD_PATH.unshift('tests')
- $stderr.puts "Checking for test cases:" if t.verbose
- Dir['tests/tc_*.rb'].each do |testcase|
- $stderr.puts "\t#{testcase}" if t.verbose
- load testcase
- end
-
- suite = Test::Unit::TestSuite.new("Ruwiki Tests")
-
- ObjectSpace.each_object(Class) do |testcase|
- suite << testcase.suite if testcase < Test::Unit::TestCase
- end
-
- runner.run(suite)
-end
-
-task :clean_data do
- Dir["data/**/*"].each do |file|
- FileUtils.rm_f(file) if file =~ /(?:rdiff|lock|~)$/
- end
-end
-
-desc "Build the default Ruwiki deployment package."
-task :package_data => [ :clean_data ] do
- Ruwiki::Utils::Manager.package(".", ".", nil, false)
-end
-
-task :make_readonly do
- data = nil
- Dir["data/**/*.ruwiki"].each do |file|
- File.open(file, "rb") { |f| data = f.read }
- FileUtils.cp(file, "#{file}.orig")
- if data =~ %r{properties!editable:}o
- data.gsub!(%r{^properties!editable:[ \t].*?$}, "properties!editable:\tfalse")
- else
- data << "properties!editable:\tfalse\n"
- end
- File.open(file, "wb") { |out| out.write(data) }
- end
-end
-
-task :clean_readonly do
- Dir["data/**/*.ruwiki"].each do |file|
- orig = "#{file}.orig"
- FileUtils.mv(orig, file) if File.exists?(orig)
- end
-end
-
-spec = Gem::Specification.new do |s|
- s.name = %q(ruwiki)
- s.version = Ruwiki::VERSION
- s.summary = %q{A simple, extensible, and fast Wiki-clone.}
-
- s.add_dependency('diff-lcs', '~> 1.1.2')
- s.add_dependency('archive-tar-minitar', '~> 0.5.1')
-
- s.has_rdoc = true
- s.rdoc_options = ["--title", "Ruwiki - An Extensible Wiki", "--main", "Readme.tarfile", "--line-numbers"]
- s.extra_rdoc_files = %w(Readme.tarfile Readme.rubygems)
-
- s.bindir = 'bin'
- s.executables = Dir['bin/**/*'].delete_if do |item|
- item =~ %r{(?:\bCVS\b|\.svn\b|[Rr]akefile|install.rb$|~$|gem(?:spec)?$)}
- end.map { |item| item.gsub(%r{^bin/}, "") }
- s.autorequire = %q{ruwiki}
- s.require_paths = %w{lib}
-
- s.test_files = %w{tests/testall.rb}
-
- files = Dir["**/*"].delete_if do |item|
- item =~ %r{\bCVS\b |
- \.svn\b |
- \.bak$ |
- [Rr]akefile |
- install\.rb$ |
- ~$ |
- gem(spec)?$ |
- lib/archive |
- lib/diff |
- \.ruwiki\.orig$}x
- end
- files << "ruwiki.pkg"
- s.files = files
-
- s.author = %q{Austin Ziegler and Alan Chen}
- s.email = %q{ruwiki-discuss@rubyforge.org}
- s.rubyforge_project = %q(ruwiki)
- s.homepage = %q{http://ruwiki.rubyforge.org/}
-
- description = []
- File.open("Readme.rubygems") do |file|
- file.each do |line|
- line.chomp!
- break if line.empty?
- description << "#{line.gsub(/\[\d\]/, '')}"
- end
- end
- s.description = description[2..-1].join(" ")
-end
-desc "Build the RubyGem for Ruwiki."
-task :gem => [ :test ]
-task :gem => [ :update_version ]
-task :gem => [ :package_data ]
-task :gem => [ :make_readonly ]
-Rake::GemPackageTask.new(spec) do |g|
- g.need_tar = false
- g.need_zip = false
- g.package_dir = ".."
-end
-
-VERSION_STRING_RE = %r{\\?%RV#%}
-
-desc "Update the version of Ruwiki to #{Ruwiki::VERSION} in documentation files."
-task :update_version do
- FileList["data/**/*.ruwiki", "Readme*"].to_a.each do |file|
- data = File.read(file)
- data.gsub!(VERSION_STRING_RE) do |match|
- if match[0] == '\\'
- match
- else
- Ruwiki::VERSION
- end
- end
- File.open(file, "wb") { |f| f.write(data) }
- end
-end
-
-desc "Build a Ruwiki .tar.gz distribution."
-task :tar => [ TARDIST ]
-file TARDIST => [ :test, :update_version ] do |t|
- current = File.basename(Dir.pwd)
- Dir.chdir("..") do
- begin
- files = Dir["#{current}/**/*"].select { |dd| dd !~ %r{(?:/CVS/?|~$)} }
- files.delete_if { |dd| dd =~ %r{Rakefile} }
- files.map! do |dd|
- mtime = ReleaseDate || File.stat(dd).mtime
- ddnew = dd.gsub(/^#{current}/, DISTDIR)
- if File.directory?(dd)
- { :name => ddnew, :mode => 0755, :dir => true, :mtime => mtime }
- else
- if dd =~ %r{bin/}
- mode = 0755
- else
- mode = 0644
- end
- data = File.read(dd)
- { :name => ddnew, :mode => mode, :data => data, :size => data.size,
- :mtime => mtime }
- end
- end
-
- ff = File.open(t.name.gsub(%r{^\.\./}o, ''), "wb")
- gz = Zlib::GzipWriter.new(ff)
- tw = Archive::Tar::Minitar::Writer.new(gz)
-
- files.each do |entry|
- if entry[:dir]
- tw.mkdir(entry[:name], entry)
- else
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
- end
- end
- ensure
- tw.close if tw
- gz.close if gz
- end
- end
-end
-
-desc "Build everything."
-task :default => [ :tar, :gem, :clean_readonly ]
diff --git a/ruwiki/tags/release-0.9.1/Readme.rubygems b/ruwiki/tags/release-0.9.1/Readme.rubygems
deleted file mode 100644
index 240fe57..0000000
--- a/ruwiki/tags/release-0.9.1/Readme.rubygems
+++ /dev/null
@@ -1,86 +0,0 @@
-Ruwiki %RV#%
-------------
-Ruwiki is a simple, extensible Wiki-clone written in Ruby. It supports both
-CGI and WEBrick interfaces, templates, and CSS formatting. This Wiki differs
-from most other Wikis in that it supports project namespaces, so that two
-topics may be named the same for differing projects without colliding or
-having to resort to odd naming conventions. Please see the ::Ruwiki project in
-the running Wiki for more information. Ruwiki %RV#% has German and Spanish
-translations available.
-
-Upgrading
----------
-Ruwiki %RV#% has a flatfile format that is incompatible with older versions of
-Ruwiki. If you are upgrading from one of these versions, you must use the
-bin/convert. The simple case will be (assuming that your data files are in
-./data):
-
- % convert ./data
-
-The convert utility is automatically installed by RubyGems.
-
-Requirements
-------------
-Ruwiki currently requires:
- * Ruby 1.8
- * Diff::LCS 1.2.0
- * Archive::Tar::Minitar 0.5.1
-
-The YAML backend requires Ruby 1.8.2 after preview2. You should have been
-prompted to load these dependencies on installation.
-
-Quick Start (WEBrick Readonly)
-------------------------------
-1. Type:
-
- % ruwiki_servlet --gem-data
-
-2. Point your web browser to <http://localhost:8808/>.
-
-Quick Start (CGI)
------------------
-1. Create a directory in a place that your webserver can execute CGI programs
- and type:
-
- % ruwiki install cgi,data --to <directory>
-
-2. Ensure that ruwiki.cgi is executable on your webserver.
-3. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Create a directory to store your data and templates and type:
-
- % ruwiki install data --to <directory>
-
-2. Type:
-
- % ruwiki_servlet
-
-3. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of Ruwiki
-without editing the servlet; use ruwiki_servlet --help for more information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-Credits
--------
-* This software includes portions of Diff::LCS by Austin Ziegler, available
- for download from the Ruwiki RubyForge project:
- [http://rubyforge.org/projects/ruwiki/]
-* Portions of this software are derived from Dave Thomas's RDoc system, now
- part of the Ruby distribution.
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen].
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández].
-
-$Id$
diff --git a/ruwiki/tags/release-0.9.1/Readme.tarfile b/ruwiki/tags/release-0.9.1/Readme.tarfile
deleted file mode 100644
index a3f4ea6..0000000
--- a/ruwiki/tags/release-0.9.1/Readme.tarfile
+++ /dev/null
@@ -1,65 +0,0 @@
-Ruwiki %RV#%
-------------
-Ruwiki is a simple, extensible Wiki-clone written in Ruby. It supports both
-CGI and WEBrick interfaces, templates, and CSS formatting. This Wiki differs
-from most other Wikis in that it supports project namespaces, so that two
-topics may be named the same for differing projects without colliding or
-having to resort to odd naming conventions. Please see the ::Ruwiki project in
-the running Wiki for more information. Ruwiki %RV#% has German and Spanish
-translations available.
-
-Upgrading
----------
-Ruwiki %RV#% has a flatfile format that is incompatible with versions of
-Ruwiki older than 0.8.0. If you are upgrading from one of these versions, you
-must use the bin/convert. The simplest case will be (assuming that your data
-files are in ./data):
-
- % bin/convert ./data
-
-Requirements
-------------
-Ruwiki currently requires:
- * Ruby 1.8
- * Diff::LCS 1.2.0
- * Archive::Tar::Minitar 0.5.1
-
-The YAML backend requires Ruby 1.8.2 after preview2. Portions of Diff::LCS and
-Archive::Tar::Minitar have been included in this version of Ruwiki.
-
-Quick Start (CGI)
------------------
-1. Place the Ruwiki directory in a place that your webserver can execute CGI
- programs and ensure that ruwiki.cgi is executable on your webserver.
-2. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Run bin/ruwiki_servlet (ruby bin/ruwiki_servlet under Windows).
-2. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of Ruwiki
-without editing the servlet; use ruwiki_servlet --help for more information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-Credits
--------
-* This software includes portions of Diff::LCS and Archive::Tar::Minitar by
- Austin Ziegler, available for download from the Ruwiki RubyForge project:
- [http://rubyforge.org/projects/ruwiki/]
-* Portions of this software are derived from Dave Thomas's RDoc system, now
- part of the Ruby distribution.
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen].
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández].
-
-$Id$
diff --git a/ruwiki/tags/release-0.9.1/contrib/enscript-token.rb b/ruwiki/tags/release-0.9.1/contrib/enscript-token.rb
deleted file mode 100644
index 08c2018..0000000
--- a/ruwiki/tags/release-0.9.1/contrib/enscript-token.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# This token by Javier Fontan <jfontan@pc3d.cesga.es>.
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-require "open3"
-
-class Ruwiki::Wiki::CodeColor < Ruwiki::Wiki::Token
- def self.rank
- 0
- end
-
- def self.regexp
- %r<\{\{\{(?::(\w+)\b)?(.*?)\}\}\}>m
- end
-
- def replace
- cap = @match.captures
-
- if cap[0].nil?
- language = "ruby"
- else
- language = cap[0]
- end
-
- text = cap[1]
-
- i, o, e = Open3.popen3("enscript -B --color=emacs -Whtml -E#{language} -o -")
- i.print text
- i.close
-
- re_script = %r{(<pre>.*?</pre>)}mio
- c = o.readlines[1..-1].join("\n")
- re_script.match(c).captures[0]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<pre>\n}im, '<pre class="rwtk_CodeColor>')
- content.gsub!(%r{\n</pre>}im, '</pre>')
- content.gsub!(%r{<font color="(.+?)">}im, '<span style="color: \1">')
- content.gsub!(%r{</font>}im, '</span>')
- content.gsub!(%r{<B>}i, '<b>')
- content.gsub!(%r{</B}i, '</b>')
- content
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/contrib/rublog_integrator.rb b/ruwiki/tags/release-0.9.1/contrib/rublog_integrator.rb
deleted file mode 100644
index 504d9d6..0000000
--- a/ruwiki/tags/release-0.9.1/contrib/rublog_integrator.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This integrator based on work by Chad Fowler.
-#
-# $Id$
-#++
-
-# NOTE: This is not currently compatible with Ruwiki 0.8.0
-#
-# require 'ruwiki/wiki/handler'
-
-class Ruwiki::RubLogHandler < Ruwiki::Wiki::Handler
- def initialize(entries)
- @entries = entries
- end
-
- def page_exists?(page, project)
-# puts "pP: #{page}, #{project}"
- matches = @entries.find_entries_with_root_name(page)
- matches.each { |entry| return true if(entry.dir_name =~ /#{project}/) }
- false
- end
-
- def project_exists?(project)
- true
- end
-
- def script_url
-# request.environment['SCRIPT_NAME']
-# !!SMELL!!
- ENV['SCRIPT_NAME']
- end
-end
-
- # An experimental convertor for Ruwiki
-class RuwikiConvertor < BaseConvertor
- handles "wiki"
-
- def get_title(f)
- title = "---Untitled---"
- loop do
- line = f.gets
- if(line =~ /^topic: (\S+)/) then
- title = $1
- elsif(line =~ /^\#EHDR/) then
- return title
- end
- end
- end
-
- def convert_html(file_entry, f, all_entries)
- title = get_title(f)
- markup = Ruwiki::Wiki.new('Default', Ruwiki::RubLogHandler.new(all_entries))
- body = markup.parse(f.readlines.join("\n"), file_entry.dir_name)
- HTMLEntry.new(title, body, self)
- end
-
- # FIXME: Need to check this one
- def convert_plain(file_name, f, all_entries)
- f.read
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/data/Default/ProjectIndex.ruwiki b/ruwiki/tags/release-0.9.1/data/Default/ProjectIndex.ruwiki
deleted file mode 100644
index 28807a7..0000000
--- a/ruwiki/tags/release-0.9.1/data/Default/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,48 +0,0 @@
-page!content: = Ruwiki
- Ruwiki is a simple, extensible Wiki written in Ruby. It supports both
- CGI and \WEBrick interfaces, templates, and CSS formatting.
- Additionally, it supports project namespaces, so that two pages can be
- named the same for differing projects without colliding or odd naming
- conventions. Please see the ::Ruwiki project for more information.
-
- Ruwiki is also an internationalised Wiki, although more testing,
- especially testing with multibyte character encodings and Unicode
- (UTF-8) is required. There are German and Spanish localisations of the
- messages included with the Ruwiki distribution.
-
- The current version is %RV#%. Enhancements and changes include:
- * a deployment system, whereby Ruwiki deployments can be installed from a package manager like that used for RPA (rpa-base) or \RubyGems (see Ruwiki::RuwikiUtilities);
- * support for Ruwiki as a Windows service on NT, 2000, XP, and 2003 systems;
- * demotion of YAML and Marshal storage types to formats of the Flatfiles storage type;
- * external user authentication (currently to \RubyForge only);
- * antispam efforts including robot and IP exclusion and URL redirection (see Ruwiki::[[Antispam]]); and
- * protection against cross-site scripting (XSS) attacks with HTML and CSS cleaning.
- The full list of changes can be found in Ruwiki::ChangeLog, with
- discussions of various features in Ruwiki::WikiMarkup,
- Ruwiki::Configuring_Ruwiki, and Ruwiki::Extending_Ruwiki.
-
- If you are upgrading from a version of Ruwiki older than 0.8.0, please
- read Ruwiki::RuwikiUtilities.
-
- Certain Ruwiki \APIs are considered stable at this point, others will
- be changing leading up to 1.0. Some of this is discussed in
- Ruwiki::To_Do, with further architectural discussions in
- Ruwiki::[[Roadmap]].
-
- %projects()
-
- Please review ::Tutorial and ::Ruwiki if you are unfamiliar with the
- concept of Wikis in general. If you want to play with \WikiFormatting
- for Ruwiki, use the Ruwiki::SandBox.
-
- [http://rubyforge.org/projects/ruwiki Ruwiki development] is hosted at
- [http://rubyforge.org RubyForge]. The current release of Ruwiki can
- always be [http://rubyforge.org/frs/?group_id=84 downloaded] from
- \RubyForge or the development (unstable) version can be obtained from
- CVS.
-properties!project: Default
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/Antispam.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/Antispam.ruwiki
deleted file mode 100644
index d84ca5a..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/Antispam.ruwiki
+++ /dev/null
@@ -1,83 +0,0 @@
-page!content: = Ruwiki %RV#% Antispam
- Wiki-spam, like email spam, is a major problem. Ruwiki is going to have
- extensive configurable tools for fighting spam. As it is, there are
- several tools built into Ruwiki to assist in the fight against these
- pond scum, but the tool development is certainly not complete.
-
- == External URI Redirection
- Although this will not greatly assist in the reduction of wiki spam,
- all external \URIs are redirected through an URI on Google that is
- designed specifically to remove \PageRank from links. The mechanism
- currently works on all manually-specified external \URIs and is not
- configurable without changing the URI tokenisation code. Thus, links
- that are generated by \[ruby-talk:12345] will not be redirected through
- Google, but direct links will be.
-
- New to Ruwiki 0.9.1, \URIs may be whitelisted with
- <tt>./data/clean.uri</tt>. The list of \URIs in <tt>clean.uri</tt> are
- &#8220;extended&#8221; Ruby regular expressions, one optional
- expression to a line. Spaces are not significant and comments are
- allowed. If you want to recognise a space in your regular expression,
- do so either with a character class ([ ]) or the whitespace
- meta-character (\s). Hash marks must be escaped (\#) or they will be
- treated as comment markers. Blank or comment-only lines are ignored.
- All other lines will be joined together.
-
- As noted, this will not necessarily reduce wiki spam, but it will deny
- spammers the entire benefit of spamming a wiki implemented with Ruwiki.
-
- == Reacting to Spammers and Robots
- Ruwiki %RV#% includes the ability to present alternative versions of
- itself to certain user agents and/or IP addresses based on a list. In
- the future, both the lists and the faces presented will be configurable
- (highly configurable, at that -- watch this space), but in this version
- of Ruwiki, there are three possible versions to be displayed:
- # Normal Ruwiki. This is a normally displayable and editable wiki.
- # Read-only Ruwiki. This is displayed to benign robots and users who have demonstrated that they cannot be trusted with edit access. The primary effect is to make command pages neither indexable, archivable, nor link-followable, and to remove certain links from visibility for these user agents.
- # Forbidden Ruwiki. The user gets an HTTP response of 403 Forbidden. This is displayed to malign (email-collecting) robots and users who have demonstrated that they are malicious and bent upon defacing the wiki.
-
- While Ruwiki provides these lists, and provides an extensive list of
- both malign and benign robots, it is up to the administrators of the
- wiki to ensure that they are kept up to date.
-
- The lists themselves are &#8220;extended&#8221; Ruby regular
- expressions, one optional expression to a line. Spaces are not
- significant and comments are allowed. If you want to recognise a space
- in your regular expression, do so either with a character class ([ ]) or
- the whitespace meta-character (\s). Hash marks must be escaped (\#) or
- they will be treated as comment markers. Blank or comment-only lines are
- ignored. All other lines will be joined together.
-
- foo
- bar
-
- becomes:
-
- %r{foo|bar}x
-
- The file are stored in the data directory for the running instance of
- Ruwiki (e.g., <tt>./data</tt>):
-
- ./data/agents.banned
- ./data/agents.readonly
- ./data/hostip.banned
- ./data/hostip.readonly
-page!footer:
-page!header:
-properties!create-date: 1103593880
-properties!creator:
-properties!creator-ip: UNKNOWN
-properties!edit-comment:
-properties!edit-date: 1103593880
-properties!editable: true
-properties!editor:
-properties!editor-ip: 127.0.0.1
-properties!entropy: 0.0
-properties!html-headers:
-properties!indexable: false
-properties!project: Ruwiki
-properties!title: Antispam
-properties!topic: Antispam
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/BugTracking.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/BugTracking.ruwiki
deleted file mode 100644
index 5f24cc7..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/BugTracking.ruwiki
+++ /dev/null
@@ -1,32 +0,0 @@
-page!content: = Ruwiki %RV#% Bug Tracking
- This page is for tracking bugs in Ruwiki. Only bugs from recent
- distributions are tracked. In addition to this source-based bug
- tracking, there is the [http://rubyforge.org RubyForge]
- [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug
- tracker] for Ruwiki.
-
- Those interested in Ruwiki development may also find the Ruwiki::To_Do
- list and the Ruwiki::[[Roadmap]] useful. The format of the bug list is
- &ldquo;version: description&rdquo;.
-
- == Open Bugs
- The version number is the version in which the bug was first reported.
- * 0.6.2: Not all formatting is applied consistently. The token rankings may need adjusting. Eivind Eklund has suggested a scheme that may help with this, but it will require architectural adjustment and will probably slow things down.
-
- ----
- == Closed Bugs
- The version number is the version in which the bug was fixed.
- * 0.9.0: Fixed a problem with old page edits being applied inappropriately.
- * 0.8.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=707&group_id=84&atid=407 Sub-Numbered bullets don&rsquo;t increment]. Fixed a list numbering problem. I think that lists are a bit slower now, but they are completely accurate.
- * 0.7.0: Fixed a link detection problem in \[wikiword] format. Thanks to [mailto:eivind@FreeBSD.org Eivind Eklund] for the patch.
- * 0.7.0: Fixed a problem with &lt;pre&gt; paragraph detection and generation.
- * 0.7.0: Fixed a problem with &lt;p&gt; generation.
- * 0.7.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=197&group_id=84&atid=407 Run-away ruby on some links in default distribution]. This may be related to a runaway header problem that was reported to me on IRC some time back that I believe has been fixed. Please advise.
- * 0.6.1: Projects aren&rsquo;t created appropriately.
- * 0.6.1: Saving without editing (or repost) appears to cause problems. A fix has been applied to attempt to address this. Pages that have not been changed will not be saved.
-properties!project: Ruwiki
-properties!title: BugTracking
-properties!topic: BugTracking
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/ChangeLog.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/ChangeLog.ruwiki
deleted file mode 100644
index 5cef3bf..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/ChangeLog.ruwiki
+++ /dev/null
@@ -1,110 +0,0 @@
-page!content: = Ruwiki %RV#% ChangeLog
- Uncompleted to-do items can be found in To_Do. Bugs in Ruwiki are
- tracked in BugTracking.
-
- == 0.9.1
- * Fixed a couple of problems with the Ruwiki deployment system surrounding Win32::Service management.
- * Added a Google redirect exclusion list to the configuration.
- * Fixed a problem where last lines of code blocks may not be properly marked.
- * Changed relevant timestamps to UTC.
- * Fixed a problem with Google redirection not working.
- * Fixed a problem with some pages not being displayed as links in the topic listing; only affected some pages created with the Wikipedia form of naming.
- * Fixed a problem with tokens being redefined. Once a token is defined, its class is frozen; the token reader will silently ignore TypeError exceptions.
-
- == 0.9.0
- * Created a Ruwiki deployment system. Various steps were required to accomplish this:
- ** Moved executable files to bin/ for better packaging; moved core servlet code and other utilities to Ruwiki::Utils namespace.
- ** Renamed bin/convert to bin/ruwiki_convert. This will ultimately be moved into the ruwiki command.
- ** Refactored Flatfile format (section!\item:<Tab>value) to Ruwiki::Exportable, loosened the format restrictions to allow for either section!\item:<Tab>value or section!\item:<Space>value.
- ** Incorporated Ruwiki::Exportable into Ruwiki::Config to allow for the saving of configuration files.
- ** Incorporated Ruwiki::Exportable into Ruwiki::\Utils::ServletRunner to allow for the saving of configuration files.
- ** Added Ruwiki manager code for installation and management of Ruwiki deployments.
- ** Added code for running the Ruwiki servlet as a Windows service on Win32. (Currently minimally tested and unworking.)
- ** Added --central to bin/ruwiki_servlet, to run a read-only instance of Ruwiki using the centralised data from RPA or \RubyGems.
- * Removed YAML and Marshal storage types as separate classes and incorporated them as formats of the Flatfiles storage type. Added the 'format' option to the Flatfiles storage_options hash.
- * Added draft \APIs for authentication, robot exclusion, IP exclusion, and HTML cleaning.
- ** Implemented initial authentication for \RubyForge. It verifies a user against their current \RubyForge cookie.
- ** Implemented known robot list. It may require further refinement. It contains two classes of robots:
- *** Read-only: known to be good (like the Googlebot) or neutral (most other crawlers). They are permitted to read, index, and follow links on all non-command pages.
- *** Banned: known to be bad, essentially spam-crawlers. These robots will uniformly get a 403 Forbidden result.
- ** Implemented IP exclusion list. It may require further refinement. It contains two classes of IPs:
- *** Read-only: IP addresses that are not permitted to edit the wiki. They will be treated as read-only robot exclusion.
- *** Banned: known to be bad, essentially spam-crawlers. These IPs will uniformly get a 403 Forbidden result.
- ** HTML cleaning has been implemented.
- *** HTML entities &amp;, &lt;, and &gt; will be escaped.
- *** Only HTML tags and attributes from a &ldquo;known good&rdquo; list will be passed through unchanged.
- *** CSS properties display and visibility will be silently eliminated from embedded HTML.
- *** Although (mostly) valid XHTML is generated, Ruwiki does not currently support tags or attributes in namespaces. If and when this is enabled, it will be enabled on a namespace-by-namespace basis.
- * External URLs are redirected through a single point through the Google PageRank remover URI \http://www.google.com/url?sa=D&q=<em>uri</em>. There is no whitelisting for URIs at this point.
- * Added a Rakefile for packaging. Currently incomplete.
- * Modified the default template style to remove the bottom control bar, as it was blocking the last bit of text on some pages in lesser browsers.
- * Updated more documentation.
- * Added a message facility so that non-error messages can be communicated to the user.
- * Fixed a bug with submitting an old version of the code with an expired lock reverting changes. The changed versions are now merged automatically and re-presented to the user. It's a simplistic merge, to be improved in a later version of Ruwiki. A message is displayed to the user.
- * Modified searching for empty strings so that instead of throwing an error, a message is displayed to the user.
-
- == 0.8.0
- * AC: Added topic list (_topics) and project list (_projects) controls on templates and backend.
- * AZ: Added %topics() and %projects() tokens. See WikiMarkup for details.
- * AC: Added simple search on back-end (both project and global); search strings must be validated and cleansed before being sent to the back-end (the back-end must prepare the string for its own search mechanism). The back-end is wholly responsible for the searching of the pages.
- * AC: Added \RecentChanges list to backend and controls.
- * AZ: Changed default for Ruwiki::Config#storage_options[:flatfiles][:extension] to <tt>ruwiki</tt>.
- * AZ: Topic backlink search: searches for mentions of the topic in the other topics of the project.
- * AZ: New templating engine: The Rdoc templating engine has been greatly enhanced in preparation for some changes that will happen surrounding antispam capabilities.
- * AZ: Multiple flatfile-based backend support: tagged file (&ldquo;flatfiles&rdquo;), YAML (&ldquo;yaml&rdquo;), and Marshal (&ldquo;marshal&rdquo;).
- * AZ: A converter utility between backends.
- * AZ: Defined a canonical, extensible page transport format.
- * AZ: Defined a canonical, format-independent diff format.
- * AZ: Fixed list numbering problem. Modified lists to allow for mixed lists. See WikiMarkup for restrictions.
- * AZ: Removed automatic image conversion for \URIs that look like images. Now, images must be specified with the \[image:uri] format. See WikiMarkup for more details.
- * AZ: Fixed minor bugs in several tokens.
- * AZ: New look! Ruwiki now sports a new default look with CSS and template changes.
- * AZ: New look! Ruwiki has a &ldquo;simple&rdquo; template set.
- * AZ: New look! Ruwiki has a &ldquo;sidebar&rdquo; template set.
- * AZ: Fixed a long-standing bug with code tokens.
-
- == 0.7.0
- * Changed the tokenization API so that the #post_replace call is made at the Token class level instead of the instance level.
- * Improved HTML code generation.
- * Added servlet runner batch files for Windows. They <strong>will</strong> require modification to run properly.
- * Added %calendar(...) support. See WikiMarkup for more information.
-
- == 0.6.2
- * Removed dependencies on Ruwiki from a number of classes (Ruwiki::Backend, Ruwiki::Backend::Flatfiles, Ruwiki::Page, Ruwiki::Wiki, Ruwiki::Wiki::Tokens, and various tokens).
- * Ruwiki now initializes a \Ruwiki::BackendDelegator, which creates the requisite Ruwiki::Backend instance with Ruwiki::Config#storage_options.
- * Added German (Christian Neukirchen &lt;cneukirchin@yahoo.de&gt;) and Spanish translations (Mauricio Fernández &lt;batsman.geo@yahoo.com&gt;).
-
- == 0.6.1
- * Changed Ruwiki::Config#data_path to Ruwiki::Config#storage_options[:flatfiles][:data_path]. This represents a generalisation of storage type options so that the Ruwiki::Config object is not polluted with storage type options. Ruwiki::Config#storage_options keys should be the same Ruby Symbol as is used in Ruwiki::Config#storage_type.
- * Added Ruwiki::Config#storage_options[:flatfiles][:extension], based on a request by Chad Fowler. This allows you to have Project/\TopicFile actually stored as Project/\TopicFile.wiki if Ruwiki::Config#storage_options[:flatfiles][:extension] is set to <tt>wiki</tt>. The default for Ruwiki::Config#storage_options[:flatfiles][:extension] is <tt>nil</tt>.
- * Fixed incorrect references. I had been incorrectly attributing [http://sourceforge.net/projects/rdoc-wiki RDoc Wiki] to Dave Thomas. \RDoc Wiki is by Michael Neumann. However, the project I pulled from <strong>is</strong> by Dave Thomas, but it&rsquo;s [http://sourceforge.net/projects/rublog RubLog]. Apologies to both developers.
- * Added RuwikiTemplatingLibrary documentation.
- * Internationalized messages, except for the templating library.
- * Added configuration API for future work surrounding features. The existing wiki is mostly feature complete. Additional features (such as access controls) will be added through the feature interface.
- * Fixed project creation.
- * Fixed problems with \WikiWord links.
- * Added Wikipedia-style Wiki links (\[[list of words]]).
- * Fixed a potential problem with re-posted data or saving without editing.
- * Added the ability to put commands in the URL.
-
- == 0.6.0
- * Added Ruby mailing list reference support (e.g., \[ruby-talk:12345]).
- * Reorganised the code (again) to better support alternative frontends. Based, in part, on [http://sourceforge.net/projects/rublog RubLog] by Dave Thomas. (Reference corrected in 0.6.1.)
- * Added a [http://www.webrick.org WEBrick] servlet interface. Based, in part, on the \WEBrick servlet interface provided with \RubLog by Chad Fowler.
- * Added templates, using the [http://rdoc.sourceforge.net RDoc] template.rb library.
- * Changed the default topic to be \ProjectIndex instead of \DefaultProject.
- * Added a new \WikiWord format, \Wiki_Word_with_Spaces.
- * Completed lots of Ruwiki documentation.
- * Updated the save page.
- * Fixed a problem with the linking of project specific pages.
-
- == 0.5.0
- * Reorganized the code significantly to be easier to edit and extend.
- * Added abbreviation capabilities.
- * Cleaned up a lot of tokenizing code.
-properties!project: Ruwiki
-properties!title: ChangeLog
-properties!topic: ChangeLog
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/Configuring_Ruwiki.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/Configuring_Ruwiki.ruwiki
deleted file mode 100644
index bfb3c3b..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/Configuring_Ruwiki.ruwiki
+++ /dev/null
@@ -1,150 +0,0 @@
-page!content: = Configuring Ruwiki %RV#%
- Ruwiki is configured similarly as both a CGI and a \WEBrick servlet.
- The biggest distinction is that because the Wiki servlet is created
- after the \WEBrick server is created (during the dispatch to the
- servlet), it is necessary to configure the wiki with a global
- Ruwiki::Config object stored in Ruwiki::Servlet.config. This must be a
- valid Ruwiki::Config object. In the examples below,
- <em>wiki.config</em> may be simply considered a random Ruwiki::Config
- object.
-
- > This has changed in Ruwiki 0.9.0 from a global configuration object
- > named $config.
-
- : Additional configuration options will be added from time to time. The
- : form for specifying configuration may be changed prior to 1.0.
-
- If you are looking for discussion on templates, this has been moved to
- Extending_Ruwiki.
-
- == Ruwiki Configuration Options
- === wiki.config.title
- This configuration option names the Wiki; by default this is
- <tt>Ruwiki</tt>. This affects the display of the home link and the
- &lt;title&gt; element of pages.
-
- === wiki.config.webmaster
- The email address for the webmaster. This is used in generating error
- reports that can be emailed to the wiki&rsquo;s webmaster.
-
- === wiki.config.language
- This sets the internationalisation mechanism. It must be one of the
- known two-letter ISO language codes or a module under Ruwiki::Lang
- matching that description. See Extending_Ruwiki for more information.
- Ruwiki's default language is English ('en'), but there are translations
- for Spanish ('es') and German ('de') included. Localization is
- currently per wiki instance. In a servlet environment, this may mean
- that only a single language is recognised.
-
- === wiki.config.default_page, wiki.config.default_project
- These options indicate what will happen when the wiki&rsquo;s URL is
- specified without any parameters (the default page in the default
- project is opened), when a topic is specified without a project (the
- topic is opened in the default project), and when a project is
- specified without a topic (the default page is opened in the project).
-
- === wiki.config.storage_type, wiki.config.storage_options
- <tt>wiki.config.storage_type</tt> specifies the back-end storage
- mechanism as a Ruby Symbol. Currently, <tt>'flatfiles'</tt>,
- is supported. See Extending_Ruwiki for more information.
-
- <tt>wiki.config.storage_options</tt> is a hash of option hashes for
- each known storage type known to the Wiki. This must use the same
- Symbol as <tt>wiki.config.storage_type</tt> as the top-level hash key.
-
- ==== ...storage_options['flatfiles']['data-path']
- The directory in which the wiki files will be found. By default, this
- is &ldquo;<tt>./data/</tt>&rdquo;.
-
- ==== ...storage_options['flatfiles']['format']
- Specifies the storage format for the flatfiles backend. The default
- format is 'exportable', but may be set to 'yaml' or 'marshal' as well.
- The 'yaml' format will not work reliably with versions of Ruby before
- 1.8.2 preview 3.
-
- ==== ...storage_options['flatfiles']['extension']
- The extension of the wiki files. By default, this is
- &ldquo;ruwiki&rdquo;. For those upgrading from a version of Ruwiki
- before 0.8.0, note that you must explicitly set this value to
- <tt>nil</tt> if you wish to have no extension.
-
- === wiki.config.template_path
- This specifies the paths where the Wiki templates will be found. The
- process running the Wiki must have read access to the template_path.
-
- === wiki.config.template_set, wiki.config.css
- These two options indicate which template set will be used. Three
- template sets are provided in the release package:
- &ldquo;default&rdquo;, &ldquo;simple&rdquo;, and &ldquo;sidebar&rdquo;.
- The only CSS file used initially is &ldquo;ruwiki.css&rdquo;. Templates
- work such that they will be found in
- <em>template_path</em>/<em>template_set</em>. All CSS files are loaded
- from the template set directory and emitted as part of the output
- stream.
-
- : The bad side of this is that the CSS never caches on the client side
- : as it would if it were a separate file. However, as templates may not
- : be in a web-accessible directory, this is necessary.
-
- === wiki.config.time_format, wiki.config.date_format, wiki.config.datetime_format
- When the wiki displays date or time values, these formats are used.
- They are not currently accessible by tokens.
-
- === wiki.config.debug
- Adds additional information to the (rare) error reports. Defaults to
- <tt>false</tt>.
-
- === wiki.config.logger
- Sets or returns the logger. The logger, if set, must respond to the
- same methods as WEBrick::Logger.
-
- === wiki.config.auth_mechanism
- The authentication mechanism name as a String. Corresponds to a
- filename that will be found in ruwiki/auth. The authenticator must have
- a single class method, +authenticate+, which accepts the +request+, the
- +response+, and the +auth_options+. This API is a draft API and is
- likely to change in future versions of Ruwiki. In this version of
- Ruwiki, only one authentication mechanism will be found -- for dealing
- with authenticating users already logged into RubyForge.
-
- === wiki.config.auth_options
- Options for the authentication mechanism as a Hash. This will be passed
- to the authenticator defined in wiki.config.auth_mechanism. The
- <tt>auth_options</tt> are a single-level hash. They may be stored in
- the Ruwiki configuration file as:
-
- ruwiki-config!auth-options: default!user: pgsqluser
- default!pass: pgsqlpass
-
- == Ruwiki Servlet Options
- Most, if not all, of the configuration above can be achieved through
- command-line options of the ruwiki servlet.
-
- === Servlet Command-Line Options
- ; -P, --port <em>PORT</em> : Runs the Ruwiki servlet on the specified port. Default 8808.
- ; -A, --accept <em>ADDRESSES</em> : Restricts the Ruwiki servlet to accepting connections from the specified address or (comma-separated) addresses. May be specified multiple times. Defaults to all addresses.
- ; -L, --local : Restricts the Ruwiki servlet to accepting only local connections (127.0.0.1). Overrides any previous --accept addresses.
- ; -M, --mount <em>MOUNT_POINT</em> : The relative URI from which Ruwiki will be accessible. Defaults to &ldquo;/&rdquo;.
- ; --[no-]log : Log \WEBrick activity. Default is --log.
- ; --logfile <em>LOGFILE</em> : The file to which \WEBrick logs are written. Default is standard error.
- ; -T, --threads <em>THREADS</em> : Sets the \WEBrick threadcount.
-
- === Ruwiki Command-Line Options
- ; --language <em>LANGUAGE</em> : The interface language for Ruwiki. Defaults to &ldquo;en&rdquo;. May be &ldquo;en&rdquo;, &ldquo;de&rdquo;, or &ldquo;es&rdquo;.
- ; --webmaster <em>WEBMASTER</em> : The Ruwiki webmaster email address. Defaults to &ldquo;webmaster@domain.com&rdquo;.
- ; --[no-]debug : Turns on Ruwiki debugging. Defaults to --no-debug.
- ; --title <em>TITLE</em> : Provides the Ruwiki title. Default is &ldquo;Ruwiki&rdquo;.
- ; --default-page <em>PAGENAME</em> : An alternate default page. Default is &ldquo;\ProjectIndex&rdquo;.
- ; --default-project <em>PAGENAME</em> : An alternate default project. Default is &ldquo;Default&rdquo;.
- ; --template-path <em>TEMPLATE_PATH</em> : The location of Ruwiki templates. Default is &ldquo;./templates&rdquo;.
- ; --templates <em>TEMPLATES</em> : The name of the Ruwiki templates. Default is &ldquo;default&rdquo;.
- ; --css <em>CSS_NAME</em> : The name of the <acronym title="Cascading Style Sheets">CSS</acronym> file in the template path. Default is &ldquo;ruwiki.css&rdquo;.
- ; --storage-type <em>TYPE</em> : Select the storage type: flatfiles, yaml, marshal
- ; --flatfiles-data-path <em>PATH</em> : The path where data files are stored. Default is &ldquo;./data&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
- ; --flatfiles-extension <em>EXT</em> : The extension for data files. Default is &ldquo;ruwiki&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
-properties!project: Ruwiki
-properties!title: Configuring_Ruwiki
-properties!topic: Configuring_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/Extending_Ruwiki.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/Extending_Ruwiki.ruwiki
deleted file mode 100644
index fbc89b8..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/Extending_Ruwiki.ruwiki
+++ /dev/null
@@ -1,316 +0,0 @@
-page!content: = Extending Ruwiki %RV#%
- Ruwiki is relatively easily extended to support new features. There are
- four primary ways in which Ruwiki can be extended or modified by the
- end user: templates, translating Ruwiki messages and labels, markup
- tokens, and creating new backends.
-
- == Templates
- Templating is done with a heavily modified version of the \RDoc
- template.rb library included in the distribution of Ruwiki. The
- templating library allows for nested templates, and this is used
- extensively in Ruwiki. This library is documented in
- RuwikiTemplatingLibrary.
-
- There are four major templates: content, edit, save, and error. Each of
- these has a slightly different combination of template files used, and
- this means that there are different sets of variables available.
-
- The major templates are &ldquo;composite templates&rdquo; that are
- defined as follows:
- ; content or search : body.tmpl, content.tmpl, controls.tmpl, footer.tmpl
- ; edit or preview : body.tmpl, edit.tmpl
- ; save : body.tmpl, save.tmpl, controls.tmpl, footer.tmpl
- ; error : body.tmpl, error.tmpl
-
- === Common Variables
- The following template variables are presented for all composite
- templates.
- ; <tt>%css_link%</tt> : The contents of the CSS file for the template set.
- ; <tt>%home_link%</tt> : A link to the root page of the Wiki.
- ; <tt>%editable%</tt> : A boolean value to mark the page as editable or not. Used in a conditional block in the templates.
- ; <tt>%cgi_url%</tt> : The URL for the Wiki.
- ; <tt>%content%</tt> : The formatted content of the current page.
- ; <tt>%page_project%</tt> : The project for the current page.
- ; <tt>%page_raw_topic%</tt> : The topic for the current page, escaped for safe transmission over the web.
- ; <tt>%page_topic%</tt> : The printable topic for the current page.
- ; <tt>%url_project%</tt> : The URL to the current page&rsquo;s project.
- ; <tt>%url_topic_search%</tt> : The URL to search for the current topic in the current project.
- ; <tt>%link_topic_search%</tt> : A link to the current topic search.
-
- === Variables for :content, :save, :search, :edit, :preview
- ; <tt>%message%</tt> : A message presented at the top of the Wiki when Ruwiki needs to inform the user of something that is not an error.
-
- === Variables for :content, :save, :search
- ; <tt>%wiki_title%</tt> : The title of the Wiki.
- ; <tt>%label_topic_or_search%</tt> : Either <tt>#topic#</tt> or <tt>#search#</tt>.
- ; <tt>%page_topic_name%</tt> : The same as <tt>%page_topic%</tt>.
-
- === Variables for :edit, :preview
- ; <tt>%wiki_title%</tt> : The title of the Wiki with a tag to indicate that the page is being edited.
- ; <tt>%page_content%</tt> : The content of the page.
- ; <tt>%page_version%</tt> : The current version number of the page.
- ; <tt>%unedited_page_content%</tt> : The formatted, unedited content of the page.
- ; <tt>%pre_page_content%</tt> : A Web-escaped form of the page content.
- ; <tt>%edit_comment%</tt> : The current edit comment.
-
- === Variables for :error
- ; <tt>%wiki_title%</tt> : The title of the Wiki with an error message.
- ; <tt>%name%</tt> : The name of the error.
- ; <tt>%backtrace%</tt> : The backtrace of the error.
- ; <tt>%backtrace_email%</tt> : The backtrace of the error formatted for sending by email.
- ; <tt>%webmaster%</tt> : The email address of the webmaster.
-
- == Translating Ruwiki Messages
- : NOTE: The mechanism for specifying language may be changed in a
- : future version of Ruwiki, although the internationalisation mechanism
- : will not be changing.
-
- Ruwiki is internationalized. This method sets the Ruwiki error messages
- (and a few other messages) to the specified language Module. The
- language Module must have a constant Hash called <tt>Message</tt>
- containing a set of symbols and localized versions of the messages
- associated with them.
-
- If the file <em>ruwiki/lang/es.rb</em> contains the module
- <tt>Ruwiki::Lang::ES</tt>, the messages for RSS could be localized to
- Spanish thus:
-
- require 'ruwiki/lang/es'
- ...
- wiki.config.language = Ruwiki::Lang::ES
-
- Localization is currently per wiki instance. In a servlet environment,
- this may mean that only a single language is recognised.
-
- It is recommended that the hash be created with a default proc that
- reports unknown message keys.
-
- Message = Hash.new { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
-
- == Extending Ruwiki Markup
-
- : <strong>WARNING:</strong> These \APIs will change in Ruwiki 0.9.0,
- : replacing the instance variables @project, @backend, and @script with
- : a Handler object. There may be other changes as well.
-
- Ruwiki&rsquo;s WikiMarkup can be extended by creating a new
- Ruwiki::Wiki::Token. Tokens will be automatically loaded if they are
- placed in <em>ruwiki/wiki/tokens</em>.
-
- It is recommended that new tokens be added to the test cases in
- <tt>tests/tc_tokens.rb</tt>.
-
- The following Ruwiki::Wiki::Token class will convert strings in the
- forms of \[ruby-talk:12345] to links.
-
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- === Known Instance Variables
- ==== @match
- The match data for this token instance is is kept in @match. This is
- what will be used in #replace and #restore.
-
- ==== @project
- The project being processed.
-
- ==== @backend
- The Backend for the wiki. If you are using Ruwiki tokenizers outside of
- Ruwiki, this does not need to be a \BackendDelegator, but can be the
- direct Backend (which expects less information).
-
- ==== @script
- The URI to the script.
-
- ==== @message
- The message hash for displaying localised messages.
-
- ==== @title
- The title of the wiki instance.
-
- === Required Methods
- ==== ::regexp
- Ruwiki tokens are matched only through regular expression matches. As
- shown in the example above, the regular expression for ruby-talk
- mailing list posts is <tt>%r{\[ruby-\talk:(\d+)\]}</tt>. The purpose of
- the ::regexp method is to return the regexp for matching.
-
- For most inline matches, Ruwiki will ensure that the escape character
- (\) works automatically. For whole-line matches, it is necessary to
- match the escape character manually and provide a #restore method.
-
- As an example, the \HRule class implements these methods.
-
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- It may also be necessary to match escapes manually on inline matches
- that must be along word boundaries where the regular expression
- includes characters that normally match word boundaries. The project
- index match (e.g., \::Ruwiki) regular expression does this
- <tt>%r{(\B|\\)::([A-Z][a-z]+)}</tt>.
-
- ==== #replace
- This returns the formatted token. In the \RubyTalkLinks class above,
- the matched regular expression will be replaced with a hyperlink. The
- text of the hyperlink will be the matched text; the target of the
- hyperlink will include the first captured value.
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
-
- === Optional Methods
- ==== ::rank
- By default, a token will be processed in the order created. Tokens may
- be given a specific rank to ensure that they are processed in a
- particular order. The default rank is <tt>9999</tt>.
-
- ==== #restore
- Restores the token without replacement. Implements the results of the
- escape character. Each Token class is responsible for its own
- restoration. As noted in #regexp, whole-line tokens are most likely to
- need a #restore implementation.
-
- ==== ::post_replace
- Performs any necessary massaging of the data. The Lists token uses this
- to ensure that lists are collapsed together; the Paragraph token uses
- this to ensure that there are no empty paragraph tag pairs
- (&lt;p&gt;&lt;/p&gt;).
-
- : <strong>Note:</strong> This has been changed from Ruwiki 0.6.x.
- : Plugins written for the Ruwiki 0.6.x Token API will need to be
- : modified so that this is defined as:
-
- def self.post_replace
- ...
- end
-
- : as opposed to:
-
- def post_replace
- ...
- end
-
- == Extending Ruwiki Backends
- Ruwiki can support varying backends, as the backend interface has been
- abstracted completely from the data store. The backend
- <strong>must</strong>:
-
- # reside in <em>ruwiki/backends/</em> as <em>backend_name</em>.rb.
- # be registered by adding the <em>backend_name</em> as a symbol (e.g., :<em>backend_name</em>) to Ruwiki::KNOWN_BACKENDS.
- # inherit from Ruwiki::Backend.
- # exist as Ruwiki::Backend::<em>\Backend_name</em>.
-
- === Required Methods
- ==== #initialize(storage_options)
- The backend may only obtain its configuration information from an
- option hash provided by the \BackendDelegate. This is obtained from
- <tt>wiki.config.options[backend]</tt>. If a configuration error is
- detected during initialization, the backend should raise the
- \Ruwiki::Backend exception class \BackendError. This would be done
- with:
-
- raise Ruwiki::Backend::BackendError.new([:message_symbol, [message_parameters]])
-
- Backend writers should add appropriate messages to the
- <em>lang/en.rb</em> at a minimum. The \BackendDelegator will detect
- this and report the results appropriately.
-
- ==== #load(topic, project)
- The backend will be provided the name of the topic and project. It must
- return the selected page as a hash of hashes. The hash must match that
- of \Ruwiki::Page#export. It will be passed as the parameter to
- \Ruwiki:::Page.new.
-
- ==== #store(page)
- This method must store the provided Ruwiki::Page object. Current Ruwiki
- backend implementations store the Ruwiki::Page#export hash. This method
- is responsible for calling the private method Backend#make_diff and
- adding the result to the list of diffs for the page.
-
- ===== Backend#make_diff(oldpage, newpage)
- This method expects two page objects, or their Ruwiki::Page#export
- representation. It will return a hash representing the difference set
- between the two pages.
-
- ==== #obtain_lock(page, time, expire, address = 'UKNOWN')
- Obtains an exclusive lock on the page. The \BackendDelegator is called
- with the page, the address, and a timeout which is provided. The time
- is provided by the call to the BackendDelegate, and the expire is also
- provided by the call to the BackendDelegate which is given a timeout
- value (by default 600 seconds). If the lock is still in effect, a
- second call to #obtain_lock should renew the timeout on the lock.
-
- ==== #release_lock(page, address = 'UNKNOWN')
- Releases the exclusive lock on the page. The lock should not be released
- unless the IP address on the lock is the same or the lock has expired.
-
- ==== #project_exists?(project)
- Returns <tt>true</tt> if the project exists.
-
- ==== #page_exists?(topic, project = 'Default')
- Returns <tt>true</tt> if the page exists within the specified project.
-
- ==== #create_project(project)
- Attempts to create the project.
-
- ==== #search_project(project, search_string)
- String search all topic names and content in a project and return a
- hash of topic hits:
-
- topicname => hits
-
- ==== #list_projects
- Return an array of all projects.
-
- ==== #list_topics(project)
- Return an array of all topics within the project.
-
- === Future Methods
- Note that these methods are currently optional (they are not yet called
- from Ruwiki), but will become required moving forward as the functions
- are implemented in Ruwiki.
-
- ==== #destroy(page)
- Removes the page from the wiki. This should <strong>not</strong> remove
- the change history of the topic (in the event that the page has been
- removed maliciously). There will be a separate method to remove the
- page history.
-
- ==== #destroy_project(project)
- Attempts to destroy the project.
-
- === Optional Methods
- These methods are completely optional. They are guarded in the
- \BackendDelegate by a call to #respond_to?().
-
- ==== #global_search(search_string)
- The global search in the backend delegate is by default implemented as
- a looping search through all projects. A backend may have a more
- efficient backend global search mechanism. If the backend responds to
- #global_search, then the \BackendDelegate will use this method.
-properties!project: Ruwiki
-properties!title: Extending_Ruwiki
-properties!topic: Extending_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/LicenseAndAuthorInfo.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
deleted file mode 100644
index 5d1c20e..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
+++ /dev/null
@@ -1,29 +0,0 @@
-page!content: = Ruwiki Licence
- Ruwiki is copyright &copy; 2002 - 2004 [mailto:alan@digikata.com Alan
- Chen] and [mailto:ruwiki@halostatue.ca Austin Ziegler].
-
- Ruwiki is provided free of use and without any warranty express or
- implied. You may use, distribute, or modify Ruwiki under the conditions
- of Ruby&rsquo;s licence or the [http://www.gnu.org/copyleft/gpl.html
- GNU General Public Licence].
-
- * Ruwiki includes a modified version of rdoc/template.rb originally by Dave Thomas for use in \RDoc.
-
- == Translations
- * Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen] on 2003.10.22, with corrections by Mauricio Fern&aacute;ez. Note that the initial template translations (./templates/de/) were done via \AltaVista Babelfish and should not be blamed on Christian.
- * Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fern&aacute;ndez] on 2003.10.22. Note that the initial template translations (./templates/es/) were done via \AltaVista Babelfish and should not be blamed on Mauricio.
-
- == Austin&rsquo;s Other Projects
- Austin has also released several other projects available on the RAA that you may be interested in:
- * [http://raa.ruby-lang.org/list.rhtml?name=mime-types MIME::Types], \RubyForge [http://rubyforge.org/projects/mime-types project].
- * [http://raa.ruby-lang.org/list.rhtml?name=pdf-writer PDF::Writer], \RubyForge [http://rubyforge.org/projects/ruby-pdf project].
- * [http://raa.ruby-lang.org/list.rhtml?name=text-format Text::Format], \RubyForge [http://rubyforge.org/projects/text-format project].
- * [http://raa.ruby-lang.org/list.rhtml?name=trans-simple Transaction::Simple], \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=uninheritable Uninheritable], Transaction::Simple&rsquo;s \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=diff-lcs Diff::LCS], Ruwiki&rsquo;s \RubyForge [http://rubyforge.org/projects/ruwiki project].
-properties!project: Ruwiki
-properties!title: LicenseAndAuthorInfo
-properties!topic: LicenseAndAuthorInfo
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/ProjectIndex.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/ProjectIndex.ruwiki
deleted file mode 100644
index e370528..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,83 +0,0 @@
-page!content: = Ruwiki %RV#%
- This is the \ProjectIndex page for Ruwiki. For any given project, the
- \ProjectIndex topic will be the default topic for plain project links.
-
- == Features and Information
- * This wiki supports a variety of WikiFeatures that you may be interested in. The rules for WikiMarkup are similar to some other wikis, but there are a few unique markup capabilities in Ruwiki.
- * Configuring_Ruwiki is simple.
- * Extending_Ruwiki is almost as simple.
- * What you need to know for using Ruwiki's [[Antispam]] capabilities.
- * Who wrote Ruwiki? Read the LicenseAndAuthorInfo.
-
- == Requirements
- Ruwiki currently requires Ruby 1.8, Diff::LCS 1.1.2 and
- Archive::Tar::Minitar 0.5.1. These packages are included in the
- <em>packages/</em> directory in the
- <code>ruwiki-0.9.0-full.tar.gz</code> form of the distribution.
-
- The YAML backend requires Ruby 1.8.2 preview 3 or later.
-
- == Upgrading
- Ruwiki %RV#% has a flatfile format that is incompatible with versions
- of Ruwiki older than Ruwiki 0.8.0. If you are upgrading from one of
- these versions, you must use the bin/ruwiki_convert. The simple case
- will be (assuming that your data files are in ./data):
-
- % ruwiki_convert ./data
-
- The ruwiki_convert utility is automatically installed by \RubyGems and
- RPA. See RuwikiUtilities for more information. Note that this utility
- will probably be incorporated into the main Ruwiki utility in a future
- version.
-
- == Getting Started
- There are some differences between the startup of <tt>.tar.gz</tt>,
- \RubyGems, and RPA installations of Ruwiki.
-
- === \QuickStart (Read-only: \RubyGem and RPA Installation Only)
- Run:
- % ruwiki_servlet --central
-
- Point your web browser to \http://localhost:8808/.
-
- === \QuickStart (CGI)
- # Install the Ruwiki CGI (<tt>ruwiki.cgi</tt>) program in a place where your webserver can execute it.
- #* <strong>\RubyGem:</strong> <tt>ruwiki install cgi,data --to <em>directory</em></tt>
- #* <strong><tt>.tar.gz</tt>:</strong> Extract the Ruwiki directory to that directory. <tt>cp bin/ruwiki.cgi .</tt> <em>or</em> <tt>copy bin\ruwiki.cgi .</tt>
- # Point your web browser to the appropriate URL.
-
- === \QuickStart (\WEBrick)
- # Install the Ruwiki servlet or data.
- #* <strong>\RubyGem:</strong> <tt>ruwiki install data --to <em>directory</em></tt> <em>or</em> <tt>ruwiki install servlet,data --to <em>directory</em></tt>
- #* <strong><tt>.tar.gz</tt>:</strong> Extract the Ruwiki directory.
- # Run <tt>ruwiki_servlet</tt>. Under the <tt>.tar.gz</tt>, this would be <tt>bin/ruwiki_servlet</tt> <em>or</em> <tt>ruby bin\ruwiki_servlet</tt>
- # Point your web browser to \http://localhost:8808/.
-
- == Support
- * Troubles with Ruwiki? See TroubleShooting for some suggestions. Have a new problem? Add it to the main [http://ruwiki.rubyforge.org/ruwiki.cgi/Ruwiki/TroubleShooting TroubleShooting] page.
- * Subscribe to [http://rubyforge.org/mailman/listinfo/ruwiki-discuss ruwiki-discuss] ([http://rubyforge.org/pipermail/ruwiki-discuss/ archives]).
- * You can also use the [http://rubyforge.org/forum/?group_id=84 Ruwiki Public Forum] or the on \RubyForge.
-
- == Tracking Ruwiki Development
- The development progress of Ruwiki is kept primarily in the wiki
- itself, but the services of [http://rubyforge.org RubyForge] are used
- as well.
- * The BugTracking page in Ruwiki keeps track of open and closed bugs in Ruwiki. Bugs can also be found in the \RubyForge [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug tracker] and [http://rubyforge.org/tracker/?atid=408&group_id=84&func=browse Support Requests].
- * The To_Do list keeps track of major development goals for Ruwiki. Items for this list can be found on \RubyForge in [http://rubyforge.org/tracker/?atid=410&group_id=84&func=browse Feature Requests] and [http://rubyforge.org/tracker/?atid=409&group_id=84&func=browse Patches].
- * There is a mailing list to track CVS changes: [http://rubyforge.org/mailman/listinfo/ruwiki-checkin ruwiki-checkin] ([http://rubyforge.org/pipermail/ruwiki-checkin/ archives]).
-
- == Different Features?
- If this wiki doesn&rsquo;t have the right combination of features, (or if it
- just doesn&rsquo;t feel right) try these other Ruby-based Wikis:
-
- * [http://pimwiki.rubyforge.org/ PIMWiki]
- * [http://instiki.rubyforge.org/ Instiki]
- * [http://www.walrus-ruby.org/amrita/cgi-bin/aswiki/aswiki.cgi Amrita Wiki]
- * [http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=top RWiki]
- * [http://www.xpsd.com/MiniRubyWiki MiniRubyWiki]
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/Roadmap.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/Roadmap.ruwiki
deleted file mode 100644
index 50e311b..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/Roadmap.ruwiki
+++ /dev/null
@@ -1,224 +0,0 @@
-page!content: = Ruwiki %RV#%: The Road Ahead
- This roadmap is accurate as of the release of 0.9.0.
-
- What lies ahead for Ruwiki? The To_Do list will give a detailed list
- of what is to follow, but this list is not the roadmap. There is no
- clear indication of the reason for &mdash; and in some cases, the
- meaning of &mdash; the items on the list. The intention of this
- document is to expand on that list. As items are completed, they will
- be removed from this document.
-
- == A Note About Targets
- Ruwiki development is not proceeding as quickly as I would prefer, but
- it is continuing steadily. I am at times choosing to delay releases
- and bypass some versions because there are other pressing concerns; I
- am definitely aiming for quality here, not for timeliness.
-
- == Development Inputs
- The primary driver of development on Ruwiki is the needs of a few
- groups of people. First, both Alan and Austin use or will use Ruwiki
- at work. There are particular needs that both have. Austin will be
- replacing an installation of \PhpWiki with an installation of Ruwiki
- sometime in early 2005.
-
- Second, [http://www.rubygarden.org/ruby RubyGarden], and
- [http://www.rubyforge.org RubyForge], and the
- [http://rpa.rubygarden.org <acronym title="Ruby Production Archive">RPA</acronym>]
- have expressed an intention to replace the Perl-based \UseMod wiki
- with a Ruby-based wiki. The popular and easy-to-use Instiki
- (&ldquo;there is no step 3&rdquo;) is not an ideal choice for either
- because they either require or prefer a CGI-based wiki. Ruwiki has the
- desired level of performance and implemenation simplicity that
- impresses both groups, and it is the current preferred choice. Thus,
- the needs of both websites factor highly into the goals for Ruwiki.
-
- Third, Austin gave a talk on Ruwiki at \RubyConf 2004. Many of the
- features in the current release come from a development effort leading
- up to the talk and in the weeks following.
-
- Last, and certainly not least, feature requests and bug reports are a
- factor. One of the things that changed in Ruwiki 0.8.0 was the look
- and feel; admittedly, the look and feel in earlier versions was a bit
- garish, designed to fit in with a particular website more than be a
- general wiki theme. Users complained, and we changed this. The
- continual spam defacement of the \RubyGarden wiki suggested several
- possible improvements that could be made in Ruwiki to fight wiki spam;
- initial work has been implemented in Ruwiki 0.9.0 and more work
- remains. Additionally, Ruwiki is the first wiki with built-in
- deployment support for package management systems (such as \RubyGems
- and rpa-base), although Instiki has been modified for RPA by the RPA
- team to support limited installation in RPA locations.
-
- == Ruwiki 0.10.0: &ldquo;Are You Being Served?&rdquo;
- Ruwiki 0.8.0 introduced an incompatible change in the way that page
- diffs were stored, so users were advised to remove any existing .rdiff
- files. This isn&rsquo;t as problematic as it may sound, as until
- 0.10.0, there is no way to actually view the page diffs from Ruwiki
- itself.
-
- In Ruwiki 0.7.0, a new token was introduced: %calendar(). The concept
- here is a sound one that can be extended to make token addition
- easier. Currently, it is necessary for token writers to create their
- own regular expressions. The &ldquo;function token&rdquo; will be
- added &mdash; although the form may not be
- &ldquo;%<em>function-name</em>&rdquo; &mdash; that will work with
- either a line replacement or a word replacement so that the regular
- expression does not need to be written. Tests for the replacement will
- still need to be written, but standardizing new custom tokens will be
- a good thing.
-
- Chad Fowler&rsquo;s port of \RubLog&rsquo;s vector search will
- probably be added to this version.
-
- The presence of static HTML content (headers and footers) per page has
- been accounted for in Ruwiki 0.8.0, but it will not be displayed.
- Further, there is currently no way to specify or display static
- content for the wiki or the project. (A related problem here is that
- projects do not have any properties. This will become important as
- projects should be able to be marked private within a wiki in the
- future.)
-
- The purpose of the \WikiWikiWeb is to provide a collaborative,
- community knowledge editing environment. Unfortunately, the pondscum
- known as spammers have figured out that the \WikiWikiWeb provides a
- positive Google \PageRank, and having their links on our Wikis is
- benefits them. Just as they don&rsquo;t care about filling our
- mailboxes with junk, they don&rsquo;t care about defacing our
- community knowledge. Ruwiki 0.10.0 provides additional antispam
- defences.
-
- The \RecentChanges mechanism will be updated to make it possible to
- see the \GlobalRecentChanges list.
-
- The most significant change in Ruwiki 0.10.0 will be the modification
- of the request pipeline. This will not be visible to the end user, but
- it will be significant to users who wish to extend Ruwiki. Currently,
- Ruwiki processes all commands in ruwiki.rb. In Ruwiki 0.10.0, this
- will be changed to a dispatch mechanism, where Action objects are
- introduced, and ruwiki.rb dispatches requests to Action objects.
-
- <table summary="Pipeline" style="border: 1px solid black"><tr><td>
- +---------+ +-------------------+
- | Request |--------->| Authorize Request |
- +---------+ +-------------------+
- |
- v
- +-------------------+
- | Configure Ruwiki |
- +-------------------+
- |
- v
- +-------------------+
- | Parse Request |
- +-------------------+
- |
- v
- +-------------------+
- | Perform Action |
- +-------------------+
- |
- v
- +-------------------+
- | Prepare Response |
- +-------------------+
- |
- v
- +--------+ +----+--------------+
- | Page |<----------| Send Page |
- +--------+ +-------------------+
- </td></tr></table>
-
- The diagram above shows the general pipeline. The difference is that
- the action will be its own object. In general, it will need to know
- how to process certain URL formats.
-
- In the process of defining the action objects, \ActionCards will be
- created. Below is an example \ActionCard for the default action,
- <tt>_show</tt>. In \ActionCards, everything is relative to the Ruwiki
- root URI. Important to note is that \ActionCards are an ideal: they may
- not represent something that can be accomplished for 0.10.0, 0.11.0,
- or even 1.0. They do, however, represent the ultimate target.
-
- Ruwiki does some implicit URI rewriting in the general form of:
-
- <table summary="Ruwiki URI rewriting" style="border: 1px solid black; border-collapse: collapse">
- <tr><th style="border: 1px solid black">URI</th><th style="border: 1px solid black">Rewritten URI</th></tr>
- <tr><td style="border: 1px solid black">/</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Action</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action</td></tr>
- <tr><td style="border: 1px solid black">/Topic</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/</td><td style="border: 1px solid black">/Project/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/Action</td><td style="border: 1px solid black">/Project/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action</td></tr>
- <tr><td style="border: 1px solid black">/Project/Topic</td><td style="border: 1px solid black">/Project/Topic/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/Topic/Action</td><td style="border: 1px solid black">/Project/Topic/Action</td></tr>
- </table>
-
- <table summary="_show Action Card" style="border: 1px solid black"><tr><td>
- === Action: Show [_show] <strong>DEFAULT</strong>
- The Show action is the default action that will be performed when
- there is no action specified. Without any arguments, the latest
- version of the page will be displayed.
-
- ==== Action Arguments
- ; ?r=<em>revision</em> : Show the specified revision of the page.
- ; ?r : Show the list of revisions known to the page.
- ; ?r=<em>revision1</em>:<em>revision2</em> : Shows the difference of revision1 and revision2 for the page.
- ; ?r=:<em>revision</em> : Shows the difference between the current page and the specified revision.
- ; ?d=<em>yyyymmdd[:hh[mm[ss]]]</em> : Shows the last revision from at or before the specified date and time. If time is not specified, it is assumed to be 23:59:59.
-
- ==== Interaction Notes
- Without arguments, _show generates pages pages that are editable and
- indexable (<meta name="robots" content="index,follow,archive">). If
- any argument is specified, the page is still editable, but not
- indexable (<meta name="robots" content="noindex,nofollow,noarchive">).
- </td></tr></table>
-
- == Ruwiki 0.11.0: &ldquo;What&rsquo;s My Line?&rdquo;
- The antispam techniques introduced in 0.9.0 are positive steps in the
- fight against wiki defacement. They are hopefully effective, too. The
- problem is that because 0.9.0 doesn&rsquo;t offer users or user
- authentication, there&rsquo;s no way of safely allowing the edit of
- the antispam lists. Thus, to allow this and other potentially
- dangerous actions, a user and capability framework will be added to
- Ruwiki. This framework will allow for user identification,
- authentication, and authorization to indicate what users are allowed
- to perform what actions.
-
- Authenticated users will be able to bypass blacklist checking; thus,
- if &ldquo;msn.com&rdquo; is blocked, &ldquo;joe.blog@msn.com&rdquo;
- could still authenticate with Ruwiki and edit the pages. Some users
- will be able to manage user permissions (including user management),
- edit antispam lists, etc.
-
- Other actions will be added, including the ability to rename topics
- and move topics between projects. In both cases, the topic change
- history must be maintained.
-
- The documentation for Ruwiki will be substantially complete with this
- version, lacking only specific information on the features that will
- be added in Ruwiki 1.0.0.
-
- == Ruwiki 1.0.0: &ldquo;Yes, Minister&rdquo;
- A combined strength and weakness of Ruwiki is that it currently does
- little to protect against arbitrary HTML being inserted into the
- current topic. The allowed subset of HTML should be restricted to a
- safe subset to prevent cross-site-scripting attacks.
-
- Pages and projects have properties: we need to provide the ability to
- edit those properties. Part of the properties that should be editable
- include whether a page is frozen &mdash; this means that the page is
- no longer editable by any user (unless it is unfrozen) and is
- effectively a plain HTML page. Other properties include the static
- header and footer information in a page or project.
-
- Modern Wikis require an RSS feed. Ruwiki will provide one.
-
- == The Future: &ldquo;Yes, Prime Minister&rdquo;
- Ruwiki 1.0.0 does not represent the end of the line for Ruwiki, but
- what the future holds is unclear. We&rsquo;ll see what the future
- brings.
-properties!project: Ruwiki
-properties!title: Roadmap
-properties!topic: Roadmap
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
deleted file mode 100644
index d738c18..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
+++ /dev/null
@@ -1,155 +0,0 @@
-page!content: = Ruwiki %RV#% Templating
- Ruwiki uses a heavily modified version of the \RDoc
- &ldquo;cheap-n-cheerful&rdquo; HTML page template system. This a
- line-oriented, text-based templating system.
-
- == Templates
- Templates in the templating system are essentially plain strings with
- particular references to templating keys or an include directive.
-
- The template interacts with value and message hashes provided by
- Ruwiki. The keys known to the templates expected by Ruwiki are
- detailed in Extending_Ruwiki. Nested key references are found from the
- inside-out. That is, the closest resolving key to the current level is
- found, not the furthest resolving key.
-
- === Including Other Templates
- Templates may include other templates to any arbitrary level by using
- the <tt>!INCLUDE!</tt> directive. When the \TemplatePage is created,
- an array of template strings are provided; these will be used to
- satisfy <tt>!INCLUDE!</tt> directives. If there are not enough
- template strings provided, <tt>!INCLUDE!</tt> won&rsquo;t be
- translated.
-
- : This may change before Ruwiki reaches 1.0, so that templates are
- : named instead of iterated.
-
- === Simple Template Keys
- Strings of the format <tt>%<em>key</em>%</tt> or
- <tt>%?<em>key</em>%</tt> are simple template keys. <em>key</em> is
- looked up in the provided value hash and is presented as the string
- value of the result. <tt>%key%</tt> template keys are mandatory; if
- the key is not found in the value hash, an exception will be raised.
- <tt>%?key%</tt> template keys are optional; if they key is not found
- in the value hash, an empty string (&ldquo;&rdquo;) will be used.
-
- === Labels
- Strings of the format <tt>#<em>key</em>#</tt> or
- <tt>#?<em>key</em>#</tt> are labels. <em>key</em> is looked up in the
- provided message hash as a Symbol (e.g.,
- <tt><em>key</em>.intern</tt>). As with simple template keys,
- <tt>#key#</tt> labels are mandatory and <tt>#?key#</tt> labels are
- optional.
-
- === Links
- Strings of the format <tt>HREF:\ref:name</tt> will become HTML links.
- Both <em>ref</em> and <em>name</em> are keys to be looked up.
- <em>name</em> is mandatory; an exception will be raised if it is not
- found.
-
- === Control Structures
- The templating library supports both looping and conditional control
- structures in both single-line and multi-line forms. Single-line
- control structures <strong>may not</strong> be nested; multi-line
- control structures <strong>may</strong> be nested arbitrarily deeply.
-
- ==== Looping Control Structures
- There are two forms of looping control structures.
-
- [:key|stuff:]
-
- START:key
- ... stuff ...
- END:key
-
- ===== Single-Line Looping
- [:key|stuff:]
-
- The value of <em>key</em> may be <tt>nil</tt>, an integer value, a
- range, or an array. When <em>key</em> represents:
- # <tt>nil</tt>, the looping structure will be replaced with an empty string.
- # An integer, <em>stuff</em> will be repeated <em>key</em> times. Values from 1 to <em>key</em> will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # A range, <em>stuff</em> will be repeated once for each successive value in the range of <em>key</em>. Each value will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # An array, the behaviour will differ depending on the contents of the array.
- ## If the array contains hashes, the behaviour is the same as a multi-line looping construct. See below for details.
- ## Otherwise, the template iterates through the array, providing each value to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
-
- As an example, if we have:
-
- "[:b|%b% ]"
-
- # <tt>val["b"] = 3 -> "1&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = (0..2) -> "0&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = ["a", "B"] -> "a&nbsp;B&nbsp;"</tt>
-
- ==== Multi-Line Looping
- START:key
- ... stuff ....
- END:key
-
- The value of <tt>key</tt> must be an array of hashes. <tt>... stuff
- ...</tt> will be repeated once for each entry in the array. The hashes
- will be passed as nested value hashes.
-
- %a% [:b|%a% ]%a%
-
- When the above template string is run with the following hash:
-
- val["a"] = 1
- val["b"] = [ { "a" => 2 }, { "a" => 3 } ]
-
- The result is:
-
- 1 2 3 1
-
- The behaviour is the same for multi-line blocks.
-
- ==== Conditional Block Keys
- IF:key
- ... stuff ...
- ENDIF:key
-
- The block between <tt>\IF:key</tt> and <tt>\ENDIF:key</tt> will be included in
- the output only if the corresponding key is set in the value hash.
-
- == Example
- Given the set of templates T1, T2, and T3 (shown below), here&rsquo;s how we would
- use the templating system.
-
- values = { "name" => "Dave", "state" => "TX" }
- t = TemplatePage.new(T1, T2, T3)
- File.open(name, w) { |f| t.process(f, values) }
-
- or:
-
- <!-- Source -->
- val1 = { "name" => "Dave", "state" => "TX" }
- val2 = { "name" => "Dave" }
- msgs = { }
- res = ""
- t.process(res, values, msgs)
-
- <!-- T1 -->
- Templates can subsitute a wide variety of values.
- !INCLUDE!
-
- <!-- T2 -->
- Name: %name% !INCLUDE!
-
- <!-- T3 -->
- IF:state
- State: %state%
- ENDIF:state
-
- The result will be:
-
- Name: Dave
- State: TX
-
- Name: Dave
-properties!project: Ruwiki
-properties!title: RuwikiTemplatingLibrary
-properties!topic: RuwikiTemplatingLibrary
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/RuwikiUtilities.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/RuwikiUtilities.ruwiki
deleted file mode 100644
index aef7e1f..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/RuwikiUtilities.ruwiki
+++ /dev/null
@@ -1,156 +0,0 @@
-page!content: = Ruwiki %RV#% Utilities
- Ruwiki %RV#% provides two utilities and three sample programs for
- deployment.
-
- == Managing Ruwiki Deployments
- A major change to the way that Ruwiki %RV#% works as compared to
- versions of Ruwiki 0.8.0 or earlier is that Ruwiki %RV#% supports being
- installed in a central location by one of the two major packaging
- systems available for Ruby (\RubyGems and RPA). Managing these
- deployments is accomplished with the utility appropriately enough named
- <tt>ruwiki</tt>, stored in the directory of the distribution.
-
- This utility has little value for users of the standalone release
- (either of the versions packaged in tarfiles or zipfiles), but is
- developed because packaging systems present a particular challenge to
- Ruwiki, as simply running &ldquo;ruwiki_servlet&rdquo; with no
- arguments will look for the data files and the template files relative
- to the current directory. With \RubyGems, though, this would require
- that the user specify something like:
-
- ruwiki_servlet \
- --template-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.9.0/templates \
- --flatfiles-data-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.9.0/data
-
- This is not the preferred option because Wiki installations may be
- private and the /usr/local directory is a system-wide shared
- directory. Additionally, since Ruwiki works as a CGI, the system
- shared data and template paths will not be generally accessible (and
- should not be world-writeable!) to CGI executables.
-
- This utility also encapsulates Win32 service management through
- Win32::Service for the \WEBrick servlet runner.
-
- === <tt>ruwiki <command> [<em>parameters</em>]</tt>
- The <tt>ruwiki</tt> utility will recognise four different commands on
- all platforms and a fourth command on Windows. These commands are:
-
- ; help : Displays general help or command-specific help.
- ; install : Installs the default deployment package.
- ; package : Packages a Ruwiki installation.
- ; unpackage : Unpackages a Ruwiki installation.
- ; service : Manages a Win32::Service for Ruwiki.
-
- ==== <tt>ruwiki help commands</tt>
- The list of known commands can be displayed by providing this command.
-
- % ruwiki help commands
- ==== <tt>ruwiki help <command></tt>
- The help for the named command (one of install, package, unpackage, or
- service) will be displayed upon providing this command to the ruwiki
- utility.
-
- % ruwiki help install
- ==== <tt>ruwiki install [<em>OPTIONS</em>] [<em>--to DEST</em>]
- Creates a new Ruwiki instance in the current directory or the directory
- specified by the <tt>--to</tt> option. By default, the data, template,
- and a default configuration file are installed to the destination
- directory. OPTIONS may be one of the following:
-
- ; servlet : Installs the Ruwiki WEBrick servlet stub.
- ; service : Installs the Ruwiki Win32::Service stub.
- ; cgi : Installs the Ruwiki CGI script model.
- ; data : Default; installs the Ruwiki default data, templates, and configuraiton file.
-
- Installation option names can be disabled with a dash (&lsquo;-&rsquo;)
- or the word &lsquo;no&rsquo;, making &lsquo;-data&rsquo; and
- &lsquo;nodata&rsquo; functionally equivalent.
-
- % ruwiki install cgi data
- ==== <tt>ruwiki package [<em>SOURCE</em>] [<em>--output PACKAGE</em>|<em>-o PACKAGE</em>] [<em>--replace</em>]</tt>
- Packages the Ruwiki files (data, templates, and executables) from the
- specified source or the current directory into the specified output
- package (or &ldquo;./ruwiki.pkg&rdquo;). If the SOURCE is a ruwiki
- configuration file (e.g., &ldquo;ruwiki.conf&rdquo;), then that will be
- used to determine the location and name of the data and template
- directories.
-
- Specify <tt>--replace</tt> to replace the existing output package. If
- an output package is specified that already exists, then <tt>ruwiki
- package</tt> will refuse to output to the file unless
- <tt>--replace</tt> is specified. If an output package is not specified
- and <tt>--replace</tt> is not specified, then an incremental package
- will be generated (e.g., &ldquo;./ruwiki-1.pkg&rdquo;).
-
- : NOTE: The packaging process will normalize the data and templates
- : directory names to be relative to the unpacking directory. They will
- : NEVER be absolute paths.
-
- % ruwiki package
- ==== <tt>ruwiki unpackage [<em>SOURCE</em>] [<em>--output DIRECTORY</em>|<em>-o DIRECTORY</em>]</tt>
- Unpackages the provided Ruwiki package (default "./%1$s") into the
- specified directory (default ".").
-
- % ruwiki unpackage
- ==== <tt>ruwiki service <command> <NAME> [<em>command-options</em>]</tt>
- Manages a Ruwiki WEBrick servlet as a Win32 service (with the
- assistance of
- [http://raa.ruby-lang.org/list.rhtml?name=win32-service win32-service]).
- This works in ways similar to a daemon on Unix. The sub-commands
- available to <tt>ruwiki service</tt> are:
- ===== <tt>ruwiki service install NAME [DESCRIPTION] [options]</tt>
- Installs the Ruwiki WEBrick servlet as the named Win32 service.
- <tt>install</tt> accepts an optional description (all non-options will
- be included in the description). The options for <tt>install</tt> are:
- ; --rubybin RUBYPATH : The path to the Ruby binary.
- ; --exec SERVICEPATH : The path to the service executable.
- ; --home PATHTOHOME : The path to the home directory.
- ===== <tt>ruwiki service start NAME</tt>
- Starts the named Ruwiki service.
- ===== <tt>ruwiki service stop NAME</tt>
- Stops the named Ruwiki service.
- ===== <tt>ruwiki service delete NAME</tt>
- Deletes the named Ruwiki service.
-
- : NOTE: This command can probably be used to manage other Win32
- : services that respond to the appropriate commands.
-
- == Upgrading and Converting: ruwiki_convert
- : This section was formerly a separate entry in the Wiki entitled
- : &ldquo;Upgrading and Converting&rdquo;.
-
- The flatfile backend format in Ruwiki %RV#% is not compatible with that
- of versions of Ruwiki earlier than 0.8.0. There are a number of
- reasons for this, but because of this and that there are now three
- different backend formats, Ruwiki now has a converter utility between
- backends.
-
- There are two other incompatibilities of note:
- # Ruwiki now defaults to &ldquo;ruwiki&rdquo; as an extension (e.g., \ProjectIndex.ruwiki) to the storage files. This is, of course, is something that can be modified with a configuration option, but you may find it desirable to rename your files to match this naming convention.
- # The rdiff format is incompatible. It is recommended that you remove all .rdiff files from your data directory before using Ruwiki.
-
- === ruwiki_convert [options] <directory>+
- The converter utility will work on all files in a directory and its
- subdirectories.
-
- When a file is encountered, it will be examined to be a known form of a
- Ruwiki backend (marshal, yaml, flatfiles, or "old" flatfiles). If the
- file is not one of these forms, then the file is skipped. Otherwise, it
- is converted to the specified format. By default, the converted files
- will be backed up.
-
- ==== ruwiki_convert Options
- ; --format=FORMAT : Converts encountered files (regardless of the current format), to the specified format. Default is yaml. Allowed formats are: yaml marshal flatfiles
- ; --[no-]backup : Create backups of upgraded files. Default is --backup.
- ; --backup-extension=EXTENSION : Specify the backup extension. Default is "~", which is appended to the data filename.
- ; --extension=EXTENSION : Specifies the extension of Ruwiki data files. The default is .ruwiki
- ; --no-extension : Indicates that the Ruwiki data files have no extension.
- ; --quiet : Runs quietly. Default is to run with normal messages.
- ; --verbose : Runs with full messages. Default is to run with normal messages.
- ; --help : Shows this text.
-properties!project: Ruwiki
-properties!title: RuwikiUtilities
-properties!topic: RuwikiUtilities
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/SandBox.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/SandBox.ruwiki
deleted file mode 100644
index dfe4911..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/SandBox.ruwiki
+++ /dev/null
@@ -1,8 +0,0 @@
-page!content: This page is intended for users to play with freely to practice
- their \WikiFormatting.
-properties!project: Ruwiki
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/To_Do.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/To_Do.ruwiki
deleted file mode 100644
index 38242fd..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/To_Do.ruwiki
+++ /dev/null
@@ -1,50 +0,0 @@
-page!content: = Ruwiki %RV#% To Do Tracking
- Completed to-do items can be found in the ChangeLog. Bugs in Ruwiki
- are tracked in BugTracking.
-
- == Well-Defined To Do Items
- === Ruwiki 0.10.0
- ; Versioning : complete the change history interface. Change history is currently stored in a file <em>topic[.extension]</em>.rdiff. There is no way to display the change history at this point.
- ; Action objects : Actions will be generalised to pull the processing out of the main ruwiki.rb inasmuch as is possible.
- ; Function tokens : generalize the %&lt;function-name&gt;[(&lt;args&gt;)] calling method so that function tokens can be created without having to create a custom regular expression.
- ; Search work : There is further search work required. The current mechanism is effective, but inefficient, as it must load and convert each file in a project to a page and then search selectively within that page. The search mechanism must be improved.
- ; Frozen content : make it so that frozen content can be provided on a per-page or Wiki basis. Will provide both headers and footers. <strong>Note:</strong> Ruwiki 0.9.0 will only provide the ability to present the information, not create or modify it.
- ; Blacklisting : Allow the specification of an allow/deny list for \IPs or hostnames, aimed at blocking known spammers. Entries in this list can be permanent or temporary (e.g., &ldquo;* DENY&rdquo;, &ldquo;spammer.com DENY UNTIL 20040723&rdquo;, &ldquo;139.244.33.25 ALLOW&rdquo;).
- ; External URL redirection : Add whitelisting of known good external URIs.
- ; \GlobalRecentChanges : Recent changes for all projects.
- ;
- === Ruwiki 0.11.0
- ; Authentication : complete authentication to provide for a standard Ruwiki authentication mechanism, not just an external API. This may require changes to the existing external API. Allows for user creation and authentication. Authenticate users bypass blacklist checking; thus, if &ldquo;msn.com&rdquo; is blocked, joe.blog@msn.com could still authenticate with Ruwiki and edit the pages.
- ; Topic renaming : add the ability to rename a topic within a project. Topic change history should be maintained.
- ; Topic moving : add the ability to move and/or rename a topic between projects. Topic change history should be maintained.
- ; Complete documentation : Complete the documentation of Ruwiki.
- ; Antispam : Allow the on-line editing of antispam lists to authenticated and authorised users.
- === Ruwiki 1.0.0
- ; RSS Feed : Ruwiki must be able to offer \RecentChanges and \GlobalRecentChanges as RSS feeds. This may not be ideal with the current \RecentChanges format. It may be easier to move to a two-stage \RecentChanges format.
- ; Static content : Allow the creation and editing of static content.
- ; Frozen pages : provide the ability to freeze content in place; the page is no longer &ldquo;wiki&rdquo; editable and is effectively a plain HTML page.
- ; Page properties : provide the ability to generally edit the properties of a given page.
-
- == General Future To Do Items
- ; E-mail gateway : accept topic appends via e-mail.
- ; alternative backends : access other wiki data storage, or other formats, e.g. e-mail boxes in mh or mbox formats
- ; bug tracker backend : with alternate markup
- ; add setup and user config methods : for backend plugin classes, then we can use them with an interactive or gui tool frontend to setup data storage backends. The user might have to run as root or other user with database create permissions.
- ; add id="" to various markup elements (make id specific to topic) : Later we can allow users to tweak a page using uploaded css fragments which might get appended onto the standard css contents.
- ; ruby action : upload a ruby code fragment to add a smart &ldquo;action&rdquo; to that wiki page. Need some sort of security + approval system to handle this safely.
- ; Preview button : add a preview button to the save page.
- ; Alternative templating systems : not as high priority now that there&rsquo;s a real templating system in place.
- ; Alternative markup systems : potentially allow \RedCloth (Textile) and/or \BlueCloth (Markdown) to be processed for a page. This could be implemented as a %function.
- ; Project/topic security : allow certain projects to be restricted/authenticated for read/write based on user.
- ; Track last <em>n</em> links/topics : ?
- ; Write a markup debugger : ?
- ; Validate topic formatting from cgi : ?
- ; Validate project from cgi : ?
- ; Project-based backend : Allow different projects to have different backends.
- ; Arbitrary-depth project namespace support : Foo::Bar::\BazPage.
-properties!project: Ruwiki
-properties!title: To_Do
-properties!topic: To_Do
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/TroubleShooting.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/TroubleShooting.ruwiki
deleted file mode 100644
index 7ccfde4..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/TroubleShooting.ruwiki
+++ /dev/null
@@ -1,32 +0,0 @@
-page!content: = Ruwiki %RV#%
- = Ruwiki %RV#% Troubleshooting Tips
- Following are some tips contributed by users of Ruwiki. Remember:
- Ruwiki currently requires Ruby version 1.8; the YAML backend requires
- Ruby version 1.8.2 or the latest CVS of Ruby 1.9.
-
- == No such file or directory
- (Unix systems only.) If you get something like:
-
- % ./ruwiki_servlet
- : no such file or directory
-
- run the following in the Ruwiki directory:
-
- % find . | xargs dos2unix
-
- The developers of Ruwiki do what they can to ensure that Ruwiki is
- distributed in a way that works well for both Unix and Windows
- systems, but this will occasionally cause problems.
-
- == undefined method
- % ./ruwiki_servlet
- ./ruwiki_servlet:64: undefined method `[]=' for nil (NameError)
-
- This may appear if you are running Ruby 1.6. Ruwiki requires Ruby 1.8
- or higher; certain features require Ruby 1.8.2 preview 3 or better.
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/WikiFeatures.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/WikiFeatures.ruwiki
deleted file mode 100644
index e47ffdd..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/WikiFeatures.ruwiki
+++ /dev/null
@@ -1,16 +0,0 @@
-page!content: Ruwiki is a [http://www.ruby-lang.org Ruby]-based wiki. It is
- ideal for personal or small team use.
-
- Ruwiki:
- * Uses the [http://www.ruby-lang.org Ruby] language.
- * Runs quickly and easily as a CGI or \WEBrick servlet.
- * Uses a simple templating system and CSS for presentation.
- * Has flatfile storage with simple versioning.
- * Offers project namespaces. Different projects can have the same topic names and not collide. Thus, \Default::ReadMe and \Project::ReadMe are two different pages.
- * Offers a calendar for date-based collaborative editing.
-properties!project: Ruwiki
-properties!title: WikiFeatures
-properties!topic: WikiFeatures
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Ruwiki/WikiMarkup.ruwiki b/ruwiki/tags/release-0.9.1/data/Ruwiki/WikiMarkup.ruwiki
deleted file mode 100644
index 3480564..0000000
--- a/ruwiki/tags/release-0.9.1/data/Ruwiki/WikiMarkup.ruwiki
+++ /dev/null
@@ -1,260 +0,0 @@
-page!content: = Ruwiki Markup
- A [http://c2.com/cgi/wiki Wiki] obeys certain formatting rules to make
- it easy to format text without needing to know HTML. This Wiki obeys
- the following rules by default. Because Ruwiki is extensible, there may
- be additional formatting rules. These rules are those rules that apply
- as of Ruwiki %RV#%.
-
- == \WikiWords, \WikiProjects, Calendars, and External Resources
- While reading stuff on this Wiki, you will see some words mashed
- together with capitalisation (like \WikiWords). While this may seem odd
- at first, this feature allows internal links to be created across the
- Wiki.
-
- There are several allowable forms for \WikiWords.
- # Two or more words concatenated directly. Each word must begin with a capital letter and be followed by zero or more lowercase letters. Thus, \FooBar, \CPlusPlus, and \AbC are all valid \WikiWords, but ABC is not.
- # Two or more words concatenated with underscores. The first word must begin with a capital letter. This makes \Foo_Bar, \C_Plus_Plus, and \A_b_C valid \WikiWords. These \WikiWords will be displayed with spaces instead of underscores. \C_Plus_Plus will be displayed as &ldquo;C Plus Plus&rdquo;.
- # One or more words contained in double square brackets. This the form supported by [http://wikipedia.com/ Wikipedia], and looks like \[[A Wiki Phrase]]. These links will be displayed exactly as entered between the brackets.
- # One or more words contained in double square brackets with display text separated by a vertical bar. These \WikiWords look like \[[A Wiki Phrase|but show this text]]. The link will be to the page &ldquo;A Wiki Phrase&rdquo; and &ldquo;but show this text&rdquo; will be the hyperlink.
-
- If a \WikiWord is found that does not have a page defining the
- \WikiWord, then the word will be shown with a hyperlink question mark
- following it, allowing the \WikiWord to be created.
-
- === \WikiProjects
- This Wiki supports &ldquo;projects.&rdquo; Within each project, a given
- \WikiWord is unique. Thus, if you have a Default project and a Ruwiki
- project, you can have two pages called \ReadMe. Any given \WikiWord
- refers only to topics within its project. That is, if I have \WikiWord
- in the \ReadMe topic of the Default project, it will refer to the
- \WikiWord topic of the Default project. (Another term for this
- capability is &ldquo;namespaces.&rdquo;)
-
- A cross-project link is composed of the project&rsquo;s name, two colons
- (::), and the \WikiWord desired. Thus, from \Default::ReadMe, I can
- have \Ruwiki::ReadMe as a link. The project index can be referred to
- with \::Project. This is the same as doing \Project::ProjectIndex.
- Thus, \::Ruwiki becomes ::Ruwiki, which is the same as
- \Ruwiki::ProjectIndex (Ruwiki::ProjectIndex).
-
- === Project Lists and Topic Lists
- The list of known projects may be listed with the %projects() token;
- the list of known topics for the current project may be listed with the
- %topics() link. An arbitrary project may be provided to the %topics()
- token, as in %topics(Default).
-
- %topics(Default)
-
- %projects()
-
- === Calendars
- Ruwiki supports a miniature calendar. Future versions of Ruwiki will
- allow for calendar aggregation. Using the %calendar function, a
- calendar section will be generated:
-
- %calendar(<year>, <month>[, <project>])
- %calendar(today[, <project>])
-
- %calendar accepts either the English word &ldquo;today&rdquo; (displaying the
- calendar for the current month and year) or a specific month and year
- for display. A calendar for the specified month will be generated
- where each date in the month is treated as a \WikiWord (as are the
- links to the current month, the previous month, and the next month)
- ready for display or editing. As with all other \WikiWord links in
- Ruwiki, a project may be specified in %calendar, making
- &ldquo;%calendar(today, Ruwiki)&rdquo; different from &ldquo;%calendar(today, Default)&rdquo;.
-
- %calendar(today)
- %calendar(1999, 08, Default)
-
- === External Resources
- Ruwiki behaves intelligently about resources external to the Wiki
- itself.
-
- ==== External Links
- \URLs to external resources are automatically detected for web
- addresses, FTP addresses, newsgroups, and email links. They are
- automatically converted to clickable \URLs. Be aware that some things
- that look like URL schemas may be make clickable but are not really
- \URLs.
-
- * \http://www.ruby-lang.org becomes http://www.ruby-lang.org
-
- \URLs may be named with the [url name] syntax. If the name is omitted,
- the URL will be numbered. Numbering is contained to within the page.
-
- * \[http://www.rubygarden.org RubyGarden] becomes [http://www.rubygarden.org RubyGarden].
- * \[http://www.halostatue.ca] and \[http://www.halostatue.ca/ruby] become [http://www.halostatue.ca] and [http://www.halostatue.ca/ruby].
-
- ==== Images
- : <strong>Changed in Ruwiki 0.8.0!</strong>
-
- In preparation for the anti-wiki-spam features of Ruwiki 0.9.0, it has
- been necessary to remove the ability for \URLs to be converted into
- inline images automatically. Inline images are now created with the
- image markup format, generally of the format \[image:URI options]. The
- <em>options</em> format is generally the same format as an HTML
- attribute (<em>name="value"</em>; the quotes are optional for
- single-word option values) and any valid HTML attribute is also a
- valid <em>option</em>. There is one special <em>option</em>,
- <tt>numbered</tt>. This value, if set to any other value than &ldquo;false&rdquo;,
- will set the <tt>title</tt> of the image to a numbered link.
-
- If the <tt>title</tt> attribute is not specified, it will be set from
- the <tt>alt</tt> attribute (if specified) or the image&rsquo;s URL. If the
- <tt>alt</tt> attribute is not specified, it will be set from the
- <tt>title</tt> attribute.
-
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif] [image:http://www.halostatue.ca/graphics/maple_leaf.gif]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true] [image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"]
-
- ==== Ruby Mailing Lists
- If a Ruby mailing list message tag is provided, it will be converted appropriately.
-
- * \[ruby-talk:12345] will become [ruby-talk:12345]
- * \[ruby-core:12345] will become [ruby-core:12345]
- * \[ruby-doc:12345] will become [ruby-doc:12345]
-
- == Headings and Lists
- === Headings
- Use equals signs (=) for headings. Up to six equals signs can be used
- for HTML headings 1 - 6.
-
- \===== Heading five<br />
- \====== Heading six
- ===== Heading five
- ====== Heading six
-
- === Lists
- ==== Bulleted Lists
- Use asterisks (*) to create bulleted lists. More asterisks means more
- levels.
-
- \* level 1<br />
- \** level 2<br />
- \*** level 3
-
- * level 1
- ** level 2
- *** level 3
-
- ==== Numbered Lists
- Use hash marks (#) for numbered lists. More hash marks means deeper
- levels.
-
- \# level 1<br />
- \## level 2<br />
- \### level 3<br />
- \### level 3.2<br />
- \## level 2.2<br />
- \# level 1.2
-
- # level 1
- ## level 2
- ### level 3
- ### level 3.2
- ## level 2.2
- # level 1.2
-
- ==== Definition Lists
- Definitions can be created similar to other lists. Unlike &ldquo;standard&rdquo;
- lists, though, definition lists have both the term and the definition.
- They are specified like so. As with other lists, repeating the first
- item (;) will increase the indentation level. The browser may not
- respect this.
-
- \; term : definition<br />
- \;; term2 : definition<br />
- \;;; term3 : definition
-
- ; term : definition
- ;; term2 : definition
- ;;; term3 : definition
- == Paragraph Formatting
- === Rules
- Four or more dashes ("----") on a line by itself makes a horizontal
- rule, like so:
-
- \----
- ----
- === Paragraphs
- A blank line (it may have whitespace on it) marks a new paragraph. All
- other lines are joined together (excepting headers, lists, and rules).
-
- This line is a new paragraph.
-
- === Block Indent Paragraphs
- Paragraphs can be indented by beginning the paragraph with one or more
- colons (:).
-
- \: Indent Level 1<br />
- \:: Indent Level 2<br />
- \::: Indent Level 3
-
- : Indent Level 1
- :: Indent Level 2
- ::: Indent Level 3
-
- Paragraphs may be indented as &ldquo;cites&rdquo; by using one or more
- greater-than signs (>) at the beginning of the line.
-
- \> Indent Level 1<br />
- \>> Indent Level 2<br />
- \>>> Indent Level 3
-
- > Indent Level 1
- >> Indent Level 2
- >>> Indent Level 3
-
- === Code
- Text that is indented will be presented as formatted in a monospaced
- font. The only change is to escape HTML entities &lt; (&amp;lt;), &gt;
- (&amp;gt;), and &amp; (&amp;amp;).
-
- def replace
- content = @match[1]
- %Q{<pre>#{content}</pre>}
- end
-
- == Miscellaneous Formatting
- === HTML
- The Ruwiki engine currently passes through HTML without changes. Thus,
- &lt;strong&gt;strong&lt;/strong&gt; would be shown as
- <strong>strong</strong>. <strong><em>Note:</em></strong> This
- capability could be very dangerous as it could expose the Wiki to
- cross-site scripting (XSS) vulnerabilities. This will be remedied
- prior to the 1.0 release of Ruwiki.
-
- === Abbreviations
- Certain abbreviations may be known to the Wiki. While there is not yet
- any way for a user to query what abbreviations are known, if the
- abbreviations are told to the users, they may be used. Abbreviations
- are presented with @{key}, where <em>key</em> is the abbreviation
- desired. This Wiki, for example, knows that \@{matz} means &ldquo;@{matz}&rdquo;.
- The special form \@{} will produce the current list of known
- abbreviations. Unknown abbreviations will simply be put back into the
- data stream unchanged. Thus, \@{unknownkey} results in @{unknownkey}.
-
- ==== Known Abbreviations
- @{}
-
- === Preventing Formatting
- If you wish to prevent a word or sequence from being interpreted, put
- a backslash (\) in front of it. This works on all formatting options
- except paragraph positioning. Thus, if I want to prevent a \WikiWord
- from being turned into a hyperlink, I need to backslash it:
- \\WikiWord.
-
- === Other Possible Considerations
- I&rsquo;m looking at adding styles similar to what is shown on the Wiki
- below.
-
- * http://www.pmichaud.com/wiki/PmWiki/WikiStyles
-properties!project: Ruwiki
-properties!title: WikiMarkup
-properties!topic: WikiMarkup
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Tutorial/AddingPages.ruwiki b/ruwiki/tags/release-0.9.1/data/Tutorial/AddingPages.ruwiki
deleted file mode 100644
index c405b70..0000000
--- a/ruwiki/tags/release-0.9.1/data/Tutorial/AddingPages.ruwiki
+++ /dev/null
@@ -1,15 +0,0 @@
-page!content: = Adding Pages
- To add a new page to Ruwiki, all you need to do is come up with a
- meaningful title, turn it into a \WikiWord (see Ruwiki::WikiMarkup) and
- Ruwiki will automatically recognise it as a reference to a page that
- does not yet exist.
-
- At the end of the new \WikiWord is a hyperlinked question mark;
- clicking on this will open the edit page for the new \WikiWord in
- Ruwiki.
-properties!project: Tutorial
-properties!title: AddingPages
-properties!topic: AddingPages
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Tutorial/AddingProjects.ruwiki b/ruwiki/tags/release-0.9.1/data/Tutorial/AddingProjects.ruwiki
deleted file mode 100644
index 6f27415..0000000
--- a/ruwiki/tags/release-0.9.1/data/Tutorial/AddingProjects.ruwiki
+++ /dev/null
@@ -1,15 +0,0 @@
-page!content: = Adding Projects
- To add a new project to Ruwiki, all you need to do is come up with a
- meaningful one-word name, and then turn it into a project link, e.g.,
- \::Project. Projects may <strong>only</strong> be a single word &mdash;
- they are not normal \WikiWords (see Ruwiki::WikiMarkup for details).
- Ruwiki will recognise this as a project that does not yet exist. At the
- end of the Project link is a hyperlinked question mark; clicking on
- this will open the \Project::ProjectIndex in Ruwiki for editing and
- create the new project.
-properties!project: Tutorial
-properties!title: AddingProjects
-properties!topic: AddingProjects
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Tutorial/ProjectIndex.ruwiki b/ruwiki/tags/release-0.9.1/data/Tutorial/ProjectIndex.ruwiki
deleted file mode 100644
index 25aaefd..0000000
--- a/ruwiki/tags/release-0.9.1/data/Tutorial/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,10 +0,0 @@
-page!content: = Ruwiki %RV#% Tutorial
- This tutorial is incomplate.
-
- %topics(Tutorial)
-properties!project: Tutorial
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/Tutorial/SandBox.ruwiki b/ruwiki/tags/release-0.9.1/data/Tutorial/SandBox.ruwiki
deleted file mode 100644
index 0488031..0000000
--- a/ruwiki/tags/release-0.9.1/data/Tutorial/SandBox.ruwiki
+++ /dev/null
@@ -1,8 +0,0 @@
-page!content: This page is intended for users to play with freely to practice
- their \WikiFormatting.
-properties!project: Tutorial
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.1/data/agents.banned b/ruwiki/tags/release-0.9.1/data/agents.banned
deleted file mode 100644
index 93500d9..0000000
--- a/ruwiki/tags/release-0.9.1/data/agents.banned
+++ /dev/null
@@ -1,60 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of User Agent strings which will be greeted
-# with "403 Forbidden" responses by Ruwiki. These are generally known email
-# harvesters or link directory builders for reciprocal link partners. These
-# may also be robots that routinely ignore the robots.txt file.
-#
-# This list is generated from a wide variety of sources including:
-# * http://www.clockwatchers.com/robots_list.html
-# * http://searchenginewatch.com/webmasters/article.php/2167991
-# * http://www.neilgunton.com/spambot_trap/
-# * http://www.robotstxt.org/wc/active/all.txt
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# foo
-# bar
-#
-# becomes:
-#
-# %r{foo|bar}x
-#++
-
- # Known email harvesters
-(?i:^nicerspro)
-(?i:^teleport)
-^CherryPicker
-^Crescent # Crescent Internet ToolPak
-^EmailCollector
-^EmailSiphon
-^EmailWolf
-^ExtractorPro
-^Microsoft\sURL
-^WebEMailExtrac
-
- # Link directory builders.
-^LinkWalker
-^Zeus.*Webster
-
- # Strongly suspected spoofed user agents from spam harvesters. These user
- # agents have been reported patterns by other antispam fighters.
-^[A-Z]+$
-^Internet\sExplore\s5.x
-^Mozilla.*NEWT
-^Mozilla\/4.0$
-MSIECrawler
diff --git a/ruwiki/tags/release-0.9.1/data/agents.readonly b/ruwiki/tags/release-0.9.1/data/agents.readonly
deleted file mode 100644
index e7168c5..0000000
--- a/ruwiki/tags/release-0.9.1/data/agents.readonly
+++ /dev/null
@@ -1,321 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of User Agent strings which will be given
-# readonly versions of the wiki instance.
-#
-# This list is generated from a wide variety of sources including:
-# * http://www.clockwatchers.com/robots_list.html
-# * http://searchenginewatch.com/webmasters/article.php/2167991
-# * http://www.neilgunton.com/spambot_trap/
-# * http://www.robotstxt.org/wc/active/all.txt
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# foo
-# bar
-#
-# becomes:
-#
-# %r{foo|bar}x
-#++
-
-(?:^.*HTTrack)
-(?:^.*LWP)
-(?:^Digimarc)
-(?:ChristCrawler.com|ChristCrawler@ChristCENTRAL.com)
-(?:Net|Web)Mechanic
-(?:PerlCrawler|Xavatoria)/
-(?:pjspider|PortalJuice.com)
-(?:spider_monkey|mouse.house)
-(?:tach_bw|Black\sWidow)
-(?:topiclink|TLSpider)
-(?i:(?-i:ComputingSite\s)?Robi)
-(?i:^curl)
-(?i:^googlebot)
-(?i:^gulliver) # NorthernLight
-(?i:^Scooter) # Altavista
-(?i:^w[@a]pSpider)
-(?i:infoseek) # InfoSeek
-^ABCdatos\sBotLink # http://www.abcdatos.com/botlink/
-^AITCSRobot/
-^anthill
-^appie
-^Arachnoidea # Euroseek
-^Arachnophilia
-^arale
-^araneo
-^AraybOt
-^ArchitextSpider # Excite, WebCrawler
-^ariadne
-^arks
-^Ask\s?Jeeves/Teoma
-^ASpider/
-^ATN_Worldwide
-^Atomz
-^AURESYS/
-^BackRub/
-^BaySpider
-^bbot
-^Big\sBrother
-^Bjaaland
-^BlackWidow
-^borg-bot/
-^(?i:boxseabot)
-^BSpider/
-^CACTVS\sChemistry\sSpider
-^calif
-^Checkbot/
-^cienciaficcion.net
-^CMCM/
-^combine
-(?i:^confuzzledbot)
-^CoolBot
-^cosmos
-^crawlpaper
-^cusco
-^cyberspyder
-(?i:^cydralspider)
-^desert\s?realm
-^Deweb
-^Die\sBlinde\sKuh
-^dienstspider/
-^digger
-^Digger
-^DIIbot
-^dlw3robot/
-^DNAbot/
-^downloadexpress
-^DragonBot
-^Duppies
-^dwcp
-^ebiness
-^ecollector
-^EIT-Link-Verifier-Robot/
-^elfinbot
-^Emacs-w3/
-^EMC\sSpider
-(?i:^esculapio)
-^ESI
-^esther
-^Evliya\sCelebi
-^explorersearch
-^fast # Fast/AllTheWeb
-^fastcrawler
-^FDSE
-^FELIX\s?IDE
-^fido
-^Fish-Search-Robot
-^fouineur
-^Freecrawl
-^FunnelWeb-
-^gammaSpider
-^gazz
-^gcreep
-^gestalttIconoclast/
-^Getterrobo-?Plus
-^GetURL\.rexx
-^golem
-^grabber
-^griffon
-^Gromit
-^gulper
-^hambot
-^havIndex
-^HKU\sWWW\sRobot
-^Hometown\sSpider\sPro
-^Hämähäkki
-^hotwired
-^htdig
-^htmlgobble
-^IAGENT/
-^iajabot
-^IBM_Planetwide
-^image\.kapsi\.net
-^IncyWincy
-^Informant
-^InfoSpiders
-^INGRID/
-^inspectorwww
-^Internet\sCruiser\sRobot
-^irobot
-^Iron33
-^IsraeliSearch/
-^JavaBee
-^JBot
-^jcrawler
-^jobo
-^Jobot/
-^JoeBot/
-^JubiiRobot/
-^jumpstation
-^Katipo/
-^KDD-Explorer
-^KIT-Fireball # Fireball.de
-^ko_yappo_robot
-^label-grabber
-^LabelGrab/
-^larbin
-^legs
-^Linkidator
-^LinkScan\s(?:Server|Workstation)
-^Lockon
-^logo\.gif\scrawler
-^logo_gif_crawler
-^Lycos_Spider_(T-Rex) # Lycos
-^M/
-^Magpie/
-^marvin
-^mattie
-^mediafox
-^MerzScope
-^MindCrawler
-^moget
-^MOMspider/
-^Monster
-^Motor
-^Mozilla/3\.01\s(Win95;\sI) # InfoSeek
-^Mozilla\/3.0.+Indy\sLibrary
-^msnbot
-^muncher
-(?i:^muninn)
-^MuscatFerret
-^MwdSearch
-^NDSpider/
-^NEC-MeshExplorer
-^Nederland.zoek
-^Net.Vampire
-^NetCarta
-^NetScoop
-^newscan-online
-^NHSEWalker/
-^Nomad
-^NorthStar
-^NPBot # Detects IP violations(?)
-^ObjectsSearch
-^Occam
-^Openbot # OpenFind
-^Openfind
-^Orbsearch
-^PackRat
-^pageboy
-^parasite
-^patric
-^PBWF
-^pegasus
-^Peregrinator-Mathematics/
-^PGP-KA/
-^phpdig
-^piltdownman
-^Pimptrain
-^Pioneer
-^Plucker
-^PlumtreeWebAccessor
-^Poppi/
-^PortalBSpider
-^psbot
-^Raven
-^Resume\sRobot
-^RHCS
-^RixBot
-^Road\s?Runner
-^Robbie
-^RoboCrawl
-^robofox
-^Robot\sdu\sCRIM
-^Robozilla/
-^root/
-^Roverbot
-^RuLeS/
-^SafetyNet\sRobot
-^Search-AU
-^searchprocess
-^searchterms\.it
-^Senrigan
-^SG-Scout
-^Shagseeker
-^Shai'Hulud
-^sharp-info-agent
-^SimBot
-^Site\sValet
-^sitecheck
-^SiteTech-Rover
-^SLCrawler
-^Sleek\sSpider
-^Slurp # Inktomi, AOL
-^snooper
-^solbot
-^speedy
-^SpiderBot
-^spiderline
-^SpiderMan
-^SpiderView
-^ssearcher
-^suke
-^suntek
-(?i:http://www.sygol.com)
-^T-H-U-N-D-E-R-S-T-O-N-E
-^Tarantula/
-^tarspider
-^TechBOT
-^Templeton
-^TeomaAgent # Teoma
-^TITAN
-^titin
-^TurnitinBot # Plagiarism detector
-^UCSD-Crawler
-^UdmSearch
-^udmsearch
-^Ukonline
-^uptimebot
-^URL\sSpider\sPro
-^urlck
-^Valkyrie
-^verticrawl
-^Victoria
-^vision-search
-^void-bot
-^Voyager
-^VWbot_K
-^w3index
-^W3M2/
-^w3mir
-^WebBandit
-^webcatcher
-^WebCopier
-^WebCopy
-^WebFetcher/
-^weblayers/
-^WebLinker/
-^WebMoose
-^webquest
-^WebReaper
-^webs
-^webspider
-^webvac
-^webwalk
-^WebWalker
-^WebWatch
-^wget
-^whowhere
-^winona
-^wired-digital-newsbot/
-^wlm
-^WOLP
-^WWWC
-^WWWWanderer
-^XGET
-^ZyBorg # WiseNut/LookSmart
diff --git a/ruwiki/tags/release-0.9.1/data/clean.uri b/ruwiki/tags/release-0.9.1/data/clean.uri
deleted file mode 100644
index cf38b6f..0000000
--- a/ruwiki/tags/release-0.9.1/data/clean.uri
+++ /dev/null
@@ -1,37 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of URIs or partial URIs that will not be
-# redirected by the automatic redirection technique. It is recommended that the
-# Regular Expression be specific and be anchored to prevent "similar" URIs from
-# being handled poorly. Non HTTP/HTTPS URIs are not redirected at this time.
-#
-# This file is in "extended" regular expression format, one optional expression
-# to a line. Spaces are not significant and comments are allowed. If you want
-# to recognise a space in your regular expression, do so either with a
-# character class ([ ]) or the whitespace meta-character (\s). Hash marks must
-# be escaped (\#) or they will be treated as comment markers. Blank or
-# comment-only lines are ignored. All other lines will be joined together:
-#
-# ^http://[^/]*?ruby-lang.org/?.*$
-# ^http://[^/]*?rubyforge.org/?.*$
-#
-# becomes:
-#
-# %r{^http://[^/]*?ruby-lang.org/?.*$|^http://[^/]*?rubyforge.org/?.*$}
-#++
-(?ix-m:^http://[^/]*?ruby-lang.org/?.*$)
-(?ix-m:^http://[^/]*?rubyforge.org/?.*$)
-(?ix-m:^http://rubyforge.halostatue.info/?.*$)
-(?ix-m:^http://[^/]*?ruwiki.org/?.*$)
-(?ix-m:^http://[^/]*?ruby-doc.org/?.*$)
-(?ix-m:^http://[^/]*?pragmaticprogrammers.com/?.*$)
-(?ix-m:^http://127\.0\.0\.(\d|\d\d|1\d\d|2[0-4]\d|25[0-5])/?.*$)
-(?ix-m:^http://localhost/?.*$)
diff --git a/ruwiki/tags/release-0.9.1/data/hostip.banned b/ruwiki/tags/release-0.9.1/data/hostip.banned
deleted file mode 100644
index b7f3c55..0000000
--- a/ruwiki/tags/release-0.9.1/data/hostip.banned
+++ /dev/null
@@ -1,30 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of IP address strings which will be greeted with
-# "403 Forbidden" responses by Ruwiki. These are generally known email
-# harvesters or link directory builders for reciprocal link partners. These may
-# also be robots that routinely ignore the robots.txt file.
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will be
-# joined together:
-#
-# 192\.168\.0\..*
-# 127\.0\.0\..*
-#
-# becomes:
-#
-# %r{192\.168\.0\..*|127\.0\.0\..*}
-#++
diff --git a/ruwiki/tags/release-0.9.1/data/hostip.readonly b/ruwiki/tags/release-0.9.1/data/hostip.readonly
deleted file mode 100644
index 55d589c..0000000
--- a/ruwiki/tags/release-0.9.1/data/hostip.readonly
+++ /dev/null
@@ -1,28 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of IP address strings which will be given
-# readonly versions of the wiki instance.
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# 192\.168\.0\..*
-# 127\.0\.0\..*
-#
-# becomes:
-#
-# %r{192\.168\.0\..*|127\.0\.0\..*}
-#++
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki.rb
deleted file mode 100644
index a006b34..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki.rb
+++ /dev/null
@@ -1,626 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-class Ruwiki
- VERSION = '0.9.1'
- CONTENT_VERSION = 2
-end
-
-require 'cgi'
-require 'ruwiki/handler'
-require 'ruwiki/auth'
-require 'ruwiki/template'
-require 'ruwiki/lang/en' # Default to the English language.
-require 'ruwiki/config'
-require 'ruwiki/backend'
-require 'ruwiki/wiki'
-require 'ruwiki/page'
-
- # = Ruwiki
- # Ruwiki is a simple, extensible Wiki written in Ruby. It supports both
- # CGI and WEBrick interfaces, templates, and CSS formatting. Additionally,
- # it supports project namespaces, so that two pages can be named the same
- # for differing projects without colliding or having to resort to odd
- # naming conventions. Please see the ::Ruwiki project in the running Wiki
- # for more information. Ruwiki 0.9.1 has German and Spanish translations
- # available.
- #
- # == Quick Start (CGI)
- # 1. Place the Ruwiki directory in a place that your webserver can execute
- # CGI programs and ensure that ruwiki.cgi is executable on your webserver.
- # 2. Point your web browser to the appropriate URL.
- #
- # == Quick Start (WEBrick)
- # 1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
- # 2. Point your web browser to <http://localhost:8808/>.
- #
- # == Configuration
- # There are extensive configuration options available. The Ruwiki WEBrick
- # servlet offers command-line options that simplify the configuration of
- # Ruwiki without editing the servlet; use ruwiki_servlet --help for more
- # information.
- #
- # == Copyright
- # Copyright:: Copyright © 2002 - 2004, Digikata and HaloStatue, Ltd.
- # Authors:: Alan Chen (alan@digikata.com)
- # Austin Ziegler (ruwiki@halostatue.ca)
- # Licence:: Ruby's
-class Ruwiki
- ALLOWED_ACTIONS = %w(edit create)
- EDIT_ACTIONS = %w(save cancel)
- EDIT_VARS = %w(newpage version edcomment q)
- RESERVED = ['save', 'preview', 'cancel', EDIT_VARS].flatten
-
- # Returns the current configuration object.
- attr_reader :config
- # Returns the current Response object.
- attr_reader :response
- # Returns the current Request object.
- attr_reader :request
- # Returns the current Markup object.
- attr_reader :markup
- # Returns the current Backend object.
- attr_reader :backend
- # Sets the configuration object to a new configuration object.
- def config=(cc)
- raise self.message[:config_not_ruwiki_config] unless cc.kind_of?(Ruwiki::Config)
- @config = cc
- self.config!
- end
-
- def config!
- @markup.default_project = @config.default_project
- @markup.message = self.message
- end
-
- def load_config(filename)
- @config = Ruwiki::Config.read(filename)
- self.config!
- end
-
- # The message hash.
- def message
- @config.message
- end
-
- # Initializes Ruwiki.
- def initialize(handler)
- @request = handler.request
- @response = handler.response
-
- @config = Ruwiki::Config.new
-
- @path_info = @request.determine_request_path || ''
-
- @type = nil
- @error = {}
-
- @markup = Ruwiki::Wiki.new(@config.default_project,
- @request.script_url,
- @config.title)
- end
-
- # Initializes the backend for Ruwiki.
- def set_backend
- @backend = BackendDelegator.new(self, @config.storage_type)
- @markup.backend = @backend
- # Load the blacklists here because I don't as of yet know where else
- # to put them. :(
- @banned_agents = load_blacklist('agents.banned')
- @banned_hostip = load_blacklist('hostip.banned')
- @readonly_agents = load_blacklist('agents.readonly')
- @readonly_hostip = load_blacklist('hostip.readonly')
- # Prevent Google redirection against these URIs.
- Ruwiki::Wiki.no_redirect = load_blacklist('clean.uri')
- end
-
- def load_blacklist(filename)
- data = []
- filename = File.join(@config.storage_options[@config.storage_type]['data-path'], filename)
- ii = '^'
- jj = /^#{ii}/o
- File.open(filename, 'rb') do |f|
- f.each do |line|
- line.gsub!(%r{^\s*#.*$}, '')
- line.strip!
- if line.empty?
- data << nil
- else
- if line =~ jj
- data << "(?:#{line}\n)"
- else
- data << line
- end
- end
- end
- end
- data.compact!
- if data.empty?
- nil
- else
- Regexp.new(data.join("|"), Regexp::EXTENDED)
- end
- rescue
- return nil
- end
-
- def check_useragent
- addr = @request.environment['REMOTE_ADDR']
- user = @request.environment['HTTP_USER_AGENT']
-
- if user.nil? or user.empty?
- :forbidden
- elsif @banned_hostip and addr and addr =~ @banned_hostip
- :forbidden
- elsif @banned_agents and user =~ @banned_agents
- :forbidden
- elsif @readonly_hostip and addr and addr =~ @readonly_hostip
- :read_only
- elsif @readonly_agents and user =~ @readonly_agents
- :read_only
- else
- :clean
- end
- end
-
- # Runs the steps to process the wiki.
- def run
- @config.verify
- set_backend
- set_page
- process_page
- render
- rescue Exception => ee
- render(:error, ee)
- ensure
- output
- end
-
- # Initializes current page for Ruwiki.
- def set_page
- path_info = @path_info.split(%r{/}, -1).map { |ee| ee.empty? ? nil : ee }
-
- if path_info.size == 1 or (path_info.size > 1 and path_info[0])
- raise self.message[:invalid_path_info_value] % [@path_info] unless path_info[0].nil?
- end
-
- # path_info[0] will ALWAYS be nil.
- path_info.shift
-
- case path_info.size
- when 0 # Safety check.
- nil
- when 1 # /PageTopic OR /_edit
- set_page_name_or_action(path_info[0])
- when 2 # /Project/ OR /Project/PageTopic OR /Project/_edit OR /Project/create
- @project = path_info.shift
- set_page_name_or_action(path_info[0])
- else # /Project/PageTopic/_edit OR /Project/diff/3,4 OR something else.
- @project = path_info.shift
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- else
- @topic = item
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- end
- end
- end
-
-# @request.each_parameter { |key, val| puts "#{key} :: #{val.class}" }
-
- @project ||= @config.default_project
- @topic ||= @config.default_page
- end
-
- PROJECT_LIST_ITEM = %[%1$s (a href='\\%2$s/%1$s/_topics' class='rw_minilink')%3$s\\</a\\>]
-
- # Processes the page through the necessary steps. This is where the edit,
- # save, cancel, and display actions are present.
- def process_page
- content = nil
- formatted = false
-
- @page = Ruwiki::Page.new(@backend.retrieve(@topic, @project))
- @type = :content
-
- agent_ok = check_useragent
- case agent_ok
- when :read_only
- @page.editable = false
- case @action
- when 'edit', 'save', 'preview', 'cancel', 'search'
- @page.indexable = false
- end
- when :forbidden
- forbidden
- return
- else
- unless @config.auth_mechanism.nil?
- @auth_token = Ruwiki::Auth[@config.auth_mechanism].authenticate(@request, @response, @config.auth_options)
- @page.editable = @auth_token.permissions['edit']
- end
- end
-
- # TODO Detect if @action has already been set.
- @action ||= @request.parameters['action'].downcase if @request.parameters['action']
- @action ||= 'save' if @request.parameters['save']
- @action ||= 'cancel' if @request.parameters['cancel']
- @action ||= 'preview' if @request.parameters['preview']
-
- unless @page.editable
- case @action
- when 'edit', 'save', 'preview', 'cancel'
- @action = 'show'
- end
- end
-
- case @action
- when 'search'
- # get, validate, and cleanse the search string
- # TODO: add empty string rejection.
- srchstr = validate_search_string(@request.parameters['q'])
- if not srchstr.nil?
- srchall = @request.parameters['a']
-
- @page.editable = false
- @page.indexable = false
-
- @page.content = self.message[:search_results_for] % [srchstr]
- @page.topic = srchstr || ""
-
- unless srchall.nil?
- hits = @backend.search_all_projects(srchstr)
- else
- hits = @backend.search_project(@page.project, srchstr)
- end
-
- # turn hit hash into content
- hitarr = []
- # organize by number of hits
- hits.each { |key, val| (hitarr[val] ||= []) << key }
-
- rhitarr = hitarr.reverse
- maxhits = hitarr.size
- rhitarr.each_with_index do |tarray, rnhits|
- next if tarray.nil? or tarray.empty?
- nhits = maxhits - rnhits - 1
-
- if nhits > 0
- @page.content << "\n== #{self.message[:number_of_hits] % [nhits]}\n* "
- @page.content << tarray.join("\n* ")
- end
- end
-
- @type = :search
- else
- @sysmessage = self.message[:no_empty_search_string] % [ @page.project, @page.topic ]
- @type = :content
- end
- when 'topics'
- if @backend.project_exists?(@page.project)
- topic_list = @backend.list_topics(@page.project)
- else
- topic_list = []
- end
-
- @page.editable = false
-
- # todo: make this localized
- if topic_list.empty?
- @page.content = self.message[:no_topics] % [@page.project]
- else
- topic_list.map! do |tt|
- uu = CGI.unescape(tt)
- if (uu != tt) or (tt !~ Ruwiki::Wiki::RE_WIKI_WORDS)
- "[[#{CGI.unescape(tt)}]]"
- else
- tt
- end
- end
- @page.content = <<EPAGE
-= #{self.message[:topics_for_project] % [@page.project]}
-* #{topic_list.join("\n* ")}
-EPAGE
- end
-
- @type = :content
- when 'projects'
- proj_list = @backend.list_projects
-
- @page.editable = false
-
- if proj_list.empty?
- @page.content = self.message[:no_projects]
- else
- # TODO make this localized
- proj_list.map! { |proj| PROJECT_LIST_ITEM % [ proj, @request.script_url, self.message[:project_topics_link] ] }
- @page.content = <<EPAGE
-= #{self.message[:wiki_projects] % [@config.title]}
-* ::#{proj_list.join("\n* ::")}
-EPAGE
- end
-
- content = @page.to_html(@markup)
- content.gsub!(%r{\(a href='([^']+)/_topics' class='rw_minilink'\)}, '<a href="\1/_topics" class="rw_minilink">') #'
- content.gsub!(%r{\\&lt;}, '<')
- content.gsub!(%r{\\&gt;}, '>')
- formatted = true
- @type = :content
- when 'edit', 'create'
- # Automatically create the project if it doesn't exist or if the
- # action is 'create'.
- @backend.create_project(@page.project) if @action == 'create'
- @backend.create_project(@page.project) unless @backend.project_exists?(@page.project)
- @page.creator = @auth_token.name if @action == 'create' and @auth_token
- @page.indexable = false
- @lock = @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR']) rescue nil
-
- if @lock.nil?
- @type = :content
- @sysmessage = self.message[:page_is_locked]
- else
- content = nil
- formatted = true
- @type = :edit
- end
- when 'save', 'preview'
- np = @request.parameters['newpage'].gsub(/\r/, '').chomp
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.editor_ip = @request.environment['REMOTE_ADDR']
- @page.indexable = false
-
- save_ver = @backend.retrieve(@page.topic, @page.project)['properties']['version'].to_i
- sent_ver = @request.parameters['version'].to_i
-
- if sent_ver < save_ver
- @type = :edit
-
- np = np.split($/)
- content_diff = Diff::LCS.sdiff(np, @page.content.split($/), Diff::LCS::ContextDiffCallbacks)
- content_diff.reverse_each do |hunk|
- case hunk
- when Array
- hunk.reverse_each do |diff|
- case diff.action
- when '+'
-# np.insert(diff.old_position, "+#{diff.new_element}")
- np.insert(diff.old_position, "#{diff.new_element}")
- when '-'
- np.delete_at(diff.old_position)
-# np[diff.old_position] = "-#{diff.old_element}"
- when '!'
- np[diff.old_position] = "-#{diff.old_element}"
- np.insert(diff.old_position + 1, "+#{diff.new_element}")
- end
- end
- when Diff::LCS::ContextChange
- case hunk.action
- when '+'
- np.insert(hunk.old_position, "#{hunk.new_element}")
-# np.insert(hunk.old_position, "+#{hunk.new_element}")
- when '-'
- np.delete_at(hunk.old_position)
-# np[diff.old_position] = "-#{hunk.old_element}"
- when '!'
- np[hunk.old_position] = "-#{hunk.old_element}"
- np.insert(hunk.old_position + 1, "+#{hunk.new_element}")
- end
- end
- end
- @page.content = np.join("\n")
-
- edc = @request.parameters['edcomment']
- unless (edc.nil? or edc.empty? or edc == "*")
- @page.edit_comment = edc
- end
-
- @sysmessage = self.message[:not_editing_current_version] % [ @page.project, @page.topic ]
- else
- if @action == 'save'
- @page.editor = @auth_token.name if @auth_token
- op = @page.content
- else
- op = nil
- end
-
- if (np == op) and (@action == 'save')
- @type = :content
- else
- @page.content = np
- edc = @request.parameters['edcomment']
- unless (edc.nil? or edc.empty? or edc == "*")
- @page.edit_comment = edc
- end
-
- if @action == 'save'
- @type = :save
- @page.version = @request.parameters['version'].to_i + 1
- @backend.store(@page)
-
- # hack to ensure that Recent Changes are updated correctly
- if @page.topic == 'RecentChanges'
- recent = Ruwiki::Page.new(@backend.retrieve(@page.topic, @page.project))
- @page.content = recent.content
- end
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- else
- @type = :preview
- @lock = @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR'])
- content = nil
- formatted = true
- end
- end
- end
- when 'cancel'
-# @page.topic = @request.parameters['topic']
-# @page.project = @request.parameters['project']
-# @page.version = @request.parameters['version'].to_i
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- @type = :content
- else
- # TODO AZ: This should probably return a 501 Not Implemented or some
- # other error unless @action.nil?
- nil
- end
- content = @page.to_html(@markup) if not formatted
- rescue Exception => ee # rescue for def process_page
- @type = :error
- if ee.kind_of?(Ruwiki::Backend::BackendError)
- name = "#{self.message[:error]}: #{ee.to_s}"
- else
- name = "#{self.message[:complete_utter_failure]}: #{ee.to_s}"
- end
- @error[:name] = CGI.escapeHTML(name)
- @error[:backtrace] = ee.backtrace.map { |el| CGI.escapeHTML(el) }.join("<br />\n")
- content = nil
- ensure
- @content = content
- end # def process_page
-
- # Renders the page.
- def render(*args)
- if args.empty?
- type = @type
- error = @error
- else
- raise ArgumentError, self.message[:render_arguments] unless args.size == 2
- type = args[0]
- error = {
- :name => Ruwiki.clean_entities(args[1].inspect),
- :backtrace => args[1].backtrace.join("<br />\n")
- }
- @page = Ruwiki::Page.new(Ruwiki::Page::NULL_PAGE)
- end
-
- @rendered_page = ""
- values = {
- "css_link" => @config.css_link,
- "home_link" => %Q(<a href="#{@request.script_url}">#{@config.title}</a>),
- "cgi_url" => @request.script_url,
- "content" => @content,
- }
-
- if @page.nil?
- values["page_project"] = ""
- values["page_raw_topic"] = ""
- values["page_topic"] = ""
- values["editable"] = false
- values["indexable"] = false
- else
- values["page_project"] = @page.project
- values["page_raw_topic"] = @page.topic
- values["page_topic"] = CGI.unescape(@page.topic)
- values["editable"] = @page.editable
- values["indexable"] = @page.indexable
- end
-
- values["url_project"] = %Q(#{values["cgi_url"]}/#{values["page_project"]})
- values["url_topic_search"] = %Q(#{values["url_project"]}/_search?q=#{values["page_topic"]})
- values["link_topic_search"] = %Q(<a href='#{values["url_topic_search"]}'><strong>#{values["page_topic"]}</strong></a>)
- values["message"] = @sysmessage unless @sysmessage.nil?
-
- case type
- when :content, :save, :search
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}" if @page.nil?
- values["wiki_title"] ||= "#{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["label_topic_or_search"] = self.message[:label_topic]
- values["page_topic_name"] = values["page_topic"]
- if type == :content or type == :search
- template = TemplatePage.new(@config.template(:body), @config.template(:content), @config.template(:controls), @config.template(:footer))
- if type == :search
- values["label_topic_or_search"] = self.message[:label_search]
- else
- values["page_topic"] = values["link_topic_search"]
- end
- else
- # action type was save
- values["page_topic"] = values["link_topic_search"]
- template = TemplatePage.new(@config.template(:body), @config.template(:save), @config.template(:controls), @config.template(:footer))
- end
- when :edit, :preview
- template = TemplatePage.new(@config.template(:body), @config.template(:edit))
- values["wiki_title"] = "#{self.message[:editing]}: #{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_content"] = @page.content
- values["page_version"] = @page.version.to_s
- values["unedited_page_content"] = @page.to_html(@markup)
- values["pre_page_content"] = CGI.escapeHTML(@page.content)
- if @request.parameters["edcomment"].nil? or @request.parameters["edcomment"].empty?
- values["edit_comment"] = "*"
- else
- values["edit_comment"] = @request.parameters["edcomment"]
- end
- when :error
- template = TemplatePage.new(@config.template(:body), @config.template(:error))
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}"
- values["name"] = error[:name]
- values["backtrace"] = error[:backtrace]
- values["backtrace_email"] = error[:backtrace].gsub(/<br \/>/, '')
- values["webmaster"] = @config.webmaster
- end
-
- template.to_html(values, :messages => @config.message,
- :output => @rendered_page)
- end
-
- # Outputs the page.
- def output
- return if @response.written?
-# if @request.environment["HTTP_ACCEPT"] =~ %r{application/xhtml\+xml}
-# @response.add_header("Content-type", "application/xhtml+xml")
-# else
- @response.add_header("Content-type", "text/html")
-# end
- @response.add_header("Cache-Control", "max_age=0")
- @response.write_headers
- @response << @rendered_page
- end
-
- def forbidden
- protocol = @request.environment["SERVER_PROTOCOL"] || "HTTP/1.0"
- @response.write_status "#{protocol} 403 FORBIDDEN\nDate: #{CGI::rfc1123_date(Time.now)}\n\n"
- end
-
- # nil if string is invalid
- def validate_search_string(instr)
- return nil if instr.empty?
-
- modstr = instr.dup
-
- #TODO: add validation of modstr
- return modstr
- end
-
- def self.clean_entities(data)
- data.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;')
- end
-
-private
- RE_ACTION = %r{^_([[:lower:]]+)$}
-
- def set_page_name_or_action(item)
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- else
- @topic = item
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/auth.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/auth.rb
deleted file mode 100644
index ab4c923..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/auth.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Auth
- class << self
- def [](name)
- @delegate ||= {}
-
- if @delegate.has_key?(name)
- @delegate[name]
- else
- require "ruwiki/auth/#{name}"
- @delegate[name] = Ruwiki::Auth.const_get(name.capitalize)
- end
- end
- end
-
- class Token
- def initialize(name = nil, groups = [], permissions = {})
- @user_name = name
- @groups = groups
- @permissions = permissions
- end
-
- def found?
- not @user_name.nil?
- end
-
- def name
- @user_name
- end
-
- def member?(unix_group_name)
- @groups.include?(unix_group_name)
- end
-
- def groups
- @groups
- end
-
- def allowed?(action)
- @permission[action]
- end
-
- def permissions
- @permissions
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/auth/gforge.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/auth/gforge.rb
deleted file mode 100644
index 70895a1..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/auth/gforge.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-begin
- require 'gforge_auth'
-rescue LoadError
- class GForgeAuthenticator
- class AuthenticationResult
- def initialize(name = nil, groups = [])
- @user_name = name
- @groups = groups
- end
-
- def found?
- not @user_name.nil?
- end
-
- def user_name
- raise "No session associated with the given key was found" unless found?
- @user_name
- end
-
- def member?(unix_group_name)
- raise "No session associated with the given key was found" unless found?
- @groups.include?(unix_group_name)
- end
-
- def groups
- raise "No session associated with the given key was found" unless found?
- @groups
- end
- end
-
- def self.authenticate(sessionkey, options = {})
- sql = %Q(SELECT user_name FROM users u, user_session us WHERE us.session_hash = '#{sessionkey}' AND us.user_id = u.user_id;)
- res = %x{psql -q -t -U #{options['user']} #{options['pass']} -c \"#{sql}\"}
- rows = res.split(/\n/)
- return AuthenticationResult.new if rows.size != 1
-
- user_name = rows[0].strip
- sql = %Q(SELECT unix_group_name FROM groups g, users u, user_group ug WHERE u.user_name = '#{user_name}' AND ug.user_id = u.user_id AND g.group_id = ug.group_id)
-
- res = %x(psql -q -t -U #{options['user']} #{options['pass']} -c \"#{sql}\")
- groups = []
- res.split(/\n/).each {|row| groups << row.strip }
- AuthenticationResult.new(user_name, groups)
- end
- end
-end
-
-class Ruwiki::Auth::Gforge < Ruwiki::Auth
- def self.authenticate(request, response, options = {})
- options['user'] = options['user'].gsub!(%r{^(\w+)}, '\1')
- options['pass'] = options['pass'].gsub!(%r{^(\w+)}, '\1')
- session_key = request.cookies['session_ser'].value[0].split(%r{-\*-})[-1]
- token = GForgeAuthenticator.authenticate(session_key, options)
- token = Ruwiki::Auth::Token.new(token.user_name, token.groups)
- token.permissions.default = true if token.found?
- rescue
- token = Ruwiki::Auth::Token.new
- token.permissions.default = false
- ensure
- return token
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/backend.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/backend.rb
deleted file mode 100644
index 063666e..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/backend.rb
+++ /dev/null
@@ -1,318 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-begin
- if defined?(Gem::Cache)
- require_gem 'diff-lcs', '~> 1.1.2'
- else
- require 'diff/lcs'
- end
-rescue LoadError => ex
- $stderr.puts ex.message
- raise
-end
-
-class Ruwiki
- # The list of known backends.
- KNOWN_BACKENDS = %w(flatfiles)
-
- # The Ruwiki backend delegator. Ruwiki will always instantiate a version
- # of this class which delegates the actual method execution to the Backend
- # class. Error handling is handled by capturing (and possibly forwarding)
- # exceptions raised by the delegate class.
- class BackendDelegator
- def initialize(ruwiki, backend)
- @message = ruwiki.config.message
- @time_format = ruwiki.config.time_format || "%H:%M:%S"
- @date_format = ruwiki.config.date_format || "%Y.%m.%d"
- @datetime_format = ruwiki.config.datetime_format || "#{@date_format} #{@time_format}"
- options = ruwiki.config.storage_options
- options['default-page'] = ruwiki.config.default_page
-
- unless Ruwiki::KNOWN_BACKENDS.include?(backend)
- raise RuntimeError, @message[:backend_unknown] % [backend]
- end
-
- beconst = backend.capitalize
-
- require "ruwiki/backend/#{backend}"
-
- beoptions = options[backend]
- @delegate = Ruwiki::Backend.const_get(beconst).new(beoptions)
- rescue Ruwiki::Backend::BackendError => ex
- if ex.kind_of?(Array)
- raise Ruwiki::Backend::BackendError.new(nil), @message[ex.reason[0]] % ex.reason[1]
- else
- raise
- end
- end
-
- # Retrieve the specified topic and project page. Calls Backend#load
- # after verifying that the project exists.
- def retrieve(topic, project = 'Default')
- unless page_exists?(topic, project)
- exported = Ruwiki::Page::NULL_PAGE.dup
- exported['properties'] = {
- 'title' => topic,
- 'topic' => topic,
- 'project' => project,
- 'create-date' => Time.now.utc,
- 'edit-date' => Time.now.utc,
- 'editable' => true,
- 'indexable' => true,
- 'entropy' => 0.0,
- 'html-headers' => [],
- 'version' => 0
- }
- exported['page'] = {
- 'header' => nil,
- 'footer' => nil
- }
-
- if project_exists?(project)
- exported['page']['content'] = ""
- else
- exported['page']['content'] = @message[:project_does_not_exist] % [project]
- end
- return exported
- end
-
- return @delegate.load(topic, project)
- rescue Ruwiki::Backend::InvalidFormatError => ex
- raise Ruwiki::Backend::BackendError.new(nil), @message[:page_not_in_backend_format] % [project, topic, @delegate.class]
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_read_topic] % [project, topic]
- rescue Exception => ex
- mm = [project, topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_retrieve_topic] % mm
- end
-
- # Stores the specified topic and project page.
- def store(page)
- @delegate.store(page)
-
- # update change page
- begin
- recent_changes = nil
- if (page.topic == 'RecentChanges')
- recent_changes = page.dup
- else
- recent_changes = Page.new(retrieve('RecentChanges', page.project))
- end
-
- changeline = "\n; #{page.editor_ip} (#{Time.now.utc.strftime(@datetime_format)}), #{page.topic} : #{page.edit_comment}"
-
- # add changeline to top of page
- recent_changes.content = changeline + (recent_changes.content || "")
- @delegate.store(recent_changes)
- rescue Exception => ex
- raise "Couldn't save RecentChanges\n#{ex.backtrace}"
- end
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_store_topic] % [page.project, page.topic]
- rescue Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_store_topic] % mm
- end
-
- # Destroys the specified topic and project page.
- def destroy(page)
- @delegate.destroy(page)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_destroy_topic] % [page.project, page.topic]
- rescue Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_destroy_topic] % mm
- end
-
- # Releases the lock on the page.
- def release_lock(page, address = 'UNKNOWN')
- time = Time.now.utc.to_i
- @delegate.release_lock(page, time, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_release_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:error_releasing_lock] % mm
- end
-
- # Attempts to obtain a lock on the page. The lock
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- time = Time.now.utc.to_i
- expire = time + timeout
- @delegate.obtain_lock(page, time, expire, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_obtain_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:error_creating_lock] % mm
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- @delegate.project_exists?(project)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- @delegate.page_exists?(topic, project)
- end
-
- # Attempts to create the project.
- def create_project(project)
- @delegate.create_project(project)
- rescue Ruwiki::Backend::ProjectExists => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:project_already_exists] % [project]
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_create_project] % [project]
- rescue Exception => ex
- mm = [project, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_create_project] % mm
- end
-
- # Attempts to destroy the project.
- def destroy_project(project)
- @delegate.destroy_project(project)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_destroy_project] % [project]
- rescue Exception => ex
- mm = [project, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_destroy_project] % mm
- end
-
- def search_all_projects(searchstr)
- if @delegate.respond_to?(:search_all_projects)
- @delegate.search_all_projects(searchstr)
- else
- search_all_projects_default(searchstr)
- end
- end
-
- # Attempts to search all projects. This is the default
- # search_all_projects used unless the delegate implements
- # a specialized search_all_projects.
- def search_all_projects_default(searchstr)
- hits = {}
- list_projects.each do |project|
- lhits = search_project(project, searchstr)
- # Transform the keys from project local to global links.
- lhits.each { |key, val| hits["#{project}::#{key}"] = val }
- end
- hits
- end
-
- # Attempts to search a project
- def search_project(project, searchstr)
- #TODO: Validate searchstr is a safe regexp?
- @delegate.search_project(project, searchstr)
- rescue Exception => ex
- mm = [project, searchstr, ex.class, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:search_project_fail] % mm
- end
-
- # Return an array of projects
- def list_projects
- @delegate.list_projects
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_list_projects]
- rescue Exception => ex
- mm = ['', %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_list_projects] % mm
- end
-
- # Return an array of projects
- def list_topics(projname)
- @delegate.list_topics(projname)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_list_topics] % [projname]
- rescue Exception => ex
- mm = [projname, ex.message]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_list_topics] % mm
- end
- end
-
- # The Ruwiki backend abstract class and factory.
- class Backend
- class ProjectExists < RuntimeError #:nodoc:
- end
- class InvalidFormatError < RuntimeError #:nodoc:
- end
- class BackendError < RuntimeError #:nodoc:
- attr_reader :reason
-
- def initialize(reason, *args)
- if @reason.respond_to?(:message)
- @reason = reason.message
- else
- @reason = reason
- end
- end
- end
- def initialize(storage_options)
- end
-
- private
- NL_RE = %r{\n} #:nodoc:
-
- def map_diffset(diffset)
- diffset.map do |hunk|
- if hunk.kind_of?(Array)
- hunk.map { |change| change.to_a }
- else
- hunk.to_a
- end
- end
- end
-
- # Creates the current diff object. This is made from two
- # Ruwiki::Page#export hashes.
- def make_diff(oldpage, newpage)
- oldpage = oldpage.export if oldpage.kind_of?(Ruwiki::Page)
- newpage = newpage.export if newpage.kind_of?(Ruwiki::Page)
-
- diff = Hash.new
-
- newpage.keys.sort.each do |sect|
- newpage[sect].keys.sort.each do |item|
- oldval = oldpage[sect][item]
- newval = newpage[sect][item]
-
- case [sect, item]
- when ['properties', 'html-headers']
- # Protect against NoMethodError.
- oldval ||= []
- newval ||= []
- val = Diff::LCS.sdiff(oldval, newval, Diff::LCS::ContextDiffCallbacks)
- when ['ruwiki', 'content-version'], ['properties', 'version'],
- ['properties', 'entropy']
- val = Diff::LCS.sdiff([oldval], [newval], Diff::LCS::ContextDiffCallbacks)
- when ['properties', 'create-date'], ['properties', 'edit-date']
- val = Diff::LCS.sdiff([oldval.to_i], [newval.to_i], Diff::LCS::ContextDiffCallbacks)
- else
- # Protect against NoMethodError.
- val = Diff::LCS.sdiff(oldval.to_s.split(NL_RE), newval.to_s.split(NL_RE), Diff::LCS::ContextDiffCallbacks)
- end
-
- (diff[sect] ||= {})[item] = map_diffset(val) unless val.nil? or val.empty?
- end
- end
-
- diff_hash = {
- 'old_version' => oldpage['properties']['version'],
- 'new_version' => newpage['properties']['version'],
- 'edit-date' => newpage['properties']['edit-date'].to_i,
- 'editor-ip' => newpage['properties']['editor-ip'],
- 'editor' => newpage['properties']['editor'],
- 'diff' => diff
- }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/backend/flatfiles.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/backend/flatfiles.rb
deleted file mode 100644
index e9a9ae2..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/backend/flatfiles.rb
+++ /dev/null
@@ -1,216 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Flatfiles < Ruwiki::Backend
- # Initializes the Flatfiles backend. The known options for the Flatfiles
- # backend are documented below.
- #
- # data-path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # format:: The format of the files in the backend. By default,
- # this is 'exportable', a tagged data format produced by
- # Ruwiki::Exportable; alternative formats are 'yaml'
- # (::YAML.dump) and 'marshal' (::Marshal.dump).
- # default-page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- @data_path = options['data-path'] || File.join(".", "data")
- @extension = options['extension']
- @format = case options['format']
- when 'exportable', nil
- Ruwiki::Exportable
- when 'yaml'
- ::YAML
- when 'marshal'
- ::Marshal
- end
-
- if @extension.nil?
- @extension_re = /$/
- else
- @extension_re = /\.#{@extension}$/
- end
-
- @default_page = options['default-page'] || "ProjectIndex"
- if not (File.exists?(@data_path) and File.directory?(@data_path))
- raise Ruwiki::Backend::BackendError.new([:flatfiles_no_data_directory, [@data_path]])
- end
-
- super
- end
-
- # Destroys the topic page.
- def destroy(page)
- pf = page_file(page.topic, page.project)
- File.unlink(pf) if File.exists?(pf)
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- pd = project_directory(project)
- File.exists?(pd) and File.directory?(pd)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- pf = page_file(topic, project)
- project_exists?(project) and File.exists?(pf)
- end
-
- # Tries to create the project.
- def create_project(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::ProjectExists if File.exists?(pd)
- Dir.mkdir(pd)
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # String search all topic names and content in a project and
- # return a hash of topic hits.
- def search_project(project, searchstr)
- re_search = Regexp.new(searchstr, Regexp::IGNORECASE)
-
- hits = Hash.new { |hh, kk| hh[kk] = 0 }
- topic_list = list_topics(project)
-
- return hits if topic_list.empty?
-
- # search topic content
- topic_list.each do |topic|
- # search name
- hits[topic] += topic.scan(re_search).size
-
- # check content
- page = load(topic, project) rescue Ruwiki::Page::NULL_PAGE
- page['page'].each_value do |item|
- item = item.join("") if item.kind_of?(Array)
- item ||= ""
- hits[topic] += item.scan(re_search).size
- end
- end
-
- hits
- end
-
- def lock_okay?(page, time, address = 'UNKNOWN')
- lockokay = false
- lockfile = "#{page_file(page.topic, page.project)}.lock"
-
- if File.exists?(lockfile)
- data = File.read(lockfile).split(%r{!})
- # If the lock belongs to this address, we don't care how old it is.
- # Thus, release it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lockokay = true
- end
- end
-
- # Attempts to obtain a lock on the topic page. This must return the lock
- def obtain_lock(page, time, expire, address = 'UNKNOWN')
- lock = "#{address}!#{expire}"
-
- if lock_okay?(page, time, address)
- File.open("#{page_file(page.topic, page.project)}.lock", 'wb') { |lfh| lfh.puts lock }
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- lock
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, time, address = 'UNKNOWN')
- lockfile = "#{page_file(page.topic, page.project)}.lock"
-
- if lock_okay?(page, time, address)
- File.unlink(lockfile) if File.exists?(lockfile)
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- true
- end
-
- # list projects found in data path
- def list_projects
- Dir[File.join(@data_path, "*")].select do |dd|
- File.directory?(dd) and File.exist?(page_file(@default_page, File.basename(dd)))
- end.map { |dd| File.basename(dd) }
- end
-
- # list topics found in data path
- def list_topics(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::BackendError.new(:no_project) unless File.exist?(pd)
-
- Dir[File.join(pd, "*")].select do |ff|
- ff !~ /\.rdiff$/ and ff !~ /\.lock$/ and File.file?(ff) and ff =~ @extension_re
- end.map { |ff| File.basename(ff).sub(@extension_re, "") }
- end
-
- def project_directory(project) # :nodoc:
- File.join(@data_path, project)
- end
-
- def page_file(topic, project = 'Default') # :nodoc:
- if @extension.nil?
- File.join(project_directory(project), topic)
- else
- File.join(project_directory(project), "#{topic}.#{@extension}")
- end
- end
-
- def make_rdiff(page_file, new_page)
- diff_file = "#{page_file}.rdiff"
-
- old_page = self.class.load(pf) rescue Ruwiki::Page::NULL_PAGE
-
- diffs = []
- File.open(diff_file, 'rb') { |ff| diffs = Marshal.load(ff) } if File.exists?(diff_file)
- diffs << make_diff(old_page, new_page)
- changes = Marshal.dump(diffs)
-
- File.open(diff_file, 'wb') { |ff| ff << changes }
- end
-
- # Provides a HEADER marker.
- # Loads the topic page from disk.
- def load(topic, project)
- data = nil
- File.open(page_file(topic, project), 'rb') { |ff| data = ff.read }
-
- Ruwiki::Page::NULL_PAGE.merge(@format.load(data))
- rescue Ruwiki::Exportable::InvalidFormatError, TypeError, ArgumentError
- raise Ruwiki::Backend::InvalidFormatError
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = @format.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |ff| ff.puts newpage }
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/config.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/config.rb
deleted file mode 100644
index d01dca1..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/config.rb
+++ /dev/null
@@ -1,244 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # Ruwiki configuration.
-class Ruwiki::Config
- include Ruwiki::Exportable
-
- CONFIG_NAME = 'ruwiki.conf'
-
- exportable_group 'ruwiki-config'
- # Sets or returns the logger. The logger, if set, must respond to the same
- # methods as WEBrick::Logger.
- attr_accessor :logger
- # Sets or returns the time format whenever time is outputted in Ruwiki.
- # Default is <tt>%H:%M:%S</tt> (23:59:59).
- attr_accessor :time_format
- exportable :time_format
- # Sets or returns the date format whenever time is outputted in Ruwiki.
- # Default is <tt>%Y.%m.%d</tt> (2004.08.04).
- attr_accessor :date_format
- exportable :date_format
- # Sets or returns the date-time format whenever time is outputted in
- # Ruwiki. Default is <tt>%Y.%m.%d %H:%M:%S</tt> (2004.08.04 23:59:59).
- attr_accessor :datetime_format
- exportable :datetime_format
- # Adds additional information to the (rare) error reports. Defaults to
- # +false+.
- attr_accessor :debug
- exportable :debug
- # The default page for display when Ruwiki is called without any arguments.
- # Defaults to +ProjectIndex+
- attr_accessor :default_page
- exportable :default_page
- # The default project for display when Ruwiki is called without any
- # arguments or a project specification. Defaults to +Default+
- attr_accessor :default_project
- exportable :default_project
- # The authentication mechanism name as a String. Corresponds to
- # a filename that will be found in ruwiki/auth. The authenticator must
- # have a single class method, +authenticate+, which accepts the
- # +request+, the +response+, and the +#auth_options+. This API is
- # a draft API and is likely to change in future versions of Ruwiki. In
- # this version of Ruwiki, only one authentication mechanism will be
- # found -- for dealing with authenticating users already logged into
- # RubyForge.
- attr_accessor :auth_mechanism
- exportable :auth_mechanism
- # Options for the authentication mechanism as a Hash. This will be
- # passed to the authenticator defined in +#auth_mechanism+.
- attr_accessor :auth_options
- exportable :auth_options
- # The storage type as a String. Corresponds to a filename that will be
- # found in ruwiki/backend. NOTE: The yaml and marshal storage types have
- # been removed from Ruwiki 0.9.0, to be replaced with a single storage
- # type of Flatfiles. Now, the YAML and Marshal formats can be enabled by
- # setting options in the @storage_options field.
- attr_accessor :storage_type
- exportable :storage_type
- # The options for the specified storage type. This is a hash of hashes with
- # auto-vifification. See the storage type for available options.
- attr_reader :storage_options
- exportable :storage_options
- # The path for templates. Defaults to <tt>./templates/</tt>.
- attr_accessor :template_path
- exportable :template_path
- # The name of the Wiki. Defaults to <tt>ruwiki</tt>
- attr_accessor :title
- exportable :title
- # The email address of the webmaster for the Wiki. Defaults to +nil+.
- attr_accessor :webmaster
- exportable :webmaster
- # The name of the Ruwiki CSS file. Defaults to <tt>ruwiki.css</tt>.
- attr_accessor :css
- exportable :css
- # The template set. Templates are always named as
- # <template_path>/<template_set>/<template_name>. Template filename. Must
- # be reachable by File#read.
- attr_accessor :template_set
- exportable :template_set
- # Ruwiki is internationalized. This method sets the Ruwiki error
- # messages (and a few other messages) to the specified language Module.
- # The language Module must have a constant Hash called +Message+
- # containing a set of symbols and localized versions of the messages
- # associated with them.
- #
- # If the file 'ruwiki/lang/es.rb' contains the module
- # <tt>Ruwiki::Lang::ES</tt>, the error messages for RSS could be
- # localized to Español thus:
- #
- # require 'ruwiki/lang/es'
- # ...
- # wiki.config.language = Ruwiki::Lang::ES
- #
- # Localization is per wiki instance. In a servlet environment, this may
- # mean that only a single language is recognised.
- #
- # See Ruwiki::Lang::EN for more information.
- attr_accessor :language
- exportable :language
- # The message hash.
- attr_reader :message
-
- def language=(ll) #:nodoc:
- if ll.kind_of?(String)
- @language = Ruwiki::Lang::const_get(ll.upcase)
- else
- @language = ll
- end
- @message = @language::Message
- end
-
- # Returns the specified template as a string.
- def template(name)
- File.read(File.join(@template_path, @template_set, "#{name.to_s}.tmpl"))
- rescue Errno::ENOENT
- raise ConfigError, message[:no_template_found] % [name.inspect, @template_set]
- end
-
- # Returns the CSS stylesheet content for the Wiki. This previously
- # returned the <link> to the stylesheet, but instead returns a <style>
- # block in the head so that the CSS is kept with the template set, which
- # may be kept outside of the HTML area.
- def css_link
- %Q[<style type="text/css" media="screen,print">#{File.read(File.join(@template_path, @template_set, @css))}</style>]
- end
-
- # Creates a new configuration object.
- def initialize(exportable = {})
- rc = exportable['ruwiki-config'] || {}
- @debug = (rc['debug'] == "false") ? false : true
- @default_project = rc['default-project'] || "Default"
- @default_page = rc['default-page'] || "ProjectIndex"
- @auth_mechanism = rc['auth-mechanism'] || nil
-
- case rc['auth-options']
- when nil, ""
- @auth_options = {}
- else
- @auth_options = Ruwiki::Exportable.load(rc['auth-options'])['default']
- end
-
- case rc['storage-type']
- when nil, ""
- @storage_type = 'flatfiles'
- else
- @storage_type = rc['storage-type']
- end
-
- # in 'type!name:<Tab>value\n' format.
- if rc['storage-options'].nil? or rc['storage-options'].empty?
- @storage_options = Hash.new { |hh, kk| hh[kk] = {} }
- else
- @storage_options = Ruwiki::Exportable.load(rc['storage-options'])
- @storage_options.keys.each do |key|
- @storage_options[key] = @storage_options.delete(key)
- end
- end
- if @storage_options.empty?
- @storage_options[@storage_type]['extension'] = "ruwiki"
- @storage_options[@storage_type]['data-path'] = "./data"
- @storage_options[@storage_type]['format'] = "exportable"
- end
-
- @storage_options.each_value do |vv|
- if vv['extension'].nil? or vv['extension'].empty?
- vv['extension'] = "ruwiki"
- end
- if vv['data-path'].nil? or vv['data-path'].empty?
- vv['data-path'] = "./data"
- end
- end
-
- @template_path = rc['template-path'] || "./templates/"
- @template_set = rc['template-set'] || "default"
- @css = rc['css'] || "ruwiki.css"
- @webmaster = rc['webmaster']
- @title = rc['title'] || "Ruwiki"
- @time_format = rc['time-format'] || "%H:%M:%S"
- @date_format = rc['date-format'] || "%Y.%m.%d"
- @datetime_format = rc['datetime-format'] || "#{@date_format} #{@time_format}"
- case rc['language']
- when nil, ""
- self.language = Ruwiki::Lang::EN
- else
- self.language = Ruwiki::Lang::const_get(rc['language'].upcase)
- end
- end
-
- # Verifies that required configuration options are actually set. Right
- # now, it only checks the values that are defaulted to +nil+.
- def verify
- raise ConfigError, message[:no_webmaster_defined] if @webmaster.nil? or @webmaster.empty?
- raise ConfigError, message[:invalid_template_dir] % [@template_path] unless File.exists?(@template_path) and File.directory?(@template_path)
- tt = File.join(@template_path, @template_set)
- raise ConfigError, message[:no_template_set] % [@template_set] unless File.exists?(tt) and File.directory?(tt)
- end
-
- # Provides the canonical export hash.
- def export
- exportable = super
-
- rc = exportable['ruwiki-config']
-
- rc['auth-options'] = Ruwiki::Exportable.dump({ 'default' => rc['auth-options']})
-
- rc['storage-options'] = Ruwiki::Exportable.dump(rc['storage-options'])
- rc['storage-type'] = rc['storage-type'].to_s
- rc['language'] = "#{rc['language']}".sub(/^.*?::([A-Z]+)$/, '\1').downcase
- exportable
- end
-
- class << self
- def write(file, config)
- if file.respond_to?(:write)
- file.puts(config.dump)
- else
- File.open(file, 'wb') { |ff| ff.puts(config.dump) }
- end
- end
-
- def read(file)
- data = nil
- if file.respond_to?(:read)
- data = file.read
- else
- File.open(file, 'rb') { |ff| data = ff.read }
- end
- hash = Ruwiki::Exportable.load(data)
-
- Ruwiki::Config.new(hash)
- end
- end
-
- class ConfigError < StandardError; end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/exportable.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/exportable.rb
deleted file mode 100644
index c18290f..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/exportable.rb
+++ /dev/null
@@ -1,192 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # == Synopsis
- # Generalises a marshaling format that is easily read and edited by humans
- # and is relatively easy to manage by software. When an attribute is marked
- # #exportable, the name of the attribute is transformed and stored in
- # a two-level hash, e.g.:
- #
- # exportable_group 'group1'
- # exportable :var_1
- # exportable :var_2
- # exportable_group 'group2'
- # exportable :var_3
- # exportable :var_4
- #
- # Results in an exportable hash of:
- #
- # { 'group1' =>
- # { 'var-1' => @var1,
- # 'var-2' => @var2, },
- # 'group2' =>
- # { 'var-3' => @var3,
- # 'var-4' => @var4, }, }
- #
-module Ruwiki::Exportable
- class InvalidFormatError < RuntimeError; end
-
- class << self
- # Adds two methods and an attribute to the class that is including Exportable
- #
- # <tt>__exportables</tt>:: Contains the list of exportable symbols by group.
- # <tt>exportable_group</tt>:: Defines the current group for exportable
- # symbols. Default is 'default'.
- # <tt>exportable</tt>:: Accepts two arguments, the attribute being
- # exported and an option hash, containing the
- # values :name and :group, where :name
- # indicates the name of the attribute (so
- # that the default name transformation is
- # not applied) and :group overrides the
- # current #exportable_group. By default, the
- # name of the attribute is transformed such
- # that underscores are converted to dashes
- # (<tt>var_1</tt> becomes 'var-1').
- def append_features(mod)
- super
-
- class << mod
- attr_reader :__exportables
-
- define_method(:exportable_group) do |name|
- @__exportable_group = name || 'default'
- end
-
- define_method(:exportable) do |*symset|
- symbol = symset.shift
- options = symset.shift || {}
-
- @__exportables ||= {}
-
- options[:name] ||= symbol.to_s.gsub(/_/, '-')
- options[:group] ||= @__exportable_group || 'default'
-
- @__exportables[options[:group]] ||= {}
- @__exportables[options[:group]][options[:name]] = "@#{symbol.to_s}".intern
- end
- end
- end
-
- # Looks for comments. Comments may ONLY be on single lines.
- COMMENT_RE = %r{^#}
- # Looks for newlines
- NL_RE = %r{\n}
- # Looks for a line that indicates an exportable value. See #dump.
- HEADER_RE = %r{^([a-z][-a-z]+)!([a-z][-a-z]+):[ \t](.*)$}
- # Looks for an indented group indicating that the last group is
- # a multiline value.
- FIRST_TAB = %r{^[ \t]}
-
- # Dumps the provided exportable hash in the form:
- #
- # section!name:<Tab>Value
- # section!name:<Space>Value
- #
- # Multiline values are indented either one space or one tab:
- #
- # section!name:<Tab>Value Line 1
- # <Tab>Value Line 2
- # <Tab>Value Line 3
- # <Tab>Value Line 4
- #
- # All values in the exportable hash are converted to string
- # representations, so only values that can meaningfully be reinstantiated
- # from string representations should be stored in the exportable hash. It
- # is the responsibility of the class preparing the exportable hash
- # through Exportable#export to make the necessary transformations.
- def dump(export_hash)
- dumpstr = ""
-
- export_hash.keys.sort.each do |sect|
- export_hash[sect].keys.sort.each do |item|
- val = export_hash[sect][item].to_s.split(NL_RE).join("\n\t")
- dumpstr << "#{sect}!#{item}:\t#{val}\n"
- end
- end
-
- dumpstr
- end
-
- # Loads a buffer in the form provided by #dump into an exportable hash.
- # Skips comment lines.
- def load(buffer)
- hash = {}
- return hash if buffer.nil? or buffer.empty?
-
- # Split the buffer and eliminate comments.
- buffer = buffer.split(NL_RE).delete_if { |line| line =~ COMMENT_RE }
-
- if HEADER_RE.match(buffer[0]).nil?
- raise Ruwiki::Exportable::InvalidFormatError
- end
-
- sect = item = nil
-
- buffer.each do |line|
- line.chomp!
- match = HEADER_RE.match(line)
-
- # If there is no match, add the current line to the previous match.
- # Remove the leading \t, though.
- if match.nil?
- raise Ruwiki::Exportable::InvalidFormatError if FIRST_TAB.match(line).nil?
- hash[sect][item] << "\n#{line.gsub(FIRST_TAB, '')}"
- else
- sect = match.captures[0]
- item = match.captures[1]
- hash[sect] ||= {}
- hash[sect][item] = match.captures[2]
- end
- end
-
- hash
- end
- end
-
- # Converts #exportable attributes to an exportable hash, in the form:
- # { 'group1' =>
- # { 'var-1' => @var1,
- # 'var-2' => @var2, },
- # 'group2' =>
- # { 'var-3' => @var3,
- # 'var-4' => @var4, }, }
- #
- # Classes that #include Exportable are encouraged to override export to
- # ensure safe transformations of values. An example use might be:
- #
- # class TimeClass
- # include Ruwiki::Exportable
- #
- # def export
- # sym = super
- #
- # sym['default']['time'] = sym['default']['time'].to_i
- # sym
- # end
- #
- # In this way, the 'time' value is converted to an integer rather than the
- # default string representation.
- def export
- sym = {}
-
- self.class.__exportables.each do |group, gval|
- gname = group || @__exportable_group || 'default'
- gsym = {}
- gval.each do |name, nval|
- val = self.instance_variable_get(nval)
- gsym[name] = val unless val.nil?
- end
- sym[gname] = gsym
- end
-
- sym
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/handler.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/handler.rb
deleted file mode 100644
index c6a9375..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/handler.rb
+++ /dev/null
@@ -1,342 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Handler
- class << self
- # Generate a new Handler pair from a CGI request.
- def from_cgi(cgi, output_stream = $stdout)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::CGIRequest.new(cgi)
- o.response = Ruwiki::Handler::CGIResponse.new(cgi, output_stream)
- end
- end
-
- # Generate a new Handler pair from a WEBrick request.
- def from_webrick(req, res)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::WEBrickRequest.new(req)
- o.response = Ruwiki::Handler::WEBrickResponse.new(res)
- end
- end
- end
-
- # Returns the handler's request object.
- attr_accessor :request
- # Returns the handler's response object.
- attr_accessor :response
-
- # Creates the handler pair.
- def initialize(&block) #:yields: self
- @request = nil
- @response = nil
- yield self if block_given?
- end
-
- # Essentially a clone of WEBrick::Cookie for use with Ruwiki.
- class Cookie
- attr_reader :name
- attr_accessor :value
- attr_accessor :version
-
- FIELDS = %w(domain path secure comment max_age expires)
-
- FIELDS.each { |field| attr_accessor field.intern }
-
- def initialize(name, value)
- @name = name
- @value = value
- @version = 0 # Netscape Cookie
-
- FIELDS.each { |field| instance_variable_set("@#{field}", nil) }
-
- yield self if block_given?
- end
-
- def expires=(t) #:nodoc:
- @expires = if t.nil? or t.kind_of?(Time)
- t
- else
- Time.parse(t.to_s)
- end
- end
-
- def to_s
- ret = "#{@name}=#{@value}"
- ret << "; Version=#{@version.to_s}" if @version > 0
- ret << "; Domain=#{@domain}" if @domain
- ret << "; Expires=#{CGI::rfc1123_date(@expires)}" if @expires
- ret << "; Max-Age=#{CGI::rfc1123_date(@max_age)}" if @max_age
- ret << "; Comment=#{@comment}" if @comment
- ret << "; Path=#{@path}" if @path
- ret << "; Secure" if @secure
- ret
- end
- end
-
- # Represents an abstract incoming request. This insulates the rest of
- # the code from knowing whether parameters are passed as part of the
- # path, as parameters in the URL, or in some other fashion.
- class AbstractRequest
- def initialize(*args)
- end
- end
-
- # Handles all requests from web applications.
- #
- # Subclasses should provide:
- # @parameters:: Hash-like object that responds to #[] and #hash_key?]
- # @environment:: Hash-like object that responds to #[]
- class AbstractWebRequest < AbstractRequest
- # The parameters provided via the web request.
- attr_reader :parameters
- # The environment provided to the web request.
- attr_reader :environment
- # The request path.
- attr_reader :path
-
- # The list of cookies.
- attr_reader :cookies
-
- def each_parameter #:yields parameter, value:
- @parameters.each { |kk, vv| yield kk, vv }
- end
-
- def each_environment #:yields variable, value
- @environment.each { |kk, vv| yield kk, vv }
- end
-
- def each_cookie #:yields name, value:
- @cookies.each { |kk, vv| yield kk, vv }
- end
-
- # Return the URL of our server.
- def server_url
- res = "http://" # should detect whether we're in secure server mode.
- if @environment['HTTP_HOST']
- res << @environment['HTTP_HOST']
- else
- res << "#{@environment['SERVER_NAME']}:#{@environment['SERVER_PORT']}"
- end
- end
-
- # Return the URL of this script.
- def script_url
- server_url << @environment['SCRIPT_NAME'].to_s
- end
-
- # Return the URL of this request.
- def request_url
- res = script_url
- res << @environment['PATH_INFO'] if @environment['PATH_INFO']
- query = @environment['QUERY_STRING']
- res << "?#{@environment['QUERY_STRING']}" if query && !query.empty?
- res
- end
-
- # Convert a file path into a URL
- def make_url(project, path)
- "#{server_url}/#{project}/#{path}"
- end
-
- def determine_request_path
- @path = ""
- return @path if @environment['PATH_INFO'].nil?
- @path = @environment['PATH_INFO'].dup
- end
- end
-
- # Request for CGI-based activity to ruwiki.
- class CGIRequest < AbstractWebRequest
- def initialize(cgi, output_stream = $stdout)
- @environment = ENV
- @cgi = cgi
- @parameters = {}
- cgi.params.each { |kk, vv| @parameters[kk] = vv[0] }
- @cookies = {}
- cgi.cookies.each do |name, cookie|
- @cookies[name] = Ruwiki::Handler::Cookie.new(name, cookie.value) do |oc|
- oc.version = cookie.version if cookie.respond_to?(:version)
- oc.domain = cookie.domain
- oc.path = cookie.path
- oc.secure = cookie.secure
- oc.comment = cookie.comment if cookie.respond_to?(:comment)
- oc.expires = cookie.expires
- end
- end
- super
- end
- end
-
- # Request for WEBrick based servlet activity to ruwiki.
- class WEBrickRequest < AbstractWebRequest
- def initialize(req)
- @environment = req.meta_vars
- @parameters = req.query
- @cookies = {}
- req.cookies.each do |rqc|
- @cookies[rqc.name] = Ruwiki::Handler::Cookie.new(rqc.name, rqc.value) do |oc|
- oc.version = rqc.version
- oc.domain = rqc.domain
- oc.path = rqc.path
- oc.secure = rqc.secure
- oc.comment = rqc.comment
- oc.expires = rqc.expires
- oc.max_age = rqc.max_age
- end
- end
- super
- end
- end
-
- # Used to write responses in different execution environments such as
- # CGI and Webrick.
- #
- # If you want to create a new response object, you'll need to implement
- # #add_header, #write_headers, #write_cookies, and #<<.
- #
- # The Response object is instantiated with an output stream which must
- # supply +<<+ and +puts+ methods.
- class AbstractResponse
- # Add to the list of headers to be sent back to the client.
- def add_header(key, value)
- raise "Not implemented"
- end
-
- # Write the accumulated headers back to the client.
- def write_headers
- raise "Not implemented"
- end
-
- # Write the string to the client.
- def <<(string)
- raise "Not implemented"
- end
-
- def add_cookies(*cookies)
- cookies.each do |cookie|
- @cookies << cookie
- end
- end
-
- def write_cookies
- raise "Not implemented"
- end
-
- # output_stream must respond to #<< and #puts.
- def initialize(output_stream = $stdout)
- @headers = {}
- @cookies = []
- @written = false
- @status = nil
- @output_stream = output_stream
- end
-
- def written?
- @written
- end
- end
-
- # CGIResponse is the response object for CGI mode.
- class CGIResponse < AbstractResponse
- # output_stream must respond to #<< and #puts.
- def initialize(cgi, output_stream = $stdout)
- @cgi = cgi
- @done = {
- :headers => false,
- :cookies => false,
- :body => false
- }
- super(output_stream)
- end
-
- # Add the header pair for later output as a CGI header.
- def add_header(key, value)
- @headers[key] = value
- end
-
- # Write the headers to the stream. The headers can only be written
- # once.
- def write_headers
- return if @done[:headers]
- @headers.each { |key, value| @output_stream.puts "#{key}: #{value}\r\n" }
- write_cookies
- @output_stream.puts
- @done[:headers] = true
- end
-
- # Write the cookies to the stream. The cookies can only be written
- # once.
- def write_cookies
- return if @done[:cookies]
- @cookies.each do |cookie|
- @output_stream.puts "Set-Cookie: #{cookie.to_s}"
- end
- @done[:cookes] = true
- end
-
- # Output the string to the stream provided.
- def <<(string)
- @output_stream << string
- @written = true
- end
-
- def write_status(status)
- unless status.nil?
- @output_stream << status
- @written = true
- end
- end
- end
-
- # WEBrickResponse is the response object for WEBrick servlet mode.
- class WEBrickResponse < AbstractResponse
- def initialize(webrick_response)
- @response = webrick_response
- @cookies = []
- @done = {
- :headers => false,
- :cookies => false,
- :body => false
- }
- end
-
- def add_header(key, value)
- @response[key] = value
- end
-
- # Copy the cookies into the WEBrick::HTTPResponse cookies array.
- def write_cookies
- return if @done[:cookies]
- @cookies.each do |cookie|
- @response.cookies << cookie.to_s
- end
- @done[:cookes] = true
- end
-
- def write_headers
- write_cookies
- # Webrick will take care of this on its own.
- end
-
- def <<(string)
- @response.body << string.to_s
- @written = true
- end
-
- def write_status(status)
- unless status.nil?
- match = %r{^HTTP/(?:\d|\.)+ (\d+) .*}.match(status)
- @response.status = match.captures[0]
- @response.body << status
- @written = true
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/lang/de.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/lang/de.rb
deleted file mode 100644
index b9db0ef..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/lang/de.rb
+++ /dev/null
@@ -1,339 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Translation by Christian Neukirchen (chneukirchen@yahoo.de) on 22oct2003
-# Updated by Christian Neukirchen (purl.org/net/chneukirchen) on 27aug2004
-# Updated by Christian Neukirchen (purl.org/net/chneukirchen) on 09nov2004
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::DE is the German-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module DE
- Message = Hash.new { |hh, kk| hh[kk] = "Sprachdatei-FEHLER: Unbekannter Nachrichten-Typ #{k.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Unbekanntes Backend %1$s.",
- :cannot_create_project => "Kann %1$s nicht erstellen: %2$s",
- :cannot_destroy_project => "Kann %1$s nicht zerstören: %2$s",
- :cannot_destroy_topic => "Kann %1$s::%2$s nicht zerstören: %3$s",
- :cannot_obtain_lock => "Kann keine Sperre für %1$s::%2$s erhalten. Bitte in Kürze nochmal versuchen.",
- :cannot_release_lock => "Kann die Sperre für %1$s::%2$s nicht lösen. Bitte später nochmal versuchen.",
- :cannot_retrieve_topic => "Kann auf %1$s::%2$s nicht zugreifen: %3$s",
- :cannot_store_topic => "Kann %1$s::%2$s nicht speichern: %3$s",
- :cannot_list_topics => "Kann Themen für Projekt %1$s nicht auflisten: %2$s",
- :error_creating_lock => "Fehler beim Erzeugen der Sperre von %1$s::%2$s: %3$s",
- :error_releasing_lock => "Fehler beim Lösen der Sperre von %1$s::%2$s: %3$s",
- :flatfiles_no_data_directory => "Das Daten-Verzeichnis (%1$s) existiert nicht.",
- :no_access_list_projects => "Keine Berechtigung zum Auflisten der Projekte.",
- :no_access_list_topics => "Keine Berechtigung zum Auflisten der Themen von Projekt %1$s.",
- :no_access_to_create_project => "Keine Berechtigung um Projekt %1$s zu erzeugen.",
- :no_access_to_destroy_project => "Keine Berechtigung um Projekt %1$s zu zerstören.",
- :no_access_to_destroy_topic => "Keine Berechtigung um Thema %1$s::%2$s zu zerstören.",
- :no_access_to_read_topic => "Keine Berechtigung um Thema %1$s::%2$s zu lesen.",
- :no_access_to_store_topic => "Keine Berechtigung um Thema %1$s::%2$s zu speichern.",
- :page_not_in_backend_format => "%1$s::%2$s ist in einem von Backend %3$s nicht unterstütztem Format.",
- :project_already_exists => "Project %1$s existiert bereits.",
- :project_does_not_exist => "Project %1$s existiert nicht.",
- :search_project_fail => "Suche in Projekt %1$s nach Zeichenkette %2$s gescheitert.",
- :yaml_requires_182_or_higher => "YAML-Flatfile-Support existiert nur für Ruby 1.8.2 oder höher.",
- :not_editing_current_version => <<EOM ,
-Sie haben eine alte Version von %1$s::%2$s abgeschickt. Die Unterschiede
-zwischen ihrer und der jetzigen Version wurden kombiniert. Konfliktierende
-Zeilen zeigen beide Zeilen. Bitte gehen sie sicher, dass sie die gesammte
-Seite bearbeitet haben bevor sie nochmals speichern.
-EOM
- :no_empty_search_string => <<EOM ,
-Das Suchfeld darf nicht leer sein. Bitte etwas eingeben bevor der Suchknopf
-gedrückt wird.
-EOM
- :page_is_locked => "Die Seite ist bereits zur Bearbeitung gesperrt. Bitte warte ein paar Minuten und versuche es dann noch ein mal.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Die Konfiguration muss von Typ der Klasse Ruwiki::Config sein.",
- :invalid_template_dir => "Der angegebene Pfad für Schablonen (%1$s) existiert nicht oder ist kein Verzeichnis.",
- :no_template_found => "Keine Schablone %1$s im Schablonen-Set '%2$s' gefunden.",
- :no_template_set => "Es gibt kein Schablonen-Set '%1$s' im Schablonen-Pfad.",
- :no_webmaster_defined => "Konfigurations-Fehler: Kein Webmaster definiert.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fataler Fehler",
- :editing => "Editieren",
- :error => "Fehler",
- :invalid_path_info_value => "Fataler Fehler in der Web-Umgebung. PATH_INFO = %1$s",
- # Should this really get translated? --chris
- :render_arguments => "Ruwiki#render muss mit zwei oder mehr Argumenten aufgerufen werden.",
- :unknown_feature => "Unbekanntes Feature %1$s.",
- :topics_for_project => "Themen for Projekt ::%1$s",
- :project_topics_link => "(Themen)",
- :wiki_projects => "Projekte in %1$s",
- :no_projects => "Keine Projekte bekannt.",
- :no_topics => "Keine Themen in Projekt %1$s.",
- :search_results_for => "= Suchergebnisse für: %1$s",
- :number_of_hits => "%d Treffer",
-
- # Labels
- :label_search_project => "Durchsuche Projekt",
- :label_search_all => "Alles",
- :label_search => "Suche: ",
- :label_project => "Projekt: ",
- :label_topic => "Thema: ",
- :label_edit => "Editieren",
- :label_recent_changes => "Aktuelle Änderungen",
- :label_topics => "Themen",
- :label_projects => "Projekte",
- :label_editing => "Editieren",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Anmerkung: ",
- :label_comment_accelerator => "R",
- :label_save => "Speichern",
- :label_save_accelerator => "S",
- :label_cancel => "Abbrechen",
- :label_cancel_accelerator => "A",
- :label_preview => "Vorschau",
- :label_preview_accelerator => "V",
- :label_original_text => "Ursprüngliche Version",
- :label_raw => "Formatfrei",
- :label_formatted => "Formatiert",
- :label_send_report_by => "Schicken Sie dem Webmaster einen Report via Email.",
- :label_send_report => "Report schicken.",
- :label_saved_page => "Gespeicherte Seite: ",
-
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Benutzung: %1$s [Optionen] <Verzeichnis>+",
- :converter_format_desc => [ "Konvertiert gefundene Dateien (Jetziges",
- "Format egal) in das angegebene Format",
- "Standard ist flatfiles. Erlaubte",
- "Formate sind: yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Erzeugt Backups der aktualisierten",
- "Dateien. Standard ist --backup." ],
- :converter_backupext_desc => [ 'Gibt die Backup-Erweiterung an. Standard',
- 'ist "~", das dem Datendateinamen',
- 'angehängt wird.' ],
- :converter_backupext_error => "Die Backup-Erweiterung darf nicht leer sein.",
- :converter_extension_desc => [ "Gibt die Erweiterung der Ruwiki-",
- "Datendateien an. Standard ist .ruwiki" ],
- :converter_extension_error => "Die Erweiterung darf nicht leer sein.",
- :converter_noextension_desc => [ "Gibt an, dass Ruwiki-Datendateien",
- "keine Dateierweiterung haben." ],
- :converter_quiet_desc => [ "Still sein. Standard sind normale",
- "Mitteilungen." ],
- :converter_language_desc => [ "Sprache auf LANG setzen. Standard ist",
- "en (Englisch). Bekannte Sprachen sind:",
- "en es de" ],
- :converter_verbose_desc => [ "Gesprächig sein. Standard sind normale",
- "Mitteilungen." ],
- :converter_help_desc => [ "Diesen Text zeigen." ],
- :converter_num_arguments => "Fehler: Nicht genug Parameter.",
- :converter_directory => "Verzeichnis",
- :converter_converting_from => "Wandle von %1$s nach %2$s um... ",
- :converter_done => "fertig.",
- :converter_not_ruwiki => "Keine Ruwiki-Datei; übersprungen.",
- :converter_nosave_modified => "Kann veränderte Datei %1$s nicht speichern.",
- :converter_page_format_error => "Fehler: Kann Seitenformat nicht erkennen.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Unbekannter Befehl: %1$s",
- :manager_help_commands => <<EOH ,
-Es gibt diese 'ruwiki'-Befehle:
-
- ruwiki install Standard-Entwicklungspaket installieren.
- ruwiki package Ruwiki-Installation einpacken.
- ruwiki unpackage Ruwiki-Installation auspacken.
- ruwiki service Win32::Service für Ruwiki verwalten.
-
-EOH
- :manager_help_help => <<-EOH ,
-Diese Hilfsnachricht zeigt, wie man mehr Informationen zu diesem
-Kommandozeilenwerkzeug erhalten kann:
-
- ruwiki help commands Alle 'ruwiki' Befehle anzeigen.
- ruwiki help <BEFEHL> Hilfe zu <BEFEHL> zeigen.
- (e.g., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Fehlender Parameter für Option: %1$s",
- :manager_dest_not_directory => "Das Ziel (%1$s) ist kein Verzeichnis.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPTIONEN] [--to ZIEL]
-
-Erzeugt eine neue Ruwiki-Instanz. Standardmäßig installiert dies die Daten,
-Schablonen und eine Standard-Konfigurationsdatei im derzeitigen Verzeichnis.
-Das Ziel kann mit --to geändert werden, und was installiert werden soll mit
-der OPTIONEN-Liste. Die Elemente der OPTIONEN-Liste dürfen durch Leerzeichen,
-Komma oder Semikola getrennt werden. Daher haben
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-alle die gleiche Wirkung. Die Groß-/Kleinschreibung spielt keine Rolle.
-Die OPTIONEN sind:
-
- servlet # Den Ruwiki servlet stub installieren
- service # Den Ruwiki Win32::Service stub installieren
- CGI # Das Ruwiki CGI-Skript installieren
- data # Ruwiki-Daten, Schablonen, und Konfiguration installieren
-
-Optionen können durch voranstellen von '-' oder 'no' abgeschaltet werden:
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-Dies würde das CGI-Skript, nicht aber die Daten installieren.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [QUELL] [--output PAKET] [--replace]
- ruwiki package [QUELL] [-o PAKET] [--replace]
-
-Packt die Ruwiki-Dateien (Daten, Schablonen und Programme) vom angegebenen
-QUELL-Verzeichnis oder dem derzeitigen Verzeichnis in das angegebene Paket
-(oder "./%1$s"). Sollte QUELL eine Ruwuki-Konfigurationsdatei sein (z.B.
-"%2$s"), dann wird sie verwendet, um Ort und Name der Daten- und Schablonen-
-Verzeichnisse zu erfahren.
-
- MERKE: Der Einpack-Prozess normalisiert die Daten- und Schablonen-
- Verzeichnisnamen relativ zum Einpackverzeichnis. Es werden
- niemals absolute Pfade sein.
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [QUELL] [--output VERZEICHNIS]
- ruwiki unpackage [QUELL] [-o VERZEICHNIS]
-
-Entpackt das gegebene Rukwiki-Paket (Standard: "./%1$s") in das angebene
-Verzeichnis (oder ".").
-EOH
- :manager_service_broken => "Kann keinen Win32-Service verwalten, wenn Win32::Service nicht installiert ist.",
- :manager_service_lo_argcount => "Ungenügene Parameteranzahl: %1$s",
- :manager_service_hi_argcount => "Zu viele Parameter: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NAME [BESCHREIBUNG] [Optionen]
- ruwiki service start NAME
- ruwiki service stop NAME
- ruwiki service delete NAME
-
-Verwaltet das Ruwiki WEBrick servlet als Windows-Service. Der Service muss
-benannt (NAME) sein. install unterstützt folgende zusätzliche Optionen:
-
- --rubybin RUBYPFAD Der Pfad zum Ruby-Binärverzeichnis.
- --exec SERVICEPFAD Der Pfad zum Service-Programm.
- --home PFADNACHAHAUSE Der Pfad zum Heimverzeichnis.
-EOH
- :manager_package_exists => "Das Paket %1$s existiert bereits.",
- :manager_service_installed => "Service %1$s installiert.",
- :manager_one_moment => "Moment, %1$s ...",
- :manager_service_started => "Service %1$s gestartet.",
- :manager_service_stopped => "Service %1$s gestoppt.",
- :manager_service_deleted => "Service %1$s gelöscht.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Verwendung: %1$s [Optionen]",
- :runner_general_options => "Allgemeine Optionen:",
- :runner_saveconfig_desc => [ "Sichert die Konfiguration nach FILENAME",
- "und beendet. Falls FILENAME nicht",
- "gegben ist, wird die Standardkonfig-",
- "urationsdatei verwendet. Alle Optionen",
- "werden von der bestehenen Konfiguration",
- "und der Kommandozeile und gesichert.",
- "Das Servlet wird nicht gestartet.",
- "Der Standardname ist:" ],
- :runner_config_desc => [ "Standardkonfiguration von FILENAME",
- "statt der Standardkonfigurationsdatei",
- "lesen. Optionen die bislang gesetzt",
- "wurden werden zu den Werten, die in der",
- "Konfigurationsdatei stehen,",
- " zurückgesetzt." ],
- :runner_webrick_options => "WEBrick-Optionen:",
- :runner_port_desc => [ "Lässt das Ruwiki-Servlet auf dem gegebenen",
- "Port laufen. Standard: 8808." ],
- :runner_address_desc => [ "Schränkt das Ruwiki-Servlet so ein, dass",
- "es nur die (Komma-separierten) Adressen",
- "akzepiert. Kann mehrfach angegeben werden",
- "Standardmäßig wird nicht eingeschränkt." ],
- :runner_local_desc => [ "Lässt das Ruwiki-Servlet nur lokale",
- "Verbindungen akzeptieren (127.0.0.1).",
- "Hebt vorige -A Adressen auf." ],
- :runner_mountpoint_desc => [ "Die relative URI unter der Ruwiki",
- 'zugreifbar wird. Standard: "/".' ],
- :runner_log_desc => [ "Protokolliere WEBrick. Standard ist --log." ],
- :runner_logfile_desc => [ "Die Datei, in die das WEBrick-Protokoll",
- "geschrieben wird. Standard: Standard-",
- "fehlerausgabe." ],
- :runner_threads_desc => [ "Setzt den WEBrick-Threadcount." ],
- :runner_ruwiki_options => "Ruwiki-Optionen:",
- :runner_language_desc => [ 'Wählt die Oberflächensprache für Ruwiki.',
- 'Standard: "en". Kann "en", "de", oder',
- '"es" sein.' ],
- :runner_webmaster_desc => [ 'Die Ruwiki-Wwebmaster Email-Adresse.',
- 'Standard: "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Aktiviert Ruwuki-Debugging. Standard:',
- '--no-debug.' ],
- :runner_title_desc => [ 'Gibt den Ruwiki-Titel an. Standard ist',
- '"Ruwiki".' ],
- :runner_defaultpage_desc => [ 'Eine andere Standardseite. Standard ist',
- '"ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'Eine andere Standardprojektseite.',
- 'Standard ist "Default".' ],
- :runner_templatepath_desc => [ 'Ort, an dem Ruwiki-Schablonen sind.',
- 'Standard ist "./templates".' ],
- :runner_templatename_desc => [ 'Name der Ruwiki-Schablonen. Default',
- 'Standard ist "default".' ],
- :runner_cssname_desc => [ 'Name der CSS-Datei im Schablonenpfad',
- 'Standard ist "ruwiki.css".' ],
- :runner_storage_desc => [ 'Wähle den Speichertyp:' ],
- :runner_datapath_desc => [ 'Ort, an dem Datendateien gespeichert sind.',
- 'Standard ist "./data".' ],
- :runner_extension_desc => [ 'Dateierweiterung für Datendateien.',
- 'Standard ist "ruwiki".' ],
- :runner_central_desc => [ 'Lässt Ruwiki mit den Daten des Standard-',
- 'RubyGem-Orts laufen .' ],
- :runner_general_info => "Allgemeine Information:",
- :runner_help_desc => [ "Zeigt diesen Text an." ],
- :runner_version_desc => [ "Zeigt die Ruwuki-Version." ],
- :runner_rejected_address => "Adresse %1$s abgewiesen. Nur Verbindungen von %2$s werden akzeptiert.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-WEBrick-Optionen:
- Port %2$d
- Erlaubte Adressen %3$s
- Mount Point %4$s
- Protokollieren? %5$s
- Protokollpfad %6$s
- Threads %7$s
-
-Ruwiki-Options:
- Webmaster %8$s
- Debugging? %9$s
- Titel %10$s
- Standardprojekt %11$s
- Standardseite %12$s
- Schablonenpfad %13$s
- Schablone %14$s
- CSS-Datei %15$s
-
- Speichertyp %16$s
- Datenpfad %17$s
- Dateierweiterung %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/lang/en.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/lang/en.rb
deleted file mode 100644
index de0771a..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/lang/en.rb
+++ /dev/null
@@ -1,334 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::EN is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module EN
- Message = Hash.new { |hh, kk| hh[kk] = "Language ERROR: Unknown message key #{kk.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Backend %1$s is unknown.",
- :cannot_create_project => "Cannot create project %1$s: %2$s",
- :cannot_destroy_project => "Cannot destroy project %1$s: %2$s",
- :cannot_destroy_topic => "Cannot destroy %1$s::%2$s: %3$s",
- :cannot_obtain_lock => "Unable to obtain a lock on %1$s::%2$s. Try again shortly.",
- :cannot_release_lock => "Unable to release the lock on %1$s::%2$s. Try again shortly.",
- :cannot_retrieve_topic => "Cannot retrieve %1$s::%2$s: %3$s",
- :cannot_store_topic => "Cannot store %1$s::%2$s: %3$s",
- :cannot_list_topics => "Cannot list topics for project %1$s: %2$s",
- :error_creating_lock => "Error creating lock on %1$s::%2$s: %3$s",
- :error_releasing_lock => "Error releasing lock on %1$s::%2$s: %3$s",
- :flatfiles_no_data_directory => "The data directory (%1$s) does not exist.",
- :no_access_list_projects => "No permission to list projects.",
- :no_access_list_topics => "No permission to list topics in project %1$s.",
- :no_access_to_create_project => "No permission to create project %1$s.",
- :no_access_to_destroy_project => "No permission to destroy project %1$s::%2$s.",
- :no_access_to_destroy_topic => "No permission to destroy topic %1$s::%2$s.",
- :no_access_to_read_topic => "No permission to retrieve the %1$s::%2$s.",
- :no_access_to_store_topic => "No permission to store the %1$s::%2$s.",
- :page_not_in_backend_format => "%1$s::%2$s is not in the format supported by the backend %3$s.",
- :project_already_exists => "Project %1$s already exists.",
- :project_does_not_exist => "Project %1$s does not exist.",
- :search_project_fail => "Failure searching project %1$s with string %2$s.",
- :yaml_requires_182_or_higher => "YAML flatfile support exists only for Ruby version 1.8.2 or higher.",
- :not_editing_current_version => <<EOM ,
-You have submitted an old version of %1$s::%2$s. The differences between
-your version and the current version of this page have been merged.
-Conflicting lines have both lines shown. Please ensure that you have edited
-the entire page before saving again.
-EOM
- :no_empty_search_string => <<EOM ,
-The search field may not be empty. Please enter something in the search box
-before pressing the search button.
-EOM
- :page_is_locked => "The page is locked for editing. Please wait a few minutes and try again.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Configuration must be of class Ruwiki::Config.",
- :invalid_template_dir => "The specified path for templates (%1$s) does not exist or is not a directory.",
- :no_template_found => "No template of %1$s found in template set %2$s.",
- :no_template_set => "There is no template set '%1$s' in the template path.",
- :no_webmaster_defined => "Configuration error: Webmaster is unset.",
- # Miscellaneous messages.
- :complete_utter_failure => "Complete and Utter Failure",
- :editing => "Editing",
- :error => "Error",
- :invalid_path_info_value => "Something has gone seriously wrong with the web environment. PATH_INFO = %1$s",
- :render_arguments => "Ruwiki#render must be called with zero or two arguments.",
- :unknown_feature => "Unknown feature %1$s.",
- :topics_for_project => "Topics for Project ::%1$s",
- :project_topics_link => "(topics)",
- :wiki_projects => "Projects in %1$s",
- :no_projects => "No known projects.",
- :no_topics => "No topics in project %1$s.",
- :search_results_for => "= Search results for: %1$s",
- :number_of_hits => "%1$d Hits",
-
- # Labels
- :label_search_project => "Search Project",
- :label_search_all => "All",
- :label_search => "Search: ",
- :label_project => "Project: ",
- :label_topic => "Topic: ",
- :label_edit => "Edit",
- :label_recent_changes => "Recent Changes",
- :label_topics => "Topics",
- :label_projects => "Projects",
- :label_editing => "Editing",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Edit Comment: ",
- :label_comment_accelerator => "O",
- :label_save => "Save",
- :label_save_accelerator => "S",
- :label_cancel => "Cancel",
- :label_cancel_accelerator => "C",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Original Text",
- :label_raw => "Raw",
- :label_formatted => "Formatted",
- :label_send_report_by => "Send the Wiki maintainer a report by email.",
- :label_send_report => "Send report.",
- :label_saved_page => "Saved page: ",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Usage: %1$s [options] <directory>+",
- :converter_format_desc => [ "Converts encountered files (regardless",
- "of the current format), to the specified",
- "format. Default is flatfiles. Allowed",
- "formats are: yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Create backups of upgraded files.",
- "Default is --backup." ],
- :converter_backupext_desc => [ 'Specify the backup extension. Default',
- 'is "~", which is appended to the data',
- 'filename.' ],
- :converter_backupext_error => "The backup extension must not be empty.",
- :converter_extension_desc => [ "Specifies the extension of Ruwiki data",
- "files. The default is .ruwiki" ],
- :converter_extension_error => "The extension must not be empty.",
- :converter_noextension_desc => [ "Indicates that the Ruwiki data files",
- "have no extension." ],
- :converter_quiet_desc => [ "Runs quietly. Default is to run with",
- "normal messages." ],
- :converter_language_desc => [ "Sets the language to LANG. Defaults",
- "to en (English). Known languages",
- "are: en es de" ],
- :converter_verbose_desc => [ "Runs with full message. Default is to",
- "run with normal messages." ],
- :converter_help_desc => [ "Shows this text." ],
- :converter_num_arguments => "Error: not enough arguments.",
- :converter_directory => "directory",
- :converter_converting_from => "converting from %1$s to %2$s ... ",
- :converter_done => "done.",
- :converter_not_ruwiki => "not a Ruwiki file; skipping.",
- :converter_nosave_modified => "cannot save modified %1$s.",
- :converter_page_format_error => "Error: Cannot detect the page format.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Unknown command: %1$s",
- :manager_help_commands => <<EOH ,
-The commands known to 'ruwiki' are:
-
- ruwiki install Installs the default deployment package.
- ruwiki package Packages a Ruwiki installation.
- ruwiki unpackage Unpackages a Ruwiki installation.
- ruwiki service Manages a Win32::Service for Ruwiki.
-
-EOH
- :manager_help_help => <<-EOH ,
-This is a basic help message containing pointers to more information on how
-to use this command-line tool. Try:
-
- ruwiki help commands list all 'ruwiki' commands
- ruwiki help <COMMAND> show help on <COMMAND>
- (e.g., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Missing parameter for option: %1$s",
- :manager_dest_not_directory => "The destination (%1$s) is not a directory.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPTIONS] [--to DEST]
-
-Creates a new Ruwiki instance. By default this installs the data, templates,
-and a default configuration file to the current directory. The destination
-can be changed with the --to option, and what is installed can be specified
-with the OPTIONS list. The OPTIONS list may be space, comma, or semi-colon
-separated. Thus,
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-are all equivalent. The options may be specified in any case. The
-installation OPTIONS are:
-
- servlet # Installs the Ruwiki servlet stub
- service # Installs the Ruwiki Win32::Service stub
- CGI # Installs the Ruwiki CGI script
- data # Installs the Ruwiki data, templates, and configuration
-
-Options may be disabled with by prepending a dash or 'no':
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-These will install the CGI script but not the data.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [SOURCE] [--output PACKAGE] [--replace]
- ruwiki package [SOURCE] [-o PACKAGE] [--replace]
-
-Packages the Ruwiki files (data, templates, and executables) from the
-specified SOURCE or the current directory into the specified output package
-(or "./%1$s"). If the SOURCE is a ruwiki configuration file (e.g.,
-"%2$s"), then that will be used to determine the location and name of
-the data and template directories.
-
- NOTE: The packaging process will normalize the data and templates
- directory names to be relative to the unpacking directory. They
- will NEVER be absolute paths.
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [SOURCE] [--output DIRECTORY]
- ruwiki unpackage [SOURCE] [-o DIRECTORY]
-
-Unpackages the provided Ruwiki package (default "./%1$s") into the
-specified directory (default ".").
-EOH
- :manager_service_broken => "Cannot manage a Win32 service if Win32::Service is not installed.",
- :manager_service_lo_argcount => "Insufficient arguments: %1$s",
- :manager_service_hi_argcount => "Too many arguments: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NAME [DESCRIPTION] [options]
- ruwiki service start NAME
- ruwiki service stop NAME
- ruwiki service delete NAME
-
-Manages the Ruwiki WEBrick servlet as a Windows service. The service must be
-NAMEd. install supports the following additional options:
-
- --rubybin RUBYPATH The path to the Ruby binary.
- --exec SERVICEPATH The path to the service executable.
- --home PATHTOHOME The path to the home directory.
-EOH
- :manager_package_exists => "Package %1$s already exists.",
- :manager_service_installed => "%1$s service installed.",
- :manager_one_moment => "One moment, %1$s ...",
- :manager_service_started => "%1$s service started.",
- :manager_service_stopped => "%1$s service stopped.",
- :manager_service_deleted => "%1$s service deleted.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Usage: %1$s [options]",
- :runner_general_options => "General options:",
- :runner_saveconfig_desc => [ "Saves the configuration to FILENAME and",
- "exit. If FILENAME is not used, then the",
- "default configuration file will be",
- "used. All options will be read from the",
- "existing configuration file and the",
- "command-line and saved. The servlet",
- "will not start. The default name is:" ],
- :runner_config_desc => [ "Read the default configuration from",
- "FILENAME instead of the default config",
- "file. Options set until this point will",
- "be reset to the values from those read",
- "configuration file." ],
- :runner_webrick_options => "WEBrick options:",
- :runner_port_desc => [ "Runs the Ruwiki servlet on the specified",
- "port. Default 8808." ],
- :runner_address_desc => [ "Restricts the Ruwiki servlet to accepting",
- "connections from the specified address or",
- "(comma-separated) addresses. May be",
- "specified multiple times. Defaults to all",
- "addresses." ],
- :runner_local_desc => [ "Restricts the Ruwiki servlet to accepting",
- "only local connections (127.0.0.1).",
- "Overrides any previous -A addresses." ],
- :runner_mountpoint_desc => [ "The relative URI from which Ruwiki will",
- 'be accessible. Defaults to "/".' ],
- :runner_log_desc => [ "Log WEBrick activity. Default is --log." ],
- :runner_logfile_desc => [ "The file to which WEBrick logs are",
- "written. Default is standard error." ],
- :runner_threads_desc => [ "Sets the WEBrick threadcount." ],
- :runner_ruwiki_options => "Ruwiki options:",
- :runner_language_desc => [ 'The interface language for Ruwiki.',
- 'Defaults to "en". May be "en", "de", or',
- '"es".' ],
- :runner_webmaster_desc => [ 'The Ruwiki webmaster email address.',
- 'Defaults to "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Turns on Ruwiki debugging. Defaults',
- 'to --no-debug.' ],
- :runner_title_desc => [ 'Provides the Ruwiki title. Default is',
- '"Ruwiki".' ],
- :runner_defaultpage_desc => [ 'An alternate default page. Default is',
- '"ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'An alternate default project. Default is',
- '"Default".' ],
- :runner_templatepath_desc => [ 'The location of Ruwiki templates. Default',
- 'is "./templates".' ],
- :runner_templatename_desc => [ 'The name of the Ruwiki templates. Default',
- 'is "default".' ],
- :runner_cssname_desc => [ 'The name of the CSS file in the template',
- 'path. Default is "ruwiki.css".' ],
- :runner_storage_desc => [ 'Select the storage type:' ],
- :runner_datapath_desc => [ 'The path where data files are stored.',
- 'Default is "./data".' ],
- :runner_extension_desc => [ 'The extension for data files.',
- 'Default is "ruwiki".' ],
- :runner_central_desc => [ 'Runs Ruwiki with the data in the default',
- 'RubyGem location.' ],
- :runner_general_info => "General info:",
- :runner_help_desc => [ "Shows this text." ],
- :runner_version_desc => [ "Shows the version of Ruwiki." ],
- :runner_rejected_address => "Rejected peer address %1$s. Connections are only accepted from %2$s.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-WEBrick options:
- Port %2$d
- Accepted Addresses %3$s
- Mount Point %4$s
- Logging? %5$s
- Log Destination %6$s
- Threads %7$s
-
-Ruwiki options:
- Webmaster %8$s
- Debugging? %9$s
- Title %10$s
- Default Project %11$s
- Default Page %12$s
- Template Path %13$s
- Template Set %14$s
- CSS Source %15$s
-
- Storage Type %16$s
- Data Path %17$s
- Extension %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/lang/es.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/lang/es.rb
deleted file mode 100644
index 4a9ee2a..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/lang/es.rb
+++ /dev/null
@@ -1,339 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Mauricio Julio Fernández Pradier (batsman.geo@yahoo.com)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::ES is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module ES
- Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Identificador de mensaje desconocido: #{kk.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Backend %1$s desconocido.",
- :cannot_create_project => "No pudo crearse el proyecto %1$s: %2$s",
- :cannot_destroy_project => "No pudo borrarse el proyecto %1$s: %2$s",
- :cannot_destroy_topic => "No pudo borrarse %1$s::%2$s: %3$s",
- :cannot_obtain_lock => "No pudo obtenerse el cerrojo para %1$s::%2$s. Reinténtelo de nuevo en breve.",
- :cannot_release_lock => "No pudo liberarse el cerrojo para %1$s::%2$s. Reinténtelo de nuevo en breve.",
- :cannot_retrieve_topic => "No pudo obtenerse %1$s::%2$s: %3$s",
- :cannot_store_topic => "No pudo almacenarse %1$s::%2$s: %3$s",
- :cannot_list_topics => "No se pudo listar los temas del proyecto %1$s: %2$s",
- :error_creating_lock => "Error al crear el cerrojo para %1$s::%2$s: %3$s",
- :error_releasing_lock => "Error al liberar el cerrojo para %1s::%2$s: %3$s",
- :flatfiles_no_data_directory => "El directorio de datos (%1$s) no existe.",
- :no_access_list_projects => "Permiso denegado al listar los proyectos.",
- :no_access_list_topics => "Permiso denegado al listar los temas del proyecto %1$s.",
- :no_access_to_create_project => "Permiso denegado al crear el proyecto %1$s.",
- :no_access_to_destroy_project => "Permiso denegado al borrar el proyecto %1$s::%2$s.",
- :no_access_to_destroy_topic => "Permiso denegado al borrar el borrar el tema %1$s::%2$s.",
- :no_access_to_read_topic => "Permiso denegado al acceder a %1$s::%2$s.",
- :no_access_to_store_topic => "Permiso denegado al almacenar %1$s::%2$s.",
- :page_not_in_backend_format => "%1$s::%2$s no está en un formato soportado por el backend %3$s.",
- :project_already_exists => "El proyecto %1$s ya existe.",
- :project_does_not_exist => "El proyecto %1$s no existe.",
- :search_project_fail => "Error al buscar la cadena %2$s en el proyecto %1$s.",
- :yaml_requires_182_or_higher => "El soporte para archivos YAML sólo está disponible en Ruby versión 1.8.2 o superior.",
- :not_editing_current_version => <<EOM ,
-Ha enviado una versión antigua de %1$s::%2$s. Las diferencias entre su versión
-y la actual han sido fusionadas. En caso de conflicto, las líneas de ambas
-versiones serán mostradas. Asegúrese de editar la página en su totalidad
-antes de salvar de nuevo.
-EOM
- :no_empty_search_string => <<EOM ,
-El campo de búsqueda no puede estar vacío. Por favor introduzca el texto
-a buscar antes de pulsar sobre el botón de búsqueda.
-EOM
- :page_is_locked => "La pagina no puede ser editada al estar bloqueada en este momento. Por favor espere unos minutos y vuelva a intentar.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "La configuración debe ser de clase Ruwiki::Config.",
- :invalid_template_dir => "El path para plantillas (%1$s) no existe o no es un directorio.",
- :no_template_found => "No pudo encontrarse la plantilla para %1$s en el conjunto %2$s.",
- :no_template_set => "No pudo encontrarse el conjunto de plantillas '%1$s' en el path.",
- :no_webmaster_defined => "Error de configuración: Webmaster no está definido.",
- # Miscellaneous messages.
- :complete_utter_failure => "Error catastrófico",
- :editing => "Edición",
- :error => "Error",
- :invalid_path_info_value => "Algo huele a podrido en su entorno Web. PATH_INFO = %1$s",
- :render_arguments => "Ruwiki#render debe ser llamado con cero o dos argumentos.",
- :unknown_feature => "Característica desconocida: %1$s.",
- :topics_for_project => "Temas del Proyecto ::%1$s",
- :project_topics_link => "(temas)",
- :wiki_projects => "Proyectos en %1$s",
- :no_projects => "Ningún proyecto.",
- :no_topics => "El proyecto %1$s no tiene nigún tema.",
- :search_results_for => "= Resultados de la búsqueda de: %1$s",
- :number_of_hits => "%1$d Resultados",
-
- # Labels
- :label_search_project => "Buscar en projecto",
- :label_search_all => "Todo",
- :label_search => "Buscar: ",
- :label_project => "Proyecto: ",
- :label_topic => "Tema: ",
- :label_edit => "Editar",
- :label_recent_changes => "Cambios recientes",
- :label_topics => "Temas",
- :label_projects => "Proyectos",
- :label_editing => "Edición",
- :label_text => "Texto:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Editar Comentario: ",
- :label_comment_accelerator => "O",
- :label_save => "Salvar",
- :label_save_accelerator => "S",
- :label_cancel => "Cancelar",
- :label_cancel_accelerator => "C",
- :label_preview => "Previsualizar",
- :label_preview_accelerator => "P",
- :label_original_text => "Text Original",
- :label_raw => "Crudo",
- :label_formatted => "Formateado",
- :label_send_report_by => "Enviar notificación al administrador del Wiki por email.",
- :label_send_report => "Enviar notificación.",
- :label_saved_page => "Página salvada: ",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Modo de empleo: %1$s [opciones] <dir.>",
- :converter_format_desc => [ "Convertir los ficheros encontrados",
- "(independientemente de su formato), al",
- "formato especificado; por defecto ",
- "archivos planos. Formatos permitidos:",
- " yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Crear copias de seguridad de ficheros ",
- "actualizados. La opción por defecto es ",
- "--backup." ],
- :converter_backupext_desc => [ 'Especificar la extensión para las copias',
- 'de seguridad (por defecto "~") que se',
- 'añade al nombre del fichero de datos' ],
- :converter_backupext_error => [ "La extensión para copias de seguridad",
- "no debe estar vacía." ],
- :converter_extension_desc => [ "Especifica la extensión de los ficheros",
- "de datos de Ruwiki (por defecto .ruwiki)" ],
- :converter_extension_error => "La extensión no debe estar vacía.",
- :converter_noextension_desc => [ "Indica que los ficheros de datos de",
- "Ruwiki no tienen ninguna extensión." ],
- :converter_quiet_desc => [ "Ejecución silenciosa. Por defecto se ",
- "ejecuta con mensajes normales." ],
- :converter_language_desc => [ "Especifica el idioma a emplear con LANG.",
- "Por defecto 'en' (inglés).",
- "Idiomas disponibles: en es de" ],
- :converter_verbose_desc => [ "Información detallada de ejecución.",
- "Por defecto se ejecuta con un nivel de ",
- "detalle inferior." ],
- :converter_help_desc => [ "Mostrar este texto." ],
- :converter_num_arguments => "Error: número de argumentos insuficiente.",
- :converter_directory => "directorio",
- :converter_converting_from => "convertiendo de %1$s a %2$s ... ",
- :converter_done => "hecho.",
- :converter_not_ruwiki => "no es un fichero de Ruwiki; ignorando.",
- :converter_nosave_modified => "no pudo salvarse %1$s.",
- :converter_page_format_error => "Error: No pudo detectarse el formato de la página.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Comando desconocido: %1$s",
- :manager_help_commands => <<EOH ,
-Los comandos reconocidos por 'ruwiki' son:
-
- ruwiki install Instala el entorno por defecto.
- ruwiki package Empaqueta una instalación de Ruwiki.
- ruwiki unpackage Desempaqueta una instalación de Ruwiki.
- ruwiki service Gestiona un Win32::Service para Ruwiki.
-
-EOH
- :manager_help_help => <<-EOH ,
-Este es un mensaje de ayuda básico con referencias a información suplementaria
-relativa a esta herramienta de la línea de comandos. Intente:
-
- ruwiki help commands mostrar todos los comandos de ruwiki
- ruwiki help <COMANDO> mostrar ayuda sobre <COMANDO>
- (p.ej., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Falta parámetro para la opción: %1$s",
- :manager_dest_not_directory => "El destino (%1$s) no es un directorio.",
- :manager_service_broken => "No pudo crearse un servicio de Win32 al no estar instalado Win32::Service.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPCIONES] [--to DEST]
-
-Crea una instancia de Ruwiki. Por defecto, se instala los ficheros de datos,
-plantillas y la configuración por defecto en el directorio actual. El destino
-puede ser cambiado con la opción --to, y los elementos a instalar con la lista
-de OPCIONES, que puede ser delimitada por espacios, comas o puntos y comas.
-Así pues,
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-son equivalentes. Las opciones pueden especificarse en mayúsculas/minúsculas.
-Las opciones de instalación son:
-
- servlet # Instala el stub para el servlet Ruwiki
- service # Instala el stub para el Win32::Service Ruwiki
- CGI # Instala el script CGI Ruwiki
- data # Instala los datos, plantillas y configuración de Ruwiki
-
-Las opciones pueden deshabilitarse precediéndolas de un guión o 'no':
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-instalarán el script CGI pero no los datos.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [FUENTE] [--output PAQUETE] [--replace]
- ruwiki package [FUENTE] [-o PAQUETE] [--replace]
-
-Empaqueta los ficheros de Ruwiki (datos, plantillas y ejecutables) de la
-FUENTE especificada o el directorio actual en el archivo de salida
-especificado (o "../%1$s"). Si la FUENTE es un fichero de configuración
-de rukiwi (p.ej. "%2$s"), será empleado para determinar la localización
-y el nombre de los directorios de datos y plantillas.
-
- NOTA: El proceso de empaquetado normaliza los nombres de los
- ficheros de datos y plantillas para que sean relativos al
- directorio de desempaquetado. NUNCA serán paths absolutos.
-
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [FUENTE] [--output DIRECTORIO]
- ruwiki unpackage [FUENTE] [-o DIRECTORIO]
-
-Desempaqueta el paquete de Ruwiki provisto (por defecto "./%1$s")
-en el directorio indicado (por defecto ".").
-EOH
- :manager_service_lo_argcount => "Argumentos insuficientes: %1$s",
- :manager_service_hi_argcount => "Demasiados argumentos: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NOMBRE [DESCRIPCION] [opciones]
- ruwiki service start NOMBRE
- ruwiki service stop NOMBRE
- ruwiki service delete NOMBRE
-
-Gestiona el servlet Ruwiki para WEBrick como un servicio de Windows, bajo el
-NOMBRE indicado. install soporta además las opciones siguientes:
-
- --rubybin RUBYPATH Path del ejecutable Ruby.
- --exec SERVICEPATH Path del ejecutable del servicio.
- --home PATHTOHOME Path del directorio home.
-EOH
- :manager_package_exists => "El paquete %1$s ya existe.",
- :manager_service_installed => "Servicio %1$s instalado.",
- :manager_one_moment => "Un momento, %1$s ...",
- :manager_service_started => "Servicio %1$s iniciado.",
- :manager_service_stopped => "Servicio %1$s parado.",
- :manager_service_deleted => "Servicio %1$s borrado.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Modo de empleo: %1$s [opciones]",
- :runner_general_options => "Opciones generales:",
- :runner_saveconfig_desc => [ "Salvar la configuración en FILENAME y",
- "salir. Si no se emplea FILENAME, la",
- "configuración por defecto será usada.",
- "Todas las opciones serán leídas del",
- "fichero existente y de la línea de",
- "comandos y salvadas. El servlet no se",
- "arrancará. El nombre por defecto es:" ],
- :runner_config_desc => [ "Leer la configuración por defecto de",
- "FILENAME en vez del fichero por defecto",
- "Las opciones especificadas anteriormente",
- "serán sobrescritas" ],
- :runner_webrick_options => "Opciones de WEBrick:",
- :runner_port_desc => [ "Ejecutar el servlet Ruwiki en el puerto",
- "especificado; por defecto 8808." ],
- :runner_address_desc => [ "Aceptar únicamente conexiones desde las",
- "direcciones especificadas (separadas por",
- "comas). Puede usarse repetidamente. Por",
- "defecto todas las direcciones serán",
- "aceptadas" ],
- :runner_local_desc => [ "Aceptar únicamente conexiones locales",
- "(127.0.0.1). Anula las direcciones",
- "indicadas previamente en -A" ],
- :runner_mountpoint_desc => [ "URI relativo en el que Ruwiki estará",
- 'accesible. Por defecto "/".' ],
- :runner_log_desc => [ "Realizar log de la actividad de WEBrick.",
- "Por defecto se usa --log." ],
- :runner_logfile_desc => [ "Fichero en el que escribir los logs de",
- "WEBrick. Por defecto, el standard error." ],
- :runner_threads_desc => [ "Asigna al threadcount de WEBrick." ],
- :runner_ruwiki_options => "Opciones de Ruwiki:",
- :runner_language_desc => [ 'Idioma de la inferfaz de Ruwiki.',
- 'Por defecto "en". Puede ser "en", ',
- '"de", o "es".' ],
- :runner_webmaster_desc => [ 'Email del webmaster de Ruwiki.',
- 'Por defecto "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Activa debugging de Ruwiki. Por defecto',
- 'inhabilitado.' ],
- :runner_title_desc => 'Título del Ruwiki. Por defecto "Ruwiki".',
- :runner_defaultpage_desc => [ 'Página por defecto alternativa; por',
- 'defecto "ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'Proyecto por defecto. Por defecto',
- '"Default".' ],
- :runner_templatepath_desc => [ 'Localización de las plantillas.',
- 'Por defecto "./templates".' ],
- :runner_templatename_desc => [ 'Nombre de las plantillas. Por defecto',
- '"default".' ],
- :runner_cssname_desc => [ 'Nombre del fichero CSS en el directorio',
- 'de plantillas. Por defecto "ruwiki.css".' ],
- :runner_storage_desc => [ 'Tipo de almacenamiento:' ],
- :runner_datapath_desc => [ 'Path donde salvar los ficheros de datos.',
- 'Por defecto; "./data".' ],
- :runner_extension_desc => [ 'Extensión para ficheros de datos.',
- 'Por defecto "ruwiki".' ],
- :runner_central_desc => [ 'Ejecuta Ruwiki con los datos del',
- 'directorio RubyGem.' ],
- :runner_general_info => "Información general:",
- :runner_help_desc => [ "Muestra este texto." ],
- :runner_version_desc => [ "Muestra la versión de Ruwiki." ],
- :runner_rejected_address => "Dirección remota %1$s rechazada. Sólo se admiten conexiones desde %2$s.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-Opciones de WEBrick:
- Puerto %2$d
- Direcciones admitidas %3$s
- Punto de montaje %4$s
- Logging? %5$s
- Destino del log %6$s
- Hebras %7$s
-
-Opciones de Ruwiki:
- Webmaster %8$s
- Debugging? %9$s
- Título %10$s
- Proyecto por defecto %11$s
- Página por defecto %12$s
- Path para plantillas %13$s
- Conjunto de plantillas %14$s
- Fuente CSS %15$s
-
- Tipo de almacenamiento %16$s
- Path de datos %17$s
- Extensión %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/page.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/page.rb
deleted file mode 100644
index e94521f..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/page.rb
+++ /dev/null
@@ -1,262 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # The page class for Ruwiki. The page defines the data and meta-data for a
- # page.
-class Ruwiki::Page
- include Ruwiki::Exportable
-
- exportable_group 'ruwiki'
- # Returns the content version of the page. If the page has a greater
- # content version than this version of Ruwiki does, we should probably
- # throw an exception, because attempting to save such a page will cause
- # a loss of data. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +content-version+
- attr_reader :content_version
- exportable :content_version
- # Returns the version of Ruwiki from which this page was generated.
- # Informational only. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +version+
- attr_reader :ruwiki_version
- exportable :ruwiki_version, :name => 'version'
-
- exportable_group 'properties'
- # Returns or sets the displayed title of the page, which may differ from
- # the topic of the page. As of Ruwiki 0.8.0, this is not currently used
- # and it may disappear.
- #
- # Class:: +properties+
- # ID:: +title+
- attr_accessor :title
- exportable :title
- # Returns or sets the topic of the page, which may differ from the
- # title. This is used to set the topic on a page being saved.
- #
- # Class:: +properties+
- # ID:: +topic+
- attr_accessor :topic
- exportable :topic
- # Returns or sets the project of the page, which may differ from the
- # title. This is used to set the project on a page being saved.
- #
- # Class:: +properties+
- # ID:: +project+
- attr_accessor :project
- exportable :project
- # Returns or sets the creator of the page. Unless we know the user
- # (through the authentication mechanism, only partially implemented for
- # Ruwiki 0.9.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +creator+
- attr_accessor :creator
- exportable :creator
- # Returns or sets the creator's IP address. This should always be set.
- # It will have a value of "UNKNOWN" on the off-chance that something
- # prevents this from working.
- #
- # Class:: +properties+
- # ID:: +creator-ip+
- attr_accessor :creator_ip
- exportable :creator_ip
- # Returns or sets the date of creation.
- #
- # Class:: +properties+
- # ID:: +create-date+
- attr_accessor :create_date
- exportable :create_date
- # Returns or sets the last editor of the page. Unless we know the user
- # (through the authentication mechanism, only partially implemented for
- # Ruwiki 0.9.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +editor+
- attr_accessor :editor
- exportable :editor
- # Returns or sets the last editor's IP address. This should always be
- # set. It will have a value of "UNKNOWN" on the off-chance that
- # something prevents this from working.
- #
- # Class:: +properties+
- # ID:: +editor-ip+
- attr_accessor :editor_ip
- exportable :editor_ip
- # Returns or sets the date of the last edit.
- #
- # Class:: +properties+
- # ID:: +edit-date+
- attr_accessor :edit_date
- exportable :edit_date
- # Indicates whether the page is editable. Non-editable pages are
- # effectively static pages.
- #
- # Class:: +properties+
- # ID:: +editable+
- attr_accessor :editable
- exportable :editable
- # Indicates whether the page is indexable. Non-indexable pages are
- # invisible to compliant web robots, and their links may not be
- # followed.
- #
- # Class:: +properties+
- # ID:: +indexable+
- attr_accessor :indexable
- exportable :indexable
- # The current version of the page. The old version is always (#version
- # - 1).
- #
- # Class:: +properties+
- # ID:: +version+
- attr_accessor :version
- exportable :version
- # An array of complete tags that will appear in the HTML <HEAD> section.
- # Can be used to specify additional CSS, <META> tags, or even JavaScript
- # on a per-page basis. Currently unused.
- #
- # Class:: +properties+
- # ID:: +html-headers+
- attr_accessor :html_headers
- exportable :html_headers
- # The entropy of the page. This is a ratio of the number of lines
- # changed in the file vs. the total number of lines in the file. This
- # value is currently unused. (And, sad to say, I don't remember why
- # I included it. However, it's an interesting value that may be useful
- # in spam fighting techniques. It is currently stored in the meta-data,
- # but that may change moving forward.)
- #
- # Class:: +properties+
- # ID:: +entropy+
- attr_reader :entropy
- exportable :entropy
- # The edit comment for the current revision of the page.
- #
- # Class:: +properties+
- # ID:: +edit-comment+
- attr_accessor :edit_comment
- exportable :edit_comment
-
- exportable_group 'page'
- # The header content of the page. This is static content (in either Wiki
- # or HTML formats) that appears before the editable contents of the
- # page. If both this and Wiki-level header content are specified, this
- # will appear *after* the Wiki-level header content.
- #
- # Class:: +page+
- # ID:: +header+
- attr_accessor :header
- exportable :header
- # The footer content of the page. This is static content (in either Wiki
- # or HTML formats) that appears before the editable contents of the
- # page. If both this and Wiki-level footer content are specified, this
- # will appear *before* the Wiki-level footer content.
- #
- # Class:: +page+
- # ID:: +footer+
- attr_accessor :footer
- exportable :footer
- # The editable unformatted Wiki content of the page.
- #
- # Class:: +page+
- # ID:: +content+
- attr_accessor :content
- exportable :content
-
- # Creates a Ruwiki page. This must be created from the canonical export
- # hash.
- def initialize(exported = {})
- ruwiki = exported['ruwiki']
- @content_version = (ruwiki['content-version'] || Ruwiki::CONTENT_VERSION).to_i
- @ruwiki_version = ruwiki['version'] || Ruwiki::VERSION
-
- props = exported['properties']
- @title = props['title']
- @topic = props['topic'] || "NewTopic"
- @project = props['project'] || "Default"
- @creator = props['creator'] || ""
- @creator_ip = props['creator-ip'] || "UNKNOWN"
- @create_date = Time.at((props['create-date'] || Time.now.utc).to_i)
- @editor = props['editor'] || ""
- @editor_ip = props['editor-ip'] || "UNKNOWN"
- @edit_date = Time.at((props['edit-date'] || Time.now.utc).to_i)
- @edit_comment = props['edit-comment'] || ""
- case props['editable']
- when "false"
- @editable = false
- else
- @editable = true
- end
- case props['indexable']
- when "false"
- @indexable = false
- else
- @indexable = true
- end
- @entropy = (props['entropy'] || 0).to_f
- @html_headers = props['html-headers'] || []
- @version = (props['version'] || 0).to_i
-
- page = exported['page']
- @header = page['header'] || ""
- @content = page['content'] || ""
- @footer = page['footer'] || ""
-
- # Fix the possibility that the content might be an array of chunks.
- @content = @content.join("") if @content.kind_of?(Array)
-
- @content.gsub!(/\r/, "")
- end
-
- # Outputs the HTML version of the page.
- def to_html(markup)
- # Normalise the content, first
- @content.gsub!(/\r/, "")
- markup.parse(@content, @project)
- end
-
- # Provides the canonical export hash.
- def export
- sym = super
-
- sym.each_key do |sect|
- if sect == 'ruwiki'
- sym[sect]['content-version'] = Ruwiki::CONTENT_VERSION
- sym[sect]['version'] = Ruwiki::VERSION
- else
- sym[sect].each_key do |item|
- case [sect, item]
- when ['properties', 'create-date'], ['properties', 'edit-date']
- sym[sect][item] = sym[sect][item].to_i
- when ['properties', 'editable'], ['properties', 'indexable']
- sym[sect][item] = (sym[sect][item] ? 'true' : 'false')
- else
- sym[sect][item] = sym[sect][item].to_s
- end
- end
- end
- end
-
- sym
- end
-
- NULL_PAGE = {
- 'ruwiki' => {
- 'content-version' => Ruwiki::CONTENT_VERSION,
- 'version' => Ruwiki::VERSION
- },
- 'properties' => { },
- 'page' => { },
- }
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/servlet.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/servlet.rb
deleted file mode 100644
index 373482e..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/servlet.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'webrick'
-
-class Ruwiki::Servlet < WEBrick::HTTPServlet::AbstractServlet
- class << self
- attr_accessor :config
- end
-
- def initialize(config)
- @config = config
- end
-
- # Converts a POST into a GET.
- def do_POST(req, res)
- do_GET(req, res)
- end
-
- def do_GET(req, res)
- # Generate the reponse handlers for Ruwiki from the request and response
- # objects provided.
- wiki = Ruwiki.new(Ruwiki::Handler.from_webrick(req, res))
-
- # Configuration defaults to certain values. This overrides the defaults.
- wiki.config = Ruwiki::Servlet.config unless Ruwiki::Servlet.config.nil?
- wiki.config!
- wiki.config.logger = @config.logger
- wiki.run
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/template.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/template.rb
deleted file mode 100644
index af26151..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/template.rb
+++ /dev/null
@@ -1,553 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file is originally from rdoc by Dave Thomas (dave@pragprog.com).
-#
-# $Id$
-#++
-require 'cgi'
-
- # Ruwiki templating, based originally on RDoc's "cheap-n-cheerful" HTML
- # page template system, which is a line-oriented, text-based templating
- # system.
- #
- # Templates can contain:
- #
- # * The directive !INCLUDE!, which will include the next template from the
- # provided list. This is processed before any template substitution, so
- # repeating and optional blocks work on the values within the template
- # substitution.
- # * Substitutable variable values between percent signs (<tt>%key%</tt>).
- # Optional variable values can be preceded by a question mark
- # (<tt>%?key%</tt>).
- # * Label values between hash marks (<tt>#key#</tt>). Optional label
- # values can be preceded by a question mark (<tt>#?key#</tt>).
- # * Links (<tt>HREF:ref:name:</tt>).
- # * Repeating substitution values (<tt>[:key| stuff :]</tt>). The value of
- # +key+ may be an integer value or a range (in which case key will be
- # used as an iterator, providing the current value of key on successive
- # values), an array of scalar values (substituting each value), or an
- # array of hashes (in which case it works like repeating blocks, see
- # below). These must NOT be nested. Note that integer value counting is
- # one-based.
- # * Optional substitution values (<tt>[?key| stuff ?]</tt> or <tt>[!key|
- # stuff ?]</tt>. These must NOT be nested.
- # * Repeating blocks:
- # START:key
- # ... stuff
- # END:key
- # * Optional blocks:
- # IF:key
- # ... stuff
- # ENDIF:key
- # or:
- # IFNOT:key
- # ... stuff
- # ENDIF:key
- #
- # When generating the output, a hash of values is provided and an optional
- # hash of labels is provided. Simple variables are resolved directly from
- # the hash; labels are resolved as Symbols from the label hash or are
- # otherwise treated as variables. Labels are always resolved from a single
- # message hash.
- #
- # The +key+ for repeating blocks (one-line or multi-line) must be an array
- # of hashes. The repeating block will be generated once for each entry.
- # Blocks can be nested arbitrarily deeply.
- #
- # Optional blocks will only be generated if the test is true. IF blocks
- # test for the presence of +key+ or that +key+ is non-+nil+; IFNOT blocks
- # look for the absence or +nil+ value of +key+. IFBLANK blocks test for
- # the absence, +nil+ value, or emptiness of +key+; IFNOTBLANK blocks test
- # for the presence of +key+ and that it is neither +nil+ nor empty.
- #
- # Usage: Given a set of templates <tt>T1</tt>, <tt>T2</tt>, etc.
- #
- # values = { "name" => "Dave", "state" => "TX" }
- # fr = { :name => "Nom", :state => "Etat" }
- # en = { :name => "Name", :state => "State" }
- # tt = TemplatePage.new(T1, T2, T3)
- #
- # res = ""
- # tt.process(res, values, fr)
- # tt.process(res, values, en)
- #
-class Ruwiki::TemplatePage
- BLOCK_RE = %r{^\s*(IF|IFNOT|IFBLANK|IFNOTBLANK|ENDIF|START|END):(\w+)?}
- HREF_RE = %r{HREF:(\w+?):(\w+?):}
- LABEL_RE = %r{#(\??)(-?)(\w+?)#}
- VARIABLE_RE = %r{%(\??)(-?)(\w+?)%}
- IFLINE_RE = %r{\[([?!])(\w+?)\|(.*?)\?\]}
- BLOCKLINE_RE = %r{\[:(\w+?)\|(.*?):\]}
- INCLUDE_RE = %r{!INCLUDE!}
-
- DDLB_RES = [
- [ :check, %r{%check:(\w+?)%} ],
- [ :date, %r{%date:(\w+?)%} ],
- [ :popup, %r{%popup:(\w+?):(\w+?)%} ],
- [ :ddlb, %r{%ddlb:(\w+?):(\w+?)%} ],
- [ :vsortddlb, %r{%vsortddlb:(\w+?):(\w+?)%} ],
- [ :radio, %r{%radio:(\w+?):(\w+?)%} ],
- [ :radioone, %r{%radioone:(\w+?):(\w+?)%} ],
- [ :input, %r{%input:(\w+?):(\d+?):(\d+?)%} ],
- [ :text, %r{%text:(\w+?):(\d+?):(\d+?)%} ],
- [ :pwinput, %r{%pwinput:(\w+?):(\d+?):(\d+?)%} ],
- [ :pair, %r{%pair(\d)?:([^:]+)(\w+?)%} ]
- ]
-
- # Nasty hack to allow folks to insert tags if they really, really want to
- OPEN_TAG = "\001"
- CLOSE_TAG = "\002"
- BR = "#{OPEN_TAG}br#{CLOSE_TAG}"
-
- # A Context holds a stack of key/value pairs (like a symbol table). When
- # asked to resolve a key, it first searches the top of the stack, then the
- # next level, and so on until it finds a match (or runs out of entries).
- class Context
- def initialize
- @stack = []
- end
-
- def push(hash)
- @stack.push(hash)
- end
-
- def pop
- @stack.pop
- end
-
- # Find a scalar value, throwing an exception if not found. This method is
- # used when substituting the %xxx% constructs
- def find_scalar_raw(key)
- @stack.reverse_each do |level|
- if level.has_key?(key)
- val = level[key]
- return val unless val.kind_of?(Array)
- end
- end
- raise "Template error: can't find variable '#{key}'."
- end
-
- def find_scalar(key)
- find_scalar_raw(key) || ''
- end
-
- # Lookup any key in the stack of hashes
- def lookup(key)
- @stack.reverse_each do |level|
- return level[key] if level.has_key?(key)
- end
- nil
- end
- end
-
- # Simple class to read lines out of a string
- class LineReader
- attr_reader :lines
- def initialize(lines)
- @lines = lines
- end
-
- # read the next line
- def read
- @lines.shift
- end
-
- # Return a list of lines up to the line that matches a pattern. That last
- # line is discarded.
- def read_up_to(pattern)
- res = []
- while line = read
- if pattern.match(line)
- return LineReader.new(res)
- else
- res << line
- end
- end
- raise "Missing end tag in template: #{pattern.source}"
- end
-
- # Return a copy of ourselves that can be modified without affecting us
- def dup
- LineReader.new(@lines.dup)
- end
- end
-
- # +templates+ is an array of strings containing the templates. We start at
- # the first, and substitute in subsequent ones where the string
- # <tt>!INCLUDE!</tt> occurs. For example, we could have the overall page
- # template containing
- #
- # <html><body>
- # <h1>Master</h1>
- # !INCLUDE!
- # </body></html>
- #
- # and substitute subpages in to it by passing [master, sub_page]. This
- # gives us a cheap way of framing pages
- def initialize(*templates)
- result = templates.shift.dup
- templates.each { |content| result.sub!(INCLUDE_RE, content) }
- @lines = LineReader.new(result.split(/\r?\n/))
- end
-
- attr_reader :lines
-
- def set_options(opts = {})
- @message = opts[:messages] || {}
- @output = opts[:output] || $stdout
- end
-
- # Render templates as HTML. Compatibility method for Rublog and
- # Rdoc.
- def write_html_on(op, value_hash, message_hash = {})
- to_html(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as HTML
- def to_html(value_hash, options = {})
- set_options(options)
- esc = proc { |str| CGI.escapeHTML(str) }
- @output << process(value_hash, esc)
- end
-
- # Render templates as TeX. Compatibility method for Rublog and
- # Rdoc.
- def write_tex_on(op, value_hash, message_hash = {})
- to_tex(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as TeX
- def to_tex(value_hash, options = {})
- set_options(options)
-
- esc = proc do |str|
- str.
- gsub(/&lt;/, '<').
- gsub(/&gt;/, '>').
- gsub(/&amp;/) { '\\&' }.
- gsub(/([$&%\#{}_])/) { "\\#$1" }.
- gsub(/>/, '$>$').
- gsub(/</, '$<$')
- end
- str = ""
-
- str << process(value_hash, esc)
- @output << str
- end
-
- # Render templates as plain text. Compatibility method for Rublog and
- # Rdoc.
- def write_plain_on(op, value_hash, message_hash = {})
- to_plain(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as plain text.
- def to_plain(value_hash, options = {})
- set_options(options)
- esc = proc {|str| str}
- @output << process(value_hash, esc)
- end
-
- # Render the templates. The The <tt>value_hash</tt> contains key/value
- # pairs used to drive the substitution (as described above). The
- # +escaper+ is a proc which will be used to sanitise the contents of the
- # template.
- def process(value_hash, escaper)
- @context = Context.new
- sub(@lines.dup, value_hash, escaper).
- tr("\000", '\\').
- tr(OPEN_TAG, '<').
- tr(CLOSE_TAG, '>')
- end
-
- # Substitute a set of key/value pairs into the given template. Keys with
- # scalar values have them substituted directly into the page. Those with
- # array values invoke <tt>substitute_array</tt> (below), which examples a
- # block of the template once for each row in the array.
- #
- # This routine also copes with the <tt>IF:</tt>_key_ directive, removing
- # chunks of the template if the corresponding key does not appear in the
- # hash, and the START: directive, which loops its contents for each value
- # in an array
- def sub(lines, values, escaper)
- @context.push(values)
- skip_to = nil
- result = []
-
- while line = lines.read
- mv = line.match(BLOCK_RE)
-
- if mv.nil?
- result << expand(line.dup, escaper)
- next
- else
- cmd = mv.captures[0]
- tag = mv.captures[1]
- end
-
- case cmd
- when "IF", "IFNOT", "IFNOTBLANK", "IFBLANK"
- raise "#{cmd}: must have a key to test." if tag.nil?
-
- val = @context.lookup(tag)
- case cmd # Skip lines if the value is...
- when "IF" # false or +nil+ (not false => true)
- test = (not val)
- when "IFBLANK" # +nil+ or empty
- test = (not (val.nil? or val.empty?))
- when "IFNOT"
- test = val
- when "IFNOTBLANK" #
- test = (val.nil? or val.empty?)
- end
- lines.read_up_to(/^\s*ENDIF:#{tag}/) if test
- when "ENDIF"
- nil
- when "START"
- raise "#{cmd}: must have a key." if tag.nil?
-
- body = lines.read_up_to(/^\s*END:#{tag}/)
- inner = @context.lookup(tag)
- raise "unknown tag: #{tag}" unless inner
- raise "not array: #{tag}" unless inner.kind_of?(Array)
- inner.each { |vals| result << sub(body.dup, vals, escaper) }
- result << "" # Append the missing \n
- else
- result << expand(line.dup, escaper)
- end
- end
-
- @context.pop
-
- result.join("\n")
- end
-
- # Given an individual line, we look for %xxx%, %?xxx%, #xxx#, #?xxx#,
- # [:key| xxx :], [?key| stuff ?], [!key| stuff ?] and HREF:ref:name:
- # constructs, substituting as appropriate.
- def expand(line, escaper)
- # Generate a cross-reference if a reference is given. Otherwise, just
- # fill in the name part.
- line = line.gsub(HREF_RE) do
- ref = @context.lookup($1)
- name = @context.find_scalar($2)
-
- if ref and not ref.kind_of?(Array)
- %Q(<a href="#{ref}">#{name}</a>)
- else
- name
- end
- end
-
- # Look for optional content.
- line = line.gsub(IFLINE_RE) do
- type = $1
- name = $2
- stuff = $3
-
- case type
- when '?'
- test = @context.lookup(name)
- when '!'
- test = (not @context.lookup(name))
- end
-
- if test
- stuff
- else
- ""
- end
- end
-
- # Look for repeating content.
- line = line.gsub(BLOCKLINE_RE) do |match|
- name = $1
- stuff = $2
-
- val = @context.lookup(name)
- ss = ""
- case val
- when nil
- nil
- when Fixnum
- val.times { |ii| ss << stuff.sub(/%#{name}%/, "#{ii + 1}") }
- when Range
- val.each { |ii| ss << stuff.sub(/%#{name}%/, "#{ii}") }
- when Array
- if not val.empty? and val[0].kind_of?(Hash)
- val.each do |vv|
- @context.push(vv)
- ss << expand(stuff, escaper)
- @context.pop
- end
- else
- val.each { |ee| ss << stuff.sub(/%#{name}%/, "#{ee}") }
- end
- end
- ss
- end
-
- # Substitute in values for #xxx# constructs.
- line = line.gsub(LABEL_RE) do
- mandatory = $1.nil?
- escaped = $2.nil?
- key = $3.intern
- val = @message[key]
-
- if val.nil?
- raise "Template error: can't find label '#{key}'." if mandatory
- ""
- else
- val = val.to_s
- val = escaper.call(val) if escaped
- val.tr('\\', "\000")
- end
- end
-
- # Substitute in values for %xxx% constructs. This is made complex
- # because the replacement string may contain characters that are
- # meaningful to the regexp (like \1)
- line = line.gsub(VARIABLE_RE) do
- mandatory = $1.nil?
- escaped = $2.nil?
- key = $3
- val = @context.lookup(key)
-
- if val.nil?
- raise "Template error: can't find variable '#{key}'." if mandatory
- ""
- else
- val = val.to_s
- val = escaper.call(val) if escaped
- val.tr('\\', "\000")
- end
- end
-
- # Substitute DDLB controls:
- DDLB_RES.each do |ddlb|
- line = line.gsub(ddlb[1]) do
- self.send(ddlb[0], Regexp.last_match.captures)
- end
- end
-
- line
- rescue Exception => ex
- raise "Error in template: #{ex}\nOriginal line: #{line}\n#{ex.backtrace[0]}"
- end
-
- def check(*args)
- value = @context.find_scalar_raw(args[0])
- checked = value ? " checked" : ""
- "<input type=\"checkbox\" name=\"#{name}\"#{checked}>"
- end
-
- def vsortddlb(*args)
- ddlb(*(args.dup << true))
- end
-
- def ddlb(*args)
- value = @context.find_scalar(args[0]).to_s
- options = @context.lookup(args[1])
- sort_on = args[2] || 0
-
- unless options and options.kind_of?(Hash)
- raise "Missing options #{args[1]} for ddlb #{args[0]}."
- end
-
- res = %Q(<select name="#{args[0]}">)
-
- sorted = options.to_a.sort do |aa, bb|
- if aa[0] == -1
- -1
- elsif bb[0] == -1
- 1
- else
- aa[sort_on] <=> bb[sort_on]
- end
- end
-
- sorted.each do |key, val|
- selected = (key.to_s == value) ? " selected" : ""
- res << %Q(<option value="#{key}"#{selected}>#{val}</option>)
- end
- res << "</select>"
- end
-
- def date(*args)
- yy = "#{argv[0]}_y"
- mm = "#{argv[0]}_m"
- dd = "#{argv[0]}_d"
- %Q<#{input(yy, 4, 4)}&nbsp;.&nbsp;#{input(mm, 2, 2)}&nbsp;.&nbsp;#{input(dd, 2, 2)}>
- end
-
- def radioone(*args)
- radio(*(args.dup << ""))
- end
-
- def radio(*args)
- value = @context.find_scalar(argv[0]).to_s
- options = @context.lookup(argv[1])
- br = argv[2] || "<br />"
-
- unless options and options.kind_of?(Hash)
- raise "Missing options #{args[1]} for radio #{args[0]}."
- end
-
- res = ""
- options.keys.sort.each do |key|
- val = options[key]
- checked = (key.to_s == value) ? " checked" : ""
- res << %Q(<label>
- <input type="radio" name="#{args[0]}"
- value="#{key}"#{checked}">#{val}</label>#{br})
- end
- res
- end
-
- def text(*args)
- value = @context.find_scalar(args[0]).to_s
- %Q(<textarea name="#{args[0]}" cols="#{args[1]}" rows="#{args[2]}">
-#{CGI.escapeHTML(value)}
-</textarea>)
- end
-
- def pwinput(*args)
- input(*(args.dup << "password"))
- end
-
- def input(*args)
- name = args[0]
- value = @context.find_scalar(name).to_s
- width = args[1]
- max = args[2]
- iptype = args[3] || "text"
- %Q(<input type="#{iptype}" name="#{name}" value="#{value}" size="#{width}" maxsize="#{max}">)
- end
-
- def popup(*args)
- url = CGI.escapeHTML(@context.find_scalar(args[0]).to_s)
- text = @context.find_scalar(args[1]).to_s
- %Q|<a href="#{url}" target="Popup" class="methodtitle" onClick="popup('#{url}'); return false;">#{text}</a>|
- end
-
- def pair(*args)
- label = args[0]
- name = args[1]
- colsp = args[2]
-
- value = @context.find_scalar(name).to_s
- value = case value
- when "true" then "Yes"
- when "false" then "No"
- else value
- end
- td = (colsp.nil? or colsp.empty?) ? "<td>" : %Q{<td colspan="#{colsp}">}
- "#{Html.tag(label)}#{td}#{value}</td>"
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/utils.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/utils.rb
deleted file mode 100644
index c58a9f4..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/utils.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # So that Ruwiki doesn't have to be loaded in full to use the bloody thing.
-unless defined?(Ruwiki)
- class Ruwiki
- VERSION = "0.9.0"
- end
-end
-
-module Ruwiki::Utils
- RUN_PATH = Dir.pwd
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/utils/command.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/utils/command.rb
deleted file mode 100644
index ba7c060..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/utils/command.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # Implements the command pattern. Commands are used by the command-line
-class Ruwiki::Utils::CommandPattern
- class AbstractCommandError < Exception; end
- class UnknownCommandError < RuntimeError; end
- class CommandAlreadyExists < RuntimeError; end
- class MissingParameterError < ArgumentError
- def initialize(argument)
- @argument = argument
- end
-
- attr_reader :argument
- end
-
- class << self
- def add(command)
- command = command.new if command.kind_of?(Class)
-
- @commands ||= {}
- if @commands.has_key?(command.name)
- raise CommandAlreadyExists
- else
- @commands[command.name] = command
- end
-
- if command.respond_to?(:altname)
- unless @commands.has_key?(command.altname)
- @commands[command.altname] = command
- end
- end
- end
-
- def <<(command)
- add(command)
- end
-
- attr_accessor :default
- def default=(command) #:nodoc:
- if command.kind_of?(Ruwiki::Utils::CommandPattern)
- @default = command
- elsif command.kind_of?(Class)
- @default = command.new
- elsif @commands.has_key?(command)
- @default = @commands[command]
- else
- raise UnknownCommandError
- end
- end
-
- def command?(command)
- @commands.has_key?(command)
- end
-
- def command(command)
- if command?(command)
- @commands[command]
- else
- @default
- end
- end
-
- def [](cmd)
- self.command(cmd)
- end
-
- def default_ioe(ioe = {})
- ioe[:input] ||= $stdin
- ioe[:output] ||= $stdout
- ioe[:error] ||= $stderr
- ioe
- end
- end
-
- def [](args, opts = {}, ioe = {})
- call(args, opts, ioe)
- end
-
- def name
- raise AbstractCommandError
- end
-
- def call(args, opts = {}, ioe = {})
- raise AbstractCommandError
- end
-
- def help
- raise AbstractCommandError
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/utils/converter.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/utils/converter.rb
deleted file mode 100644
index 0261af8..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/utils/converter.rb
+++ /dev/null
@@ -1,297 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-
-module Ruwiki::Utils::Converter
- class << self
- TARGETS = %w(flatfiles yaml marshal)
-
- # Create the regular expressions that are used in Ruwiki 0.6.2
- OLD_HEADER_RE = /^\s*([a-z]+)\s*:\s*(.*)$/
- OLD_HEADER_END_RE = /^#EHDR$/
- DATA_HEADER_END_RE = /\A#EHDR\z/
- NL_RE = /\n/
-
- def with(obj)
- yield obj if block_given?
- end
-
- # Only allow this to be run once. Silently fail otherwise.
- def set_defaults
- return unless @options.nil?
- @options = OpenStruct.new
-
- with @options do |oo|
- oo.traverse_directories = true
- oo.backup_old_files = true
- oo.backup_extension = "~"
- oo.quiet = false
- oo.verbose = false
- oo.extension = 'ruwiki'
- oo.target_format = 'flatfiles'
- end
- end
-
- def message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def message(id)
- if @message[id].nil?
- []
- else
- @message[id]
- end
- end
-
- def display_options
- end
-
- def summary
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- set_defaults
-
- @input = input
- @output = output
- @error = error
-
- language = 'en'
- find_lang = argv.grep(%r{^--lang})
- find_lang.each do |ee|
- if ee =~ %r{^--lang=}
- language = ee.sub(%r{^--lang=}, '')
- else
- language = argv[argv.index(ee).succ]
- end
- end
-
- require "ruwiki/lang/#{language.downcase}"
- self.message = Ruwiki::Lang.const_get(language.upcase)
-
- argv.options do |opts|
- opts.banner = message(:converter_usage) % File.basename($0)
- opts.separator ''
- opts.on('--format=FORMAT', *message(:converter_format_desc)) do |ff|
- @options.target_format = ff
- end
- opts.on('--[no-]backup', *message(:converter_backup_desc)) do |bb|
- @options.backup_old_files = bb
- end
- opts.on('--backup-extension=EXTENSION', *message(:converter_backupext_desc)) do |ee|
- if ee.nil? or ee.empty?
- @error << message(:converter_backupext_error) << "\n" if ee.nil? or ee.empty?
- @error << "#{opts}\n"
- return 0
- end
- @options.backup_extension = ee
- end
- opts.on('--extension=EXTENSION', *message(:converter_extension_desc)) do |ee|
- if ee.nil? or ee.empty?
- @error << message(:converter_extension_error) << "\n" if ee.nil? or ee.empty?
- @error << "#{opts}\n"
- return 0
- end
- @options.extension = ee
- end
- opts.on('--no-extension', *message(:converter_noextension_desc)) do
- @options.extension = nil
- end
- opts.on('--lang=LANG', *message(:converter_language_desc)) do |lang|
- self.message = Ruwiki::Lang.const_get(lang.upcase)
- end
- opts.on('--quiet', *message(:converter_quiet_desc)) do |qq|
- @options.quiet = qq
- @options.verbose = (not qq)
- end
- opts.on('--verbose', *message(:converter_verbose_desc)) do |vv|
- @options.quiet = (not vv)
- @options.verbose = vv
- end
- opts.separator ''
- opts.on_tail('--help', *message(:converter_help_desc)) do
- @error << "#{opts}\n"
- return 0
- end
-
- opts.parse!
- end
-
- if argv.empty?
- @error << message(:converter_num_arguments) << "\n#{argv.options}\n" unless @options.quiet
- return 127
- end
-
- display_options if @options.verbose
-
- @options.target_format.capitalize!
- @options.target_format_class = Ruwiki::Backend.const_get(@options.target_format)
-
- argv.each { |file| process_file(file) }
-
- summary if not @options.quiet
- end
-
- # Process a single file.
- def process_file(file)
- if @options.backup_old_files
- return if file =~ /#{@options.backup_extension}/
- end
- @out << "#{file}: " unless @options.quiet
-
- if File.directory?(file) and @options.traverse_directories
- @out << message(:converter_directory) << "\n" unless @options.quiet
- Dir.chdir(file) { Dir['*'].each { |entry| process_file(entry) } }
- else
- begin
- page, page_format = load_page(file)
- @out << message(:converter_converting_from) % [ page_format, @options.target_format ] if @options.verbose
- save_page(file, page)
- @out << message(:converter_done) << "\n" unless @options.quiet
- rescue PageLoadException
- @out << message(:converter_not_ruwiki) << "\n" unless @options.quiet
- rescue PageSaveException
- @out << message(:cannot_nosave_modified) << "\n" % [ file ] unless @options.quiet
- end
- end
- end
-
- def load_page(file)
- data = File.read(file)
- page_format = nil
-
- if data =~ OLD_HEADER_END_RE
- page_format = 'OldFlatfiles'
-
- page = Ruwiki::Page::NULL_PAGE.dup
-
- unless data.empty?
- rawbuf = data.split(NL_RE).map { |ee| ee.chomp }
-
- loop do
- if rawbuf[0] =~ OLD_HEADER_END_RE
- rawbuf.shift
- break
- end
-
- match = OLD_HEADER_RE.match(rawbuf[0])
-
- unless match.nil?
- case match.captures[0]
- when 'topic'
- page['properties']['topic'] = match.captures[1]
- page['properties']['title'] = match.captures[1]
- when 'version'
- page['properties']['version'] = match.captures[1].to_i
- else
- nil
- end
- end
- rawbuf.shift
- end
-
- page['page']['content'] = rawbuf.join("\n")
-
- with page['properties'] do |pp|
- pp['project'] = File.basename(File.dirname(File.expand_path(file)))
- pp['editable'] = true
- pp['indexable'] = true
- pp['entropy'] = 0.0
- end
- end
- end
-
- # Try Marshal
- if page_format.nil?
- begin
- page = ::Marshal.load(data)
- page_format = 'Marshal'
- rescue Exception
- nil
- end
- end
-
- # Try YAML
- if page_format.nil?
- begin
- page = ::YAML.load(data)
- page_format = 'YAML'
- rescue Exception
- nil
- end
- end
-
- # Try the Flatfiles format
- if page_format.nil?
- begin
- page = Ruwiki::Backend::Flatfiles.load(data)
- page_format = 'Exportable'
- rescue Exception => ex
- nil
- end
- end
-
- if page_format.nil? # Cannot detect page type.
- @error << @message[:converter_page_format_error] << "\n"
- raise PageLoadException
- end
- [page, page_format]
- rescue PageLoadException
- raise
- rescue Exception => ex
- @error << %Q|#{ex.message}\n#{ex.backtrace.join("\n")}\n| if @options.verbose
- raise PageLoadException
- end
-
- def save_page(file, page)
- if @options.backup_extension != '~'
- backup = "#{file}.#{@options.backup_extension}"
- else
- backup = "#{file}#{@options.backup_extension}"
- end
-
- # Always backup the file -- we are transactional.
- FileUtils.cp(file, backup)
-
- if @options.target_format == 'Marshal'
- method = :print
- else
- method = :puts
- end
- File.open(file, 'wb') { |ff| ff.__send__(method, @options.target_format_class.dump(page)) }
- rescue Exception => ex
- FileUtils.mv(backup, file) if File.exists?(backup)
- @error << %Q|#{ex.message}\n#{ex.backtrace.join("\n")}\n| if @options.verbose
- raise PageSaveException
- ensure
- # If we aren't *supposed* to back up the file, then get rid of the
- # backup.
- if File.exists?(backup) and (not @options.backup_old_files)
- FileUtils.rm(backup)
- end
- end
-
- class PageLoadException < RuntimeError; end
- class PageSaveException < RuntimeError; end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/utils/manager.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/utils/manager.rb
deleted file mode 100644
index ef322f9..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/utils/manager.rb
+++ /dev/null
@@ -1,648 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-require 'stringio'
-require 'zlib'
-require 'ruwiki/exportable'
-require 'ruwiki/utils/command'
-require 'ruwiki/config'
-
-begin
- if defined?(Gem::Cache)
- require_gem 'archive-tar-minitar', '~> 0.5.1'
- else
- require 'archive/tar/minitar'
- end
-rescue LoadError => ex
- $stderr.puts ex.message
- raise
-end
-
-module Ruwiki::Utils::Manager
- DEFAULT_PACKAGE_NAME = 'ruwiki.pkg'
-
- def self.message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def self.message(id)
- @message[id]
- end
-
- class ManagerError < RuntimeError; end
-
- EXECUTABLES = %w(ruwiki.cgi ruwiki_servlet ruwiki_servlet.bat \
- ruwiki_servlet.cmd ruwiki_service.rb)
-
- class ManagerHelp < Ruwiki::Utils::CommandPattern
- def name
- "help"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- help_on = args.shift
- output = ""
-
- if Ruwiki::Utils::CommandPattern.command?(help_on)
- ioe[:output] << Ruwiki::Utils::CommandPattern[help_on].help
- elsif help_on == "commands"
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_help_commands)
- else
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_unknown_command) % [ help_on ] << "\n" % [ help_on ] unless help_on.nil? or help_on.empty?
- ioe[:output] << self.help
- end
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_help_help)
- end
- end
-
- class ManagerInstall < Ruwiki::Utils::CommandPattern
- def name
- "install"
- end
-
- def call(args, opts = {}, ioe = {})
- argv = []
-
- replace = false
- dest = "."
- name = nil
-
- while (arg = args.shift)
- case arg
- when '--to'
- dir = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if dir.nil?
- if File.exist?(dir)
- if not File.directory?(dir)
- raise ArgumentError, Ruwiki::Utils::Manager.message(:manager_dest_not_directory)
- end
- else
- FileUtils.mkdir_p(dir)
- end
- dest = dir
- when /;/o
- argv.push(*(arg.split(/;/o)))
- when /,/o
- argv.push(*(arg.split(/,/o)))
- else
- argv << arg
- end
- end
-
- options = { 'data' => true }
-
- while (arg = argv.shift)
- case arg
- when /^(?:-|no)(.*$)/
- options.delete($1)
- else
- options[arg] = true
- end
- end
-
- Ruwiki::Utils::Manager.install(dest, options)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_install_help)
- end
- end
-
- class ManagerPackage < Ruwiki::Utils::CommandPattern
- def name
- "package"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- argv = []
- replace = false
- dest = "."
- name = nil
-
- while (arg = args.shift)
- case arg
- when '--replace'
- replace = true
- when '-o', '--output'
- name = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if name.nil?
- dest = File.dirname(name)
- name = File.basename(name)
- else
- argv << arg
- end
- end
-
- if argv.size > 1
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_hi_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 1
- end
- source = argv.shift || "."
-
- Ruwiki::Utils::Manager.package(source, dest, name, replace)
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_package_help) % [ "./#{Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME}",
- Ruwiki::Config::CONFIG_NAME ]
- end
- end
-
- class ManagerUnpackage < Ruwiki::Utils::CommandPattern
- def name
- "unpackage"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- argv = []
- dir = "."
-
- while (arg = args.shift)
- case arg
- when '-o', '--output'
- dir = args.shift
- raise Ruwiki::Utils::CommandPatter::MissingParameterError.new(arg) if dir.nil? or not File.directory?(dir)
- else
- argv << arg
- end
- end
-
- if argv.size > 1
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_hi_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 1
- end
- source = argv.shift || Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME
-
- Ruwiki::Utils::Manager.unpackage(source, dir)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_unpackage_help) % [ "./#{Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME}" ]
- end
- end
-
- if RUBY_PLATFORM =~ /win32/
- class ManagerService < Ruwiki::Utils::CommandPattern
- def name
- "service"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
-
- if args.size < 2
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_lo_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 0
- end
-
- command = args.shift
- service = args.shift
-
- options ||= {}
- options[:service_name] = service
- options[:service_home] = File.expand_path(".")
-
- argv = []
- while (arg = args.shift)
- case arg
- when "--rubybin"
- options[:ruby_bin] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:ruby_bin].nil?
- when "--exec"
- options[:service_bin] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:service_bin].nil?
- when "--home"
- options[:service_home] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:service_home].nil?
- else
- argv << arg
- end
- end
-
- options[:service_desc] = args.join(" ") if args.size > 0
-
- case command
- when "install"
- options[:service_install] = true
- when "start"
- options[:service_start] = true
- when "stop"
- options[:service_stop] = true
- when "delete"
- options[:service_delete] = true
- else
- raise ArgumentError, Ruwiki::Utils::Manager.message(:manager_unknown_command) % [ command ]
- end
-
- Ruwiki::Utils::Manager.manage_windows_service(options, ioe)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_service_help)
- end
- end
- Ruwiki::Utils::CommandPattern << ManagerService
- end
-
- Ruwiki::Utils::CommandPattern << ManagerHelp
- Ruwiki::Utils::CommandPattern << ManagerInstall
- Ruwiki::Utils::CommandPattern << ManagerPackage
- Ruwiki::Utils::CommandPattern << ManagerUnpackage
- Ruwiki::Utils::CommandPattern.default = Ruwiki::Utils::CommandPattern["help"]
-
- class << self
- attr_accessor :shared
- attr_reader :ruwiki_servlet
- attr_reader :ruwiki_servlet_bat
- attr_reader :ruwiki_servlet_cmd
- attr_reader :ruwiki_service
- attr_reader :ruwiki_cgi
- attr_reader :ruwiki_pkg
- def shared=(shared)
- @shared = shared
- @ruwiki_servlet = File.join(@shared, "bin", "ruwiki_servlet")
- @ruwiki_servlet_bat = File.join(@shared, "bin", "ruwiki_servlet.bat")
- @ruwiki_servlet_cmd = File.join(@shared, "bin", "ruwiki_servlet.cmd")
- @ruwiki_service = File.join(@shared, "bin", "ruwiki_service.rb")
- @ruwiki_cgi = File.join(@shared, "bin", "ruwiki.cgi")
- @ruwiki_pkg = File.join(@shared, "share", "ruwiki",
- Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME)
- end
-
- def with(obj)
- yield obj if block_given?
- end
-
- def tar_files(list, name)
- ff = StringIO.new
- gz = Zlib::GzipWriter.new(ff)
- to = Archive::Tar::Minitar::Output.new(gz)
- list.each { |item| Archive::Tar::Minitar.pack_file(item, to) }
- data = ff.string
- group = {
- :name => name,
- :data => data,
- :mode => 0644,
- }
- return group
- rescue Exception => ex
- puts ex.message, ex.backtrace.join("\n")
- ensure
- to.close
- group[:size] = group[:data].size
- end
-
- def package(source, dest, name = nil, replace = false)
- # If the package name is nil, use the default name. If replace is
- # false, then append a number on the end if the file already exists.
- # Increment the number until we have a unique filename.
- if name.nil?
- pkg = File.join(dest, DEFAULT_PACKAGE_NAME)
- if File.exists?(pkg) and (not replace)
- pbn = "#{File.basename(DEFAULT_PACKAGE_NAME, '.pkg')}-%02d.pkg"
- ii = 1
- while File.exists?(pkg)
- pkg = File.join(dest, pbn % ii)
- ii += 1
- end
- end
- else
- pkg = File.join(dest, name)
- if File.exists?(pkg) and (not replace)
- raise ManagerError, Ruwiki::Utils::Manager.message(:manager_package_exists)
- end
- end
-
- files = []
-
- if File.directory?(source)
- Dir.chdir(source) do
- if File.exists?(Ruwiki::Config::CONFIG_NAME)
- cs = File.stat(Ruwiki::Config::CONFIG_NAME)
- files << {
- :name => Ruwiki::Config::CONFIG_NAME,
- :data => File.read(Ruwiki::Config::CONFIG_NAME),
- :mtime => cs.mtime,
- :mode => 0644,
- :size => cs.size
- }
- end
-
- EXECUTABLES.each do |ff|
- if File.exists?(ff)
- cs = File.stat(ff)
- files << {
- :name => ff,
- :data => File.read(ff),
- :mtime => cs.mtime,
- :mode => 0755,
- :size => cs.size
- }
- end
- end
-
- f_data = Dir["data/**/**"].select { |dd| dd !~ /CVS\// }
- f_data.unshift("data")
- f_data.map! do |dd|
- res = { :name => dd, :mode => 0644 }
- if File.directory?(dd)
- res[:mode] = 0755
- res[:dir] = true
- end
- res
- end
-
- f_tmpl = Dir["templates/**/**"].select { |tt| tt !~ /CVS\// }
- f_tmpl.unshift("templates")
- f_tmpl.map! do |tt|
- res = { :name => tt, :mode => 0644 }
- if File.directory?(tt)
- res[:mode] = 0755
- res[:dir] = true
- end
- res
- end
-
- files << tar_files(f_data, "data.pkg")
- files << tar_files(f_tmpl, "tmpl.pkg")
- end
- else
- stat = File.stat(source)
- files << {
- :name => File.basename(source),
- :data => File.read(source),
- :mtime => stat.mtime,
- :mode => 0644,
- :size => stat.size
- }
-
- EXECUTABLES.each do |ff|
- ff = File.join(File.dirname(source), ff)
- if File.exists?(ff)
- cs = File.stat(ff)
- files << {
- :name => ff,
- :data => File.read(ff),
- :mtime => cs.mtime,
- :mode => 0755,
- :size => cs.size
- }
- end
- end
-
- cc = Ruwiki::Exportable.load(files[0][:data])
- tp = cc['ruwiki-config']['template-path']
- tp = "./templates" if tp.nil? or tp.empty?
- so = cc['ruwiki-config']['storage-options']
-
- if so.nil? or so.empty?
- dp = "./data"
- else
- so = Ruwiki::Exportable.load(so)
- key = 'flatfiles'
- dp = so[key]['data-path']
- end
-
- dp = "./data" if dp.nil? or dp.empty?
- bndp = File.basename(dp)
- bntp = File.basename(tp)
-
- so[key]['data-path'] = bndp
- cc['ruwiki-config']['storage-options'] = Ruwiki::Exportable.dump(so)
- cc['ruwiki-config']['template-path'] = bntp
- files[0][:data] = Ruwiki::Exportable.dump(cc)
- files[0][:size] = files[0][:data].size
-
- Dir.chdir(File.dirname(dp)) do
- f_data = Dir["#{bndp}/**/**"].select { |dd| dd !~ /CVS\// }
- f_data.map! { |dd| { :name => dd, :mode => 0644 } }
- files << tar_files(f_data, "data.pkg")
- end
-
- Dir.chdir(File.dirname(tp)) do
- f_tmpl = Dir["#{bntp}/**/**"].select { |tt| tt !~ /CVS\// }
- f_tmpl.map! { |tt| { :name => tt, :mode => 0644 } }
- files << tar_files(f_tmpl, "tmpl.pkg")
- end
- end
-
- ff = File.open(pkg, "wb")
- gz = Zlib::GzipWriter.new(ff)
- tw = Archive::Tar::Minitar::Writer.new(gz)
-
- files.each do |entry|
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
- end
-
- nil
- rescue Exception => ex
- puts ex, ex.backtrace.join("\n")
- ensure
- tw.close if tw
- gz.close if gz
- end
-
- def unpackage(source, dest)
- ff = File.open(source, "rb")
- gz = Zlib::GzipReader.new(ff)
- Archive::Tar::Minitar::Input.open(gz) do |it|
- it.each do |entry|
- case entry.full_name
- when "data.pkg", "tmpl.pkg"
- pkg = StringIO.new(entry.read)
- pkgz = Zlib::GzipReader.new(pkg)
- Archive::Tar::Minitar::Input.open(pkgz) do |inner|
- inner.each { |item| inner.extract_entry(dest, item) }
- end
- else
- it.extract_entry(dest, entry)
- end
- end
- end
-
- nil
- end
-
- def install(dest, options = {})
- if options['servlet']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet, dest, :mode => 0755)
- if RUBY_PLATFORM =~ /win32/
- if File.exists?(Ruwiki::Utils::Manager.ruwiki_servlet_bat)
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet_bat, dest, :mode => 0755)
- end
- if File.exists?(Ruwiki::Utils::Manager.ruwiki_servlet_cmd)
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet_cmd, dest, :mode => 0755)
- end
- end
- end
-
- if RUBY_PLATFORM =~ /win32/ and options['service']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_service, dest, :mode => 0755)
- end
-
- if options['cgi']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_cgi, dest, :mode => 0755)
- end
-
- if options['data']
- unpackage(Ruwiki::Utils::Manager.ruwiki_pkg, dest)
- if options['service']
- cfn = File.join(dest, 'ruwiki.conf')
- cfg = nil
- File.open(cfn, "rb") { |f| cfg = f.read }
- cfg.gsub!(%r{\./data}, File.join(File.expand_path(dest), "data"))
- cfg.gsub!(%r{\./templates}, File.join(File.expand_path(dest), "templates"))
- File.open(cfn, "wb") { |f| f.write(cfg) }
- end
- end
- end
-
- if RUBY_PLATFORM =~ /win32/
- begin
- require 'win32/service'
- require 'rbconfig'
- HasWin32Service = true
- rescue LoadError
- HasWin32Service = false
- end
-
- # The work here is based on Daniel Berger's Instiki Service Tutorial.
- # http://rubyforge.org/docman/view.php/85/107/instiki_service_tutorial.txt
- def manage_windows_service(options, ioe)
- raise Ruwiki::Utils::Manager.message(:manager_service_broken) unless HasWin32Service
-
- service_name = options[:service_name] || 'RuwikiSvc'
-
- if options[:service_install]
- service_home = options[:service_home]
-
- program = options[:service_bin]
- if program.nil? or program.empty?
- program = File.join(service_home, "ruwiki_service.rb")
- elsif program !~ %r{[/\\]}
- program = File.join(service_home, program)
- end
- program = %<"#{program}">
-
- ruby = options[:ruby_bin] || %<"#{File.join(Config::CONFIG['bindir'], 'ruby.exe')}">
-
- service_desc = options[:service_desc] || 'Ruwiki'
-
- binpath = "#{ruby} #{program}".tr('/', '\\')
-
- service = Win32::Service.new
- service.create_service do |svc|
- svc.service_name = service_name
- svc.display_name = service_desc
- svc.binary_path_name = binpath
- svc.dependencies = [] # Required because of a bug in Win32::Service
- end
- service.close
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_installed) % [ service_name ] << "\n"
- end
-
- if options[:service_start]
- Win32::Service.start(service_name)
- started = false
- while (not started)
- status = Win32::Service.status(service_name)
- started = (status.current_state == "running")
- break if started
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_one_moment) % [ status.current_state ] << "\n"
- sleep 1
- end
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_started) % [ service_name ] << "\n"
- end
-
- if options[:service_stop]
- Win32::Service.stop(service_name)
- stopped = false
- while (not stopped)
- status = Win32::Service.status(service_name)
- stopped = (status.current_state == "stopped")
- break if stopped
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_one_moment) % [ status.current_state ] << "\n"
- sleep 1
- end
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_stopped) % [ service_name ] << "\n"
- end
-
- if options[:service_delete]
- Win32::Service.stop(service_name) rescue nil
- Win32::Service.delete(service_name)
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_deleted) % [ service_name ] << "\n"
- end
- end
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- ioe = {
- :input => input,
- :output => output,
- :error => error
- }
-
- language = 'en'
- find_lang = argv.grep(%r{^--lang})
- find_lang.each do |ee|
- eepos = argv.index(ee)
- if ee =~ %r{^--lang=}
- language = ee.sub(%r{^--lang=}, '')
- else
- language = argv[eepos.succ]
- argv.delete_at(eepos.succ)
- end
- argv.delete_at(eepos)
- end
-
- require "ruwiki/lang/#{language.downcase}"
- Ruwiki::Utils::Manager.message = Ruwiki::Lang.const_get(language.upcase)
-
- command = Ruwiki::Utils::CommandPattern[(argv.shift or "").downcase]
- return command[argv, {}, ioe]
- rescue Ruwiki::Utils::CommandPattern::MissingParameterError => ee
- ioe[:error] << Ruwiki::Utils::Manager.message(:manager_missing_parameter) % [ ee.argument ] << "\n"
- return 1
- rescue ArgumentError, ManagerError => ee
- ioe[:error] << ee.message << "\n"
- return 1
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/utils/servletrunner.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/utils/servletrunner.rb
deleted file mode 100644
index 91dc916..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/utils/servletrunner.rb
+++ /dev/null
@@ -1,296 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-require 'webrick'
-
-require 'ruwiki/utils'
-require 'ruwiki/exportable'
-require 'ruwiki/servlet'
-require 'ruwiki/lang/en'
-require 'ruwiki/lang/de'
-require 'ruwiki/lang/es'
-
-require 'optparse'
-require 'ostruct'
-
-module Ruwiki::Utils::ServletRunner
- COPYRIGHT = <<-"COPYRIGHT"
-Ruwiki #{Ruwiki::VERSION}
- Copyright © 2002 - 2004, Digikata and HaloStatue
-
- http://rubyforge.org/projects/ruwiki/
-
- Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-
-Licensed under the same terms as Ruby.
-
-$Id$
-COPYRIGHT
-
- class WEBrickConfig
- include Ruwiki::Exportable
-
- exportable_group 'webrick-config'
- attr_accessor :port
- exportable :port
- attr_accessor :addresses
- exportable :addresses
- attr_accessor :mount
- exportable :mount
- attr_accessor :do_log
- exportable :do_log
- attr_accessor :log_dest
- exportable :log_dest
- attr_accessor :threads
- exportable :threads
-
- def export
- hash = super
- sc = hash['webrick-config']
- sc['addresses'] = sc['addresses'].join(";")
- sc['do-log'] = (sc['do-log'] ? 'true' : 'false')
- hash
- end
-
- # Because the servlet can be started from the command-line, provide
- # defaults for all possible configuration options.
- def initialize(exported = {})
- sc = exported['webrick-config'] || {}
- @port = sc['port'] || 8808
- @mount = sc['mount'] || '/'
- @addresses = sc['addresses']
- @do_log = ((sc['do-log'] == 'false') ? false : true)
- @log_dest = sc['log-dest']
- @threads = sc['threads'] || 1
-
- if @addresses.nil? or @addresses.empty?
- @addresses = []
- else
- @addresses = @addresses.split(/;/)
- end
-
- if @log_dest.nil? or @log_dest.empty?
- @log_dest = "<STDERR>"
- end
- end
- end
-
- def self.message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def self.message(id)
- @message[id]
- end
-
- class << self
- # This is for the WEBrick version of Ruwiki. This has been abstracted to
- # accept a Config global variable to reconfigure Ruwiki after initial
- # creation.
- def read_config(filename)
- ch = {}
- if File.exists?(filename)
- File.open(filename, 'rb') { |ff| ch = Ruwiki::Exportable.load(ff.read) }
- end
-
- @sc = WEBrickConfig.new(ch)
- @rc = Ruwiki::Config.new(ch)
-
- if @rc.webmaster.nil? or @rc.webmaster.empty?
- @rc.webmaster = "webmaster@domain.tld"
- end
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- read_config(Ruwiki::Config::CONFIG_NAME)
-
- save_config = nil
-
- language = 'en'
- find_lang = argv.grep(%r{^--language})
- find_lang.each do |ee|
- if ee =~ %r{^--language=}
- language = ee.sub(%r{^--language=}, '')
- else
- language = argv[argv.index(ee).succ]
- end
- end
-
- require "ruwiki/lang/#{language.downcase}"
- @rc.language = Ruwiki::Lang.const_get(language.upcase)
- self.message = @rc.language
-
- argv.options do |oo|
- oo.banner = self.message(:runner_usage) % [ File.basename($0) ]
- oo.separator self.message(:runner_general_options)
- oo.on('--save-config [FILENAME]', *([ self.message(:runner_saveconfig_desc), Ruwiki::Config::CONFIG_NAME ].flatten)) { |fname|
- save_config = fname || Ruwiki::Config::CONFIG_NAME
- }
- oo.on('--config FILENAME', *self.message(:runner_config_desc)) { |fn|
- read_config(fn)
- }
- oo.separator ""
- oo.separator self.message(:runner_webrick_options)
- oo.on('-P', '--port PORT', Numeric, *self.message(:runner_port_desc)) { |port|
- @sc.port = port
- }
- oo.on('-A', '--accept ADDRESS,ADDRESS,ADDRESS', Array, *self.message(:runner_address_desc)) { |address|
- @sc.addresses += address
- }
- oo.on('-L', '--local', *self.message(:runner_local_desc)) {
- @sc.addresses = ["127.0.0.1"]
- }
- oo.on('-M', '--mount MOUNT-POINT', *self.message(:runner_mountpoint_desc)) { |mp|
- @sc.mount = mp
- }
- oo.on('--[no-]log', *self.message(:runner_log_desc)) { |log|
- @sc.do_log = log
- }
- oo.on('--logfile LOGFILE', *self.message(:runner_logfile_desc)) { |lf|
- @sc.log_dest = lf
- }
- oo.on('-T', '--threads THREADS', Integer, *self.message(:runner_threads_desc)) { |tc|
- @sc.threads = tc
- }
- oo.separator ""
- oo.separator self.message(:runner_ruwiki_options)
- oo.on('--language=LANGUAGE', *self.message(:runner_language_desc)) { |lang|
- nil
- }
- oo.on('--webmaster WEBMASTER', *self.message(:runner_webmaster_desc)) { |wm|
- @rc.webmaster = wm
- }
- oo.on('--[no-]debug', *self.message(:runner_debug_desc)) { |dd|
- @rc.debug = dd
- }
- oo.on('--title TITLE', *self.message(:runner_title_desc)) { |tt|
- @rc.title = tt
- }
- oo.on('--default-page PAGENAME', *self.message(:runner_defaultpage_desc)) { |dp|
- @rc.default_page = dp
- }
- oo.on('--default-project PAGENAME', *self.message(:runner_defaultproject_desc)) { |dp|
- @rc.default_project = dp
- }
- oo.on('--template-path TEMPLATE_PATH', *self.message(:runner_templatepath_desc)) { |tp|
- @rc.template_path = tp
- }
- oo.on('--templates TEMPLATES', *self.message(:runner_templatename_desc)) { |tp|
- @rc.template_set = tp
- }
- oo.on('--css CSS_NAME', *self.message(:runner_cssname_desc)) { |css|
- @rc.css = css
- }
- oo.on('--storage-type TYPE', Ruwiki::KNOWN_BACKENDS, *([self.message(:runner_storage_desc), Ruwiki::KNOWN_BACKENDS.join(", ")].flatten)) { |st|
- @rc.storage_type = st
- @rc.storage_options[@rc.storage_type]['data-path'] ||= "./data/"
- @rc.storage_options[@rc.storage_type]['extension'] ||= "ruwiki"
- }
- oo.on('--data-path PATH', *self.message(:runner_datapath_desc)) { |fdp|
- @rc.storage_options['flatfiles']['data-path'] = fdp
- }
- oo.on('--extension EXT', *self.message(:runner_extension_desc)) { |ext|
- @rc.storage_options['flatfiles']['data-path'] = fdp
- }
- if defined?(Gem::Cache)
- oo.separator ""
- oo.on('--central', *self.message(:runner_central_desc)) {
- gempath = Gem::Cache.from_installed_gems.search("ruwiki", "=#{Ruwiki::VERSION}").last.full_gem_path
- @rc.storage_type = 'flatfiles'
- @rc.storage_options['flatfiles']['data-path'] = "#{gempath}/data"
- @rc.storage_options['flatfiles']['extension'] = "ruwiki"
- @rc.storage_options['flatfiles']['format'] = "exportable"
- @rc.template_path = "#{gempath}/templates"
- @rc.template_set = "sidebar"
- }
- end
-
- # TODO: Add options for time, date, and datetime formats.
- oo.separator ""
- oo.separator self.message(:runner_general_info)
- oo.on_tail('--help', *self.message(:runner_help_desc)) {
- error << oo << "\n"
- return 0
- }
- oo.on_tail('--version', *self.message(:runner_version_desc)) {
- error << COPYRIGHT << "\n"
- return 0
- }
- oo.parse!
- end
-
- if save_config
- sc = @sc.export
- rc = @rc.export
- cf = sc.merge(rc)
-
- File.open(save_config, 'wb') { |ff| ff.puts Ruwiki::Exportable.dump(cf) }
- return 0
- end
-
- # If the list of accepted addresses is not empty, provide IP-based
- # restrictions.
- if not @sc.addresses.empty?
- localonly = lambda do |sock|
- if not @sc.addresses.include?(sock.peeraddr[3])
- raise WEBrick::ServerError, self.message(:runner_rejected_address) % [ sock.peeraddr[3], @sc.addresses.join(", ") ]
- end
- end
- else
- localonly = nil
- end
-
- if @sc.do_log
- if "<STDERR>" == @sc.log_dest
- dest = $stderr
- else
- dest = File.open(@sc.log_dest, "wb+")
- end
- logger = WEBrick::Log.new(dest, WEBrick::Log::DEBUG)
- else
- logger = nil
- end
-
- banner = self.message(:runner_banner) %
- [ Ruwiki::Utils::ServletRunner::COPYRIGHT, @sc.port,
- @sc.addresses.join(", "), @sc.mount, @sc.do_log, @sc.log_dest,
- @sc.threads, @rc.webmaster, @rc.debug, @rc.title,
- @rc.default_project, @rc.default_page, @rc.template_path,
- @rc.template_set, @rc.css, @rc.storage_type,
- @rc.storage_options[@rc.storage_type]['data-path'],
- @rc.storage_options[@rc.storage_type]['extension'] ]
-
- banner.each { |bb| logger.info(bb) } unless logger.nil?
-
- server = WEBrick::HTTPServer.new(:Port => @sc.port.to_i,
- :StartThreads => @sc.threads.to_i,
- :AcceptCallback => localonly,
- :Logger => logger)
- @rc.logger = logger
- Ruwiki::Servlet.config = @rc
-
- server.mount(@sc.mount, Ruwiki::Servlet)
- trap("INT") { server.shutdown; return 0 }
- server.start
- return 0
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki.rb
deleted file mode 100644
index ded37ee..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki.rb
+++ /dev/null
@@ -1,164 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
- # Ruwiki's Wiki markup class. This will convert the Wiki markup known by
- # Ruwiki (defined by Token classes). The algorithm is as follows:
- #
- # 1. For each known Token class, match each instance of it in the content
- # stream. Replace each instance in the content stream with a Token
- # marker: TOKEN_x or \TOKEN_x, where x is a digit representing the Token.
- # (\TOKEN_x is a special case of token matching. See
- # Ruwiki::Markup::Token for more information.) Store the Token for later
- # processing.
- # 2. Go back through the content, replacing each instance of \TOKEN_x with
- # the Token's defined restore value (which should be the same value as was
- # originally matched).
- # 3. Go through the content, replacing each instance of TOKEN_x with the
- # Token's defined replacement value.
- # 4. Go through the tokens, in reverse, and execute the post replacement
- # routine defined by the Token. (This may be necessary to collapse
- # consecutive HTML structures.)
- # 5. Return the parsed content and the collected metadata.
- #
- # == Tokens
- # Look at Ruwiki::Markup::Token describes how to create Token objects.
-class Ruwiki::Wiki
- def parse(content, project)
- content = clean(content)
- tokens = []
- project ||= @default_project
-
- Token.tokenlist.each do |token|
- content.gsub!(token.regexp) do |mm|
- match = Regexp.last_match
- tc = token.new(match, project, @backend, @script, @message, @title)
- tokens << tc
- if mm[0, 1] == '\\'
- "\\TOKEN_#{tokens.size - 1}"
- else
- "TOKEN_#{tokens.size - 1}"
- end
- end
- end
-
- replaced = []
- ss = true
- loop do
- break if replaced.size >= tokens.size
- break if ss.nil?
- ss = content.gsub!(/\\TOKEN_(\d+)/) { |mm|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].restore
- }
-
- ss = content.gsub!(/TOKEN_(\d+)/) { |mm|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].replace
- }
- end
-
- token_classes = tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
-
- content
- end
-
- attr_accessor :default_project
- attr_accessor :script
- attr_accessor :backend
- attr_accessor :message
-
- # Creates the markup class.
- def initialize(default_project, script, title)
- @default_project = default_project
- @script = script
- @title = title
- end
-
- # A regular expression that will prevent redirection.
- class << self
- attr_accessor :no_redirect
-
- def redirect(uri)
- if uri =~ %r{^https?://}
- if self.no_redirect and uri =~ self.no_redirect
- uri
- else
- "http://www.google.com/url?sa=D&amp;q=#{CGI.escape(uri)}"
- end
- else
- uri
- end
- end
- end
-
-private
- # Find HTML tags
- SIMPLE_TAG_RE = %r{<[^<>]+?>} # Ensure that only the tag is grabbed.
- HTML_TAG_RE = %r{\A< # Tag must be at start of match.
- (/)? # Closing tag?
- ([\w:]+) # Tag name
- (?:\s+ # Space
- ([^>]+) # Attributes
- (/)? # Singleton tag?
- )? # The above three are optional
- >}x
- ATTRIBUTES_RE = %r{([\w:]+)(=(?:\w+|"[^"]+?"|'[^']+?'))?}x
- STYLE_NOVD_RE = %r{(?:\s?(visibility|display):[^'";]+;?)}x
- ALLOWED_ATTR = %w(style title type lang dir class id cite datetime abbr) +
- %w(colspan rowspan compact start media)
- ALLOWED_HTML = %w(abbr acronym address b big blockquote br caption cite) +
- %w(code col colgroup dd del dfn dir div dl dt em h1 h2 h3) +
- %w(h4 h5 h6 hr i ins kbd li menu ol p pre q s samp small) +
- %w(span strike strong style sub sup table tbody td tfoot) +
- %w(th thead tr tt u ul var)
-
- # Clean the content of unsupported HTML and attributes. This includes
- # XML namespaced HTML. Sorry, but there's too much possibility for
- # abuse.
- def clean(content)
- content = content.gsub(SIMPLE_TAG_RE) do |tag|
- tagset = HTML_TAG_RE.match(tag)
-
- if tagset.nil?
- tag = Ruwiki.clean_entities(tag)
- else
- closer, name, attributes, single = tagset.captures
-
- if ALLOWED_HTML.include?(name.downcase)
- unless closer or attributes.nil?
- attributes = attributes.scan(ATTRIBUTES_RE).map do |set|
- if ALLOWED_ATTR.include?(set[0].downcase)
- if set[0] == 'style'
- set[1].gsub!(STYLE_NOVD_RE, '')
- end
- set.join
- else
- nil
- end
- end.compact.join(" ")
- tag = "<#{closer}#{name} #{attributes}#{single}>"
- else
- tag = "<#{closer}#{name}>"
- end
- else
- tag = Ruwiki.clean_entities(tag)
- end
- end
- tag.gsub(%r{((?:href|src)=["'])(#{Ruwiki::Wiki::RE_URI_SCHEME})}) { "#{$1}\\#{$2}" }
- end
- end
-end
-
-require 'ruwiki/wiki/tokens'
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens.rb
deleted file mode 100644
index decc562..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens.rb
+++ /dev/null
@@ -1,131 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
- # The base Token class. All Token classes must inherit from Token and
- # *must* implement the following methods:
- #
- # [self.regexp] The regular expression that the Token will be replacing.
- # [replace] The mechanism for replacing the Token with the desired
- # results.
- #
- # Token classes <i>should</i> implement the following method:
- # [self.rank] Default: <tt>5000</tt>. Affects the sort order.
- # Must return an integer.
- #
- # Token classes <i>may</i> implement the following methods:
- # [restore] Restores the token without replacement. Implements
- # the results of the escape character. NOTE: each
- # Token class is responsible for its own restore.
- # Tokens that are anchored to the beginning of a line
- # are the most likely to need to reimplement this.
- # [self.post_replace] Performs any necessary massaging of the data. See
- # the implementation of Ruwiki::Wiki::Lists for more
- # information.
-class Ruwiki::Wiki::Token
- @@tokenlist = []
- @@sorted = false
-
- class << self
- # Tokens should define rank if they must be first or last in
- # processing. Otherwise, they are sorted in the order defined.
- def rank
- 5000
- end
-
- # The Wiki parsing routine uses Token.tokenlist to determine the
- # tokens that are processed, and the order in which they are
- # processed. See Token.rank for more information.
- def tokenlist(sort = true)
- if sort and not @@sorted
- head = @@tokenlist.shift
- @@tokenlist.sort! { |aa, bb| aa.rank <=> bb.rank }
- @@tokenlist.unshift(head)
- @@sorted = true
- end
- @@tokenlist
- end
-
- def inherited(child_class) #:nodoc:
- @@tokenlist << Ruwiki::Wiki::Token if @@tokenlist.empty?
-
- # Make the child class post_replace a blank function because we
- # don't want to propogate the currently defined post_replace. The
- # current post_replace is specific to Token_Base only.
- class << child_class
- def self.post_replace(content)
- content
- end
- end
-
- @@tokenlist << child_class
- @@sorted = false
- end
-
- # The replacement regular expression.
- def regexp
- /TOKEN_(\d*)/o
- end
- end
-
- # All Token classes must match this header signature if they define
- # #initialize.
- #
- # [match] The MatchData object for this Token.
- # [project] The project being processed.
- # [backend] The backend for the wiki. This is used to determine if
- # the page or project exists. The object passed must
- # respond to #project_exists?(project) and
- # #page_exists?(page, project).
- # [script] The URI to the script.
- # [message] The message hash for localized messages.
- # [title] The title of the Wiki.
- def initialize(match, project, backend, script, message, title)
- @match = match
- @project = project
- @backend = backend
- @script = script
- @message = message
- @title = title
- end
-
- # The replacement method. Uses @match to replace the token with the
- # appropriate values.
- def replace
- "TOKEN_#{@match[1]}"
- end
-
- # Restores the token without replacement. By default, replaces
- # "dangerous" HTML characters.
- def restore
- Ruwiki.clean_entities(@match[0])
- end
-
- # The content may need massaging after processing.
- def self.post_replace(content)
- content
- end
-end
-
- # Load the tokens from the ruwiki/wiki/tokens directory.
-tokens_dir = 'ruwiki/wiki/tokens'
-
-$LOAD_PATH.each do |path|
- target = "#{path}/#{tokens_dir}"
- if File.exists?(target) and File.directory?(target)
- Dir::glob("#{target}/*.rb") do |token|
- begin
- require token
- rescue LoadError, TypeError
- nil
- end
- end
- end
- Ruwiki::Wiki::Token.tokenlist.each { |tk| tk.freeze }
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/00default.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/00default.rb
deleted file mode 100644
index 996e376..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/00default.rb
+++ /dev/null
@@ -1,209 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-# $debug = File.open("output.txt", "wb")
-
-class Ruwiki::Wiki
- # The Paragraph Token class changes blank lines to <p> tags. This class,
- # under the current implementation, should be *first* in the Token list
- # after Token.
- class Paragraph < Ruwiki::Wiki::Token
- # This Token is #rank 0, because it should be first in the Token list.
- def self.rank
- 0
- end
-
- # Matches blank lines. %r{^$}
- def self.regexp
- %r{(^$)}
- end
-
- def replace
- %Q(</p><p class="rwtk_Paragraph">)
- end
-
- # Ensures that <p> won't be surrounded by <br> tags.
- def self.post_replace(content)
- content.gsub!(%r{\A}, '<p class="rwtk_Paragraph">')
- content.gsub!(%r{\z}, '</p>')
- content.gsub!(%r{\n(</p>)}, '\1')
- content.gsub!(%r{(<p[^>]*>)\n}, '\1')
- content.gsub!(%r{(</p>)(<p[^>]*>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{<p[^>]*></p>}, '')
- content.gsub!(%r{^\n(<p[^>]*>)}, '\1')
- content
- end
- end
-
- # The Code Token class converts indented text to "unformatted" (<pre>)
- # text. This class should be *second* in the Token list.
- class Code < Ruwiki::Wiki::Token
- # This Token is #rank 1, because it should be second in the Token list.
- def self.rank
- 1
- end
-
- # Matches indented text. %r{^(\s+\S?.*)$}
- def self.regexp
-# %r{^(\s+.*)$}
- %r{^([ \t]+[^\n]*)\n?}
- end
-
- # Replaces the text to <pre>content</pre>.
- def replace
- content = Ruwiki.clean_entities(@match.captures[0])
-
- %Q{</p><pre class="rwtk_Code">#{content}</pre>\n}
- end
-
- # Converts cases of %r{</pre>(\n|<br ?/?>)<pre>} to \1.
- def self.post_replace(content)
- content.gsub!(%r{</pre>((\n)*</p>(\n)*)?<pre[^>]*>}, "\n")
- content.gsub!(%r{</pre>(\n|<br ?/?>)?<pre[^>]*>}, '\1')
- content.gsub!(%r{<p[^>]*>(<pre[^>]*>)}, '\1')
- content.gsub!(%r{</pre></p>}, '</pre>')
-# content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content
- end
- end
-
- RE_URI_SCHEME = %r{[-a-z0-9+.]{3,}?:}
- RE_URI_PATH = %r{[^\s<>\]]}
- RE_URI_TEXT = %r{[^\]]*}
-
- class << self
- def increment_numbered_links
- @numbered_links_count ||= 0
- @numbered_links_count += 1
- end
-
- def reset_numbered_links
- @numbered_links_count = 0
- end
- end
-
- # Converts URLs in the form of [url] to numbered links.
- class NumberedLinks < Ruwiki::Wiki::Token
-
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\]}
- end
-
- def replace
- extlink = @match.captures[0]
-
- name = "[#{Ruwiki::Wiki.increment_numbered_links}]"
-
- %Q{<a class="rwtk_NumberedLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{name}</a>}
- end
- end
-
- class Image < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- RE_IMAGE_OPTIONS=%r{([^=]+)=("[^"]+"|[^ ]+)}
-
- def self.regexp
- %r{\[image\s*:\s*(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)(\s+[^\]]+)?\]}
- end
-
- def replace
- options = { 'src' => %Q("#{@match.captures[0]}") }
- groups = @match.captures[1]
- unless groups.nil?
- groups.scan(RE_IMAGE_OPTIONS).each { |gg| options[gg[0].strip] = gg[1].strip }
- end
-
- unless options['numbered'].nil? or options['numbered'] == "false"
- options['title'] = %Q("[#{Ruwiki::Wiki.increment_numbered_links}]")
- options.delete('numbered')
- end
-
- options['title'] ||= options['alt']
- options['title'] ||= options['src']
- options['alt'] ||= options['title']
-
- ss = ""
- options.keys.sort.map { |kk| ss << %Q( #{kk}=#{options[kk]}) }
-
- %Q{<img class="rwtk_Image"#{ss} />}
- end
- end
-
- # Converts URLs in the form of [url name] to named links.
- class NamedLinks < Ruwiki::Wiki::Token
- def self.rank
- 3
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\s+(#{RE_URI_TEXT})\]}
- end
-
- def replace
- extlink = @match.captures[0]
- name = @match.captures[1]
-
- %Q{<a class="rwtk_NamedLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{name}</a>}
- end
- end
-
- # Converts URLs to links where the "name" of the link is the URL itself.
- class ExternalLinks < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{\b(#{RE_URI_SCHEME}#{RE_URI_PATH}+)}
- end
-
- def restore
- @match[0]
- end
-
- def replace
- extlink = @match.captures[0]
-
- %Q{<a class="rwtk_ExternalLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{extlink}</a>}
- end
- end
-
- # Creates a horizontal rule.
- class HRule < Ruwiki::Wiki::Token
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def replace
- %Q(<hr class="rwtk_HRule" />)
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(<p[^>]*>)*(<hr[^ />]* ?/?>)(</p>)*}, '\1')
- content.gsub!(%r{\n<hr />}, "</p>\n<hr />")
- content.gsub!(%r{<hr ?/?>\n<br ?/?>}, "<hr />")
- content.gsub!(%r{(\n|<br ?/?>)?<hr>(\n|<br ?/?>)?}, "<hr />")
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/01wikilinks.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/01wikilinks.rb
deleted file mode 100644
index 442a201..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/01wikilinks.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # This provides the basic WikiWord match. This supports WikiWord,
- # CPlusPlus, ThisIsALink, and C_Plus_Plus.
- RE_WIKI_WORDS = %r{[[:upper:]][\w_]*(?:[[:lower:]]+[[:upper:]_]|[[:upper:]_]+[[:lower:]])[\w_]*}
- # This provides wikipedia format matches, e.g., [[wikipedia links]]. The
- # only restriction on words in this format is that they must NOT begin
- # with an underscore ('_').
- RE_WIKIPEDIA_WORDS = %r{\[\[([^_].*?)\]\]}
- # This provides the basic Wiki Project match.
- RE_PROJECT_WORD = %r{[[:upper:]][[:lower:]]+}
-
- # This provides the Wiki view link format:
- VIEW_LINK = %Q[<a class="rwtk_WikiLink" href="%s">%s</a>]
- EDIT_LINK = %Q[<span class="rwtk_EditWikiLink">%s</span><a class="rwtk_WikiLink" href="%s">?</a>]
-
- # Creates a crosslink for a Project::WikiPage.
- class ProjectCrossLink < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::(#{RE_WIKI_WORDS})}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic.gsub(/_/, ' ')}"]
- else
- EDIT_LINK % ["#{project}::#{topic.gsub(/_/, ' ')}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a crosslink for a Project::WikiPage using a Wikipedia link
- # format.
- class ProjectCrossLinkWikipedia < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::#{RE_WIKIPEDIA_WORDS}}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic}"]
- else
- EDIT_LINK % ["#{project}::#{topic}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to the project index from ::Project.
- class ProjectIndex < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{(\B|\\)::(#{RE_PROJECT_WORD})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- project = @match.captures[1]
-
- if @backend.page_exists?('ProjectIndex', project)
- VIEW_LINK % ["#{@script}/#{project}/ProjectIndex", project]
- else
- if @backend.project_exists?(project)
- EDIT_LINK % [project, "#{@script}/#{project}/ProjectIndex/_edit"]
- else
- EDIT_LINK % [project, "#{@script}/#{project}/_create"]
- end
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project.
- class WikiLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\b|\\)(#{RE_WIKI_WORDS})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic.gsub(/_/, ' ')]
- else
- EDIT_LINK % [topic.gsub(/_/, ' '), "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project using a Wikipedia
- # link format.
- class WikipediaLinks < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(\B|\\)#{RE_WIKIPEDIA_WORDS}\B}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- ALT_TEXT = %r{(.+)\|(.+)}o
-
- def replace
- captures = @match.captures
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- at = ALT_TEXT.match(topic)
-
- if not at.nil?
- topic = at.captures[1]
- link = CGI.escape(at.captures[0])
- end
-
- if @backend.page_exists?(link, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic]
- else
- EDIT_LINK % [topic, "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/02actions.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/02actions.rb
deleted file mode 100644
index 8ad0950..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/02actions.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # Produces a list of topics.
- class TopicList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%topics\((#{Ruwiki::Wiki::RE_PROJECT_WORD})?\)$}
- end
-
- def replace
- project = @match.captures[0] || @project
-
- if @backend.project_exists?(project)
- topic_list = @backend.list_topics(project)
- else
- topic_list = []
- end
-
- if topic_list.empty?
- ss = @message[:no_topics] % [project]
- else
- ss = %Q(<h4 class="rwtk_Headings">#{@message[:topics_for_project] % [project]}</h4>\n<ul class="rwtk_Lists">\n)
- topic_list.each do |tt|
- ss << %Q(<li class="rwtk_Lists">)
- ss << VIEW_LINK % ["#{@script}/#{project}/#{tt}", "#{CGI::unescape(tt.gsub(/_/, ' '))}"]
- ss << "</li>\n"
- end
- ss << "</ul>\n"
- end
-
- ss
- end
- end
-
- class ProjectList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%projects\(\)$}
- end
-
- def replace
- proj_list = @backend.list_projects
-
- ss = %Q(<h4 class="rwtk_Headings">#{@message[:wiki_projects] % [@title]}</h4>\n<ul class="rwtk_Lists">\n)
- proj_list.each do |pp|
- ss << %Q(<li class="rwtk_Lists">)
- ss << VIEW_LINK % ["#{@script}/#{pp}/ProjectIndex", pp]
- ss << %Q! <a href='#{@script}/#{pp}/_topics' class='rw_minilink'>#{@message[:project_topics_link]}</a>!
- ss << "</li>\n"
- end
- ss << "</ul>\n"
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/abbreviations.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/abbreviations.rb
deleted file mode 100644
index b928085..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/abbreviations.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Converts abbreviations.
- class Abbreviations < Ruwiki::Wiki::Token
- ABBREVIATIONS = {
- "matz" => "Yukihiro Matsumoto",
- }
-
- def self.regexp
- %r!@\{([^\}]*)\}!
- end
-
- def replace
- kk = @match.captures[0]
- if kk.nil? or kk.empty?
- data = %Q(<dl class="rwtk_Abbreviations">)
- ABBREVIATIONS.each do |kk, vv|
- data << %Q(<dt class="rwtk_Abbreviations">#{kk}</dt><dd class="rwtk_Abbreviations">#{vv}</dd>)
- end
- data << %Q(</dl>)
- else
- if ABBREVIATIONS.has_key?(kk)
- data = ABBREVIATIONS[kk]
- else
- data = @match[0]
- end
- end
- data
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/calendar.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/calendar.rb
deleted file mode 100644
index c78dc45..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/calendar.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces a mini-calendar with dates as WikiWords.
- class Calendar < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?%calendar\((?:(today)|(\d+),\s*(\d+))(?:,\s*(#{RE_PROJECT_WORD}))?\)}
- end
-
- def self.make(year, month)
- result = []
- tt = Time.local(year, month, 1)
- rr = Array.new(tt.wday, nil)
- rr << 1
-
- 2.upto(31) do |ii|
- break if Time.local(year, month, ii).month != month
- rr << ii
- end
-
- rr += Array.new((- rr.size) % 7, nil)
-
- 0.step(rr.size - 1, 7) do |ii|
- result << rr[ii, 7]
- end
- result
- end
-
- def make_month_link(project, year, month, state = nil)
- ym = "%04d%02d" % [year, month]
- case state
- when :prev
- title = "&laquo; #{year}.#{month}"
- when :next
- title = "#{year}.#{month} &raquo;"
- else
- title = "#{project}::#{year}.#{month}"
- end
- url = "#{@script}/#{project}/#{ym}"
-
- if @backend.page_exists?(ym, project)
- VIEW_LINK % [url, title]
- else
- EDIT_LINK % [title, "#{url}/_edit"]
- end
- end
-
- def replace
- today = @match.captures[0]
- project = @match.captures[3] || @project
- now = Time.now
-
- if today.nil?
- year = @match.captures[1].to_i
- month = @match.captures[2].to_i
- else
- year = now.year
- month = now.month
- end
-
- if (year == now.year) and (month == now.month)
- show_today = now.day
- else
- show_today = nil
- end
-
- result = <<-"CALENDAR_HEAD"
-</p>
-<div class="rwtk_Calendar">
-<table class="rwtk_Calendar" summary="calendar for ::#{project}: #{year}.#{month}">
-<thead>
- CALENDAR_HEAD
-
- result << %Q{ <tr>\n<th colspan="7" class="rwtk_Calendar_current_month">}
- result << make_month_link(project, year, month)
- result << %Q{</th>\n </tr>\n <tr>\n<th colspan="2" class="rwtk_Calendar_prev_month">}
- result << make_month_link(project, year, month - 1, :prev)
- result << %Q{</th>\n<th colspan="3"></th>\n<th colspan="2" class="rwtk_Calendar_next_month">}
- result << make_month_link(project, year, month + 1, :next)
- result << "</th>\n"
-
- result << <<-"CALENDAR_HEAD2"
- </tr>
- <tr>
- <th class="rwtk_Calendar_weekend">Su</th>
- <th class="rwtk_Calendar_weekday">Mo</th>
- <th class="rwtk_Calendar_weekday">Tu</th>
- <th class="rwtk_Calendar_weekday">We</th>
- <th class="rwtk_Calendar_weekday">Th</th>
- <th class="rwtk_Calendar_weekday">Fr</th>
- <th class="rwtk_Calendar_weekend">Sa</th>
- </tr>
-</thead>
-<tbody>
- CALENDAR_HEAD2
-
- Calendar.make(year, month).each do |week|
- result << " <tr>\n"
- week.each do |day|
- if day.nil?
- result << %Q{ <td class="rwtk_Calendar_day"></td>\n}
- else
- date = "%04d%02d%02d" % [year, month, day]
- # Add the ability to create pages based on date here.
- if show_today == day
- result << %Q{ <td class="rwtk_Calendar_today">}
- else
- result << %Q{ <td class="rwtk_Calendar_day">}
- end
- if @backend.page_exists?(date, project)
- result << VIEW_LINK % ["#{@script}/#{project}/#{date}", day]
- else
- result << EDIT_LINK % [day, "#{@script}/#{project}/#{date}/_edit"]
- end
- result << %Q{</td>\n}
- end
- end
- result << " </tr>\n"
- end
-
- result << %Q(</tbody>\n</table>\n</div>\n<p class="rwtk_Paragraph">)
- result
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*>(\s*</?div(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?table(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?t(?:head|body|r)(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*<t[hd].+?</t[hd]>\s*)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/headings.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/headings.rb
deleted file mode 100644
index cfc3001..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/headings.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts headings.
- class Headings < Ruwiki::Wiki::Token
-# def self.rank
-# 5
-# end
-
- def self.regexp
- %r{^\\?(=+)\s+(.*)}
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def replace
- level = @match.captures[0].count("=")
- content = @match.captures[1]
- level = 6 if level > 6
- %Q(<h#{level} class="rwtk_Headings">#{content}</h#{level}>)
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(</h\d>)\n}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{(</h\d>)</p>\n<p>}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{<p[^>]*>(<h\d[^>]*>)}, '\1')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/lists.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/lists.rb
deleted file mode 100644
index 1615c2c..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/lists.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Produces Lists
- class Lists < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?([*#]+)\s+(.*)$}
- end
-
- def replace
- indent = @match.captures[0].scan(/./).map { |ee| ee == "*" ? 'ul' : 'ol' }
- content = @match.captures[1]
-
- pre = ''
- post = ''
- indent.each { |elem| pre << %Q(<#{elem} class="rwtk_Lists">) }
- indent.reverse_each { |elem| post << %Q(</#{elem}>) }
- %Q(#{pre}<li class="rwtk_Lists">#{content}</li>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- RE_NESTED_LISTS = %r{</[uo]l>\s*<[uo]l[^>]*>}
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*><([uo]l[^>]*)>}, '<\1>')
- content.gsub!(%r{</([uo]l)></p>}, '</\1>')
- content.gsub!(RE_NESTED_LISTS, '') while content =~ RE_NESTED_LISTS
- content
- end
- end
-
- # Produces block quotes.
- class Blockquotes < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((:+)|(>+))(\s+.*)$}
- end
-
- def replace
- content = @match.captures[3]
-
- if @match.captures[2].nil?
- char = ':'
- cite = ''
- else
- char = '>'
- cite = ' type="cite"'
- end
- indent = @match.captures[0].count(char)
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<blockquote#{cite} class="rwtk_Blockquotes">)
- post << %Q(</blockquote>)
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1].gsub(/^>/, '&gt;')
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</blockquote>(\n|<br ?/?>)?<blockquote[^>]*>}, '')
- content.gsub!(%r{(</?blockquote[^>]*>\n?)\s*}, '\1')
- content.gsub!(%r{</blockquote>(<blockquote[^>]*>)+}, '\1')
- content
- end
- end
-
- # Produces definition lists. Does not completely work correctly.
- class Definitions < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(;+)\s+(.+?)\s+:\s+(.*)}
- end
-
- def replace
- definition = @match.captures[2]
- term = @match.captures[1]
- indent = @match.captures[0].count(';')
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<dl class="rwtk_Definitions">)
- post << %Q(</dl>)
- end
- %Q(#{pre}<dt class="rwtk_Definitions">#{term}</dt><dd class="rwtk_Definitions">#{definition}</dd>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</dl>(\n|<br ?/?>)?<dl[^>]*>}, '')
- content.gsub!(%r{</dl>(<dl[^>]*>)+}, '\1')
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/rubylists.rb b/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/rubylists.rb
deleted file mode 100644
index b765ad1..0000000
--- a/ruwiki/tags/release-0.9.1/lib/ruwiki/wiki/tokens/rubylists.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Convert ruby-talk mailing list references (e.g., [ruby-talk:12345])
- # into named links.
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
-# %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/#{lm}">#{@match[0]}</a>)
- end
- end
-
- # Convert ruby-core/ext/dev/list/math mailing list references (e.g.,
- # [ruby-core:12345]) into named links.
- class OtherRubyLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-(list|doc|core|dev|ext|math):(\d+)\]}
- end
-
- def replace
- ln, lm = @match.captures[0..1]
- %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-#{ln}/#{lm}">#{@match[0]}</a>)
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/ruwiki b/ruwiki/tags/release-0.9.1/ruwiki
deleted file mode 100644
index 251a140..0000000
--- a/ruwiki/tags/release-0.9.1/ruwiki
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'ruwiki/utils'
-require 'ruwiki/utils/manager'
-
- # RPA Maintainers: Change this to the appropriate location on installation.
- # This is the right place for RubyGems, basically.
-ss = "#{File.dirname(File.expand_path(__FILE__))}/.."
-
-Ruwiki::Utils::Manager.shared = ss
-
-exit Ruwiki::Utils::Manager.run(ARGV)
diff --git a/ruwiki/tags/release-0.9.1/ruwiki.cgi b/ruwiki/tags/release-0.9.1/ruwiki.cgi
deleted file mode 100644
index 2e1ebee..0000000
--- a/ruwiki/tags/release-0.9.1/ruwiki.cgi
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
-config_file = File.join(Dir.pwd, Ruwiki::Config::CONFIG_NAME)
-
-if File.exists?(config_file)
- wiki.load_config(config_file)
- config = Ruwiki::Config.read(config_file)
- if config.webmaster.nil? or config.webmaster.empty?
- config.webmaster = "webmaster@domain.tld"
- end
-else
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
- wiki.config.webmaster = "webmaster@domain.tld"
-
-# wiki.config.debug = false
-# wiki.config.title = "Ruwiki"
-# wiki.config.default_page = "ProjectIndex"
-# wiki.config.default_project = "Default"
- # This next defaults to 'flatfiles'. Conversion of the default data will
- # be necessary to use other formats.
-# wiki.config.storage_type = 'flatfiles'
-# wiki.config.storage_options[wiki.config.storage_type][:data_path] = "./data/"
- wiki.config.storage_options[wiki.config.storage_type][:extension] = "ruwiki"
-# wiki.config.template_path = "./templates/"
-# wiki.config.template_set = "default"
-# wiki.config.css = "ruwiki.css"
-# wiki.config.time_format = "%H:%M:%S"
-# wiki.config.date_format = "%Y.%m.%d"
-# wiki.config.datetime_format = "%Y.%m.%d %H:%M:%S"
-end
-
-wiki.config!
-wiki.run
diff --git a/ruwiki/tags/release-0.9.1/ruwiki.conf b/ruwiki/tags/release-0.9.1/ruwiki.conf
deleted file mode 100644
index 72e4cc6..0000000
--- a/ruwiki/tags/release-0.9.1/ruwiki.conf
+++ /dev/null
@@ -1,22 +0,0 @@
-ruwiki-config!auth-options:
-ruwiki-config!css: ruwiki.css
-ruwiki-config!date-format: %Y.%m.%d
-ruwiki-config!datetime-format: %Y.%m.%d %H:%M:%S
-ruwiki-config!debug: true
-ruwiki-config!default-page: ProjectIndex
-ruwiki-config!default-project: Default
-ruwiki-config!language: en
-ruwiki-config!storage-options: flatfiles!data-path: ./data
- flatfiles!extension: ruwiki
-ruwiki-config!storage-type: flatfiles
-ruwiki-config!template-path: ./templates/
-ruwiki-config!template-set: default
-ruwiki-config!time-format: %H:%M:%S
-ruwiki-config!title: Ruwiki
-ruwiki-config!webmaster: webmaster@domain.tld
-webrick-config!addresses:
-webrick-config!do-log: true
-webrick-config!log-dest: <STDERR>
-webrick-config!mount: /
-webrick-config!port: 8808
-webrick-config!threads: 1
diff --git a/ruwiki/tags/release-0.9.1/ruwiki_convert b/ruwiki/tags/release-0.9.1/ruwiki_convert
deleted file mode 100644
index c290041..0000000
--- a/ruwiki/tags/release-0.9.1/ruwiki_convert
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
- # Load all of the known backends.
-require 'ruwiki/utils'
-require 'ruwiki/backend/flatfiles'
-require 'ruwiki/utils/converter'
-
-exit Ruwiki::Utils::Converter.run(ARGV)
diff --git a/ruwiki/tags/release-0.9.1/ruwiki_service.rb b/ruwiki/tags/release-0.9.1/ruwiki_service.rb
deleted file mode 100644
index bd66d49..0000000
--- a/ruwiki/tags/release-0.9.1/ruwiki_service.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'win32/service'
-require 'ruwiki/utils/servletrunner'
-
-class Ruwiki::Utils::Daemon < Win32::Daemon
- LOCATION = File.dirname(File.expand_path(__FILE__))
-
- def initialize
- @logfile = File.open(File.join(LOCATION, "ruwiki_service.log"), "ab+")
- rescue Exception => e
- File.open(File.join(LOCATION, "temp.log"), "a+") do |f|
- f.puts "Logfile error: #{e}"
- f.puts "Backtrace:\n#{e.backtrace.join(', ')}"
- end
- exit
- end
-
- def service_main
- ARGV.replace(["--config", File.join(LOCATION, Ruwiki::Config::CONFIG_NAME),
- "--logfile", File.join(LOCATION, "ruwiki_servlet.log")])
- Ruwiki::Utils::ServletRunner.run(ARGV, @logfile, @logfile, @logfile)
- rescue Exception => e
- file = LOCATION + '/temp.log'
- File.open(file, "a+") do |f|
- f.puts "Error: #{e}"
- f.puts "Backtrace: #{e.backtrace.join(', ')}"
- end
- exit
- end
-end
-
-daemon = Ruwiki::Utils::Daemon.new
-daemon.mainloop
diff --git a/ruwiki/tags/release-0.9.1/ruwiki_servlet b/ruwiki/tags/release-0.9.1/ruwiki_servlet
deleted file mode 100644
index 224ab3f..0000000
--- a/ruwiki/tags/release-0.9.1/ruwiki_servlet
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'ruwiki/utils/servletrunner'
-
-exit Ruwiki::Utils::ServletRunner.run(ARGV)
diff --git a/ruwiki/tags/release-0.9.1/templates/default/body.tmpl b/ruwiki/tags/release-0.9.1/templates/default/body.tmpl
deleted file mode 100644
index baaa259..0000000
--- a/ruwiki/tags/release-0.9.1/templates/default/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow,noarchive" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.9.1/templates/default/content.tmpl b/ruwiki/tags/release-0.9.1/templates/default/content.tmpl
deleted file mode 100644
index 7f662b2..0000000
--- a/ruwiki/tags/release-0.9.1/templates/default/content.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.1/templates/default/controls.tmpl b/ruwiki/tags/release-0.9.1/templates/default/controls.tmpl
deleted file mode 100644
index 8f855c2..0000000
--- a/ruwiki/tags/release-0.9.1/templates/default/controls.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_header">
- <form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- <!-- Right-hand tabs must go in reverse order! -->
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.9.1/templates/default/edit.tmpl b/ruwiki/tags/release-0.9.1/templates/default/edit.tmpl
deleted file mode 100644
index 9e5dbb5..0000000
--- a/ruwiki/tags/release-0.9.1/templates/default/edit.tmpl
+++ /dev/null
@@ -1,27 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_navbar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_navbar_righttab" id="rw_editing_tab"><strong><em>#label_editing#</em> #%page_version%</strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <div class="rw_content">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.1/templates/default/error.tmpl b/ruwiki/tags/release-0.9.1/templates/default/error.tmpl
deleted file mode 100644
index a3887b2..0000000
--- a/ruwiki/tags/release-0.9.1/templates/default/error.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.1/templates/default/footer.tmpl b/ruwiki/tags/release-0.9.1/templates/default/footer.tmpl
deleted file mode 100644
index 48146ea..0000000
--- a/ruwiki/tags/release-0.9.1/templates/default/footer.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_footer">
-<!--<form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- {!-- Right-hand tabs must go in reverse order! --}
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>-->
-</div>
diff --git a/ruwiki/tags/release-0.9.1/templates/default/ruwiki.css b/ruwiki/tags/release-0.9.1/templates/default/ruwiki.css
deleted file mode 100644
index cfe7bf6..0000000
--- a/ruwiki/tags/release-0.9.1/templates/default/ruwiki.css
+++ /dev/null
@@ -1,297 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_footer
-{
-/*position: absolute;
- width: 100%;
- bottom: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;*/
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_footer { position: fixed; }
-
-body > div#rw_footer > .rw_navbar { position: fixed; bottom: 0; }
-body > div#rw_footer > .rw_navbar > div { position: relative; top: -2em; }
-
-body
-{
- margin: 0.5em;
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_navbar
-{
- width: 100%;
- margin: 0;
- padding: 0.1em;
- font-size: 0.7em;
- border: 1px solid black;
- color: white;
- background-color: #27C;
- height: 0.5em;
- z-index: 2;
-}
-
-.rw_navbar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_navbar a:visited
-{
- color: #2E7;
- font-weight: normal;
- border-bottom: 1px dashed #2E7;
-}
-
-.rw_navbar a:hover
-{
- text-decoration: none;
-}
-
-.rw_navbar_tab
-{
- float: left;
- background-color: #27C;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_navbar_tab:hover
-{
- background-color: #49E;
-}
-
-.rw_navbar_righttab
-{
- float: right;
- padding-left: 0.8em;
- padding-top: 0.3em;
- padding-right: 0.8em;
- border: 1px solid #059;
- background-color: #27C;
- margin: 0 0.3em;
- height: 2em;
-}
-
-.rw_navbar_righttab:hover
-{
- background-color: #49E;
-}
-
-.rw_content
-{
- clear: both;
- margin-top: 2em;
- margin-left: 3em;
- margin-right: 3em;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- font-weight: bolder;
- clear: both;
- font-size: 90%;
- padding: 1em;
- margin-top: 3em;
- margin-left: 5em;
- margin-right: 5em;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #27C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #27C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab { background-color: #C72; }
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
-
diff --git a/ruwiki/tags/release-0.9.1/templates/default/save.tmpl b/ruwiki/tags/release-0.9.1/templates/default/save.tmpl
deleted file mode 100644
index 04069b1..0000000
--- a/ruwiki/tags/release-0.9.1/templates/default/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.1/templates/sidebar/body.tmpl b/ruwiki/tags/release-0.9.1/templates/sidebar/body.tmpl
deleted file mode 100644
index 2f3c10f..0000000
--- a/ruwiki/tags/release-0.9.1/templates/sidebar/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.9.1/templates/sidebar/content.tmpl b/ruwiki/tags/release-0.9.1/templates/sidebar/content.tmpl
deleted file mode 100644
index fa2d67e..0000000
--- a/ruwiki/tags/release-0.9.1/templates/sidebar/content.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.9.1/templates/sidebar/controls.tmpl b/ruwiki/tags/release-0.9.1/templates/sidebar/controls.tmpl
deleted file mode 100644
index 6e12b22..0000000
--- a/ruwiki/tags/release-0.9.1/templates/sidebar/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_titlebar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_titlebar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.1/templates/sidebar/edit.tmpl b/ruwiki/tags/release-0.9.1/templates/sidebar/edit.tmpl
deleted file mode 100644
index eb04395..0000000
--- a/ruwiki/tags/release-0.9.1/templates/sidebar/edit.tmpl
+++ /dev/null
@@ -1,27 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_titlebar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_titlebar_tab" id="rw_editing_tab"><strong><em>#label_editing#</em> #%page_version%</strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <div class="rw_content_edit">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.1/templates/sidebar/error.tmpl b/ruwiki/tags/release-0.9.1/templates/sidebar/error.tmpl
deleted file mode 100644
index 5a2882e..0000000
--- a/ruwiki/tags/release-0.9.1/templates/sidebar/error.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.1/templates/sidebar/footer.tmpl b/ruwiki/tags/release-0.9.1/templates/sidebar/footer.tmpl
deleted file mode 100644
index 6dfc390..0000000
--- a/ruwiki/tags/release-0.9.1/templates/sidebar/footer.tmpl
+++ /dev/null
@@ -1,22 +0,0 @@
-<div class="rw_footer">
- <form class="rw_footer_tab" action="_search">
- <div>
- <input class="rw_search_box" type="text" name="q" size="10" />
- </div>
- <div>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- </div>
- </form>
- <div class="rw_footer_tab">
- <dl>
- <dt>%page_project%::</dt>
- <dd><a href="%cgi_url%/%page_project%/_topics">#label_topics#</a><br />
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </dd>
- </div>
- <div class="rw_footer_tab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.9.1/templates/sidebar/ruwiki.css b/ruwiki/tags/release-0.9.1/templates/sidebar/ruwiki.css
deleted file mode 100644
index 0f2b4cc..0000000
--- a/ruwiki/tags/release-0.9.1/templates/sidebar/ruwiki.css
+++ /dev/null
@@ -1,347 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
-.rw_titlebar
-{
- margin: 0 auto;
- height: 0.5em;
-}
-
- /* Normal styling from here on out. */
-body
-{
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_titlebar
-{
- font-size: 0.7em;
- border: 1px solid #059;
- color: white;
- background-color: #5C9;
- height: 0.5em;
- width: 100%;
-}
-
-.rw_titlebar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_titlebar a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_titlebar a:hover
-{
- text-decoration: none;
-}
-
-.rw_titlebar_tab
-{
- float: left;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_titlebar_tab:hover
-{
- background-color: #4E9;
-}
-
-div.rw_footer
-{
- position: fixed;
- left: 72%;
- width: 20%;
- height: 100%;
- padding: 0.2em;
- padding-top: 0.5em;
-//background-color: #95C;
- font-size: 0.9em;
-}
-
-.rw_footer
-{
-}
-
-.rw_footer a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_footer a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_footer a:hover
-{
- text-decoration: none;
-}
-
-.rw_footer_tab
-{
- color: yellow;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0.3em;
- min-height: 2em;
- clear: both;
-}
-
-.rw_footer_tab div
-{
- text-align: right;
-}
-
-div#rw_content
-{
- padding: 50px 0 0 0;
- margin-left: 0;
- voice-family: "\"}\""; /* fake out IE5/Win */
- voice-family: inherit;
- margin-left: 16px;
-}
-
-body > div#rw_content
-{
- margin-left: 0;
-}
-
-.rw_content
-{
- padding-top: 0;
- margin-left: 3em;
- width: 65%;
- float: left;
-}
-
-.rw_content_edit
-{
- width: 90%;
- margin: 0 auto;
- padding: 2em;
- padding-top: 0;
- float: left;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- float: left;
- font-weight: bolder;
- font-size: 90%;
- padding: 0.5em;
- width: 65%;
- margin-top: 3em;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #59C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #59C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #59C;
- margin: 0.1em;
-}
-
-.rw_search_box
-{
- border: 1px dotted #59C;
- width: 100%;
- margin: 0.1em;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab
-{
- background-color: #C72;
- text-align: right;
- margin-right: 2em;
- float: right;
-}
-
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.9.1/templates/sidebar/save.tmpl b/ruwiki/tags/release-0.9.1/templates/sidebar/save.tmpl
deleted file mode 100644
index 7c4c31c..0000000
--- a/ruwiki/tags/release-0.9.1/templates/sidebar/save.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-<div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.9.1/templates/simple/body.tmpl b/ruwiki/tags/release-0.9.1/templates/simple/body.tmpl
deleted file mode 100644
index b3281d0..0000000
--- a/ruwiki/tags/release-0.9.1/templates/simple/body.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.9.1/templates/simple/content.tmpl b/ruwiki/tags/release-0.9.1/templates/simple/content.tmpl
deleted file mode 100644
index 2da5e62..0000000
--- a/ruwiki/tags/release-0.9.1/templates/simple/content.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content -->
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.1/templates/simple/controls.tmpl b/ruwiki/tags/release-0.9.1/templates/simple/controls.tmpl
deleted file mode 100644
index 29cdf3a..0000000
--- a/ruwiki/tags/release-0.9.1/templates/simple/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <a href="%cgi_url%/%page_project%/">%page_project%</a>
- &raquo;
- %page_topic%
- [?editable|<a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">[#label_edit#]</a>?]
-</div>
diff --git a/ruwiki/tags/release-0.9.1/templates/simple/edit.tmpl b/ruwiki/tags/release-0.9.1/templates/simple/edit.tmpl
deleted file mode 100644
index b42759d..0000000
--- a/ruwiki/tags/release-0.9.1/templates/simple/edit.tmpl
+++ /dev/null
@@ -1,25 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <strong>%page_topic%</strong>
- &raquo;
- <strong>%page_project%</strong>
- [<strong><em>#label_editing#</em> #%page_version%</strong>]
-</div>
-
-<div class="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
-</div>
diff --git a/ruwiki/tags/release-0.9.1/templates/simple/error.tmpl b/ruwiki/tags/release-0.9.1/templates/simple/error.tmpl
deleted file mode 100644
index ac898ea..0000000
--- a/ruwiki/tags/release-0.9.1/templates/simple/error.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- |
- <strong><em>%name%</em></strong>
-</div>
-<div class="rw_content">
-<h1>%name%</h1>
-<p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
-<p>%backtrace%</p>
-</div>
diff --git a/ruwiki/tags/release-0.9.1/templates/simple/footer.tmpl b/ruwiki/tags/release-0.9.1/templates/simple/footer.tmpl
deleted file mode 100644
index 2e7893b..0000000
--- a/ruwiki/tags/release-0.9.1/templates/simple/footer.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<form class="rw_navbar" action="_search">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- |
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>,
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- |
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
-</form>
diff --git a/ruwiki/tags/release-0.9.1/templates/simple/ruwiki.css b/ruwiki/tags/release-0.9.1/templates/simple/ruwiki.css
deleted file mode 100644
index 57d1a09..0000000
--- a/ruwiki/tags/release-0.9.1/templates/simple/ruwiki.css
+++ /dev/null
@@ -1,192 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #fafafa;
-}
-
-.rw_navbar
-{
- font-weight: bold;
- font-size: 1.1em;
- padding: 0.3em;
-}
-
-.rw_navbar a
-{
- border-bottom: 1px dashed black;
- font-weight: bold;
-}
-.rw_navbar a:visited
-{
- color: maroon;
- border-bottom: 1px dashed maroon;
-}
-.rw_navbar a:hover { background-color: #afafaf; }
-
-.rw_content
-{
- background-color: white;
- border: 1px dashed grey;
- padding: 0.5em;
- margin-left: 1em;
- margin-right: 1em;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- font-weight: bolder;
- font-size: 90%;
- padding: 0.5em;
- margin-left: 3em;
- margin-right: 3em;
-}
-
-
-.rw_edit_content
-{
- border: 1px solid black;
- padding: 0.3em;
- width: 95%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px solid black;
- padding: 0.3em;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px solid black;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form { }
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px solid black;
-}
-
-.rw_pagelink { text-decoration: none; }
-.rw_projectxlink { }
-.rw_projectindex { }
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title { }
-
-.rw_edit_format div
-{
-}
-
-.rw_search_button
-{
- border: 1px solid black;
-}
-
-.rw_search_box
-{
- border: 1px solid black;
-}
-
-.rw_search_box:hover { }
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_saved_page_announcement { }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { border: none; }
-.rwtk_NumberedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_NamedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_ExternalLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_RubyTalkLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_OtherRubyLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dashed grey; }
-.rwtk_WikiLink { text-decoration: none; }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.9.1/templates/simple/save.tmpl b/ruwiki/tags/release-0.9.1/templates/simple/save.tmpl
deleted file mode 100644
index 51de9f4..0000000
--- a/ruwiki/tags/release-0.9.1/templates/simple/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.1/tests/harness.rb b/ruwiki/tags/release-0.9.1/tests/harness.rb
deleted file mode 100644
index 80e7eeb..0000000
--- a/ruwiki/tags/release-0.9.1/tests/harness.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-ENV["REQUEST_METHOD"] = "HEAD"
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_type = 'flatfiles'
-
-dp = nil
-dp = "../data" if File.exists?("../data")
-dp = "./data" if File.exists?("./data")
-raise "Cannot find either ./data or ../data for tests. Aborting." if dp.nil?
-
-$wiki.config.storage_options['flatfiles']['data-path'] = dp
-$wiki.config.storage_options['flatfiles']['format'] = "exportable"
-$wiki.config.storage_options['flatfiles']['extension'] = "ruwiki"
-
-tp = nil
-tp = "../templates" if File.exists?("../templates")
-tp = "./templates" if File.exists?("./templates")
-raise "Cannot find either ./templates or ../templates for tests. Aborting." if tp.nil?
-
-$wiki.config.template_path = tp
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.9.1/tests/tc_backend_flatfile.rb b/ruwiki/tags/release-0.9.1/tests/tc_backend_flatfile.rb
deleted file mode 100644
index c3c815c..0000000
--- a/ruwiki/tags/release-0.9.1/tests/tc_backend_flatfile.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-require 'fileutils'
-
-class TestBackendFlatfiles < Test::Unit::TestCase
- def setup
- @ffopts = { 'data-path' => "./test/data", 'extension' => nil }
-
- # generate a database
- raise "Setup Error: #{@ffopts['data-path']} exists" if File.exists?(@ffopts['data-path'])
-
- @flatbase = {
- 'Proj1' => ['ProjectIndex:all projects must have this',
- 'P1TopicOne:this is the content',
- 'P1TopicTwo:more content'],
- 'Proj2' => ['ProjectIndex:all projects must have this',
- 'P2TopicOne:this is the content',
- 'P2TopicTwo:more content',
- 'P2TopicThree:even more more content']
- }
-
- @flatbase.each do |key, val|
- prjdir = "#{@ffopts['data-path']}/#{key}"
- FileUtils.mkdir_p(prjdir) rescue nil
- val.each do |topcon|
- topic, content = topcon.split(":")
- File.open("#{prjdir}/#{topic}", "w") do |fh|
- fh.puts "page!content:\x09#{content}"
- end
- end
- end
-
- @backend = nil
- @pg = nil
- end
-
- def teardown
- # remove testing flatabase
- FileUtils.rm_rf(@ffopts['data-path'])
- Dir.rmdir("./test") # ugly but it works
- end
-
- def test_list_projects
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- # should be ['Proj1', 'Proj2']
- assert_equal(@flatbase.keys, @backend.list_projects)
- end
-
- def test_list_topics
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- @flatbase.keys.sort.each do |proj|
- got_topics = @backend.list_topics(proj)
- exp_topics = @flatbase[proj].map { |ent| ent.split(':')[0] }
- assert_equal(exp_topics.sort, got_topics.sort)
- end
- end
-
- # test simple one word lookups
- # need to add more complex search strings
- def test_search_project
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- assert_equal({'ProjectIndex' => 1,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 0 }.to_a.sort,
- @backend.search_project('Proj1', 'this').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 0,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'more').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'topic').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'content').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P2TopicOne' => 0,
- 'P2TopicTwo' => 1,
- 'P2TopicThree' => 2 }.to_a.sort,
- @backend.search_project('Proj2', 'more').to_a.sort)
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/tests/tc_bugs.rb b/ruwiki/tags/release-0.9.1/tests/tc_bugs.rb
deleted file mode 100644
index 477cbeb..0000000
--- a/ruwiki/tags/release-0.9.1/tests/tc_bugs.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-
-# see if we can reproduce the LicenseandAuthor hang
-# described in bug id 147 on rubyforge
-class TC_LicenseAndAuthorHang < Test::Unit::TestCase
- def setup
- @ffopts = { }
- dp = nil
- dp = "../data" if File.exists?("../data")
- dp = "./data" if File.exists?("./data")
- raise "Cannot find either ./data or ../data for tests. Aborting." if dp.nil?
-
- @ffopts['data-path'] = dp
- @ffopts['format'] = 'exportable'
-
- @backend = nil
- @pg = nil
- end
-
- # load "to the metal"
- def test_ffload
- assert_nothing_raised do
- @backend = ::Ruwiki::Backend::Flatfiles.new(@ffopts)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.load('LicenseAndAuthorInfo.ruwiki', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-
- # abstract backend retreive
- def test_beload
- @backend = nil
- assert_nothing_raised do
- mock_ruwiki = OpenStruct.new
- mock_ruwiki.config = OpenStruct.new
- mock_ruwiki.config.message = {}
- mock_ruwiki.config.storage_options = { 'flatfiles' => @ffopts }
-
- @backend = ::Ruwiki::BackendDelegator.new(mock_ruwiki, 'flatfiles')
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.retrieve('LicenseAndAuthorInfo', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-end
-
-# if __FILE__ == $0
-# ObjectSpace.each_object { |o| tests << o if o.kind_of?(Class) }
-# tests.delete_if { |o| !o.ancestors.include?(Test::Unit::TestCase) }
-# tests.delete_if { |o| o == Test::Unit::TestCase }
-
-# tests.each { |test| Test::Unit::UI::Console::TestRunner.run(test) }
-# end
diff --git a/ruwiki/tags/release-0.9.1/tests/tc_exportable.rb b/ruwiki/tags/release-0.9.1/tests/tc_exportable.rb
deleted file mode 100644
index b067240..0000000
--- a/ruwiki/tags/release-0.9.1/tests/tc_exportable.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-class Ruwiki; end if __FILE__ == $0
-
-require 'ruwiki/exportable'
-require 'test/unit'
-
- class TCExportable < Test::Unit::TestCase
- class Exportable
- include Ruwiki::Exportable
-
- attr_accessor :a, :b, :long_name, :altname, :xform, :group2
- exportable :a
- exportable :long_name
- exportable :altname, :name => 'alt-name'
- exportable :group2, :group => 'group2'
- end
-
- def test_exportable
- __exportables = {
- 'default' => {
- 'a' => '@a'.intern,
- 'long-name' => '@long_name'.intern,
- 'alt-name' => '@altname'.intern,
- },
- 'group2' => {
- 'group2' => '@group2'.intern
- }
- }
- __values = {
- 'default' => {
- 'a' => 'a',
- 'long-name' => 'c',
- 'alt-name' => 'd',
- },
- 'group2' => { 'group2' => 'e' }
- }
- xx = nil
- ss = nil
- assert_nothing_raised do
- xx = Exportable.new
- xx.a = "a"
- xx.b = "b"
- xx.long_name = "c"
- xx.altname = "d"
- xx.xform = 22/7
- xx.group2 = "e"
- ss = xx.export
- end
- assert_equal(__exportables, xx.class.__exportables)
- assert_equal(__values, ss)
- end
- end
diff --git a/ruwiki/tags/release-0.9.1/tests/tc_template.rb b/ruwiki/tags/release-0.9.1/tests/tc_template.rb
deleted file mode 100644
index c4da672..0000000
--- a/ruwiki/tags/release-0.9.1/tests/tc_template.rb
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'test/unit'
-require 'harness'
-
-class TestTemplates < Test::Unit::TestCase
- def test_include
- a = "a!INCLUDE!c"
- b = "b"
- t = Ruwiki::TemplatePage.new(a, b)
- assert_equal(["abc"], t.lines.lines)
- end
-
- def test_variables
- a = "a%b%c"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.write_plain_on("", v))
- end
-
- def test_optional_variables
- a = "a%b%%?c%d"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.write_plain_on("", v))
-
- v["c"] = "c"
- assert_equal("abcd", t.write_plain_on("", v))
- end
-
- def test_labels
- a = "a#b#c"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.write_plain_on("", v, m))
- end
-
- def test_optional_labels
- a = "a#b##?c#d"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.write_plain_on("", v, m))
-
- m[:c] = "c"
- assert_equal("abcd", t.write_plain_on("", v, m))
- end
-
- def test_hrefs
- a = "HREF:a:b:"
- t = Ruwiki::TemplatePage.new(a)
- v = { "b" => "b" }
-
- assert_equal("b", t.write_plain_on("", v))
-
- s = ""
- v["a"] = "link"
- assert_equal(%Q(<a href="link">b</a>), t.write_plain_on("", v))
- end
-
- def test_repeat_subst
- v1 = { "a" => 3 }
- v2 = { "a" => 2...4 }
- v3 = { "a" => -4...-2 }
- v4 = { "a" => [3, 1, 4, 1, 5, 9] }
- v5 = { "a" => [{ "a" => 3 }, { "a" => 1 }, { "a" => 4 }, { "a" => 1 }, { "a" => 5 }, { "a" => 9 }] }
-
- a = "[:a|xy:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("xyxyxy", t.write_plain_on("", v1))
- assert_equal("xyxy", t.write_plain_on("", v2))
- assert_equal("xyxy", t.write_plain_on("", v3))
- assert_equal("xyxyxyxyxyxy", t.write_plain_on("", v4))
- assert_equal("xyxyxyxyxyxy", t.write_plain_on("", v5))
-
- a = "[:a|%a%:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("123", t.write_plain_on("", v1))
- assert_equal("23", t.write_plain_on("", v2))
- assert_equal("-4-3", t.write_plain_on("", v3))
- assert_equal("314159", t.write_plain_on("", v4))
- assert_equal("314159", t.write_plain_on("", v5))
- end
-
- def test_optional_subst
- v1 = { "a" => "a" }
- v2 = { "a" => nil }
- a1 = "[?a|xy?]"
- a2 = "[!a|xy?]"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
-
- assert_equal("xy", t1.write_plain_on("", v1))
- assert_equal("", t1.write_plain_on("", v2))
- assert_equal("", t2.write_plain_on("", v1))
- assert_equal("xy", t2.write_plain_on("", v2))
- end
-
- def test_repeat_block
- a1 = "START:a\nxy\nEND:a"
- a2 = "START:a\nx%b%y\nEND:a"
- a3 = "START:\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- v = { "a" => [{ "b" => 3 }, { "b" => 1 }, { "b" => 4 }, { "b" => 1 }, { "b" => 5 }, { "b" => 9 }] }
-
- assert_equal("xy\nxy\nxy\nxy\nxy\nxy\n", t1.write_plain_on("", v))
- assert_equal("x3y\nx1y\nx4y\nx1y\nx5y\nx9y\n", t2.write_plain_on("", v))
- assert_raises(RuntimeError) { t3.write_plain_on("", v) }
- end
-
- def test_optional_block
- a1 = "IF:a\nxy\nENDIF:a"
- a2 = "IF:\nxy\nEND:"
- a3 = "IFNOT:a\nxy\nENDIF:a"
- a4 = "IFNOT:\nxy\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- t4 = Ruwiki::TemplatePage.new(a4)
- v1 = { "a" => true }
- v2 = { "a" => nil }
-
- assert_equal("xy", t1.write_plain_on("", v1))
- assert_equal("", t1.write_plain_on("", v2))
- assert_raises(RuntimeError) { t2.write_plain_on("", v1) }
- assert_equal("", t3.write_plain_on("", v1))
- assert_equal("xy", t3.write_plain_on("", v2))
- assert_raises(RuntimeError) { t4.write_plain_on("", v1) }
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/tests/tc_tokens.rb b/ruwiki/tags/release-0.9.1/tests/tc_tokens.rb
deleted file mode 100644
index 929701a..0000000
--- a/ruwiki/tags/release-0.9.1/tests/tc_tokens.rb
+++ /dev/null
@@ -1,335 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'test/unit'
-require 'harness'
-
-class TokenTestCases < Test::Unit::TestCase
- def setup
- @mrw = MockRuwiki.new
- end
-
- class MockRuwiki
- def initialize
- @project = "Default"
- @tokens = []
- @script = "<uri>"
- @message = Hash.new { |h, k| h[k] = "#{k.inspect}" }
- @title = "Ruwiki"
- end
-
- def __tokenize(content, token)
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, @project, $wiki.backend, @script, @message, @title)
- @tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{@tokens.size - 1}"
- else
- "TOKEN_#{@tokens.size - 1}"
- end
- end
- content
- end
-
- def __replace(content)
- replaced = []
- s = true
- loop do
- break if replaced.size >= @tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].restore
- end
-
- s = content.gsub!(/TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].replace
- end
- end
- content
- end
-
- def __post_replace(content)
- token_classes = @tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
- content
- end
-
- end
-
- def __process(token, content, tokenized, replaced, result)
- assert_equal(tokenized, content = @mrw.__tokenize(content, token), "Tokenization failure.")
- assert_equal(replaced, content = @mrw.__replace(content), "Replacement failure.")
- assert_equal(result, content = @mrw.__post_replace(content), "Post-replace failure.")
- end
-
- def __display(token, content)
- p tokenized = @mrw.__tokenize(content.dup, token)
- p replaced = @mrw.__replace(tokenized.dup)
- p result = @mrw.__post_replace(replaced.dup)
- end
-
- def test_Paragraph
- token = Ruwiki::Wiki::Paragraph
- content = "\nABC\n\nabc\n"
- tkv = "TOKEN_0\nABC\nTOKEN_1\nabc\n"
- rpv = %Q(</p><p class="rwtk_Paragraph">\nABC\n</p><p class="rwtk_Paragraph">\nabc\n)
- res = %Q(<p class="rwtk_Paragraph">ABC</p>\n<p class="rwtk_Paragraph">abc</p>)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Image
- token = Ruwiki::Wiki::Image
- content = "[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_0"
- rpv = %Q(<img class="rwtk_Image" alt="http://www.halostatue.ca/graphics/maple_leaf.gif" src="http://www.halostatue.ca/graphics/maple_leaf.gif" title="http://www.halostatue.ca/graphics/maple_leaf.gif" />)
- res = rpv
-
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_1"
- content = %Q([image : http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" title="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="Maple Leaf" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_2"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true])
- rpv = %Q(<img class="rwtk_Image" alt="[1]" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[1]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_3"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true alt="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[2]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- content = "\[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_4"
- rpv = content
- res = content
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Code
- content = " line 1\n line 2\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_0TOKEN_1line 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2</pre>\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
-
- content = " line 1\n line 2\n \n\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_2TOKEN_3TOKEN_4\nline 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\n</p><pre class="rwtk_Code"> </pre>\n\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2\n </pre>\n\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NumberedLinks
- token = Ruwiki::Wiki::NumberedLinks
- Ruwiki::Wiki.reset_numbered_links
- content = "[http://www.yahoo.com] [http://www.ruby-lang.org] \\[http://www.rubyforge.org]"
- tkv = "TOKEN_0 TOKEN_1 \\TOKEN_2"
- uri = CGI.escape("http://www.yahoo.com")
- rpv = %Q{<a class="rwtk_NumberedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">[1]</a> <a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[2]</a> [http://www.rubyforge.org]}
- res = %Q{<a class="rwtk_NumberedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">[1]</a> <a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[2]</a> [http://www.rubyforge.org]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NamedLinks
- token = Ruwiki::Wiki::NamedLinks
- content = "[http://www.yahoo.com Yahoo!] [http://www.ruby-lang.org Ruby] \\[http://www.rubyforge.org RubyForge]"
- tkv = "TOKEN_0 TOKEN_1 \\TOKEN_2"
- uri = CGI.escape("http://www.yahoo.com")
- rpv = %Q{<a class="rwtk_NamedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">Yahoo!</a> <a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
- res = %Q{<a class="rwtk_NamedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">Yahoo!</a> <a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ExternalLinks
- token = Ruwiki::Wiki::ExternalLinks
- content = "http://www.yahoo.com http://www.ruby-lang.org \\http://www.rubyforge.org"
- tkv = "TOKEN_0 TOKEN_1 \\TOKEN_2"
- uri = CGI.escape("http://www.yahoo.com")
- rpv = %Q{<a class="rwtk_ExternalLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">http://www.yahoo.com</a> <a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
- res = %Q{<a class="rwtk_ExternalLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">http://www.yahoo.com</a> <a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_HRule
- token = Ruwiki::Wiki::HRule
- content = "----\n\\----"
- tkv = "TOKEN_0\n\\TOKEN_1"
- rpv = %Q(<hr class="rwtk_HRule" />\n----)
- res = %Q(<hr class="rwtk_HRule" />\n----)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLink
- token = Ruwiki::Wiki::ProjectCrossLink
- content = "Ruwiki::ChangeLog \\Ruwiki::To_Do Ruwiki::NotExist \\Ruwiki::NotExist"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLinkWikipedia
- token = Ruwiki::Wiki::ProjectCrossLinkWikipedia
- content = "Ruwiki::[[ChangeLog]] \\Ruwiki::[[To_Do]] Ruwiki::[[Does Not Exist]] \\Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 Ruwiki::[[_invalid]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectIndex
- token = Ruwiki::Wiki::ProjectIndex
- content = "::Ruwiki \\::Ruwiki ::Newproject \\::Newproject"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikiLinks
- token = Ruwiki::Wiki::WikiLinks
- content = "ProjectIndex \\ProjectIndex AustinZiegler \\AustinZiegler Alan_Chen \\Alan_Chen"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikipediaLinks
- token = Ruwiki::Wiki::WikipediaLinks
- content = "[[ProjectIndex]] \\[[ProjectIndex]] [[Austin Ziegler]] \\[[Austin Ziegler]] [[_Alan Chen]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 [[_Alan Chen]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Abbreviations
- token = Ruwiki::Wiki::Abbreviations
- content = "@{matz}\n@{}\n\\@{matz}"
- tkv = "TOKEN_0\nTOKEN_1\n\\TOKEN_2"
- rpv = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
- res = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Headings
- token = Ruwiki::Wiki::Headings
- content = "= header 1\n== header 2\n=== header 3\n==== header 4\n===== header 5\n====== header 6\n======= header 7->6\n\\== noheader 2\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\nTOKEN_6\n\\TOKEN_7\n"
- rpv = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n== noheader 2\n)
- res = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n<p class="rwtk_Paragraph">== noheader 2\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Blockquotes
- token = Ruwiki::Wiki::Blockquotes
- content = ": level 1\n:: level 2\n::: level 3\n: level 1, para 2\n\\: not a blockquote\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<blockquote class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n: not a blockquote\n)
- res = %Q(<blockquote class="rwtk_Blockquotes">level 1<blockquote class="rwtk_Blockquotes">level 2<blockquote class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n: not a blockquote\n)
- __process(token, content, tkv, rpv, res)
-
- content = "> level 1\n>> level 2\n>>> level 3\n> level 1, para 2\n\\> not a blockquote\n"
- tkv = "TOKEN_5\nTOKEN_6\nTOKEN_7\nTOKEN_8\n\\TOKEN_9\n"
- rpv = %Q(<blockquote type="cite" class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- res = %Q(<blockquote type="cite" class="rwtk_Blockquotes">level 1<blockquote type="cite" class="rwtk_Blockquotes">level 2<blockquote type="cite" class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Definitions
- token = Ruwiki::Wiki::Definitions
- content = "; word1 : val1\n;; word2 : val2\n;;; word3 : val3\n; word1/2 : val1/2\n\\; not-a-word : not-a-val\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd></dl></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl></dl>\n<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
- res = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
-
-# __display(token, content)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Lists
- content = "* level 1\n** level 2\n*** level 3\n*** level 3, item 2\n** level 2, item 2\n* level 1, item 2\n\\* not an item\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\n\\TOKEN_6\n"
- rpv = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ul></ul>\n<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- res = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ul><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n## level 2\n### level 3\n### level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_7\nTOKEN_8\nTOKEN_9\nTOKEN_10\nTOKEN_11\nTOKEN_12\n\\TOKEN_13\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ol><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n*# level 2\n*** level 3\n*#* level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_14\nTOKEN_15\nTOKEN_16\nTOKEN_17\nTOKEN_18\nTOKEN_19\n\\TOKEN_20\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ol></ul>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
- end
-
-
- def test_RubyTalkLinks
- token = Ruwiki::Wiki::RubyTalkLinks
- content = "[ruby-talk:12345] \\[ruby-talk:12345]"
- tkv = "TOKEN_0 \\TOKEN_1"
-# rpv = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
- rpv = %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
-# res = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
- res = %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_OtherRubyLinks
- token = Ruwiki::Wiki::OtherRubyLinks
- content = "[ruby-list:123] \\[ruby-list:123] [ruby-doc:123] \\[ruby-doc:123] [ruby-core:123] \\[ruby-core:123] [ruby-dev:123] \\[ruby-dev:123] [ruby-ext:123] \\[ruby-ext:123] [ruby-math:123] \\[ruby-math:123]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5 TOKEN_6 \\TOKEN_7 TOKEN_8 \\TOKEN_9 TOKEN_10 \\TOKEN_11"
- rpv = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
- res = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
-
- __process(token, content, tkv, rpv, res)
- end
-end
diff --git a/ruwiki/tags/release-0.9.1/tests/testall.rb b/ruwiki/tags/release-0.9.1/tests/testall.rb
deleted file mode 100755
index f2e9100..0000000
--- a/ruwiki/tags/release-0.9.1/tests/testall.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-$stderr.puts "Checking for test cases:"
-Dir['tc_*.rb'].each do |testcase|
- $stderr.puts "\t#{testcase}"
- load testcase
-end
-$stderr.puts " "
diff --git a/ruwiki/tags/release-0.9.2/Rakefile b/ruwiki/tags/release-0.9.2/Rakefile
deleted file mode 100644
index e1739e4..0000000
--- a/ruwiki/tags/release-0.9.2/Rakefile
+++ /dev/null
@@ -1,207 +0,0 @@
-#! /usr/bin/env rake
-$LOAD_PATH.unshift('lib')
-
-require 'rubygems'
-require 'rake/gempackagetask'
-require 'ruwiki'
-require 'ruwiki/utils'
-require 'ruwiki/utils/manager'
-require 'zlib'
-
-DISTDIR = "ruwiki-#{Ruwiki::VERSION}"
-TARDIST = "../#{DISTDIR}.tar.gz"
-
-DATE_RE = %r<(\d{4})[./-]?(\d{2})[./-]?(\d{2})(?:[\sT]?(\d{2})[:.]?(\d{2})[:.]?(\d{2})?)?>
-
-if ENV['RELEASE_DATE']
- year, month, day, hour, minute, second = DATE_RE.match(ENV['RELEASE_DATE']).captures
- year ||= 0
- month ||= 0
- day ||= 0
- hour ||= 0
- minute ||= 0
- second ||= 0
- ReleaseDate = Time.mktime(year, month, day, hour, minute, second)
-else
- ReleaseDate = nil
-end
-
-desc "Run Ruwiki unit tests."
-task :test do |t|
- require 'test/unit/testsuite'
- require 'test/unit/ui/console/testrunner'
-
- runner = Test::Unit::UI::Console::TestRunner
-
- $LOAD_PATH.unshift('tests')
- $stderr.puts "Checking for test cases:" if t.verbose
- Dir['tests/tc_*.rb'].each do |testcase|
- $stderr.puts "\t#{testcase}" if t.verbose
- load testcase
- end
-
- suite = Test::Unit::TestSuite.new("Ruwiki Tests")
-
- ObjectSpace.each_object(Class) do |testcase|
- suite << testcase.suite if testcase < Test::Unit::TestCase
- end
-
- runner.run(suite)
-end
-
-task :clean_data do
- Dir["data/**/*"].each do |file|
- FileUtils.rm_f(file) if file =~ /(?:rdiff|lock|~)$/
- end
-end
-
-desc "Build the default Ruwiki deployment package."
-task :package_data => [ :clean_data ] do
- Ruwiki::Utils::Manager.package(".", ".", nil, false)
-end
-
-task :make_readonly do
- data = nil
- Dir["data/**/*.ruwiki"].each do |file|
- File.open(file, "rb") { |f| data = f.read }
- FileUtils.cp(file, "#{file}.orig")
- if data =~ %r{properties!editable:}o
- data.gsub!(%r{^properties!editable:[ \t].*?$}, "properties!editable:\tfalse")
- else
- data << "properties!editable:\tfalse\n"
- end
- File.open(file, "wb") { |out| out.write(data) }
- end
-end
-
-task :clean_readonly do
- Dir["data/**/*.ruwiki"].each do |file|
- orig = "#{file}.orig"
- FileUtils.mv(orig, file) if File.exists?(orig)
- end
-end
-
-spec = Gem::Specification.new do |s|
- s.name = %q(ruwiki)
- s.version = Ruwiki::VERSION
- s.summary = %q{A simple, extensible, and fast Wiki-clone.}
-
- s.add_dependency('diff-lcs', '~> 1.1.2')
- s.add_dependency('archive-tar-minitar', '~> 0.5.1')
-
- s.has_rdoc = true
- s.rdoc_options = ["--title", "Ruwiki - An Extensible Wiki", "--main", "Readme.tarfile", "--line-numbers"]
- s.extra_rdoc_files = %w(Readme.tarfile Readme.rubygems)
-
- s.bindir = 'bin'
- s.executables = Dir['bin/**/*'].delete_if do |item|
- item =~ %r{(?:\bCVS\b|\.svn\b|[Rr]akefile|install.rb$|~$|gem(?:spec)?$)}
- end.map { |item| item.gsub(%r{^bin/}, "") }
- s.autorequire = %q{ruwiki}
- s.require_paths = %w{lib}
-
- s.test_files = %w{tests/testall.rb}
-
- files = Dir["**/*"].delete_if do |item|
- item =~ %r{\bCVS\b |
- \.svn\b |
- \.bak$ |
- [Rr]akefile |
- install\.rb$ |
- ~$ |
- gem(spec)?$ |
- lib/archive |
- lib/diff |
- \.ruwiki\.orig$}x
- end
- files << "ruwiki.pkg"
- s.files = files
-
- s.author = %q{Austin Ziegler and Alan Chen}
- s.email = %q{ruwiki-discuss@rubyforge.org}
- s.rubyforge_project = %q(ruwiki)
- s.homepage = %q{http://ruwiki.rubyforge.org/}
-
- description = []
- File.open("Readme.rubygems") do |file|
- file.each do |line|
- line.chomp!
- break if line.empty?
- description << "#{line.gsub(/\[\d\]/, '')}"
- end
- end
- s.description = description[2..-1].join(" ")
-end
-desc "Build the RubyGem for Ruwiki."
-task :gem => [ :test ]
-task :gem => [ :update_version ]
-task :gem => [ :package_data ]
-task :gem => [ :make_readonly ]
-Rake::GemPackageTask.new(spec) do |g|
- g.need_tar = false
- g.need_zip = false
- g.package_dir = ".."
-end
-
-VERSION_STRING_RE = %r{\\?%RV#%}
-
-desc "Update the version of Ruwiki to #{Ruwiki::VERSION} in documentation files."
-task :update_version do
- FileList["data/**/*.ruwiki", "Readme*"].to_a.each do |file|
- data = File.read(file)
- data.gsub!(VERSION_STRING_RE) do |match|
- if match[0] == '\\'
- match
- else
- Ruwiki::VERSION
- end
- end
- File.open(file, "wb") { |f| f.write(data) }
- end
-end
-
-desc "Build a Ruwiki .tar.gz distribution."
-task :tar => [ TARDIST ]
-file TARDIST => [ :test, :update_version ] do |t|
- current = File.basename(Dir.pwd)
- Dir.chdir("..") do
- begin
- files = Dir["#{current}/**/*"].select { |dd| dd !~ %r{(?:/CVS/?|~$)} }
- files.delete_if { |dd| dd =~ %r{Rakefile} }
- files.map! do |dd|
- mtime = ReleaseDate || File.stat(dd).mtime
- ddnew = dd.gsub(/^#{current}/, DISTDIR)
- if File.directory?(dd)
- { :name => ddnew, :mode => 0755, :dir => true, :mtime => mtime }
- else
- if dd =~ %r{bin/}
- mode = 0755
- else
- mode = 0644
- end
- data = File.read(dd)
- { :name => ddnew, :mode => mode, :data => data, :size => data.size,
- :mtime => mtime }
- end
- end
-
- ff = File.open(t.name.gsub(%r{^\.\./}o, ''), "wb")
- gz = Zlib::GzipWriter.new(ff)
- tw = Archive::Tar::Minitar::Writer.new(gz)
-
- files.each do |entry|
- if entry[:dir]
- tw.mkdir(entry[:name], entry)
- else
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
- end
- end
- ensure
- tw.close if tw
- gz.close if gz
- end
- end
-end
-
-desc "Build everything."
-task :default => [ :tar, :gem, :clean_readonly ]
diff --git a/ruwiki/tags/release-0.9.2/Readme.rubygems b/ruwiki/tags/release-0.9.2/Readme.rubygems
deleted file mode 100644
index 240fe57..0000000
--- a/ruwiki/tags/release-0.9.2/Readme.rubygems
+++ /dev/null
@@ -1,86 +0,0 @@
-Ruwiki %RV#%
-------------
-Ruwiki is a simple, extensible Wiki-clone written in Ruby. It supports both
-CGI and WEBrick interfaces, templates, and CSS formatting. This Wiki differs
-from most other Wikis in that it supports project namespaces, so that two
-topics may be named the same for differing projects without colliding or
-having to resort to odd naming conventions. Please see the ::Ruwiki project in
-the running Wiki for more information. Ruwiki %RV#% has German and Spanish
-translations available.
-
-Upgrading
----------
-Ruwiki %RV#% has a flatfile format that is incompatible with older versions of
-Ruwiki. If you are upgrading from one of these versions, you must use the
-bin/convert. The simple case will be (assuming that your data files are in
-./data):
-
- % convert ./data
-
-The convert utility is automatically installed by RubyGems.
-
-Requirements
-------------
-Ruwiki currently requires:
- * Ruby 1.8
- * Diff::LCS 1.2.0
- * Archive::Tar::Minitar 0.5.1
-
-The YAML backend requires Ruby 1.8.2 after preview2. You should have been
-prompted to load these dependencies on installation.
-
-Quick Start (WEBrick Readonly)
-------------------------------
-1. Type:
-
- % ruwiki_servlet --gem-data
-
-2. Point your web browser to <http://localhost:8808/>.
-
-Quick Start (CGI)
------------------
-1. Create a directory in a place that your webserver can execute CGI programs
- and type:
-
- % ruwiki install cgi,data --to <directory>
-
-2. Ensure that ruwiki.cgi is executable on your webserver.
-3. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Create a directory to store your data and templates and type:
-
- % ruwiki install data --to <directory>
-
-2. Type:
-
- % ruwiki_servlet
-
-3. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of Ruwiki
-without editing the servlet; use ruwiki_servlet --help for more information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-Credits
--------
-* This software includes portions of Diff::LCS by Austin Ziegler, available
- for download from the Ruwiki RubyForge project:
- [http://rubyforge.org/projects/ruwiki/]
-* Portions of this software are derived from Dave Thomas's RDoc system, now
- part of the Ruby distribution.
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen].
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández].
-
-$Id$
diff --git a/ruwiki/tags/release-0.9.2/Readme.tarfile b/ruwiki/tags/release-0.9.2/Readme.tarfile
deleted file mode 100644
index a3f4ea6..0000000
--- a/ruwiki/tags/release-0.9.2/Readme.tarfile
+++ /dev/null
@@ -1,65 +0,0 @@
-Ruwiki %RV#%
-------------
-Ruwiki is a simple, extensible Wiki-clone written in Ruby. It supports both
-CGI and WEBrick interfaces, templates, and CSS formatting. This Wiki differs
-from most other Wikis in that it supports project namespaces, so that two
-topics may be named the same for differing projects without colliding or
-having to resort to odd naming conventions. Please see the ::Ruwiki project in
-the running Wiki for more information. Ruwiki %RV#% has German and Spanish
-translations available.
-
-Upgrading
----------
-Ruwiki %RV#% has a flatfile format that is incompatible with versions of
-Ruwiki older than 0.8.0. If you are upgrading from one of these versions, you
-must use the bin/convert. The simplest case will be (assuming that your data
-files are in ./data):
-
- % bin/convert ./data
-
-Requirements
-------------
-Ruwiki currently requires:
- * Ruby 1.8
- * Diff::LCS 1.2.0
- * Archive::Tar::Minitar 0.5.1
-
-The YAML backend requires Ruby 1.8.2 after preview2. Portions of Diff::LCS and
-Archive::Tar::Minitar have been included in this version of Ruwiki.
-
-Quick Start (CGI)
------------------
-1. Place the Ruwiki directory in a place that your webserver can execute CGI
- programs and ensure that ruwiki.cgi is executable on your webserver.
-2. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Run bin/ruwiki_servlet (ruby bin/ruwiki_servlet under Windows).
-2. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of Ruwiki
-without editing the servlet; use ruwiki_servlet --help for more information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-Credits
--------
-* This software includes portions of Diff::LCS and Archive::Tar::Minitar by
- Austin Ziegler, available for download from the Ruwiki RubyForge project:
- [http://rubyforge.org/projects/ruwiki/]
-* Portions of this software are derived from Dave Thomas's RDoc system, now
- part of the Ruby distribution.
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen].
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández].
-
-$Id$
diff --git a/ruwiki/tags/release-0.9.2/contrib/enscript-token.rb b/ruwiki/tags/release-0.9.2/contrib/enscript-token.rb
deleted file mode 100644
index 08c2018..0000000
--- a/ruwiki/tags/release-0.9.2/contrib/enscript-token.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# This token by Javier Fontan <jfontan@pc3d.cesga.es>.
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-require "open3"
-
-class Ruwiki::Wiki::CodeColor < Ruwiki::Wiki::Token
- def self.rank
- 0
- end
-
- def self.regexp
- %r<\{\{\{(?::(\w+)\b)?(.*?)\}\}\}>m
- end
-
- def replace
- cap = @match.captures
-
- if cap[0].nil?
- language = "ruby"
- else
- language = cap[0]
- end
-
- text = cap[1]
-
- i, o, e = Open3.popen3("enscript -B --color=emacs -Whtml -E#{language} -o -")
- i.print text
- i.close
-
- re_script = %r{(<pre>.*?</pre>)}mio
- c = o.readlines[1..-1].join("\n")
- re_script.match(c).captures[0]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<pre>\n}im, '<pre class="rwtk_CodeColor>')
- content.gsub!(%r{\n</pre>}im, '</pre>')
- content.gsub!(%r{<font color="(.+?)">}im, '<span style="color: \1">')
- content.gsub!(%r{</font>}im, '</span>')
- content.gsub!(%r{<B>}i, '<b>')
- content.gsub!(%r{</B}i, '</b>')
- content
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/contrib/rublog_integrator.rb b/ruwiki/tags/release-0.9.2/contrib/rublog_integrator.rb
deleted file mode 100644
index 504d9d6..0000000
--- a/ruwiki/tags/release-0.9.2/contrib/rublog_integrator.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This integrator based on work by Chad Fowler.
-#
-# $Id$
-#++
-
-# NOTE: This is not currently compatible with Ruwiki 0.8.0
-#
-# require 'ruwiki/wiki/handler'
-
-class Ruwiki::RubLogHandler < Ruwiki::Wiki::Handler
- def initialize(entries)
- @entries = entries
- end
-
- def page_exists?(page, project)
-# puts "pP: #{page}, #{project}"
- matches = @entries.find_entries_with_root_name(page)
- matches.each { |entry| return true if(entry.dir_name =~ /#{project}/) }
- false
- end
-
- def project_exists?(project)
- true
- end
-
- def script_url
-# request.environment['SCRIPT_NAME']
-# !!SMELL!!
- ENV['SCRIPT_NAME']
- end
-end
-
- # An experimental convertor for Ruwiki
-class RuwikiConvertor < BaseConvertor
- handles "wiki"
-
- def get_title(f)
- title = "---Untitled---"
- loop do
- line = f.gets
- if(line =~ /^topic: (\S+)/) then
- title = $1
- elsif(line =~ /^\#EHDR/) then
- return title
- end
- end
- end
-
- def convert_html(file_entry, f, all_entries)
- title = get_title(f)
- markup = Ruwiki::Wiki.new('Default', Ruwiki::RubLogHandler.new(all_entries))
- body = markup.parse(f.readlines.join("\n"), file_entry.dir_name)
- HTMLEntry.new(title, body, self)
- end
-
- # FIXME: Need to check this one
- def convert_plain(file_name, f, all_entries)
- f.read
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/data/Default/ProjectIndex.ruwiki b/ruwiki/tags/release-0.9.2/data/Default/ProjectIndex.ruwiki
deleted file mode 100644
index 28807a7..0000000
--- a/ruwiki/tags/release-0.9.2/data/Default/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,48 +0,0 @@
-page!content: = Ruwiki
- Ruwiki is a simple, extensible Wiki written in Ruby. It supports both
- CGI and \WEBrick interfaces, templates, and CSS formatting.
- Additionally, it supports project namespaces, so that two pages can be
- named the same for differing projects without colliding or odd naming
- conventions. Please see the ::Ruwiki project for more information.
-
- Ruwiki is also an internationalised Wiki, although more testing,
- especially testing with multibyte character encodings and Unicode
- (UTF-8) is required. There are German and Spanish localisations of the
- messages included with the Ruwiki distribution.
-
- The current version is %RV#%. Enhancements and changes include:
- * a deployment system, whereby Ruwiki deployments can be installed from a package manager like that used for RPA (rpa-base) or \RubyGems (see Ruwiki::RuwikiUtilities);
- * support for Ruwiki as a Windows service on NT, 2000, XP, and 2003 systems;
- * demotion of YAML and Marshal storage types to formats of the Flatfiles storage type;
- * external user authentication (currently to \RubyForge only);
- * antispam efforts including robot and IP exclusion and URL redirection (see Ruwiki::[[Antispam]]); and
- * protection against cross-site scripting (XSS) attacks with HTML and CSS cleaning.
- The full list of changes can be found in Ruwiki::ChangeLog, with
- discussions of various features in Ruwiki::WikiMarkup,
- Ruwiki::Configuring_Ruwiki, and Ruwiki::Extending_Ruwiki.
-
- If you are upgrading from a version of Ruwiki older than 0.8.0, please
- read Ruwiki::RuwikiUtilities.
-
- Certain Ruwiki \APIs are considered stable at this point, others will
- be changing leading up to 1.0. Some of this is discussed in
- Ruwiki::To_Do, with further architectural discussions in
- Ruwiki::[[Roadmap]].
-
- %projects()
-
- Please review ::Tutorial and ::Ruwiki if you are unfamiliar with the
- concept of Wikis in general. If you want to play with \WikiFormatting
- for Ruwiki, use the Ruwiki::SandBox.
-
- [http://rubyforge.org/projects/ruwiki Ruwiki development] is hosted at
- [http://rubyforge.org RubyForge]. The current release of Ruwiki can
- always be [http://rubyforge.org/frs/?group_id=84 downloaded] from
- \RubyForge or the development (unstable) version can be obtained from
- CVS.
-properties!project: Default
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/Antispam.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/Antispam.ruwiki
deleted file mode 100644
index d84ca5a..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/Antispam.ruwiki
+++ /dev/null
@@ -1,83 +0,0 @@
-page!content: = Ruwiki %RV#% Antispam
- Wiki-spam, like email spam, is a major problem. Ruwiki is going to have
- extensive configurable tools for fighting spam. As it is, there are
- several tools built into Ruwiki to assist in the fight against these
- pond scum, but the tool development is certainly not complete.
-
- == External URI Redirection
- Although this will not greatly assist in the reduction of wiki spam,
- all external \URIs are redirected through an URI on Google that is
- designed specifically to remove \PageRank from links. The mechanism
- currently works on all manually-specified external \URIs and is not
- configurable without changing the URI tokenisation code. Thus, links
- that are generated by \[ruby-talk:12345] will not be redirected through
- Google, but direct links will be.
-
- New to Ruwiki 0.9.1, \URIs may be whitelisted with
- <tt>./data/clean.uri</tt>. The list of \URIs in <tt>clean.uri</tt> are
- &#8220;extended&#8221; Ruby regular expressions, one optional
- expression to a line. Spaces are not significant and comments are
- allowed. If you want to recognise a space in your regular expression,
- do so either with a character class ([ ]) or the whitespace
- meta-character (\s). Hash marks must be escaped (\#) or they will be
- treated as comment markers. Blank or comment-only lines are ignored.
- All other lines will be joined together.
-
- As noted, this will not necessarily reduce wiki spam, but it will deny
- spammers the entire benefit of spamming a wiki implemented with Ruwiki.
-
- == Reacting to Spammers and Robots
- Ruwiki %RV#% includes the ability to present alternative versions of
- itself to certain user agents and/or IP addresses based on a list. In
- the future, both the lists and the faces presented will be configurable
- (highly configurable, at that -- watch this space), but in this version
- of Ruwiki, there are three possible versions to be displayed:
- # Normal Ruwiki. This is a normally displayable and editable wiki.
- # Read-only Ruwiki. This is displayed to benign robots and users who have demonstrated that they cannot be trusted with edit access. The primary effect is to make command pages neither indexable, archivable, nor link-followable, and to remove certain links from visibility for these user agents.
- # Forbidden Ruwiki. The user gets an HTTP response of 403 Forbidden. This is displayed to malign (email-collecting) robots and users who have demonstrated that they are malicious and bent upon defacing the wiki.
-
- While Ruwiki provides these lists, and provides an extensive list of
- both malign and benign robots, it is up to the administrators of the
- wiki to ensure that they are kept up to date.
-
- The lists themselves are &#8220;extended&#8221; Ruby regular
- expressions, one optional expression to a line. Spaces are not
- significant and comments are allowed. If you want to recognise a space
- in your regular expression, do so either with a character class ([ ]) or
- the whitespace meta-character (\s). Hash marks must be escaped (\#) or
- they will be treated as comment markers. Blank or comment-only lines are
- ignored. All other lines will be joined together.
-
- foo
- bar
-
- becomes:
-
- %r{foo|bar}x
-
- The file are stored in the data directory for the running instance of
- Ruwiki (e.g., <tt>./data</tt>):
-
- ./data/agents.banned
- ./data/agents.readonly
- ./data/hostip.banned
- ./data/hostip.readonly
-page!footer:
-page!header:
-properties!create-date: 1103593880
-properties!creator:
-properties!creator-ip: UNKNOWN
-properties!edit-comment:
-properties!edit-date: 1103593880
-properties!editable: true
-properties!editor:
-properties!editor-ip: 127.0.0.1
-properties!entropy: 0.0
-properties!html-headers:
-properties!indexable: false
-properties!project: Ruwiki
-properties!title: Antispam
-properties!topic: Antispam
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/BugTracking.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/BugTracking.ruwiki
deleted file mode 100644
index 5f24cc7..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/BugTracking.ruwiki
+++ /dev/null
@@ -1,32 +0,0 @@
-page!content: = Ruwiki %RV#% Bug Tracking
- This page is for tracking bugs in Ruwiki. Only bugs from recent
- distributions are tracked. In addition to this source-based bug
- tracking, there is the [http://rubyforge.org RubyForge]
- [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug
- tracker] for Ruwiki.
-
- Those interested in Ruwiki development may also find the Ruwiki::To_Do
- list and the Ruwiki::[[Roadmap]] useful. The format of the bug list is
- &ldquo;version: description&rdquo;.
-
- == Open Bugs
- The version number is the version in which the bug was first reported.
- * 0.6.2: Not all formatting is applied consistently. The token rankings may need adjusting. Eivind Eklund has suggested a scheme that may help with this, but it will require architectural adjustment and will probably slow things down.
-
- ----
- == Closed Bugs
- The version number is the version in which the bug was fixed.
- * 0.9.0: Fixed a problem with old page edits being applied inappropriately.
- * 0.8.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=707&group_id=84&atid=407 Sub-Numbered bullets don&rsquo;t increment]. Fixed a list numbering problem. I think that lists are a bit slower now, but they are completely accurate.
- * 0.7.0: Fixed a link detection problem in \[wikiword] format. Thanks to [mailto:eivind@FreeBSD.org Eivind Eklund] for the patch.
- * 0.7.0: Fixed a problem with &lt;pre&gt; paragraph detection and generation.
- * 0.7.0: Fixed a problem with &lt;p&gt; generation.
- * 0.7.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=197&group_id=84&atid=407 Run-away ruby on some links in default distribution]. This may be related to a runaway header problem that was reported to me on IRC some time back that I believe has been fixed. Please advise.
- * 0.6.1: Projects aren&rsquo;t created appropriately.
- * 0.6.1: Saving without editing (or repost) appears to cause problems. A fix has been applied to attempt to address this. Pages that have not been changed will not be saved.
-properties!project: Ruwiki
-properties!title: BugTracking
-properties!topic: BugTracking
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/ChangeLog.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/ChangeLog.ruwiki
deleted file mode 100644
index 3abd512..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/ChangeLog.ruwiki
+++ /dev/null
@@ -1,113 +0,0 @@
-page!content: = Ruwiki %RV#% ChangeLog
- Uncompleted to-do items can be found in To_Do. Bugs in Ruwiki are
- tracked in BugTracking.
-
- == 0.9.2
- * Fixed a problem with token handling where the first token was nil.
-
- == 0.9.1
- * Fixed a couple of problems with the Ruwiki deployment system surrounding Win32::Service management.
- * Added a Google redirect exclusion list to the configuration.
- * Fixed a problem where last lines of code blocks may not be properly marked.
- * Changed relevant timestamps to UTC.
- * Fixed a problem with Google redirection not working.
- * Fixed a problem with some pages not being displayed as links in the topic listing; only affected some pages created with the Wikipedia form of naming.
- * Fixed a problem with tokens being redefined. Once a token is defined, its class is frozen; the token reader will silently ignore TypeError exceptions.
-
- == 0.9.0
- * Created a Ruwiki deployment system. Various steps were required to accomplish this:
- ** Moved executable files to bin/ for better packaging; moved core servlet code and other utilities to Ruwiki::Utils namespace.
- ** Renamed bin/convert to bin/ruwiki_convert. This will ultimately be moved into the ruwiki command.
- ** Refactored Flatfile format (section!\item:<Tab>value) to Ruwiki::Exportable, loosened the format restrictions to allow for either section!\item:<Tab>value or section!\item:<Space>value.
- ** Incorporated Ruwiki::Exportable into Ruwiki::Config to allow for the saving of configuration files.
- ** Incorporated Ruwiki::Exportable into Ruwiki::\Utils::ServletRunner to allow for the saving of configuration files.
- ** Added Ruwiki manager code for installation and management of Ruwiki deployments.
- ** Added code for running the Ruwiki servlet as a Windows service on Win32. (Currently minimally tested and unworking.)
- ** Added --central to bin/ruwiki_servlet, to run a read-only instance of Ruwiki using the centralised data from RPA or \RubyGems.
- * Removed YAML and Marshal storage types as separate classes and incorporated them as formats of the Flatfiles storage type. Added the 'format' option to the Flatfiles storage_options hash.
- * Added draft \APIs for authentication, robot exclusion, IP exclusion, and HTML cleaning.
- ** Implemented initial authentication for \RubyForge. It verifies a user against their current \RubyForge cookie.
- ** Implemented known robot list. It may require further refinement. It contains two classes of robots:
- *** Read-only: known to be good (like the Googlebot) or neutral (most other crawlers). They are permitted to read, index, and follow links on all non-command pages.
- *** Banned: known to be bad, essentially spam-crawlers. These robots will uniformly get a 403 Forbidden result.
- ** Implemented IP exclusion list. It may require further refinement. It contains two classes of IPs:
- *** Read-only: IP addresses that are not permitted to edit the wiki. They will be treated as read-only robot exclusion.
- *** Banned: known to be bad, essentially spam-crawlers. These IPs will uniformly get a 403 Forbidden result.
- ** HTML cleaning has been implemented.
- *** HTML entities &amp;, &lt;, and &gt; will be escaped.
- *** Only HTML tags and attributes from a &ldquo;known good&rdquo; list will be passed through unchanged.
- *** CSS properties display and visibility will be silently eliminated from embedded HTML.
- *** Although (mostly) valid XHTML is generated, Ruwiki does not currently support tags or attributes in namespaces. If and when this is enabled, it will be enabled on a namespace-by-namespace basis.
- * External URLs are redirected through a single point through the Google PageRank remover URI \http://www.google.com/url?sa=D&q=<em>uri</em>. There is no whitelisting for URIs at this point.
- * Added a Rakefile for packaging. Currently incomplete.
- * Modified the default template style to remove the bottom control bar, as it was blocking the last bit of text on some pages in lesser browsers.
- * Updated more documentation.
- * Added a message facility so that non-error messages can be communicated to the user.
- * Fixed a bug with submitting an old version of the code with an expired lock reverting changes. The changed versions are now merged automatically and re-presented to the user. It's a simplistic merge, to be improved in a later version of Ruwiki. A message is displayed to the user.
- * Modified searching for empty strings so that instead of throwing an error, a message is displayed to the user.
-
- == 0.8.0
- * AC: Added topic list (_topics) and project list (_projects) controls on templates and backend.
- * AZ: Added %topics() and %projects() tokens. See WikiMarkup for details.
- * AC: Added simple search on back-end (both project and global); search strings must be validated and cleansed before being sent to the back-end (the back-end must prepare the string for its own search mechanism). The back-end is wholly responsible for the searching of the pages.
- * AC: Added \RecentChanges list to backend and controls.
- * AZ: Changed default for Ruwiki::Config#storage_options[:flatfiles][:extension] to <tt>ruwiki</tt>.
- * AZ: Topic backlink search: searches for mentions of the topic in the other topics of the project.
- * AZ: New templating engine: The Rdoc templating engine has been greatly enhanced in preparation for some changes that will happen surrounding antispam capabilities.
- * AZ: Multiple flatfile-based backend support: tagged file (&ldquo;flatfiles&rdquo;), YAML (&ldquo;yaml&rdquo;), and Marshal (&ldquo;marshal&rdquo;).
- * AZ: A converter utility between backends.
- * AZ: Defined a canonical, extensible page transport format.
- * AZ: Defined a canonical, format-independent diff format.
- * AZ: Fixed list numbering problem. Modified lists to allow for mixed lists. See WikiMarkup for restrictions.
- * AZ: Removed automatic image conversion for \URIs that look like images. Now, images must be specified with the \[image:uri] format. See WikiMarkup for more details.
- * AZ: Fixed minor bugs in several tokens.
- * AZ: New look! Ruwiki now sports a new default look with CSS and template changes.
- * AZ: New look! Ruwiki has a &ldquo;simple&rdquo; template set.
- * AZ: New look! Ruwiki has a &ldquo;sidebar&rdquo; template set.
- * AZ: Fixed a long-standing bug with code tokens.
-
- == 0.7.0
- * Changed the tokenization API so that the #post_replace call is made at the Token class level instead of the instance level.
- * Improved HTML code generation.
- * Added servlet runner batch files for Windows. They <strong>will</strong> require modification to run properly.
- * Added %calendar(...) support. See WikiMarkup for more information.
-
- == 0.6.2
- * Removed dependencies on Ruwiki from a number of classes (Ruwiki::Backend, Ruwiki::Backend::Flatfiles, Ruwiki::Page, Ruwiki::Wiki, Ruwiki::Wiki::Tokens, and various tokens).
- * Ruwiki now initializes a \Ruwiki::BackendDelegator, which creates the requisite Ruwiki::Backend instance with Ruwiki::Config#storage_options.
- * Added German (Christian Neukirchen &lt;cneukirchin@yahoo.de&gt;) and Spanish translations (Mauricio Fernández &lt;batsman.geo@yahoo.com&gt;).
-
- == 0.6.1
- * Changed Ruwiki::Config#data_path to Ruwiki::Config#storage_options[:flatfiles][:data_path]. This represents a generalisation of storage type options so that the Ruwiki::Config object is not polluted with storage type options. Ruwiki::Config#storage_options keys should be the same Ruby Symbol as is used in Ruwiki::Config#storage_type.
- * Added Ruwiki::Config#storage_options[:flatfiles][:extension], based on a request by Chad Fowler. This allows you to have Project/\TopicFile actually stored as Project/\TopicFile.wiki if Ruwiki::Config#storage_options[:flatfiles][:extension] is set to <tt>wiki</tt>. The default for Ruwiki::Config#storage_options[:flatfiles][:extension] is <tt>nil</tt>.
- * Fixed incorrect references. I had been incorrectly attributing [http://sourceforge.net/projects/rdoc-wiki RDoc Wiki] to Dave Thomas. \RDoc Wiki is by Michael Neumann. However, the project I pulled from <strong>is</strong> by Dave Thomas, but it&rsquo;s [http://sourceforge.net/projects/rublog RubLog]. Apologies to both developers.
- * Added RuwikiTemplatingLibrary documentation.
- * Internationalized messages, except for the templating library.
- * Added configuration API for future work surrounding features. The existing wiki is mostly feature complete. Additional features (such as access controls) will be added through the feature interface.
- * Fixed project creation.
- * Fixed problems with \WikiWord links.
- * Added Wikipedia-style Wiki links (\[[list of words]]).
- * Fixed a potential problem with re-posted data or saving without editing.
- * Added the ability to put commands in the URL.
-
- == 0.6.0
- * Added Ruby mailing list reference support (e.g., \[ruby-talk:12345]).
- * Reorganised the code (again) to better support alternative frontends. Based, in part, on [http://sourceforge.net/projects/rublog RubLog] by Dave Thomas. (Reference corrected in 0.6.1.)
- * Added a [http://www.webrick.org WEBrick] servlet interface. Based, in part, on the \WEBrick servlet interface provided with \RubLog by Chad Fowler.
- * Added templates, using the [http://rdoc.sourceforge.net RDoc] template.rb library.
- * Changed the default topic to be \ProjectIndex instead of \DefaultProject.
- * Added a new \WikiWord format, \Wiki_Word_with_Spaces.
- * Completed lots of Ruwiki documentation.
- * Updated the save page.
- * Fixed a problem with the linking of project specific pages.
-
- == 0.5.0
- * Reorganized the code significantly to be easier to edit and extend.
- * Added abbreviation capabilities.
- * Cleaned up a lot of tokenizing code.
-properties!project: Ruwiki
-properties!title: ChangeLog
-properties!topic: ChangeLog
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/Configuring_Ruwiki.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/Configuring_Ruwiki.ruwiki
deleted file mode 100644
index bfb3c3b..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/Configuring_Ruwiki.ruwiki
+++ /dev/null
@@ -1,150 +0,0 @@
-page!content: = Configuring Ruwiki %RV#%
- Ruwiki is configured similarly as both a CGI and a \WEBrick servlet.
- The biggest distinction is that because the Wiki servlet is created
- after the \WEBrick server is created (during the dispatch to the
- servlet), it is necessary to configure the wiki with a global
- Ruwiki::Config object stored in Ruwiki::Servlet.config. This must be a
- valid Ruwiki::Config object. In the examples below,
- <em>wiki.config</em> may be simply considered a random Ruwiki::Config
- object.
-
- > This has changed in Ruwiki 0.9.0 from a global configuration object
- > named $config.
-
- : Additional configuration options will be added from time to time. The
- : form for specifying configuration may be changed prior to 1.0.
-
- If you are looking for discussion on templates, this has been moved to
- Extending_Ruwiki.
-
- == Ruwiki Configuration Options
- === wiki.config.title
- This configuration option names the Wiki; by default this is
- <tt>Ruwiki</tt>. This affects the display of the home link and the
- &lt;title&gt; element of pages.
-
- === wiki.config.webmaster
- The email address for the webmaster. This is used in generating error
- reports that can be emailed to the wiki&rsquo;s webmaster.
-
- === wiki.config.language
- This sets the internationalisation mechanism. It must be one of the
- known two-letter ISO language codes or a module under Ruwiki::Lang
- matching that description. See Extending_Ruwiki for more information.
- Ruwiki's default language is English ('en'), but there are translations
- for Spanish ('es') and German ('de') included. Localization is
- currently per wiki instance. In a servlet environment, this may mean
- that only a single language is recognised.
-
- === wiki.config.default_page, wiki.config.default_project
- These options indicate what will happen when the wiki&rsquo;s URL is
- specified without any parameters (the default page in the default
- project is opened), when a topic is specified without a project (the
- topic is opened in the default project), and when a project is
- specified without a topic (the default page is opened in the project).
-
- === wiki.config.storage_type, wiki.config.storage_options
- <tt>wiki.config.storage_type</tt> specifies the back-end storage
- mechanism as a Ruby Symbol. Currently, <tt>'flatfiles'</tt>,
- is supported. See Extending_Ruwiki for more information.
-
- <tt>wiki.config.storage_options</tt> is a hash of option hashes for
- each known storage type known to the Wiki. This must use the same
- Symbol as <tt>wiki.config.storage_type</tt> as the top-level hash key.
-
- ==== ...storage_options['flatfiles']['data-path']
- The directory in which the wiki files will be found. By default, this
- is &ldquo;<tt>./data/</tt>&rdquo;.
-
- ==== ...storage_options['flatfiles']['format']
- Specifies the storage format for the flatfiles backend. The default
- format is 'exportable', but may be set to 'yaml' or 'marshal' as well.
- The 'yaml' format will not work reliably with versions of Ruby before
- 1.8.2 preview 3.
-
- ==== ...storage_options['flatfiles']['extension']
- The extension of the wiki files. By default, this is
- &ldquo;ruwiki&rdquo;. For those upgrading from a version of Ruwiki
- before 0.8.0, note that you must explicitly set this value to
- <tt>nil</tt> if you wish to have no extension.
-
- === wiki.config.template_path
- This specifies the paths where the Wiki templates will be found. The
- process running the Wiki must have read access to the template_path.
-
- === wiki.config.template_set, wiki.config.css
- These two options indicate which template set will be used. Three
- template sets are provided in the release package:
- &ldquo;default&rdquo;, &ldquo;simple&rdquo;, and &ldquo;sidebar&rdquo;.
- The only CSS file used initially is &ldquo;ruwiki.css&rdquo;. Templates
- work such that they will be found in
- <em>template_path</em>/<em>template_set</em>. All CSS files are loaded
- from the template set directory and emitted as part of the output
- stream.
-
- : The bad side of this is that the CSS never caches on the client side
- : as it would if it were a separate file. However, as templates may not
- : be in a web-accessible directory, this is necessary.
-
- === wiki.config.time_format, wiki.config.date_format, wiki.config.datetime_format
- When the wiki displays date or time values, these formats are used.
- They are not currently accessible by tokens.
-
- === wiki.config.debug
- Adds additional information to the (rare) error reports. Defaults to
- <tt>false</tt>.
-
- === wiki.config.logger
- Sets or returns the logger. The logger, if set, must respond to the
- same methods as WEBrick::Logger.
-
- === wiki.config.auth_mechanism
- The authentication mechanism name as a String. Corresponds to a
- filename that will be found in ruwiki/auth. The authenticator must have
- a single class method, +authenticate+, which accepts the +request+, the
- +response+, and the +auth_options+. This API is a draft API and is
- likely to change in future versions of Ruwiki. In this version of
- Ruwiki, only one authentication mechanism will be found -- for dealing
- with authenticating users already logged into RubyForge.
-
- === wiki.config.auth_options
- Options for the authentication mechanism as a Hash. This will be passed
- to the authenticator defined in wiki.config.auth_mechanism. The
- <tt>auth_options</tt> are a single-level hash. They may be stored in
- the Ruwiki configuration file as:
-
- ruwiki-config!auth-options: default!user: pgsqluser
- default!pass: pgsqlpass
-
- == Ruwiki Servlet Options
- Most, if not all, of the configuration above can be achieved through
- command-line options of the ruwiki servlet.
-
- === Servlet Command-Line Options
- ; -P, --port <em>PORT</em> : Runs the Ruwiki servlet on the specified port. Default 8808.
- ; -A, --accept <em>ADDRESSES</em> : Restricts the Ruwiki servlet to accepting connections from the specified address or (comma-separated) addresses. May be specified multiple times. Defaults to all addresses.
- ; -L, --local : Restricts the Ruwiki servlet to accepting only local connections (127.0.0.1). Overrides any previous --accept addresses.
- ; -M, --mount <em>MOUNT_POINT</em> : The relative URI from which Ruwiki will be accessible. Defaults to &ldquo;/&rdquo;.
- ; --[no-]log : Log \WEBrick activity. Default is --log.
- ; --logfile <em>LOGFILE</em> : The file to which \WEBrick logs are written. Default is standard error.
- ; -T, --threads <em>THREADS</em> : Sets the \WEBrick threadcount.
-
- === Ruwiki Command-Line Options
- ; --language <em>LANGUAGE</em> : The interface language for Ruwiki. Defaults to &ldquo;en&rdquo;. May be &ldquo;en&rdquo;, &ldquo;de&rdquo;, or &ldquo;es&rdquo;.
- ; --webmaster <em>WEBMASTER</em> : The Ruwiki webmaster email address. Defaults to &ldquo;webmaster@domain.com&rdquo;.
- ; --[no-]debug : Turns on Ruwiki debugging. Defaults to --no-debug.
- ; --title <em>TITLE</em> : Provides the Ruwiki title. Default is &ldquo;Ruwiki&rdquo;.
- ; --default-page <em>PAGENAME</em> : An alternate default page. Default is &ldquo;\ProjectIndex&rdquo;.
- ; --default-project <em>PAGENAME</em> : An alternate default project. Default is &ldquo;Default&rdquo;.
- ; --template-path <em>TEMPLATE_PATH</em> : The location of Ruwiki templates. Default is &ldquo;./templates&rdquo;.
- ; --templates <em>TEMPLATES</em> : The name of the Ruwiki templates. Default is &ldquo;default&rdquo;.
- ; --css <em>CSS_NAME</em> : The name of the <acronym title="Cascading Style Sheets">CSS</acronym> file in the template path. Default is &ldquo;ruwiki.css&rdquo;.
- ; --storage-type <em>TYPE</em> : Select the storage type: flatfiles, yaml, marshal
- ; --flatfiles-data-path <em>PATH</em> : The path where data files are stored. Default is &ldquo;./data&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
- ; --flatfiles-extension <em>EXT</em> : The extension for data files. Default is &ldquo;ruwiki&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
-properties!project: Ruwiki
-properties!title: Configuring_Ruwiki
-properties!topic: Configuring_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/Extending_Ruwiki.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/Extending_Ruwiki.ruwiki
deleted file mode 100644
index fbc89b8..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/Extending_Ruwiki.ruwiki
+++ /dev/null
@@ -1,316 +0,0 @@
-page!content: = Extending Ruwiki %RV#%
- Ruwiki is relatively easily extended to support new features. There are
- four primary ways in which Ruwiki can be extended or modified by the
- end user: templates, translating Ruwiki messages and labels, markup
- tokens, and creating new backends.
-
- == Templates
- Templating is done with a heavily modified version of the \RDoc
- template.rb library included in the distribution of Ruwiki. The
- templating library allows for nested templates, and this is used
- extensively in Ruwiki. This library is documented in
- RuwikiTemplatingLibrary.
-
- There are four major templates: content, edit, save, and error. Each of
- these has a slightly different combination of template files used, and
- this means that there are different sets of variables available.
-
- The major templates are &ldquo;composite templates&rdquo; that are
- defined as follows:
- ; content or search : body.tmpl, content.tmpl, controls.tmpl, footer.tmpl
- ; edit or preview : body.tmpl, edit.tmpl
- ; save : body.tmpl, save.tmpl, controls.tmpl, footer.tmpl
- ; error : body.tmpl, error.tmpl
-
- === Common Variables
- The following template variables are presented for all composite
- templates.
- ; <tt>%css_link%</tt> : The contents of the CSS file for the template set.
- ; <tt>%home_link%</tt> : A link to the root page of the Wiki.
- ; <tt>%editable%</tt> : A boolean value to mark the page as editable or not. Used in a conditional block in the templates.
- ; <tt>%cgi_url%</tt> : The URL for the Wiki.
- ; <tt>%content%</tt> : The formatted content of the current page.
- ; <tt>%page_project%</tt> : The project for the current page.
- ; <tt>%page_raw_topic%</tt> : The topic for the current page, escaped for safe transmission over the web.
- ; <tt>%page_topic%</tt> : The printable topic for the current page.
- ; <tt>%url_project%</tt> : The URL to the current page&rsquo;s project.
- ; <tt>%url_topic_search%</tt> : The URL to search for the current topic in the current project.
- ; <tt>%link_topic_search%</tt> : A link to the current topic search.
-
- === Variables for :content, :save, :search, :edit, :preview
- ; <tt>%message%</tt> : A message presented at the top of the Wiki when Ruwiki needs to inform the user of something that is not an error.
-
- === Variables for :content, :save, :search
- ; <tt>%wiki_title%</tt> : The title of the Wiki.
- ; <tt>%label_topic_or_search%</tt> : Either <tt>#topic#</tt> or <tt>#search#</tt>.
- ; <tt>%page_topic_name%</tt> : The same as <tt>%page_topic%</tt>.
-
- === Variables for :edit, :preview
- ; <tt>%wiki_title%</tt> : The title of the Wiki with a tag to indicate that the page is being edited.
- ; <tt>%page_content%</tt> : The content of the page.
- ; <tt>%page_version%</tt> : The current version number of the page.
- ; <tt>%unedited_page_content%</tt> : The formatted, unedited content of the page.
- ; <tt>%pre_page_content%</tt> : A Web-escaped form of the page content.
- ; <tt>%edit_comment%</tt> : The current edit comment.
-
- === Variables for :error
- ; <tt>%wiki_title%</tt> : The title of the Wiki with an error message.
- ; <tt>%name%</tt> : The name of the error.
- ; <tt>%backtrace%</tt> : The backtrace of the error.
- ; <tt>%backtrace_email%</tt> : The backtrace of the error formatted for sending by email.
- ; <tt>%webmaster%</tt> : The email address of the webmaster.
-
- == Translating Ruwiki Messages
- : NOTE: The mechanism for specifying language may be changed in a
- : future version of Ruwiki, although the internationalisation mechanism
- : will not be changing.
-
- Ruwiki is internationalized. This method sets the Ruwiki error messages
- (and a few other messages) to the specified language Module. The
- language Module must have a constant Hash called <tt>Message</tt>
- containing a set of symbols and localized versions of the messages
- associated with them.
-
- If the file <em>ruwiki/lang/es.rb</em> contains the module
- <tt>Ruwiki::Lang::ES</tt>, the messages for RSS could be localized to
- Spanish thus:
-
- require 'ruwiki/lang/es'
- ...
- wiki.config.language = Ruwiki::Lang::ES
-
- Localization is currently per wiki instance. In a servlet environment,
- this may mean that only a single language is recognised.
-
- It is recommended that the hash be created with a default proc that
- reports unknown message keys.
-
- Message = Hash.new { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
-
- == Extending Ruwiki Markup
-
- : <strong>WARNING:</strong> These \APIs will change in Ruwiki 0.9.0,
- : replacing the instance variables @project, @backend, and @script with
- : a Handler object. There may be other changes as well.
-
- Ruwiki&rsquo;s WikiMarkup can be extended by creating a new
- Ruwiki::Wiki::Token. Tokens will be automatically loaded if they are
- placed in <em>ruwiki/wiki/tokens</em>.
-
- It is recommended that new tokens be added to the test cases in
- <tt>tests/tc_tokens.rb</tt>.
-
- The following Ruwiki::Wiki::Token class will convert strings in the
- forms of \[ruby-talk:12345] to links.
-
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- === Known Instance Variables
- ==== @match
- The match data for this token instance is is kept in @match. This is
- what will be used in #replace and #restore.
-
- ==== @project
- The project being processed.
-
- ==== @backend
- The Backend for the wiki. If you are using Ruwiki tokenizers outside of
- Ruwiki, this does not need to be a \BackendDelegator, but can be the
- direct Backend (which expects less information).
-
- ==== @script
- The URI to the script.
-
- ==== @message
- The message hash for displaying localised messages.
-
- ==== @title
- The title of the wiki instance.
-
- === Required Methods
- ==== ::regexp
- Ruwiki tokens are matched only through regular expression matches. As
- shown in the example above, the regular expression for ruby-talk
- mailing list posts is <tt>%r{\[ruby-\talk:(\d+)\]}</tt>. The purpose of
- the ::regexp method is to return the regexp for matching.
-
- For most inline matches, Ruwiki will ensure that the escape character
- (\) works automatically. For whole-line matches, it is necessary to
- match the escape character manually and provide a #restore method.
-
- As an example, the \HRule class implements these methods.
-
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- It may also be necessary to match escapes manually on inline matches
- that must be along word boundaries where the regular expression
- includes characters that normally match word boundaries. The project
- index match (e.g., \::Ruwiki) regular expression does this
- <tt>%r{(\B|\\)::([A-Z][a-z]+)}</tt>.
-
- ==== #replace
- This returns the formatted token. In the \RubyTalkLinks class above,
- the matched regular expression will be replaced with a hyperlink. The
- text of the hyperlink will be the matched text; the target of the
- hyperlink will include the first captured value.
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
-
- === Optional Methods
- ==== ::rank
- By default, a token will be processed in the order created. Tokens may
- be given a specific rank to ensure that they are processed in a
- particular order. The default rank is <tt>9999</tt>.
-
- ==== #restore
- Restores the token without replacement. Implements the results of the
- escape character. Each Token class is responsible for its own
- restoration. As noted in #regexp, whole-line tokens are most likely to
- need a #restore implementation.
-
- ==== ::post_replace
- Performs any necessary massaging of the data. The Lists token uses this
- to ensure that lists are collapsed together; the Paragraph token uses
- this to ensure that there are no empty paragraph tag pairs
- (&lt;p&gt;&lt;/p&gt;).
-
- : <strong>Note:</strong> This has been changed from Ruwiki 0.6.x.
- : Plugins written for the Ruwiki 0.6.x Token API will need to be
- : modified so that this is defined as:
-
- def self.post_replace
- ...
- end
-
- : as opposed to:
-
- def post_replace
- ...
- end
-
- == Extending Ruwiki Backends
- Ruwiki can support varying backends, as the backend interface has been
- abstracted completely from the data store. The backend
- <strong>must</strong>:
-
- # reside in <em>ruwiki/backends/</em> as <em>backend_name</em>.rb.
- # be registered by adding the <em>backend_name</em> as a symbol (e.g., :<em>backend_name</em>) to Ruwiki::KNOWN_BACKENDS.
- # inherit from Ruwiki::Backend.
- # exist as Ruwiki::Backend::<em>\Backend_name</em>.
-
- === Required Methods
- ==== #initialize(storage_options)
- The backend may only obtain its configuration information from an
- option hash provided by the \BackendDelegate. This is obtained from
- <tt>wiki.config.options[backend]</tt>. If a configuration error is
- detected during initialization, the backend should raise the
- \Ruwiki::Backend exception class \BackendError. This would be done
- with:
-
- raise Ruwiki::Backend::BackendError.new([:message_symbol, [message_parameters]])
-
- Backend writers should add appropriate messages to the
- <em>lang/en.rb</em> at a minimum. The \BackendDelegator will detect
- this and report the results appropriately.
-
- ==== #load(topic, project)
- The backend will be provided the name of the topic and project. It must
- return the selected page as a hash of hashes. The hash must match that
- of \Ruwiki::Page#export. It will be passed as the parameter to
- \Ruwiki:::Page.new.
-
- ==== #store(page)
- This method must store the provided Ruwiki::Page object. Current Ruwiki
- backend implementations store the Ruwiki::Page#export hash. This method
- is responsible for calling the private method Backend#make_diff and
- adding the result to the list of diffs for the page.
-
- ===== Backend#make_diff(oldpage, newpage)
- This method expects two page objects, or their Ruwiki::Page#export
- representation. It will return a hash representing the difference set
- between the two pages.
-
- ==== #obtain_lock(page, time, expire, address = 'UKNOWN')
- Obtains an exclusive lock on the page. The \BackendDelegator is called
- with the page, the address, and a timeout which is provided. The time
- is provided by the call to the BackendDelegate, and the expire is also
- provided by the call to the BackendDelegate which is given a timeout
- value (by default 600 seconds). If the lock is still in effect, a
- second call to #obtain_lock should renew the timeout on the lock.
-
- ==== #release_lock(page, address = 'UNKNOWN')
- Releases the exclusive lock on the page. The lock should not be released
- unless the IP address on the lock is the same or the lock has expired.
-
- ==== #project_exists?(project)
- Returns <tt>true</tt> if the project exists.
-
- ==== #page_exists?(topic, project = 'Default')
- Returns <tt>true</tt> if the page exists within the specified project.
-
- ==== #create_project(project)
- Attempts to create the project.
-
- ==== #search_project(project, search_string)
- String search all topic names and content in a project and return a
- hash of topic hits:
-
- topicname => hits
-
- ==== #list_projects
- Return an array of all projects.
-
- ==== #list_topics(project)
- Return an array of all topics within the project.
-
- === Future Methods
- Note that these methods are currently optional (they are not yet called
- from Ruwiki), but will become required moving forward as the functions
- are implemented in Ruwiki.
-
- ==== #destroy(page)
- Removes the page from the wiki. This should <strong>not</strong> remove
- the change history of the topic (in the event that the page has been
- removed maliciously). There will be a separate method to remove the
- page history.
-
- ==== #destroy_project(project)
- Attempts to destroy the project.
-
- === Optional Methods
- These methods are completely optional. They are guarded in the
- \BackendDelegate by a call to #respond_to?().
-
- ==== #global_search(search_string)
- The global search in the backend delegate is by default implemented as
- a looping search through all projects. A backend may have a more
- efficient backend global search mechanism. If the backend responds to
- #global_search, then the \BackendDelegate will use this method.
-properties!project: Ruwiki
-properties!title: Extending_Ruwiki
-properties!topic: Extending_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/LicenseAndAuthorInfo.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
deleted file mode 100644
index 5d1c20e..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
+++ /dev/null
@@ -1,29 +0,0 @@
-page!content: = Ruwiki Licence
- Ruwiki is copyright &copy; 2002 - 2004 [mailto:alan@digikata.com Alan
- Chen] and [mailto:ruwiki@halostatue.ca Austin Ziegler].
-
- Ruwiki is provided free of use and without any warranty express or
- implied. You may use, distribute, or modify Ruwiki under the conditions
- of Ruby&rsquo;s licence or the [http://www.gnu.org/copyleft/gpl.html
- GNU General Public Licence].
-
- * Ruwiki includes a modified version of rdoc/template.rb originally by Dave Thomas for use in \RDoc.
-
- == Translations
- * Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen] on 2003.10.22, with corrections by Mauricio Fern&aacute;ez. Note that the initial template translations (./templates/de/) were done via \AltaVista Babelfish and should not be blamed on Christian.
- * Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fern&aacute;ndez] on 2003.10.22. Note that the initial template translations (./templates/es/) were done via \AltaVista Babelfish and should not be blamed on Mauricio.
-
- == Austin&rsquo;s Other Projects
- Austin has also released several other projects available on the RAA that you may be interested in:
- * [http://raa.ruby-lang.org/list.rhtml?name=mime-types MIME::Types], \RubyForge [http://rubyforge.org/projects/mime-types project].
- * [http://raa.ruby-lang.org/list.rhtml?name=pdf-writer PDF::Writer], \RubyForge [http://rubyforge.org/projects/ruby-pdf project].
- * [http://raa.ruby-lang.org/list.rhtml?name=text-format Text::Format], \RubyForge [http://rubyforge.org/projects/text-format project].
- * [http://raa.ruby-lang.org/list.rhtml?name=trans-simple Transaction::Simple], \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=uninheritable Uninheritable], Transaction::Simple&rsquo;s \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=diff-lcs Diff::LCS], Ruwiki&rsquo;s \RubyForge [http://rubyforge.org/projects/ruwiki project].
-properties!project: Ruwiki
-properties!title: LicenseAndAuthorInfo
-properties!topic: LicenseAndAuthorInfo
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/ProjectIndex.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/ProjectIndex.ruwiki
deleted file mode 100644
index e370528..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,83 +0,0 @@
-page!content: = Ruwiki %RV#%
- This is the \ProjectIndex page for Ruwiki. For any given project, the
- \ProjectIndex topic will be the default topic for plain project links.
-
- == Features and Information
- * This wiki supports a variety of WikiFeatures that you may be interested in. The rules for WikiMarkup are similar to some other wikis, but there are a few unique markup capabilities in Ruwiki.
- * Configuring_Ruwiki is simple.
- * Extending_Ruwiki is almost as simple.
- * What you need to know for using Ruwiki's [[Antispam]] capabilities.
- * Who wrote Ruwiki? Read the LicenseAndAuthorInfo.
-
- == Requirements
- Ruwiki currently requires Ruby 1.8, Diff::LCS 1.1.2 and
- Archive::Tar::Minitar 0.5.1. These packages are included in the
- <em>packages/</em> directory in the
- <code>ruwiki-0.9.0-full.tar.gz</code> form of the distribution.
-
- The YAML backend requires Ruby 1.8.2 preview 3 or later.
-
- == Upgrading
- Ruwiki %RV#% has a flatfile format that is incompatible with versions
- of Ruwiki older than Ruwiki 0.8.0. If you are upgrading from one of
- these versions, you must use the bin/ruwiki_convert. The simple case
- will be (assuming that your data files are in ./data):
-
- % ruwiki_convert ./data
-
- The ruwiki_convert utility is automatically installed by \RubyGems and
- RPA. See RuwikiUtilities for more information. Note that this utility
- will probably be incorporated into the main Ruwiki utility in a future
- version.
-
- == Getting Started
- There are some differences between the startup of <tt>.tar.gz</tt>,
- \RubyGems, and RPA installations of Ruwiki.
-
- === \QuickStart (Read-only: \RubyGem and RPA Installation Only)
- Run:
- % ruwiki_servlet --central
-
- Point your web browser to \http://localhost:8808/.
-
- === \QuickStart (CGI)
- # Install the Ruwiki CGI (<tt>ruwiki.cgi</tt>) program in a place where your webserver can execute it.
- #* <strong>\RubyGem:</strong> <tt>ruwiki install cgi,data --to <em>directory</em></tt>
- #* <strong><tt>.tar.gz</tt>:</strong> Extract the Ruwiki directory to that directory. <tt>cp bin/ruwiki.cgi .</tt> <em>or</em> <tt>copy bin\ruwiki.cgi .</tt>
- # Point your web browser to the appropriate URL.
-
- === \QuickStart (\WEBrick)
- # Install the Ruwiki servlet or data.
- #* <strong>\RubyGem:</strong> <tt>ruwiki install data --to <em>directory</em></tt> <em>or</em> <tt>ruwiki install servlet,data --to <em>directory</em></tt>
- #* <strong><tt>.tar.gz</tt>:</strong> Extract the Ruwiki directory.
- # Run <tt>ruwiki_servlet</tt>. Under the <tt>.tar.gz</tt>, this would be <tt>bin/ruwiki_servlet</tt> <em>or</em> <tt>ruby bin\ruwiki_servlet</tt>
- # Point your web browser to \http://localhost:8808/.
-
- == Support
- * Troubles with Ruwiki? See TroubleShooting for some suggestions. Have a new problem? Add it to the main [http://ruwiki.rubyforge.org/ruwiki.cgi/Ruwiki/TroubleShooting TroubleShooting] page.
- * Subscribe to [http://rubyforge.org/mailman/listinfo/ruwiki-discuss ruwiki-discuss] ([http://rubyforge.org/pipermail/ruwiki-discuss/ archives]).
- * You can also use the [http://rubyforge.org/forum/?group_id=84 Ruwiki Public Forum] or the on \RubyForge.
-
- == Tracking Ruwiki Development
- The development progress of Ruwiki is kept primarily in the wiki
- itself, but the services of [http://rubyforge.org RubyForge] are used
- as well.
- * The BugTracking page in Ruwiki keeps track of open and closed bugs in Ruwiki. Bugs can also be found in the \RubyForge [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug tracker] and [http://rubyforge.org/tracker/?atid=408&group_id=84&func=browse Support Requests].
- * The To_Do list keeps track of major development goals for Ruwiki. Items for this list can be found on \RubyForge in [http://rubyforge.org/tracker/?atid=410&group_id=84&func=browse Feature Requests] and [http://rubyforge.org/tracker/?atid=409&group_id=84&func=browse Patches].
- * There is a mailing list to track CVS changes: [http://rubyforge.org/mailman/listinfo/ruwiki-checkin ruwiki-checkin] ([http://rubyforge.org/pipermail/ruwiki-checkin/ archives]).
-
- == Different Features?
- If this wiki doesn&rsquo;t have the right combination of features, (or if it
- just doesn&rsquo;t feel right) try these other Ruby-based Wikis:
-
- * [http://pimwiki.rubyforge.org/ PIMWiki]
- * [http://instiki.rubyforge.org/ Instiki]
- * [http://www.walrus-ruby.org/amrita/cgi-bin/aswiki/aswiki.cgi Amrita Wiki]
- * [http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=top RWiki]
- * [http://www.xpsd.com/MiniRubyWiki MiniRubyWiki]
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/Roadmap.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/Roadmap.ruwiki
deleted file mode 100644
index 50e311b..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/Roadmap.ruwiki
+++ /dev/null
@@ -1,224 +0,0 @@
-page!content: = Ruwiki %RV#%: The Road Ahead
- This roadmap is accurate as of the release of 0.9.0.
-
- What lies ahead for Ruwiki? The To_Do list will give a detailed list
- of what is to follow, but this list is not the roadmap. There is no
- clear indication of the reason for &mdash; and in some cases, the
- meaning of &mdash; the items on the list. The intention of this
- document is to expand on that list. As items are completed, they will
- be removed from this document.
-
- == A Note About Targets
- Ruwiki development is not proceeding as quickly as I would prefer, but
- it is continuing steadily. I am at times choosing to delay releases
- and bypass some versions because there are other pressing concerns; I
- am definitely aiming for quality here, not for timeliness.
-
- == Development Inputs
- The primary driver of development on Ruwiki is the needs of a few
- groups of people. First, both Alan and Austin use or will use Ruwiki
- at work. There are particular needs that both have. Austin will be
- replacing an installation of \PhpWiki with an installation of Ruwiki
- sometime in early 2005.
-
- Second, [http://www.rubygarden.org/ruby RubyGarden], and
- [http://www.rubyforge.org RubyForge], and the
- [http://rpa.rubygarden.org <acronym title="Ruby Production Archive">RPA</acronym>]
- have expressed an intention to replace the Perl-based \UseMod wiki
- with a Ruby-based wiki. The popular and easy-to-use Instiki
- (&ldquo;there is no step 3&rdquo;) is not an ideal choice for either
- because they either require or prefer a CGI-based wiki. Ruwiki has the
- desired level of performance and implemenation simplicity that
- impresses both groups, and it is the current preferred choice. Thus,
- the needs of both websites factor highly into the goals for Ruwiki.
-
- Third, Austin gave a talk on Ruwiki at \RubyConf 2004. Many of the
- features in the current release come from a development effort leading
- up to the talk and in the weeks following.
-
- Last, and certainly not least, feature requests and bug reports are a
- factor. One of the things that changed in Ruwiki 0.8.0 was the look
- and feel; admittedly, the look and feel in earlier versions was a bit
- garish, designed to fit in with a particular website more than be a
- general wiki theme. Users complained, and we changed this. The
- continual spam defacement of the \RubyGarden wiki suggested several
- possible improvements that could be made in Ruwiki to fight wiki spam;
- initial work has been implemented in Ruwiki 0.9.0 and more work
- remains. Additionally, Ruwiki is the first wiki with built-in
- deployment support for package management systems (such as \RubyGems
- and rpa-base), although Instiki has been modified for RPA by the RPA
- team to support limited installation in RPA locations.
-
- == Ruwiki 0.10.0: &ldquo;Are You Being Served?&rdquo;
- Ruwiki 0.8.0 introduced an incompatible change in the way that page
- diffs were stored, so users were advised to remove any existing .rdiff
- files. This isn&rsquo;t as problematic as it may sound, as until
- 0.10.0, there is no way to actually view the page diffs from Ruwiki
- itself.
-
- In Ruwiki 0.7.0, a new token was introduced: %calendar(). The concept
- here is a sound one that can be extended to make token addition
- easier. Currently, it is necessary for token writers to create their
- own regular expressions. The &ldquo;function token&rdquo; will be
- added &mdash; although the form may not be
- &ldquo;%<em>function-name</em>&rdquo; &mdash; that will work with
- either a line replacement or a word replacement so that the regular
- expression does not need to be written. Tests for the replacement will
- still need to be written, but standardizing new custom tokens will be
- a good thing.
-
- Chad Fowler&rsquo;s port of \RubLog&rsquo;s vector search will
- probably be added to this version.
-
- The presence of static HTML content (headers and footers) per page has
- been accounted for in Ruwiki 0.8.0, but it will not be displayed.
- Further, there is currently no way to specify or display static
- content for the wiki or the project. (A related problem here is that
- projects do not have any properties. This will become important as
- projects should be able to be marked private within a wiki in the
- future.)
-
- The purpose of the \WikiWikiWeb is to provide a collaborative,
- community knowledge editing environment. Unfortunately, the pondscum
- known as spammers have figured out that the \WikiWikiWeb provides a
- positive Google \PageRank, and having their links on our Wikis is
- benefits them. Just as they don&rsquo;t care about filling our
- mailboxes with junk, they don&rsquo;t care about defacing our
- community knowledge. Ruwiki 0.10.0 provides additional antispam
- defences.
-
- The \RecentChanges mechanism will be updated to make it possible to
- see the \GlobalRecentChanges list.
-
- The most significant change in Ruwiki 0.10.0 will be the modification
- of the request pipeline. This will not be visible to the end user, but
- it will be significant to users who wish to extend Ruwiki. Currently,
- Ruwiki processes all commands in ruwiki.rb. In Ruwiki 0.10.0, this
- will be changed to a dispatch mechanism, where Action objects are
- introduced, and ruwiki.rb dispatches requests to Action objects.
-
- <table summary="Pipeline" style="border: 1px solid black"><tr><td>
- +---------+ +-------------------+
- | Request |--------->| Authorize Request |
- +---------+ +-------------------+
- |
- v
- +-------------------+
- | Configure Ruwiki |
- +-------------------+
- |
- v
- +-------------------+
- | Parse Request |
- +-------------------+
- |
- v
- +-------------------+
- | Perform Action |
- +-------------------+
- |
- v
- +-------------------+
- | Prepare Response |
- +-------------------+
- |
- v
- +--------+ +----+--------------+
- | Page |<----------| Send Page |
- +--------+ +-------------------+
- </td></tr></table>
-
- The diagram above shows the general pipeline. The difference is that
- the action will be its own object. In general, it will need to know
- how to process certain URL formats.
-
- In the process of defining the action objects, \ActionCards will be
- created. Below is an example \ActionCard for the default action,
- <tt>_show</tt>. In \ActionCards, everything is relative to the Ruwiki
- root URI. Important to note is that \ActionCards are an ideal: they may
- not represent something that can be accomplished for 0.10.0, 0.11.0,
- or even 1.0. They do, however, represent the ultimate target.
-
- Ruwiki does some implicit URI rewriting in the general form of:
-
- <table summary="Ruwiki URI rewriting" style="border: 1px solid black; border-collapse: collapse">
- <tr><th style="border: 1px solid black">URI</th><th style="border: 1px solid black">Rewritten URI</th></tr>
- <tr><td style="border: 1px solid black">/</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Action</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action</td></tr>
- <tr><td style="border: 1px solid black">/Topic</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/</td><td style="border: 1px solid black">/Project/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/Action</td><td style="border: 1px solid black">/Project/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action</td></tr>
- <tr><td style="border: 1px solid black">/Project/Topic</td><td style="border: 1px solid black">/Project/Topic/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/Topic/Action</td><td style="border: 1px solid black">/Project/Topic/Action</td></tr>
- </table>
-
- <table summary="_show Action Card" style="border: 1px solid black"><tr><td>
- === Action: Show [_show] <strong>DEFAULT</strong>
- The Show action is the default action that will be performed when
- there is no action specified. Without any arguments, the latest
- version of the page will be displayed.
-
- ==== Action Arguments
- ; ?r=<em>revision</em> : Show the specified revision of the page.
- ; ?r : Show the list of revisions known to the page.
- ; ?r=<em>revision1</em>:<em>revision2</em> : Shows the difference of revision1 and revision2 for the page.
- ; ?r=:<em>revision</em> : Shows the difference between the current page and the specified revision.
- ; ?d=<em>yyyymmdd[:hh[mm[ss]]]</em> : Shows the last revision from at or before the specified date and time. If time is not specified, it is assumed to be 23:59:59.
-
- ==== Interaction Notes
- Without arguments, _show generates pages pages that are editable and
- indexable (<meta name="robots" content="index,follow,archive">). If
- any argument is specified, the page is still editable, but not
- indexable (<meta name="robots" content="noindex,nofollow,noarchive">).
- </td></tr></table>
-
- == Ruwiki 0.11.0: &ldquo;What&rsquo;s My Line?&rdquo;
- The antispam techniques introduced in 0.9.0 are positive steps in the
- fight against wiki defacement. They are hopefully effective, too. The
- problem is that because 0.9.0 doesn&rsquo;t offer users or user
- authentication, there&rsquo;s no way of safely allowing the edit of
- the antispam lists. Thus, to allow this and other potentially
- dangerous actions, a user and capability framework will be added to
- Ruwiki. This framework will allow for user identification,
- authentication, and authorization to indicate what users are allowed
- to perform what actions.
-
- Authenticated users will be able to bypass blacklist checking; thus,
- if &ldquo;msn.com&rdquo; is blocked, &ldquo;joe.blog@msn.com&rdquo;
- could still authenticate with Ruwiki and edit the pages. Some users
- will be able to manage user permissions (including user management),
- edit antispam lists, etc.
-
- Other actions will be added, including the ability to rename topics
- and move topics between projects. In both cases, the topic change
- history must be maintained.
-
- The documentation for Ruwiki will be substantially complete with this
- version, lacking only specific information on the features that will
- be added in Ruwiki 1.0.0.
-
- == Ruwiki 1.0.0: &ldquo;Yes, Minister&rdquo;
- A combined strength and weakness of Ruwiki is that it currently does
- little to protect against arbitrary HTML being inserted into the
- current topic. The allowed subset of HTML should be restricted to a
- safe subset to prevent cross-site-scripting attacks.
-
- Pages and projects have properties: we need to provide the ability to
- edit those properties. Part of the properties that should be editable
- include whether a page is frozen &mdash; this means that the page is
- no longer editable by any user (unless it is unfrozen) and is
- effectively a plain HTML page. Other properties include the static
- header and footer information in a page or project.
-
- Modern Wikis require an RSS feed. Ruwiki will provide one.
-
- == The Future: &ldquo;Yes, Prime Minister&rdquo;
- Ruwiki 1.0.0 does not represent the end of the line for Ruwiki, but
- what the future holds is unclear. We&rsquo;ll see what the future
- brings.
-properties!project: Ruwiki
-properties!title: Roadmap
-properties!topic: Roadmap
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
deleted file mode 100644
index d738c18..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
+++ /dev/null
@@ -1,155 +0,0 @@
-page!content: = Ruwiki %RV#% Templating
- Ruwiki uses a heavily modified version of the \RDoc
- &ldquo;cheap-n-cheerful&rdquo; HTML page template system. This a
- line-oriented, text-based templating system.
-
- == Templates
- Templates in the templating system are essentially plain strings with
- particular references to templating keys or an include directive.
-
- The template interacts with value and message hashes provided by
- Ruwiki. The keys known to the templates expected by Ruwiki are
- detailed in Extending_Ruwiki. Nested key references are found from the
- inside-out. That is, the closest resolving key to the current level is
- found, not the furthest resolving key.
-
- === Including Other Templates
- Templates may include other templates to any arbitrary level by using
- the <tt>!INCLUDE!</tt> directive. When the \TemplatePage is created,
- an array of template strings are provided; these will be used to
- satisfy <tt>!INCLUDE!</tt> directives. If there are not enough
- template strings provided, <tt>!INCLUDE!</tt> won&rsquo;t be
- translated.
-
- : This may change before Ruwiki reaches 1.0, so that templates are
- : named instead of iterated.
-
- === Simple Template Keys
- Strings of the format <tt>%<em>key</em>%</tt> or
- <tt>%?<em>key</em>%</tt> are simple template keys. <em>key</em> is
- looked up in the provided value hash and is presented as the string
- value of the result. <tt>%key%</tt> template keys are mandatory; if
- the key is not found in the value hash, an exception will be raised.
- <tt>%?key%</tt> template keys are optional; if they key is not found
- in the value hash, an empty string (&ldquo;&rdquo;) will be used.
-
- === Labels
- Strings of the format <tt>#<em>key</em>#</tt> or
- <tt>#?<em>key</em>#</tt> are labels. <em>key</em> is looked up in the
- provided message hash as a Symbol (e.g.,
- <tt><em>key</em>.intern</tt>). As with simple template keys,
- <tt>#key#</tt> labels are mandatory and <tt>#?key#</tt> labels are
- optional.
-
- === Links
- Strings of the format <tt>HREF:\ref:name</tt> will become HTML links.
- Both <em>ref</em> and <em>name</em> are keys to be looked up.
- <em>name</em> is mandatory; an exception will be raised if it is not
- found.
-
- === Control Structures
- The templating library supports both looping and conditional control
- structures in both single-line and multi-line forms. Single-line
- control structures <strong>may not</strong> be nested; multi-line
- control structures <strong>may</strong> be nested arbitrarily deeply.
-
- ==== Looping Control Structures
- There are two forms of looping control structures.
-
- [:key|stuff:]
-
- START:key
- ... stuff ...
- END:key
-
- ===== Single-Line Looping
- [:key|stuff:]
-
- The value of <em>key</em> may be <tt>nil</tt>, an integer value, a
- range, or an array. When <em>key</em> represents:
- # <tt>nil</tt>, the looping structure will be replaced with an empty string.
- # An integer, <em>stuff</em> will be repeated <em>key</em> times. Values from 1 to <em>key</em> will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # A range, <em>stuff</em> will be repeated once for each successive value in the range of <em>key</em>. Each value will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # An array, the behaviour will differ depending on the contents of the array.
- ## If the array contains hashes, the behaviour is the same as a multi-line looping construct. See below for details.
- ## Otherwise, the template iterates through the array, providing each value to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
-
- As an example, if we have:
-
- "[:b|%b% ]"
-
- # <tt>val["b"] = 3 -> "1&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = (0..2) -> "0&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = ["a", "B"] -> "a&nbsp;B&nbsp;"</tt>
-
- ==== Multi-Line Looping
- START:key
- ... stuff ....
- END:key
-
- The value of <tt>key</tt> must be an array of hashes. <tt>... stuff
- ...</tt> will be repeated once for each entry in the array. The hashes
- will be passed as nested value hashes.
-
- %a% [:b|%a% ]%a%
-
- When the above template string is run with the following hash:
-
- val["a"] = 1
- val["b"] = [ { "a" => 2 }, { "a" => 3 } ]
-
- The result is:
-
- 1 2 3 1
-
- The behaviour is the same for multi-line blocks.
-
- ==== Conditional Block Keys
- IF:key
- ... stuff ...
- ENDIF:key
-
- The block between <tt>\IF:key</tt> and <tt>\ENDIF:key</tt> will be included in
- the output only if the corresponding key is set in the value hash.
-
- == Example
- Given the set of templates T1, T2, and T3 (shown below), here&rsquo;s how we would
- use the templating system.
-
- values = { "name" => "Dave", "state" => "TX" }
- t = TemplatePage.new(T1, T2, T3)
- File.open(name, w) { |f| t.process(f, values) }
-
- or:
-
- <!-- Source -->
- val1 = { "name" => "Dave", "state" => "TX" }
- val2 = { "name" => "Dave" }
- msgs = { }
- res = ""
- t.process(res, values, msgs)
-
- <!-- T1 -->
- Templates can subsitute a wide variety of values.
- !INCLUDE!
-
- <!-- T2 -->
- Name: %name% !INCLUDE!
-
- <!-- T3 -->
- IF:state
- State: %state%
- ENDIF:state
-
- The result will be:
-
- Name: Dave
- State: TX
-
- Name: Dave
-properties!project: Ruwiki
-properties!title: RuwikiTemplatingLibrary
-properties!topic: RuwikiTemplatingLibrary
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/RuwikiUtilities.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/RuwikiUtilities.ruwiki
deleted file mode 100644
index aef7e1f..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/RuwikiUtilities.ruwiki
+++ /dev/null
@@ -1,156 +0,0 @@
-page!content: = Ruwiki %RV#% Utilities
- Ruwiki %RV#% provides two utilities and three sample programs for
- deployment.
-
- == Managing Ruwiki Deployments
- A major change to the way that Ruwiki %RV#% works as compared to
- versions of Ruwiki 0.8.0 or earlier is that Ruwiki %RV#% supports being
- installed in a central location by one of the two major packaging
- systems available for Ruby (\RubyGems and RPA). Managing these
- deployments is accomplished with the utility appropriately enough named
- <tt>ruwiki</tt>, stored in the directory of the distribution.
-
- This utility has little value for users of the standalone release
- (either of the versions packaged in tarfiles or zipfiles), but is
- developed because packaging systems present a particular challenge to
- Ruwiki, as simply running &ldquo;ruwiki_servlet&rdquo; with no
- arguments will look for the data files and the template files relative
- to the current directory. With \RubyGems, though, this would require
- that the user specify something like:
-
- ruwiki_servlet \
- --template-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.9.0/templates \
- --flatfiles-data-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.9.0/data
-
- This is not the preferred option because Wiki installations may be
- private and the /usr/local directory is a system-wide shared
- directory. Additionally, since Ruwiki works as a CGI, the system
- shared data and template paths will not be generally accessible (and
- should not be world-writeable!) to CGI executables.
-
- This utility also encapsulates Win32 service management through
- Win32::Service for the \WEBrick servlet runner.
-
- === <tt>ruwiki <command> [<em>parameters</em>]</tt>
- The <tt>ruwiki</tt> utility will recognise four different commands on
- all platforms and a fourth command on Windows. These commands are:
-
- ; help : Displays general help or command-specific help.
- ; install : Installs the default deployment package.
- ; package : Packages a Ruwiki installation.
- ; unpackage : Unpackages a Ruwiki installation.
- ; service : Manages a Win32::Service for Ruwiki.
-
- ==== <tt>ruwiki help commands</tt>
- The list of known commands can be displayed by providing this command.
-
- % ruwiki help commands
- ==== <tt>ruwiki help <command></tt>
- The help for the named command (one of install, package, unpackage, or
- service) will be displayed upon providing this command to the ruwiki
- utility.
-
- % ruwiki help install
- ==== <tt>ruwiki install [<em>OPTIONS</em>] [<em>--to DEST</em>]
- Creates a new Ruwiki instance in the current directory or the directory
- specified by the <tt>--to</tt> option. By default, the data, template,
- and a default configuration file are installed to the destination
- directory. OPTIONS may be one of the following:
-
- ; servlet : Installs the Ruwiki WEBrick servlet stub.
- ; service : Installs the Ruwiki Win32::Service stub.
- ; cgi : Installs the Ruwiki CGI script model.
- ; data : Default; installs the Ruwiki default data, templates, and configuraiton file.
-
- Installation option names can be disabled with a dash (&lsquo;-&rsquo;)
- or the word &lsquo;no&rsquo;, making &lsquo;-data&rsquo; and
- &lsquo;nodata&rsquo; functionally equivalent.
-
- % ruwiki install cgi data
- ==== <tt>ruwiki package [<em>SOURCE</em>] [<em>--output PACKAGE</em>|<em>-o PACKAGE</em>] [<em>--replace</em>]</tt>
- Packages the Ruwiki files (data, templates, and executables) from the
- specified source or the current directory into the specified output
- package (or &ldquo;./ruwiki.pkg&rdquo;). If the SOURCE is a ruwiki
- configuration file (e.g., &ldquo;ruwiki.conf&rdquo;), then that will be
- used to determine the location and name of the data and template
- directories.
-
- Specify <tt>--replace</tt> to replace the existing output package. If
- an output package is specified that already exists, then <tt>ruwiki
- package</tt> will refuse to output to the file unless
- <tt>--replace</tt> is specified. If an output package is not specified
- and <tt>--replace</tt> is not specified, then an incremental package
- will be generated (e.g., &ldquo;./ruwiki-1.pkg&rdquo;).
-
- : NOTE: The packaging process will normalize the data and templates
- : directory names to be relative to the unpacking directory. They will
- : NEVER be absolute paths.
-
- % ruwiki package
- ==== <tt>ruwiki unpackage [<em>SOURCE</em>] [<em>--output DIRECTORY</em>|<em>-o DIRECTORY</em>]</tt>
- Unpackages the provided Ruwiki package (default "./%1$s") into the
- specified directory (default ".").
-
- % ruwiki unpackage
- ==== <tt>ruwiki service <command> <NAME> [<em>command-options</em>]</tt>
- Manages a Ruwiki WEBrick servlet as a Win32 service (with the
- assistance of
- [http://raa.ruby-lang.org/list.rhtml?name=win32-service win32-service]).
- This works in ways similar to a daemon on Unix. The sub-commands
- available to <tt>ruwiki service</tt> are:
- ===== <tt>ruwiki service install NAME [DESCRIPTION] [options]</tt>
- Installs the Ruwiki WEBrick servlet as the named Win32 service.
- <tt>install</tt> accepts an optional description (all non-options will
- be included in the description). The options for <tt>install</tt> are:
- ; --rubybin RUBYPATH : The path to the Ruby binary.
- ; --exec SERVICEPATH : The path to the service executable.
- ; --home PATHTOHOME : The path to the home directory.
- ===== <tt>ruwiki service start NAME</tt>
- Starts the named Ruwiki service.
- ===== <tt>ruwiki service stop NAME</tt>
- Stops the named Ruwiki service.
- ===== <tt>ruwiki service delete NAME</tt>
- Deletes the named Ruwiki service.
-
- : NOTE: This command can probably be used to manage other Win32
- : services that respond to the appropriate commands.
-
- == Upgrading and Converting: ruwiki_convert
- : This section was formerly a separate entry in the Wiki entitled
- : &ldquo;Upgrading and Converting&rdquo;.
-
- The flatfile backend format in Ruwiki %RV#% is not compatible with that
- of versions of Ruwiki earlier than 0.8.0. There are a number of
- reasons for this, but because of this and that there are now three
- different backend formats, Ruwiki now has a converter utility between
- backends.
-
- There are two other incompatibilities of note:
- # Ruwiki now defaults to &ldquo;ruwiki&rdquo; as an extension (e.g., \ProjectIndex.ruwiki) to the storage files. This is, of course, is something that can be modified with a configuration option, but you may find it desirable to rename your files to match this naming convention.
- # The rdiff format is incompatible. It is recommended that you remove all .rdiff files from your data directory before using Ruwiki.
-
- === ruwiki_convert [options] <directory>+
- The converter utility will work on all files in a directory and its
- subdirectories.
-
- When a file is encountered, it will be examined to be a known form of a
- Ruwiki backend (marshal, yaml, flatfiles, or "old" flatfiles). If the
- file is not one of these forms, then the file is skipped. Otherwise, it
- is converted to the specified format. By default, the converted files
- will be backed up.
-
- ==== ruwiki_convert Options
- ; --format=FORMAT : Converts encountered files (regardless of the current format), to the specified format. Default is yaml. Allowed formats are: yaml marshal flatfiles
- ; --[no-]backup : Create backups of upgraded files. Default is --backup.
- ; --backup-extension=EXTENSION : Specify the backup extension. Default is "~", which is appended to the data filename.
- ; --extension=EXTENSION : Specifies the extension of Ruwiki data files. The default is .ruwiki
- ; --no-extension : Indicates that the Ruwiki data files have no extension.
- ; --quiet : Runs quietly. Default is to run with normal messages.
- ; --verbose : Runs with full messages. Default is to run with normal messages.
- ; --help : Shows this text.
-properties!project: Ruwiki
-properties!title: RuwikiUtilities
-properties!topic: RuwikiUtilities
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/SandBox.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/SandBox.ruwiki
deleted file mode 100644
index dfe4911..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/SandBox.ruwiki
+++ /dev/null
@@ -1,8 +0,0 @@
-page!content: This page is intended for users to play with freely to practice
- their \WikiFormatting.
-properties!project: Ruwiki
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/To_Do.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/To_Do.ruwiki
deleted file mode 100644
index 38242fd..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/To_Do.ruwiki
+++ /dev/null
@@ -1,50 +0,0 @@
-page!content: = Ruwiki %RV#% To Do Tracking
- Completed to-do items can be found in the ChangeLog. Bugs in Ruwiki
- are tracked in BugTracking.
-
- == Well-Defined To Do Items
- === Ruwiki 0.10.0
- ; Versioning : complete the change history interface. Change history is currently stored in a file <em>topic[.extension]</em>.rdiff. There is no way to display the change history at this point.
- ; Action objects : Actions will be generalised to pull the processing out of the main ruwiki.rb inasmuch as is possible.
- ; Function tokens : generalize the %&lt;function-name&gt;[(&lt;args&gt;)] calling method so that function tokens can be created without having to create a custom regular expression.
- ; Search work : There is further search work required. The current mechanism is effective, but inefficient, as it must load and convert each file in a project to a page and then search selectively within that page. The search mechanism must be improved.
- ; Frozen content : make it so that frozen content can be provided on a per-page or Wiki basis. Will provide both headers and footers. <strong>Note:</strong> Ruwiki 0.9.0 will only provide the ability to present the information, not create or modify it.
- ; Blacklisting : Allow the specification of an allow/deny list for \IPs or hostnames, aimed at blocking known spammers. Entries in this list can be permanent or temporary (e.g., &ldquo;* DENY&rdquo;, &ldquo;spammer.com DENY UNTIL 20040723&rdquo;, &ldquo;139.244.33.25 ALLOW&rdquo;).
- ; External URL redirection : Add whitelisting of known good external URIs.
- ; \GlobalRecentChanges : Recent changes for all projects.
- ;
- === Ruwiki 0.11.0
- ; Authentication : complete authentication to provide for a standard Ruwiki authentication mechanism, not just an external API. This may require changes to the existing external API. Allows for user creation and authentication. Authenticate users bypass blacklist checking; thus, if &ldquo;msn.com&rdquo; is blocked, joe.blog@msn.com could still authenticate with Ruwiki and edit the pages.
- ; Topic renaming : add the ability to rename a topic within a project. Topic change history should be maintained.
- ; Topic moving : add the ability to move and/or rename a topic between projects. Topic change history should be maintained.
- ; Complete documentation : Complete the documentation of Ruwiki.
- ; Antispam : Allow the on-line editing of antispam lists to authenticated and authorised users.
- === Ruwiki 1.0.0
- ; RSS Feed : Ruwiki must be able to offer \RecentChanges and \GlobalRecentChanges as RSS feeds. This may not be ideal with the current \RecentChanges format. It may be easier to move to a two-stage \RecentChanges format.
- ; Static content : Allow the creation and editing of static content.
- ; Frozen pages : provide the ability to freeze content in place; the page is no longer &ldquo;wiki&rdquo; editable and is effectively a plain HTML page.
- ; Page properties : provide the ability to generally edit the properties of a given page.
-
- == General Future To Do Items
- ; E-mail gateway : accept topic appends via e-mail.
- ; alternative backends : access other wiki data storage, or other formats, e.g. e-mail boxes in mh or mbox formats
- ; bug tracker backend : with alternate markup
- ; add setup and user config methods : for backend plugin classes, then we can use them with an interactive or gui tool frontend to setup data storage backends. The user might have to run as root or other user with database create permissions.
- ; add id="" to various markup elements (make id specific to topic) : Later we can allow users to tweak a page using uploaded css fragments which might get appended onto the standard css contents.
- ; ruby action : upload a ruby code fragment to add a smart &ldquo;action&rdquo; to that wiki page. Need some sort of security + approval system to handle this safely.
- ; Preview button : add a preview button to the save page.
- ; Alternative templating systems : not as high priority now that there&rsquo;s a real templating system in place.
- ; Alternative markup systems : potentially allow \RedCloth (Textile) and/or \BlueCloth (Markdown) to be processed for a page. This could be implemented as a %function.
- ; Project/topic security : allow certain projects to be restricted/authenticated for read/write based on user.
- ; Track last <em>n</em> links/topics : ?
- ; Write a markup debugger : ?
- ; Validate topic formatting from cgi : ?
- ; Validate project from cgi : ?
- ; Project-based backend : Allow different projects to have different backends.
- ; Arbitrary-depth project namespace support : Foo::Bar::\BazPage.
-properties!project: Ruwiki
-properties!title: To_Do
-properties!topic: To_Do
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/TroubleShooting.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/TroubleShooting.ruwiki
deleted file mode 100644
index 7ccfde4..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/TroubleShooting.ruwiki
+++ /dev/null
@@ -1,32 +0,0 @@
-page!content: = Ruwiki %RV#%
- = Ruwiki %RV#% Troubleshooting Tips
- Following are some tips contributed by users of Ruwiki. Remember:
- Ruwiki currently requires Ruby version 1.8; the YAML backend requires
- Ruby version 1.8.2 or the latest CVS of Ruby 1.9.
-
- == No such file or directory
- (Unix systems only.) If you get something like:
-
- % ./ruwiki_servlet
- : no such file or directory
-
- run the following in the Ruwiki directory:
-
- % find . | xargs dos2unix
-
- The developers of Ruwiki do what they can to ensure that Ruwiki is
- distributed in a way that works well for both Unix and Windows
- systems, but this will occasionally cause problems.
-
- == undefined method
- % ./ruwiki_servlet
- ./ruwiki_servlet:64: undefined method `[]=' for nil (NameError)
-
- This may appear if you are running Ruby 1.6. Ruwiki requires Ruby 1.8
- or higher; certain features require Ruby 1.8.2 preview 3 or better.
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/WikiFeatures.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/WikiFeatures.ruwiki
deleted file mode 100644
index e47ffdd..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/WikiFeatures.ruwiki
+++ /dev/null
@@ -1,16 +0,0 @@
-page!content: Ruwiki is a [http://www.ruby-lang.org Ruby]-based wiki. It is
- ideal for personal or small team use.
-
- Ruwiki:
- * Uses the [http://www.ruby-lang.org Ruby] language.
- * Runs quickly and easily as a CGI or \WEBrick servlet.
- * Uses a simple templating system and CSS for presentation.
- * Has flatfile storage with simple versioning.
- * Offers project namespaces. Different projects can have the same topic names and not collide. Thus, \Default::ReadMe and \Project::ReadMe are two different pages.
- * Offers a calendar for date-based collaborative editing.
-properties!project: Ruwiki
-properties!title: WikiFeatures
-properties!topic: WikiFeatures
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Ruwiki/WikiMarkup.ruwiki b/ruwiki/tags/release-0.9.2/data/Ruwiki/WikiMarkup.ruwiki
deleted file mode 100644
index 3480564..0000000
--- a/ruwiki/tags/release-0.9.2/data/Ruwiki/WikiMarkup.ruwiki
+++ /dev/null
@@ -1,260 +0,0 @@
-page!content: = Ruwiki Markup
- A [http://c2.com/cgi/wiki Wiki] obeys certain formatting rules to make
- it easy to format text without needing to know HTML. This Wiki obeys
- the following rules by default. Because Ruwiki is extensible, there may
- be additional formatting rules. These rules are those rules that apply
- as of Ruwiki %RV#%.
-
- == \WikiWords, \WikiProjects, Calendars, and External Resources
- While reading stuff on this Wiki, you will see some words mashed
- together with capitalisation (like \WikiWords). While this may seem odd
- at first, this feature allows internal links to be created across the
- Wiki.
-
- There are several allowable forms for \WikiWords.
- # Two or more words concatenated directly. Each word must begin with a capital letter and be followed by zero or more lowercase letters. Thus, \FooBar, \CPlusPlus, and \AbC are all valid \WikiWords, but ABC is not.
- # Two or more words concatenated with underscores. The first word must begin with a capital letter. This makes \Foo_Bar, \C_Plus_Plus, and \A_b_C valid \WikiWords. These \WikiWords will be displayed with spaces instead of underscores. \C_Plus_Plus will be displayed as &ldquo;C Plus Plus&rdquo;.
- # One or more words contained in double square brackets. This the form supported by [http://wikipedia.com/ Wikipedia], and looks like \[[A Wiki Phrase]]. These links will be displayed exactly as entered between the brackets.
- # One or more words contained in double square brackets with display text separated by a vertical bar. These \WikiWords look like \[[A Wiki Phrase|but show this text]]. The link will be to the page &ldquo;A Wiki Phrase&rdquo; and &ldquo;but show this text&rdquo; will be the hyperlink.
-
- If a \WikiWord is found that does not have a page defining the
- \WikiWord, then the word will be shown with a hyperlink question mark
- following it, allowing the \WikiWord to be created.
-
- === \WikiProjects
- This Wiki supports &ldquo;projects.&rdquo; Within each project, a given
- \WikiWord is unique. Thus, if you have a Default project and a Ruwiki
- project, you can have two pages called \ReadMe. Any given \WikiWord
- refers only to topics within its project. That is, if I have \WikiWord
- in the \ReadMe topic of the Default project, it will refer to the
- \WikiWord topic of the Default project. (Another term for this
- capability is &ldquo;namespaces.&rdquo;)
-
- A cross-project link is composed of the project&rsquo;s name, two colons
- (::), and the \WikiWord desired. Thus, from \Default::ReadMe, I can
- have \Ruwiki::ReadMe as a link. The project index can be referred to
- with \::Project. This is the same as doing \Project::ProjectIndex.
- Thus, \::Ruwiki becomes ::Ruwiki, which is the same as
- \Ruwiki::ProjectIndex (Ruwiki::ProjectIndex).
-
- === Project Lists and Topic Lists
- The list of known projects may be listed with the %projects() token;
- the list of known topics for the current project may be listed with the
- %topics() link. An arbitrary project may be provided to the %topics()
- token, as in %topics(Default).
-
- %topics(Default)
-
- %projects()
-
- === Calendars
- Ruwiki supports a miniature calendar. Future versions of Ruwiki will
- allow for calendar aggregation. Using the %calendar function, a
- calendar section will be generated:
-
- %calendar(<year>, <month>[, <project>])
- %calendar(today[, <project>])
-
- %calendar accepts either the English word &ldquo;today&rdquo; (displaying the
- calendar for the current month and year) or a specific month and year
- for display. A calendar for the specified month will be generated
- where each date in the month is treated as a \WikiWord (as are the
- links to the current month, the previous month, and the next month)
- ready for display or editing. As with all other \WikiWord links in
- Ruwiki, a project may be specified in %calendar, making
- &ldquo;%calendar(today, Ruwiki)&rdquo; different from &ldquo;%calendar(today, Default)&rdquo;.
-
- %calendar(today)
- %calendar(1999, 08, Default)
-
- === External Resources
- Ruwiki behaves intelligently about resources external to the Wiki
- itself.
-
- ==== External Links
- \URLs to external resources are automatically detected for web
- addresses, FTP addresses, newsgroups, and email links. They are
- automatically converted to clickable \URLs. Be aware that some things
- that look like URL schemas may be make clickable but are not really
- \URLs.
-
- * \http://www.ruby-lang.org becomes http://www.ruby-lang.org
-
- \URLs may be named with the [url name] syntax. If the name is omitted,
- the URL will be numbered. Numbering is contained to within the page.
-
- * \[http://www.rubygarden.org RubyGarden] becomes [http://www.rubygarden.org RubyGarden].
- * \[http://www.halostatue.ca] and \[http://www.halostatue.ca/ruby] become [http://www.halostatue.ca] and [http://www.halostatue.ca/ruby].
-
- ==== Images
- : <strong>Changed in Ruwiki 0.8.0!</strong>
-
- In preparation for the anti-wiki-spam features of Ruwiki 0.9.0, it has
- been necessary to remove the ability for \URLs to be converted into
- inline images automatically. Inline images are now created with the
- image markup format, generally of the format \[image:URI options]. The
- <em>options</em> format is generally the same format as an HTML
- attribute (<em>name="value"</em>; the quotes are optional for
- single-word option values) and any valid HTML attribute is also a
- valid <em>option</em>. There is one special <em>option</em>,
- <tt>numbered</tt>. This value, if set to any other value than &ldquo;false&rdquo;,
- will set the <tt>title</tt> of the image to a numbered link.
-
- If the <tt>title</tt> attribute is not specified, it will be set from
- the <tt>alt</tt> attribute (if specified) or the image&rsquo;s URL. If the
- <tt>alt</tt> attribute is not specified, it will be set from the
- <tt>title</tt> attribute.
-
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif] [image:http://www.halostatue.ca/graphics/maple_leaf.gif]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true] [image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"]
-
- ==== Ruby Mailing Lists
- If a Ruby mailing list message tag is provided, it will be converted appropriately.
-
- * \[ruby-talk:12345] will become [ruby-talk:12345]
- * \[ruby-core:12345] will become [ruby-core:12345]
- * \[ruby-doc:12345] will become [ruby-doc:12345]
-
- == Headings and Lists
- === Headings
- Use equals signs (=) for headings. Up to six equals signs can be used
- for HTML headings 1 - 6.
-
- \===== Heading five<br />
- \====== Heading six
- ===== Heading five
- ====== Heading six
-
- === Lists
- ==== Bulleted Lists
- Use asterisks (*) to create bulleted lists. More asterisks means more
- levels.
-
- \* level 1<br />
- \** level 2<br />
- \*** level 3
-
- * level 1
- ** level 2
- *** level 3
-
- ==== Numbered Lists
- Use hash marks (#) for numbered lists. More hash marks means deeper
- levels.
-
- \# level 1<br />
- \## level 2<br />
- \### level 3<br />
- \### level 3.2<br />
- \## level 2.2<br />
- \# level 1.2
-
- # level 1
- ## level 2
- ### level 3
- ### level 3.2
- ## level 2.2
- # level 1.2
-
- ==== Definition Lists
- Definitions can be created similar to other lists. Unlike &ldquo;standard&rdquo;
- lists, though, definition lists have both the term and the definition.
- They are specified like so. As with other lists, repeating the first
- item (;) will increase the indentation level. The browser may not
- respect this.
-
- \; term : definition<br />
- \;; term2 : definition<br />
- \;;; term3 : definition
-
- ; term : definition
- ;; term2 : definition
- ;;; term3 : definition
- == Paragraph Formatting
- === Rules
- Four or more dashes ("----") on a line by itself makes a horizontal
- rule, like so:
-
- \----
- ----
- === Paragraphs
- A blank line (it may have whitespace on it) marks a new paragraph. All
- other lines are joined together (excepting headers, lists, and rules).
-
- This line is a new paragraph.
-
- === Block Indent Paragraphs
- Paragraphs can be indented by beginning the paragraph with one or more
- colons (:).
-
- \: Indent Level 1<br />
- \:: Indent Level 2<br />
- \::: Indent Level 3
-
- : Indent Level 1
- :: Indent Level 2
- ::: Indent Level 3
-
- Paragraphs may be indented as &ldquo;cites&rdquo; by using one or more
- greater-than signs (>) at the beginning of the line.
-
- \> Indent Level 1<br />
- \>> Indent Level 2<br />
- \>>> Indent Level 3
-
- > Indent Level 1
- >> Indent Level 2
- >>> Indent Level 3
-
- === Code
- Text that is indented will be presented as formatted in a monospaced
- font. The only change is to escape HTML entities &lt; (&amp;lt;), &gt;
- (&amp;gt;), and &amp; (&amp;amp;).
-
- def replace
- content = @match[1]
- %Q{<pre>#{content}</pre>}
- end
-
- == Miscellaneous Formatting
- === HTML
- The Ruwiki engine currently passes through HTML without changes. Thus,
- &lt;strong&gt;strong&lt;/strong&gt; would be shown as
- <strong>strong</strong>. <strong><em>Note:</em></strong> This
- capability could be very dangerous as it could expose the Wiki to
- cross-site scripting (XSS) vulnerabilities. This will be remedied
- prior to the 1.0 release of Ruwiki.
-
- === Abbreviations
- Certain abbreviations may be known to the Wiki. While there is not yet
- any way for a user to query what abbreviations are known, if the
- abbreviations are told to the users, they may be used. Abbreviations
- are presented with @{key}, where <em>key</em> is the abbreviation
- desired. This Wiki, for example, knows that \@{matz} means &ldquo;@{matz}&rdquo;.
- The special form \@{} will produce the current list of known
- abbreviations. Unknown abbreviations will simply be put back into the
- data stream unchanged. Thus, \@{unknownkey} results in @{unknownkey}.
-
- ==== Known Abbreviations
- @{}
-
- === Preventing Formatting
- If you wish to prevent a word or sequence from being interpreted, put
- a backslash (\) in front of it. This works on all formatting options
- except paragraph positioning. Thus, if I want to prevent a \WikiWord
- from being turned into a hyperlink, I need to backslash it:
- \\WikiWord.
-
- === Other Possible Considerations
- I&rsquo;m looking at adding styles similar to what is shown on the Wiki
- below.
-
- * http://www.pmichaud.com/wiki/PmWiki/WikiStyles
-properties!project: Ruwiki
-properties!title: WikiMarkup
-properties!topic: WikiMarkup
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Tutorial/AddingPages.ruwiki b/ruwiki/tags/release-0.9.2/data/Tutorial/AddingPages.ruwiki
deleted file mode 100644
index c405b70..0000000
--- a/ruwiki/tags/release-0.9.2/data/Tutorial/AddingPages.ruwiki
+++ /dev/null
@@ -1,15 +0,0 @@
-page!content: = Adding Pages
- To add a new page to Ruwiki, all you need to do is come up with a
- meaningful title, turn it into a \WikiWord (see Ruwiki::WikiMarkup) and
- Ruwiki will automatically recognise it as a reference to a page that
- does not yet exist.
-
- At the end of the new \WikiWord is a hyperlinked question mark;
- clicking on this will open the edit page for the new \WikiWord in
- Ruwiki.
-properties!project: Tutorial
-properties!title: AddingPages
-properties!topic: AddingPages
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Tutorial/AddingProjects.ruwiki b/ruwiki/tags/release-0.9.2/data/Tutorial/AddingProjects.ruwiki
deleted file mode 100644
index 6f27415..0000000
--- a/ruwiki/tags/release-0.9.2/data/Tutorial/AddingProjects.ruwiki
+++ /dev/null
@@ -1,15 +0,0 @@
-page!content: = Adding Projects
- To add a new project to Ruwiki, all you need to do is come up with a
- meaningful one-word name, and then turn it into a project link, e.g.,
- \::Project. Projects may <strong>only</strong> be a single word &mdash;
- they are not normal \WikiWords (see Ruwiki::WikiMarkup for details).
- Ruwiki will recognise this as a project that does not yet exist. At the
- end of the Project link is a hyperlinked question mark; clicking on
- this will open the \Project::ProjectIndex in Ruwiki for editing and
- create the new project.
-properties!project: Tutorial
-properties!title: AddingProjects
-properties!topic: AddingProjects
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Tutorial/ProjectIndex.ruwiki b/ruwiki/tags/release-0.9.2/data/Tutorial/ProjectIndex.ruwiki
deleted file mode 100644
index 25aaefd..0000000
--- a/ruwiki/tags/release-0.9.2/data/Tutorial/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,10 +0,0 @@
-page!content: = Ruwiki %RV#% Tutorial
- This tutorial is incomplate.
-
- %topics(Tutorial)
-properties!project: Tutorial
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/Tutorial/SandBox.ruwiki b/ruwiki/tags/release-0.9.2/data/Tutorial/SandBox.ruwiki
deleted file mode 100644
index 0488031..0000000
--- a/ruwiki/tags/release-0.9.2/data/Tutorial/SandBox.ruwiki
+++ /dev/null
@@ -1,8 +0,0 @@
-page!content: This page is intended for users to play with freely to practice
- their \WikiFormatting.
-properties!project: Tutorial
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.2/data/agents.banned b/ruwiki/tags/release-0.9.2/data/agents.banned
deleted file mode 100644
index 93500d9..0000000
--- a/ruwiki/tags/release-0.9.2/data/agents.banned
+++ /dev/null
@@ -1,60 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of User Agent strings which will be greeted
-# with "403 Forbidden" responses by Ruwiki. These are generally known email
-# harvesters or link directory builders for reciprocal link partners. These
-# may also be robots that routinely ignore the robots.txt file.
-#
-# This list is generated from a wide variety of sources including:
-# * http://www.clockwatchers.com/robots_list.html
-# * http://searchenginewatch.com/webmasters/article.php/2167991
-# * http://www.neilgunton.com/spambot_trap/
-# * http://www.robotstxt.org/wc/active/all.txt
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# foo
-# bar
-#
-# becomes:
-#
-# %r{foo|bar}x
-#++
-
- # Known email harvesters
-(?i:^nicerspro)
-(?i:^teleport)
-^CherryPicker
-^Crescent # Crescent Internet ToolPak
-^EmailCollector
-^EmailSiphon
-^EmailWolf
-^ExtractorPro
-^Microsoft\sURL
-^WebEMailExtrac
-
- # Link directory builders.
-^LinkWalker
-^Zeus.*Webster
-
- # Strongly suspected spoofed user agents from spam harvesters. These user
- # agents have been reported patterns by other antispam fighters.
-^[A-Z]+$
-^Internet\sExplore\s5.x
-^Mozilla.*NEWT
-^Mozilla\/4.0$
-MSIECrawler
diff --git a/ruwiki/tags/release-0.9.2/data/agents.readonly b/ruwiki/tags/release-0.9.2/data/agents.readonly
deleted file mode 100644
index e7168c5..0000000
--- a/ruwiki/tags/release-0.9.2/data/agents.readonly
+++ /dev/null
@@ -1,321 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of User Agent strings which will be given
-# readonly versions of the wiki instance.
-#
-# This list is generated from a wide variety of sources including:
-# * http://www.clockwatchers.com/robots_list.html
-# * http://searchenginewatch.com/webmasters/article.php/2167991
-# * http://www.neilgunton.com/spambot_trap/
-# * http://www.robotstxt.org/wc/active/all.txt
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# foo
-# bar
-#
-# becomes:
-#
-# %r{foo|bar}x
-#++
-
-(?:^.*HTTrack)
-(?:^.*LWP)
-(?:^Digimarc)
-(?:ChristCrawler.com|ChristCrawler@ChristCENTRAL.com)
-(?:Net|Web)Mechanic
-(?:PerlCrawler|Xavatoria)/
-(?:pjspider|PortalJuice.com)
-(?:spider_monkey|mouse.house)
-(?:tach_bw|Black\sWidow)
-(?:topiclink|TLSpider)
-(?i:(?-i:ComputingSite\s)?Robi)
-(?i:^curl)
-(?i:^googlebot)
-(?i:^gulliver) # NorthernLight
-(?i:^Scooter) # Altavista
-(?i:^w[@a]pSpider)
-(?i:infoseek) # InfoSeek
-^ABCdatos\sBotLink # http://www.abcdatos.com/botlink/
-^AITCSRobot/
-^anthill
-^appie
-^Arachnoidea # Euroseek
-^Arachnophilia
-^arale
-^araneo
-^AraybOt
-^ArchitextSpider # Excite, WebCrawler
-^ariadne
-^arks
-^Ask\s?Jeeves/Teoma
-^ASpider/
-^ATN_Worldwide
-^Atomz
-^AURESYS/
-^BackRub/
-^BaySpider
-^bbot
-^Big\sBrother
-^Bjaaland
-^BlackWidow
-^borg-bot/
-^(?i:boxseabot)
-^BSpider/
-^CACTVS\sChemistry\sSpider
-^calif
-^Checkbot/
-^cienciaficcion.net
-^CMCM/
-^combine
-(?i:^confuzzledbot)
-^CoolBot
-^cosmos
-^crawlpaper
-^cusco
-^cyberspyder
-(?i:^cydralspider)
-^desert\s?realm
-^Deweb
-^Die\sBlinde\sKuh
-^dienstspider/
-^digger
-^Digger
-^DIIbot
-^dlw3robot/
-^DNAbot/
-^downloadexpress
-^DragonBot
-^Duppies
-^dwcp
-^ebiness
-^ecollector
-^EIT-Link-Verifier-Robot/
-^elfinbot
-^Emacs-w3/
-^EMC\sSpider
-(?i:^esculapio)
-^ESI
-^esther
-^Evliya\sCelebi
-^explorersearch
-^fast # Fast/AllTheWeb
-^fastcrawler
-^FDSE
-^FELIX\s?IDE
-^fido
-^Fish-Search-Robot
-^fouineur
-^Freecrawl
-^FunnelWeb-
-^gammaSpider
-^gazz
-^gcreep
-^gestalttIconoclast/
-^Getterrobo-?Plus
-^GetURL\.rexx
-^golem
-^grabber
-^griffon
-^Gromit
-^gulper
-^hambot
-^havIndex
-^HKU\sWWW\sRobot
-^Hometown\sSpider\sPro
-^Hämähäkki
-^hotwired
-^htdig
-^htmlgobble
-^IAGENT/
-^iajabot
-^IBM_Planetwide
-^image\.kapsi\.net
-^IncyWincy
-^Informant
-^InfoSpiders
-^INGRID/
-^inspectorwww
-^Internet\sCruiser\sRobot
-^irobot
-^Iron33
-^IsraeliSearch/
-^JavaBee
-^JBot
-^jcrawler
-^jobo
-^Jobot/
-^JoeBot/
-^JubiiRobot/
-^jumpstation
-^Katipo/
-^KDD-Explorer
-^KIT-Fireball # Fireball.de
-^ko_yappo_robot
-^label-grabber
-^LabelGrab/
-^larbin
-^legs
-^Linkidator
-^LinkScan\s(?:Server|Workstation)
-^Lockon
-^logo\.gif\scrawler
-^logo_gif_crawler
-^Lycos_Spider_(T-Rex) # Lycos
-^M/
-^Magpie/
-^marvin
-^mattie
-^mediafox
-^MerzScope
-^MindCrawler
-^moget
-^MOMspider/
-^Monster
-^Motor
-^Mozilla/3\.01\s(Win95;\sI) # InfoSeek
-^Mozilla\/3.0.+Indy\sLibrary
-^msnbot
-^muncher
-(?i:^muninn)
-^MuscatFerret
-^MwdSearch
-^NDSpider/
-^NEC-MeshExplorer
-^Nederland.zoek
-^Net.Vampire
-^NetCarta
-^NetScoop
-^newscan-online
-^NHSEWalker/
-^Nomad
-^NorthStar
-^NPBot # Detects IP violations(?)
-^ObjectsSearch
-^Occam
-^Openbot # OpenFind
-^Openfind
-^Orbsearch
-^PackRat
-^pageboy
-^parasite
-^patric
-^PBWF
-^pegasus
-^Peregrinator-Mathematics/
-^PGP-KA/
-^phpdig
-^piltdownman
-^Pimptrain
-^Pioneer
-^Plucker
-^PlumtreeWebAccessor
-^Poppi/
-^PortalBSpider
-^psbot
-^Raven
-^Resume\sRobot
-^RHCS
-^RixBot
-^Road\s?Runner
-^Robbie
-^RoboCrawl
-^robofox
-^Robot\sdu\sCRIM
-^Robozilla/
-^root/
-^Roverbot
-^RuLeS/
-^SafetyNet\sRobot
-^Search-AU
-^searchprocess
-^searchterms\.it
-^Senrigan
-^SG-Scout
-^Shagseeker
-^Shai'Hulud
-^sharp-info-agent
-^SimBot
-^Site\sValet
-^sitecheck
-^SiteTech-Rover
-^SLCrawler
-^Sleek\sSpider
-^Slurp # Inktomi, AOL
-^snooper
-^solbot
-^speedy
-^SpiderBot
-^spiderline
-^SpiderMan
-^SpiderView
-^ssearcher
-^suke
-^suntek
-(?i:http://www.sygol.com)
-^T-H-U-N-D-E-R-S-T-O-N-E
-^Tarantula/
-^tarspider
-^TechBOT
-^Templeton
-^TeomaAgent # Teoma
-^TITAN
-^titin
-^TurnitinBot # Plagiarism detector
-^UCSD-Crawler
-^UdmSearch
-^udmsearch
-^Ukonline
-^uptimebot
-^URL\sSpider\sPro
-^urlck
-^Valkyrie
-^verticrawl
-^Victoria
-^vision-search
-^void-bot
-^Voyager
-^VWbot_K
-^w3index
-^W3M2/
-^w3mir
-^WebBandit
-^webcatcher
-^WebCopier
-^WebCopy
-^WebFetcher/
-^weblayers/
-^WebLinker/
-^WebMoose
-^webquest
-^WebReaper
-^webs
-^webspider
-^webvac
-^webwalk
-^WebWalker
-^WebWatch
-^wget
-^whowhere
-^winona
-^wired-digital-newsbot/
-^wlm
-^WOLP
-^WWWC
-^WWWWanderer
-^XGET
-^ZyBorg # WiseNut/LookSmart
diff --git a/ruwiki/tags/release-0.9.2/data/clean.uri b/ruwiki/tags/release-0.9.2/data/clean.uri
deleted file mode 100644
index cf38b6f..0000000
--- a/ruwiki/tags/release-0.9.2/data/clean.uri
+++ /dev/null
@@ -1,37 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of URIs or partial URIs that will not be
-# redirected by the automatic redirection technique. It is recommended that the
-# Regular Expression be specific and be anchored to prevent "similar" URIs from
-# being handled poorly. Non HTTP/HTTPS URIs are not redirected at this time.
-#
-# This file is in "extended" regular expression format, one optional expression
-# to a line. Spaces are not significant and comments are allowed. If you want
-# to recognise a space in your regular expression, do so either with a
-# character class ([ ]) or the whitespace meta-character (\s). Hash marks must
-# be escaped (\#) or they will be treated as comment markers. Blank or
-# comment-only lines are ignored. All other lines will be joined together:
-#
-# ^http://[^/]*?ruby-lang.org/?.*$
-# ^http://[^/]*?rubyforge.org/?.*$
-#
-# becomes:
-#
-# %r{^http://[^/]*?ruby-lang.org/?.*$|^http://[^/]*?rubyforge.org/?.*$}
-#++
-(?ix-m:^http://[^/]*?ruby-lang.org/?.*$)
-(?ix-m:^http://[^/]*?rubyforge.org/?.*$)
-(?ix-m:^http://rubyforge.halostatue.info/?.*$)
-(?ix-m:^http://[^/]*?ruwiki.org/?.*$)
-(?ix-m:^http://[^/]*?ruby-doc.org/?.*$)
-(?ix-m:^http://[^/]*?pragmaticprogrammers.com/?.*$)
-(?ix-m:^http://127\.0\.0\.(\d|\d\d|1\d\d|2[0-4]\d|25[0-5])/?.*$)
-(?ix-m:^http://localhost/?.*$)
diff --git a/ruwiki/tags/release-0.9.2/data/hostip.banned b/ruwiki/tags/release-0.9.2/data/hostip.banned
deleted file mode 100644
index b7f3c55..0000000
--- a/ruwiki/tags/release-0.9.2/data/hostip.banned
+++ /dev/null
@@ -1,30 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of IP address strings which will be greeted with
-# "403 Forbidden" responses by Ruwiki. These are generally known email
-# harvesters or link directory builders for reciprocal link partners. These may
-# also be robots that routinely ignore the robots.txt file.
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will be
-# joined together:
-#
-# 192\.168\.0\..*
-# 127\.0\.0\..*
-#
-# becomes:
-#
-# %r{192\.168\.0\..*|127\.0\.0\..*}
-#++
diff --git a/ruwiki/tags/release-0.9.2/data/hostip.readonly b/ruwiki/tags/release-0.9.2/data/hostip.readonly
deleted file mode 100644
index 55d589c..0000000
--- a/ruwiki/tags/release-0.9.2/data/hostip.readonly
+++ /dev/null
@@ -1,28 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of IP address strings which will be given
-# readonly versions of the wiki instance.
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# 192\.168\.0\..*
-# 127\.0\.0\..*
-#
-# becomes:
-#
-# %r{192\.168\.0\..*|127\.0\.0\..*}
-#++
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki.rb
deleted file mode 100644
index 55031fc..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki.rb
+++ /dev/null
@@ -1,626 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-class Ruwiki
- VERSION = '0.9.2'
- CONTENT_VERSION = 2
-end
-
-require 'cgi'
-require 'ruwiki/handler'
-require 'ruwiki/auth'
-require 'ruwiki/template'
-require 'ruwiki/lang/en' # Default to the English language.
-require 'ruwiki/config'
-require 'ruwiki/backend'
-require 'ruwiki/wiki'
-require 'ruwiki/page'
-
- # = Ruwiki
- # Ruwiki is a simple, extensible Wiki written in Ruby. It supports both
- # CGI and WEBrick interfaces, templates, and CSS formatting. Additionally,
- # it supports project namespaces, so that two pages can be named the same
- # for differing projects without colliding or having to resort to odd
- # naming conventions. Please see the ::Ruwiki project in the running Wiki
- # for more information. Ruwiki has German and Spanish translations
- # available.
- #
- # == Quick Start (CGI)
- # 1. Place the Ruwiki directory in a place that your webserver can execute
- # CGI programs and ensure that ruwiki.cgi is executable on your webserver.
- # 2. Point your web browser to the appropriate URL.
- #
- # == Quick Start (WEBrick)
- # 1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
- # 2. Point your web browser to <http://localhost:8808/>.
- #
- # == Configuration
- # There are extensive configuration options available. The Ruwiki WEBrick
- # servlet offers command-line options that simplify the configuration of
- # Ruwiki without editing the servlet; use ruwiki_servlet --help for more
- # information.
- #
- # == Copyright
- # Copyright:: Copyright © 2002 - 2004, Digikata and HaloStatue, Ltd.
- # Authors:: Alan Chen (alan@digikata.com)
- # Austin Ziegler (ruwiki@halostatue.ca)
- # Licence:: Ruby's
-class Ruwiki
- ALLOWED_ACTIONS = %w(edit create)
- EDIT_ACTIONS = %w(save cancel)
- EDIT_VARS = %w(newpage version edcomment q)
- RESERVED = ['save', 'preview', 'cancel', EDIT_VARS].flatten
-
- # Returns the current configuration object.
- attr_reader :config
- # Returns the current Response object.
- attr_reader :response
- # Returns the current Request object.
- attr_reader :request
- # Returns the current Markup object.
- attr_reader :markup
- # Returns the current Backend object.
- attr_reader :backend
- # Sets the configuration object to a new configuration object.
- def config=(cc)
- raise self.message[:config_not_ruwiki_config] unless cc.kind_of?(Ruwiki::Config)
- @config = cc
- self.config!
- end
-
- def config!
- @markup.default_project = @config.default_project
- @markup.message = self.message
- end
-
- def load_config(filename)
- @config = Ruwiki::Config.read(filename)
- self.config!
- end
-
- # The message hash.
- def message
- @config.message
- end
-
- # Initializes Ruwiki.
- def initialize(handler)
- @request = handler.request
- @response = handler.response
-
- @config = Ruwiki::Config.new
-
- @path_info = @request.determine_request_path || ''
-
- @type = nil
- @error = {}
-
- @markup = Ruwiki::Wiki.new(@config.default_project,
- @request.script_url,
- @config.title)
- end
-
- # Initializes the backend for Ruwiki.
- def set_backend
- @backend = BackendDelegator.new(self, @config.storage_type)
- @markup.backend = @backend
- # Load the blacklists here because I don't as of yet know where else
- # to put them. :(
- @banned_agents = load_blacklist('agents.banned')
- @banned_hostip = load_blacklist('hostip.banned')
- @readonly_agents = load_blacklist('agents.readonly')
- @readonly_hostip = load_blacklist('hostip.readonly')
- # Prevent Google redirection against these URIs.
- Ruwiki::Wiki.no_redirect = load_blacklist('clean.uri')
- end
-
- def load_blacklist(filename)
- data = []
- filename = File.join(@config.storage_options[@config.storage_type]['data-path'], filename)
- ii = '^'
- jj = /^#{ii}/o
- File.open(filename, 'rb') do |f|
- f.each do |line|
- line.gsub!(%r{^\s*#.*$}, '')
- line.strip!
- if line.empty?
- data << nil
- else
- if line =~ jj
- data << "(?:#{line}\n)"
- else
- data << line
- end
- end
- end
- end
- data.compact!
- if data.empty?
- nil
- else
- Regexp.new(data.join("|"), Regexp::EXTENDED)
- end
- rescue
- return nil
- end
-
- def check_useragent
- addr = @request.environment['REMOTE_ADDR']
- user = @request.environment['HTTP_USER_AGENT']
-
- if user.nil? or user.empty?
- :forbidden
- elsif @banned_hostip and addr and addr =~ @banned_hostip
- :forbidden
- elsif @banned_agents and user =~ @banned_agents
- :forbidden
- elsif @readonly_hostip and addr and addr =~ @readonly_hostip
- :read_only
- elsif @readonly_agents and user =~ @readonly_agents
- :read_only
- else
- :clean
- end
- end
-
- # Runs the steps to process the wiki.
- def run
- @config.verify
- set_backend
- set_page
- process_page
- render
- rescue Exception => ee
- render(:error, ee)
- ensure
- output
- end
-
- # Initializes current page for Ruwiki.
- def set_page
- path_info = @path_info.split(%r{/}, -1).map { |ee| ee.empty? ? nil : ee }
-
- if path_info.size == 1 or (path_info.size > 1 and path_info[0])
- raise self.message[:invalid_path_info_value] % [@path_info] unless path_info[0].nil?
- end
-
- # path_info[0] will ALWAYS be nil.
- path_info.shift
-
- case path_info.size
- when 0 # Safety check.
- nil
- when 1 # /PageTopic OR /_edit
- set_page_name_or_action(path_info[0])
- when 2 # /Project/ OR /Project/PageTopic OR /Project/_edit OR /Project/create
- @project = path_info.shift
- set_page_name_or_action(path_info[0])
- else # /Project/PageTopic/_edit OR /Project/diff/3,4 OR something else.
- @project = path_info.shift
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- else
- @topic = item
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- end
- end
- end
-
-# @request.each_parameter { |key, val| puts "#{key} :: #{val.class}" }
-
- @project ||= @config.default_project
- @topic ||= @config.default_page
- end
-
- PROJECT_LIST_ITEM = %[%1$s (a href='\\%2$s/%1$s/_topics' class='rw_minilink')%3$s\\</a\\>]
-
- # Processes the page through the necessary steps. This is where the edit,
- # save, cancel, and display actions are present.
- def process_page
- content = nil
- formatted = false
-
- @page = Ruwiki::Page.new(@backend.retrieve(@topic, @project))
- @type = :content
-
- agent_ok = check_useragent
- case agent_ok
- when :read_only
- @page.editable = false
- case @action
- when 'edit', 'save', 'preview', 'cancel', 'search'
- @page.indexable = false
- end
- when :forbidden
- forbidden
- return
- else
- unless @config.auth_mechanism.nil?
- @auth_token = Ruwiki::Auth[@config.auth_mechanism].authenticate(@request, @response, @config.auth_options)
- @page.editable = @auth_token.permissions['edit']
- end
- end
-
- # TODO Detect if @action has already been set.
- @action ||= @request.parameters['action'].downcase if @request.parameters['action']
- @action ||= 'save' if @request.parameters['save']
- @action ||= 'cancel' if @request.parameters['cancel']
- @action ||= 'preview' if @request.parameters['preview']
-
- unless @page.editable
- case @action
- when 'edit', 'save', 'preview', 'cancel'
- @action = 'show'
- end
- end
-
- case @action
- when 'search'
- # get, validate, and cleanse the search string
- # TODO: add empty string rejection.
- srchstr = validate_search_string(@request.parameters['q'])
- if not srchstr.nil?
- srchall = @request.parameters['a']
-
- @page.editable = false
- @page.indexable = false
-
- @page.content = self.message[:search_results_for] % [srchstr]
- @page.topic = srchstr || ""
-
- unless srchall.nil?
- hits = @backend.search_all_projects(srchstr)
- else
- hits = @backend.search_project(@page.project, srchstr)
- end
-
- # turn hit hash into content
- hitarr = []
- # organize by number of hits
- hits.each { |key, val| (hitarr[val] ||= []) << key }
-
- rhitarr = hitarr.reverse
- maxhits = hitarr.size
- rhitarr.each_with_index do |tarray, rnhits|
- next if tarray.nil? or tarray.empty?
- nhits = maxhits - rnhits - 1
-
- if nhits > 0
- @page.content << "\n== #{self.message[:number_of_hits] % [nhits]}\n* "
- @page.content << tarray.join("\n* ")
- end
- end
-
- @type = :search
- else
- @sysmessage = self.message[:no_empty_search_string] % [ @page.project, @page.topic ]
- @type = :content
- end
- when 'topics'
- if @backend.project_exists?(@page.project)
- topic_list = @backend.list_topics(@page.project)
- else
- topic_list = []
- end
-
- @page.editable = false
-
- # todo: make this localized
- if topic_list.empty?
- @page.content = self.message[:no_topics] % [@page.project]
- else
- topic_list.map! do |tt|
- uu = CGI.unescape(tt)
- if (uu != tt) or (tt !~ Ruwiki::Wiki::RE_WIKI_WORDS)
- "[[#{CGI.unescape(tt)}]]"
- else
- tt
- end
- end
- @page.content = <<EPAGE
-= #{self.message[:topics_for_project] % [@page.project]}
-* #{topic_list.join("\n* ")}
-EPAGE
- end
-
- @type = :content
- when 'projects'
- proj_list = @backend.list_projects
-
- @page.editable = false
-
- if proj_list.empty?
- @page.content = self.message[:no_projects]
- else
- # TODO make this localized
- proj_list.map! { |proj| PROJECT_LIST_ITEM % [ proj, @request.script_url, self.message[:project_topics_link] ] }
- @page.content = <<EPAGE
-= #{self.message[:wiki_projects] % [@config.title]}
-* ::#{proj_list.join("\n* ::")}
-EPAGE
- end
-
- content = @page.to_html(@markup)
- content.gsub!(%r{\(a href='([^']+)/_topics' class='rw_minilink'\)}, '<a href="\1/_topics" class="rw_minilink">') #'
- content.gsub!(%r{\\&lt;}, '<')
- content.gsub!(%r{\\&gt;}, '>')
- formatted = true
- @type = :content
- when 'edit', 'create'
- # Automatically create the project if it doesn't exist or if the
- # action is 'create'.
- @backend.create_project(@page.project) if @action == 'create'
- @backend.create_project(@page.project) unless @backend.project_exists?(@page.project)
- @page.creator = @auth_token.name if @action == 'create' and @auth_token
- @page.indexable = false
- @lock = @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR']) rescue nil
-
- if @lock.nil?
- @type = :content
- @sysmessage = self.message[:page_is_locked]
- else
- content = nil
- formatted = true
- @type = :edit
- end
- when 'save', 'preview'
- np = @request.parameters['newpage'].gsub(/\r/, '').chomp
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.editor_ip = @request.environment['REMOTE_ADDR']
- @page.indexable = false
-
- save_ver = @backend.retrieve(@page.topic, @page.project)['properties']['version'].to_i
- sent_ver = @request.parameters['version'].to_i
-
- if sent_ver < save_ver
- @type = :edit
-
- np = np.split($/)
- content_diff = Diff::LCS.sdiff(np, @page.content.split($/), Diff::LCS::ContextDiffCallbacks)
- content_diff.reverse_each do |hunk|
- case hunk
- when Array
- hunk.reverse_each do |diff|
- case diff.action
- when '+'
-# np.insert(diff.old_position, "+#{diff.new_element}")
- np.insert(diff.old_position, "#{diff.new_element}")
- when '-'
- np.delete_at(diff.old_position)
-# np[diff.old_position] = "-#{diff.old_element}"
- when '!'
- np[diff.old_position] = "-#{diff.old_element}"
- np.insert(diff.old_position + 1, "+#{diff.new_element}")
- end
- end
- when Diff::LCS::ContextChange
- case hunk.action
- when '+'
- np.insert(hunk.old_position, "#{hunk.new_element}")
-# np.insert(hunk.old_position, "+#{hunk.new_element}")
- when '-'
- np.delete_at(hunk.old_position)
-# np[diff.old_position] = "-#{hunk.old_element}"
- when '!'
- np[hunk.old_position] = "-#{hunk.old_element}"
- np.insert(hunk.old_position + 1, "+#{hunk.new_element}")
- end
- end
- end
- @page.content = np.join("\n")
-
- edc = @request.parameters['edcomment']
- unless (edc.nil? or edc.empty? or edc == "*")
- @page.edit_comment = edc
- end
-
- @sysmessage = self.message[:not_editing_current_version] % [ @page.project, @page.topic ]
- else
- if @action == 'save'
- @page.editor = @auth_token.name if @auth_token
- op = @page.content
- else
- op = nil
- end
-
- if (np == op) and (@action == 'save')
- @type = :content
- else
- @page.content = np
- edc = @request.parameters['edcomment']
- unless (edc.nil? or edc.empty? or edc == "*")
- @page.edit_comment = edc
- end
-
- if @action == 'save'
- @type = :save
- @page.version = @request.parameters['version'].to_i + 1
- @backend.store(@page)
-
- # hack to ensure that Recent Changes are updated correctly
- if @page.topic == 'RecentChanges'
- recent = Ruwiki::Page.new(@backend.retrieve(@page.topic, @page.project))
- @page.content = recent.content
- end
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- else
- @type = :preview
- @lock = @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR'])
- content = nil
- formatted = true
- end
- end
- end
- when 'cancel'
-# @page.topic = @request.parameters['topic']
-# @page.project = @request.parameters['project']
-# @page.version = @request.parameters['version'].to_i
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- @type = :content
- else
- # TODO AZ: This should probably return a 501 Not Implemented or some
- # other error unless @action.nil?
- nil
- end
- content = @page.to_html(@markup) if not formatted
- rescue Exception => ee # rescue for def process_page
- @type = :error
- if ee.kind_of?(Ruwiki::Backend::BackendError)
- name = "#{self.message[:error]}: #{ee.to_s}"
- else
- name = "#{self.message[:complete_utter_failure]}: #{ee.to_s}"
- end
- @error[:name] = CGI.escapeHTML(name)
- @error[:backtrace] = ee.backtrace.map { |el| CGI.escapeHTML(el) }.join("<br />\n")
- content = nil
- ensure
- @content = content
- end # def process_page
-
- # Renders the page.
- def render(*args)
- if args.empty?
- type = @type
- error = @error
- else
- raise ArgumentError, self.message[:render_arguments] unless args.size == 2
- type = args[0]
- error = {
- :name => Ruwiki.clean_entities(args[1].inspect),
- :backtrace => args[1].backtrace.join("<br />\n")
- }
- @page = Ruwiki::Page.new(Ruwiki::Page::NULL_PAGE)
- end
-
- @rendered_page = ""
- values = {
- "css_link" => @config.css_link,
- "home_link" => %Q(<a href="#{@request.script_url}">#{@config.title}</a>),
- "cgi_url" => @request.script_url,
- "content" => @content,
- }
-
- if @page.nil?
- values["page_project"] = ""
- values["page_raw_topic"] = ""
- values["page_topic"] = ""
- values["editable"] = false
- values["indexable"] = false
- else
- values["page_project"] = @page.project
- values["page_raw_topic"] = @page.topic
- values["page_topic"] = CGI.unescape(@page.topic)
- values["editable"] = @page.editable
- values["indexable"] = @page.indexable
- end
-
- values["url_project"] = %Q(#{values["cgi_url"]}/#{values["page_project"]})
- values["url_topic_search"] = %Q(#{values["url_project"]}/_search?q=#{values["page_topic"]})
- values["link_topic_search"] = %Q(<a href='#{values["url_topic_search"]}'><strong>#{values["page_topic"]}</strong></a>)
- values["message"] = @sysmessage unless @sysmessage.nil?
-
- case type
- when :content, :save, :search
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}" if @page.nil?
- values["wiki_title"] ||= "#{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["label_topic_or_search"] = self.message[:label_topic]
- values["page_topic_name"] = values["page_topic"]
- if type == :content or type == :search
- template = TemplatePage.new(@config.template(:body), @config.template(:content), @config.template(:controls), @config.template(:footer))
- if type == :search
- values["label_topic_or_search"] = self.message[:label_search]
- else
- values["page_topic"] = values["link_topic_search"]
- end
- else
- # action type was save
- values["page_topic"] = values["link_topic_search"]
- template = TemplatePage.new(@config.template(:body), @config.template(:save), @config.template(:controls), @config.template(:footer))
- end
- when :edit, :preview
- template = TemplatePage.new(@config.template(:body), @config.template(:edit))
- values["wiki_title"] = "#{self.message[:editing]}: #{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_content"] = @page.content
- values["page_version"] = @page.version.to_s
- values["unedited_page_content"] = @page.to_html(@markup)
- values["pre_page_content"] = CGI.escapeHTML(@page.content)
- if @request.parameters["edcomment"].nil? or @request.parameters["edcomment"].empty?
- values["edit_comment"] = "*"
- else
- values["edit_comment"] = @request.parameters["edcomment"]
- end
- when :error
- template = TemplatePage.new(@config.template(:body), @config.template(:error))
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}"
- values["name"] = error[:name]
- values["backtrace"] = error[:backtrace]
- values["backtrace_email"] = error[:backtrace].gsub(/<br \/>/, '')
- values["webmaster"] = @config.webmaster
- end
-
- template.to_html(values, :messages => @config.message,
- :output => @rendered_page)
- end
-
- # Outputs the page.
- def output
- return if @response.written?
-# if @request.environment["HTTP_ACCEPT"] =~ %r{application/xhtml\+xml}
-# @response.add_header("Content-type", "application/xhtml+xml")
-# else
- @response.add_header("Content-type", "text/html")
-# end
- @response.add_header("Cache-Control", "max_age=0")
- @response.write_headers
- @response << @rendered_page
- end
-
- def forbidden
- protocol = @request.environment["SERVER_PROTOCOL"] || "HTTP/1.0"
- @response.write_status "#{protocol} 403 FORBIDDEN\nDate: #{CGI::rfc1123_date(Time.now)}\n\n"
- end
-
- # nil if string is invalid
- def validate_search_string(instr)
- return nil if instr.empty?
-
- modstr = instr.dup
-
- #TODO: add validation of modstr
- return modstr
- end
-
- def self.clean_entities(data)
- data.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;')
- end
-
-private
- RE_ACTION = %r{^_([[:lower:]]+)$}
-
- def set_page_name_or_action(item)
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- else
- @topic = item
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/auth.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/auth.rb
deleted file mode 100644
index ab4c923..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/auth.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Auth
- class << self
- def [](name)
- @delegate ||= {}
-
- if @delegate.has_key?(name)
- @delegate[name]
- else
- require "ruwiki/auth/#{name}"
- @delegate[name] = Ruwiki::Auth.const_get(name.capitalize)
- end
- end
- end
-
- class Token
- def initialize(name = nil, groups = [], permissions = {})
- @user_name = name
- @groups = groups
- @permissions = permissions
- end
-
- def found?
- not @user_name.nil?
- end
-
- def name
- @user_name
- end
-
- def member?(unix_group_name)
- @groups.include?(unix_group_name)
- end
-
- def groups
- @groups
- end
-
- def allowed?(action)
- @permission[action]
- end
-
- def permissions
- @permissions
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/auth/gforge.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/auth/gforge.rb
deleted file mode 100644
index 70895a1..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/auth/gforge.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-begin
- require 'gforge_auth'
-rescue LoadError
- class GForgeAuthenticator
- class AuthenticationResult
- def initialize(name = nil, groups = [])
- @user_name = name
- @groups = groups
- end
-
- def found?
- not @user_name.nil?
- end
-
- def user_name
- raise "No session associated with the given key was found" unless found?
- @user_name
- end
-
- def member?(unix_group_name)
- raise "No session associated with the given key was found" unless found?
- @groups.include?(unix_group_name)
- end
-
- def groups
- raise "No session associated with the given key was found" unless found?
- @groups
- end
- end
-
- def self.authenticate(sessionkey, options = {})
- sql = %Q(SELECT user_name FROM users u, user_session us WHERE us.session_hash = '#{sessionkey}' AND us.user_id = u.user_id;)
- res = %x{psql -q -t -U #{options['user']} #{options['pass']} -c \"#{sql}\"}
- rows = res.split(/\n/)
- return AuthenticationResult.new if rows.size != 1
-
- user_name = rows[0].strip
- sql = %Q(SELECT unix_group_name FROM groups g, users u, user_group ug WHERE u.user_name = '#{user_name}' AND ug.user_id = u.user_id AND g.group_id = ug.group_id)
-
- res = %x(psql -q -t -U #{options['user']} #{options['pass']} -c \"#{sql}\")
- groups = []
- res.split(/\n/).each {|row| groups << row.strip }
- AuthenticationResult.new(user_name, groups)
- end
- end
-end
-
-class Ruwiki::Auth::Gforge < Ruwiki::Auth
- def self.authenticate(request, response, options = {})
- options['user'] = options['user'].gsub!(%r{^(\w+)}, '\1')
- options['pass'] = options['pass'].gsub!(%r{^(\w+)}, '\1')
- session_key = request.cookies['session_ser'].value[0].split(%r{-\*-})[-1]
- token = GForgeAuthenticator.authenticate(session_key, options)
- token = Ruwiki::Auth::Token.new(token.user_name, token.groups)
- token.permissions.default = true if token.found?
- rescue
- token = Ruwiki::Auth::Token.new
- token.permissions.default = false
- ensure
- return token
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/backend.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/backend.rb
deleted file mode 100644
index 063666e..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/backend.rb
+++ /dev/null
@@ -1,318 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-begin
- if defined?(Gem::Cache)
- require_gem 'diff-lcs', '~> 1.1.2'
- else
- require 'diff/lcs'
- end
-rescue LoadError => ex
- $stderr.puts ex.message
- raise
-end
-
-class Ruwiki
- # The list of known backends.
- KNOWN_BACKENDS = %w(flatfiles)
-
- # The Ruwiki backend delegator. Ruwiki will always instantiate a version
- # of this class which delegates the actual method execution to the Backend
- # class. Error handling is handled by capturing (and possibly forwarding)
- # exceptions raised by the delegate class.
- class BackendDelegator
- def initialize(ruwiki, backend)
- @message = ruwiki.config.message
- @time_format = ruwiki.config.time_format || "%H:%M:%S"
- @date_format = ruwiki.config.date_format || "%Y.%m.%d"
- @datetime_format = ruwiki.config.datetime_format || "#{@date_format} #{@time_format}"
- options = ruwiki.config.storage_options
- options['default-page'] = ruwiki.config.default_page
-
- unless Ruwiki::KNOWN_BACKENDS.include?(backend)
- raise RuntimeError, @message[:backend_unknown] % [backend]
- end
-
- beconst = backend.capitalize
-
- require "ruwiki/backend/#{backend}"
-
- beoptions = options[backend]
- @delegate = Ruwiki::Backend.const_get(beconst).new(beoptions)
- rescue Ruwiki::Backend::BackendError => ex
- if ex.kind_of?(Array)
- raise Ruwiki::Backend::BackendError.new(nil), @message[ex.reason[0]] % ex.reason[1]
- else
- raise
- end
- end
-
- # Retrieve the specified topic and project page. Calls Backend#load
- # after verifying that the project exists.
- def retrieve(topic, project = 'Default')
- unless page_exists?(topic, project)
- exported = Ruwiki::Page::NULL_PAGE.dup
- exported['properties'] = {
- 'title' => topic,
- 'topic' => topic,
- 'project' => project,
- 'create-date' => Time.now.utc,
- 'edit-date' => Time.now.utc,
- 'editable' => true,
- 'indexable' => true,
- 'entropy' => 0.0,
- 'html-headers' => [],
- 'version' => 0
- }
- exported['page'] = {
- 'header' => nil,
- 'footer' => nil
- }
-
- if project_exists?(project)
- exported['page']['content'] = ""
- else
- exported['page']['content'] = @message[:project_does_not_exist] % [project]
- end
- return exported
- end
-
- return @delegate.load(topic, project)
- rescue Ruwiki::Backend::InvalidFormatError => ex
- raise Ruwiki::Backend::BackendError.new(nil), @message[:page_not_in_backend_format] % [project, topic, @delegate.class]
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_read_topic] % [project, topic]
- rescue Exception => ex
- mm = [project, topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_retrieve_topic] % mm
- end
-
- # Stores the specified topic and project page.
- def store(page)
- @delegate.store(page)
-
- # update change page
- begin
- recent_changes = nil
- if (page.topic == 'RecentChanges')
- recent_changes = page.dup
- else
- recent_changes = Page.new(retrieve('RecentChanges', page.project))
- end
-
- changeline = "\n; #{page.editor_ip} (#{Time.now.utc.strftime(@datetime_format)}), #{page.topic} : #{page.edit_comment}"
-
- # add changeline to top of page
- recent_changes.content = changeline + (recent_changes.content || "")
- @delegate.store(recent_changes)
- rescue Exception => ex
- raise "Couldn't save RecentChanges\n#{ex.backtrace}"
- end
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_store_topic] % [page.project, page.topic]
- rescue Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_store_topic] % mm
- end
-
- # Destroys the specified topic and project page.
- def destroy(page)
- @delegate.destroy(page)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_destroy_topic] % [page.project, page.topic]
- rescue Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_destroy_topic] % mm
- end
-
- # Releases the lock on the page.
- def release_lock(page, address = 'UNKNOWN')
- time = Time.now.utc.to_i
- @delegate.release_lock(page, time, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_release_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:error_releasing_lock] % mm
- end
-
- # Attempts to obtain a lock on the page. The lock
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- time = Time.now.utc.to_i
- expire = time + timeout
- @delegate.obtain_lock(page, time, expire, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_obtain_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:error_creating_lock] % mm
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- @delegate.project_exists?(project)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- @delegate.page_exists?(topic, project)
- end
-
- # Attempts to create the project.
- def create_project(project)
- @delegate.create_project(project)
- rescue Ruwiki::Backend::ProjectExists => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:project_already_exists] % [project]
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_create_project] % [project]
- rescue Exception => ex
- mm = [project, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_create_project] % mm
- end
-
- # Attempts to destroy the project.
- def destroy_project(project)
- @delegate.destroy_project(project)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_destroy_project] % [project]
- rescue Exception => ex
- mm = [project, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_destroy_project] % mm
- end
-
- def search_all_projects(searchstr)
- if @delegate.respond_to?(:search_all_projects)
- @delegate.search_all_projects(searchstr)
- else
- search_all_projects_default(searchstr)
- end
- end
-
- # Attempts to search all projects. This is the default
- # search_all_projects used unless the delegate implements
- # a specialized search_all_projects.
- def search_all_projects_default(searchstr)
- hits = {}
- list_projects.each do |project|
- lhits = search_project(project, searchstr)
- # Transform the keys from project local to global links.
- lhits.each { |key, val| hits["#{project}::#{key}"] = val }
- end
- hits
- end
-
- # Attempts to search a project
- def search_project(project, searchstr)
- #TODO: Validate searchstr is a safe regexp?
- @delegate.search_project(project, searchstr)
- rescue Exception => ex
- mm = [project, searchstr, ex.class, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:search_project_fail] % mm
- end
-
- # Return an array of projects
- def list_projects
- @delegate.list_projects
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_list_projects]
- rescue Exception => ex
- mm = ['', %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_list_projects] % mm
- end
-
- # Return an array of projects
- def list_topics(projname)
- @delegate.list_topics(projname)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_list_topics] % [projname]
- rescue Exception => ex
- mm = [projname, ex.message]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_list_topics] % mm
- end
- end
-
- # The Ruwiki backend abstract class and factory.
- class Backend
- class ProjectExists < RuntimeError #:nodoc:
- end
- class InvalidFormatError < RuntimeError #:nodoc:
- end
- class BackendError < RuntimeError #:nodoc:
- attr_reader :reason
-
- def initialize(reason, *args)
- if @reason.respond_to?(:message)
- @reason = reason.message
- else
- @reason = reason
- end
- end
- end
- def initialize(storage_options)
- end
-
- private
- NL_RE = %r{\n} #:nodoc:
-
- def map_diffset(diffset)
- diffset.map do |hunk|
- if hunk.kind_of?(Array)
- hunk.map { |change| change.to_a }
- else
- hunk.to_a
- end
- end
- end
-
- # Creates the current diff object. This is made from two
- # Ruwiki::Page#export hashes.
- def make_diff(oldpage, newpage)
- oldpage = oldpage.export if oldpage.kind_of?(Ruwiki::Page)
- newpage = newpage.export if newpage.kind_of?(Ruwiki::Page)
-
- diff = Hash.new
-
- newpage.keys.sort.each do |sect|
- newpage[sect].keys.sort.each do |item|
- oldval = oldpage[sect][item]
- newval = newpage[sect][item]
-
- case [sect, item]
- when ['properties', 'html-headers']
- # Protect against NoMethodError.
- oldval ||= []
- newval ||= []
- val = Diff::LCS.sdiff(oldval, newval, Diff::LCS::ContextDiffCallbacks)
- when ['ruwiki', 'content-version'], ['properties', 'version'],
- ['properties', 'entropy']
- val = Diff::LCS.sdiff([oldval], [newval], Diff::LCS::ContextDiffCallbacks)
- when ['properties', 'create-date'], ['properties', 'edit-date']
- val = Diff::LCS.sdiff([oldval.to_i], [newval.to_i], Diff::LCS::ContextDiffCallbacks)
- else
- # Protect against NoMethodError.
- val = Diff::LCS.sdiff(oldval.to_s.split(NL_RE), newval.to_s.split(NL_RE), Diff::LCS::ContextDiffCallbacks)
- end
-
- (diff[sect] ||= {})[item] = map_diffset(val) unless val.nil? or val.empty?
- end
- end
-
- diff_hash = {
- 'old_version' => oldpage['properties']['version'],
- 'new_version' => newpage['properties']['version'],
- 'edit-date' => newpage['properties']['edit-date'].to_i,
- 'editor-ip' => newpage['properties']['editor-ip'],
- 'editor' => newpage['properties']['editor'],
- 'diff' => diff
- }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/backend/flatfiles.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/backend/flatfiles.rb
deleted file mode 100644
index e9a9ae2..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/backend/flatfiles.rb
+++ /dev/null
@@ -1,216 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Flatfiles < Ruwiki::Backend
- # Initializes the Flatfiles backend. The known options for the Flatfiles
- # backend are documented below.
- #
- # data-path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # format:: The format of the files in the backend. By default,
- # this is 'exportable', a tagged data format produced by
- # Ruwiki::Exportable; alternative formats are 'yaml'
- # (::YAML.dump) and 'marshal' (::Marshal.dump).
- # default-page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- @data_path = options['data-path'] || File.join(".", "data")
- @extension = options['extension']
- @format = case options['format']
- when 'exportable', nil
- Ruwiki::Exportable
- when 'yaml'
- ::YAML
- when 'marshal'
- ::Marshal
- end
-
- if @extension.nil?
- @extension_re = /$/
- else
- @extension_re = /\.#{@extension}$/
- end
-
- @default_page = options['default-page'] || "ProjectIndex"
- if not (File.exists?(@data_path) and File.directory?(@data_path))
- raise Ruwiki::Backend::BackendError.new([:flatfiles_no_data_directory, [@data_path]])
- end
-
- super
- end
-
- # Destroys the topic page.
- def destroy(page)
- pf = page_file(page.topic, page.project)
- File.unlink(pf) if File.exists?(pf)
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- pd = project_directory(project)
- File.exists?(pd) and File.directory?(pd)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- pf = page_file(topic, project)
- project_exists?(project) and File.exists?(pf)
- end
-
- # Tries to create the project.
- def create_project(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::ProjectExists if File.exists?(pd)
- Dir.mkdir(pd)
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # String search all topic names and content in a project and
- # return a hash of topic hits.
- def search_project(project, searchstr)
- re_search = Regexp.new(searchstr, Regexp::IGNORECASE)
-
- hits = Hash.new { |hh, kk| hh[kk] = 0 }
- topic_list = list_topics(project)
-
- return hits if topic_list.empty?
-
- # search topic content
- topic_list.each do |topic|
- # search name
- hits[topic] += topic.scan(re_search).size
-
- # check content
- page = load(topic, project) rescue Ruwiki::Page::NULL_PAGE
- page['page'].each_value do |item|
- item = item.join("") if item.kind_of?(Array)
- item ||= ""
- hits[topic] += item.scan(re_search).size
- end
- end
-
- hits
- end
-
- def lock_okay?(page, time, address = 'UNKNOWN')
- lockokay = false
- lockfile = "#{page_file(page.topic, page.project)}.lock"
-
- if File.exists?(lockfile)
- data = File.read(lockfile).split(%r{!})
- # If the lock belongs to this address, we don't care how old it is.
- # Thus, release it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lockokay = true
- end
- end
-
- # Attempts to obtain a lock on the topic page. This must return the lock
- def obtain_lock(page, time, expire, address = 'UNKNOWN')
- lock = "#{address}!#{expire}"
-
- if lock_okay?(page, time, address)
- File.open("#{page_file(page.topic, page.project)}.lock", 'wb') { |lfh| lfh.puts lock }
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- lock
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, time, address = 'UNKNOWN')
- lockfile = "#{page_file(page.topic, page.project)}.lock"
-
- if lock_okay?(page, time, address)
- File.unlink(lockfile) if File.exists?(lockfile)
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- true
- end
-
- # list projects found in data path
- def list_projects
- Dir[File.join(@data_path, "*")].select do |dd|
- File.directory?(dd) and File.exist?(page_file(@default_page, File.basename(dd)))
- end.map { |dd| File.basename(dd) }
- end
-
- # list topics found in data path
- def list_topics(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::BackendError.new(:no_project) unless File.exist?(pd)
-
- Dir[File.join(pd, "*")].select do |ff|
- ff !~ /\.rdiff$/ and ff !~ /\.lock$/ and File.file?(ff) and ff =~ @extension_re
- end.map { |ff| File.basename(ff).sub(@extension_re, "") }
- end
-
- def project_directory(project) # :nodoc:
- File.join(@data_path, project)
- end
-
- def page_file(topic, project = 'Default') # :nodoc:
- if @extension.nil?
- File.join(project_directory(project), topic)
- else
- File.join(project_directory(project), "#{topic}.#{@extension}")
- end
- end
-
- def make_rdiff(page_file, new_page)
- diff_file = "#{page_file}.rdiff"
-
- old_page = self.class.load(pf) rescue Ruwiki::Page::NULL_PAGE
-
- diffs = []
- File.open(diff_file, 'rb') { |ff| diffs = Marshal.load(ff) } if File.exists?(diff_file)
- diffs << make_diff(old_page, new_page)
- changes = Marshal.dump(diffs)
-
- File.open(diff_file, 'wb') { |ff| ff << changes }
- end
-
- # Provides a HEADER marker.
- # Loads the topic page from disk.
- def load(topic, project)
- data = nil
- File.open(page_file(topic, project), 'rb') { |ff| data = ff.read }
-
- Ruwiki::Page::NULL_PAGE.merge(@format.load(data))
- rescue Ruwiki::Exportable::InvalidFormatError, TypeError, ArgumentError
- raise Ruwiki::Backend::InvalidFormatError
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = @format.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |ff| ff.puts newpage }
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/config.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/config.rb
deleted file mode 100644
index d01dca1..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/config.rb
+++ /dev/null
@@ -1,244 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # Ruwiki configuration.
-class Ruwiki::Config
- include Ruwiki::Exportable
-
- CONFIG_NAME = 'ruwiki.conf'
-
- exportable_group 'ruwiki-config'
- # Sets or returns the logger. The logger, if set, must respond to the same
- # methods as WEBrick::Logger.
- attr_accessor :logger
- # Sets or returns the time format whenever time is outputted in Ruwiki.
- # Default is <tt>%H:%M:%S</tt> (23:59:59).
- attr_accessor :time_format
- exportable :time_format
- # Sets or returns the date format whenever time is outputted in Ruwiki.
- # Default is <tt>%Y.%m.%d</tt> (2004.08.04).
- attr_accessor :date_format
- exportable :date_format
- # Sets or returns the date-time format whenever time is outputted in
- # Ruwiki. Default is <tt>%Y.%m.%d %H:%M:%S</tt> (2004.08.04 23:59:59).
- attr_accessor :datetime_format
- exportable :datetime_format
- # Adds additional information to the (rare) error reports. Defaults to
- # +false+.
- attr_accessor :debug
- exportable :debug
- # The default page for display when Ruwiki is called without any arguments.
- # Defaults to +ProjectIndex+
- attr_accessor :default_page
- exportable :default_page
- # The default project for display when Ruwiki is called without any
- # arguments or a project specification. Defaults to +Default+
- attr_accessor :default_project
- exportable :default_project
- # The authentication mechanism name as a String. Corresponds to
- # a filename that will be found in ruwiki/auth. The authenticator must
- # have a single class method, +authenticate+, which accepts the
- # +request+, the +response+, and the +#auth_options+. This API is
- # a draft API and is likely to change in future versions of Ruwiki. In
- # this version of Ruwiki, only one authentication mechanism will be
- # found -- for dealing with authenticating users already logged into
- # RubyForge.
- attr_accessor :auth_mechanism
- exportable :auth_mechanism
- # Options for the authentication mechanism as a Hash. This will be
- # passed to the authenticator defined in +#auth_mechanism+.
- attr_accessor :auth_options
- exportable :auth_options
- # The storage type as a String. Corresponds to a filename that will be
- # found in ruwiki/backend. NOTE: The yaml and marshal storage types have
- # been removed from Ruwiki 0.9.0, to be replaced with a single storage
- # type of Flatfiles. Now, the YAML and Marshal formats can be enabled by
- # setting options in the @storage_options field.
- attr_accessor :storage_type
- exportable :storage_type
- # The options for the specified storage type. This is a hash of hashes with
- # auto-vifification. See the storage type for available options.
- attr_reader :storage_options
- exportable :storage_options
- # The path for templates. Defaults to <tt>./templates/</tt>.
- attr_accessor :template_path
- exportable :template_path
- # The name of the Wiki. Defaults to <tt>ruwiki</tt>
- attr_accessor :title
- exportable :title
- # The email address of the webmaster for the Wiki. Defaults to +nil+.
- attr_accessor :webmaster
- exportable :webmaster
- # The name of the Ruwiki CSS file. Defaults to <tt>ruwiki.css</tt>.
- attr_accessor :css
- exportable :css
- # The template set. Templates are always named as
- # <template_path>/<template_set>/<template_name>. Template filename. Must
- # be reachable by File#read.
- attr_accessor :template_set
- exportable :template_set
- # Ruwiki is internationalized. This method sets the Ruwiki error
- # messages (and a few other messages) to the specified language Module.
- # The language Module must have a constant Hash called +Message+
- # containing a set of symbols and localized versions of the messages
- # associated with them.
- #
- # If the file 'ruwiki/lang/es.rb' contains the module
- # <tt>Ruwiki::Lang::ES</tt>, the error messages for RSS could be
- # localized to Español thus:
- #
- # require 'ruwiki/lang/es'
- # ...
- # wiki.config.language = Ruwiki::Lang::ES
- #
- # Localization is per wiki instance. In a servlet environment, this may
- # mean that only a single language is recognised.
- #
- # See Ruwiki::Lang::EN for more information.
- attr_accessor :language
- exportable :language
- # The message hash.
- attr_reader :message
-
- def language=(ll) #:nodoc:
- if ll.kind_of?(String)
- @language = Ruwiki::Lang::const_get(ll.upcase)
- else
- @language = ll
- end
- @message = @language::Message
- end
-
- # Returns the specified template as a string.
- def template(name)
- File.read(File.join(@template_path, @template_set, "#{name.to_s}.tmpl"))
- rescue Errno::ENOENT
- raise ConfigError, message[:no_template_found] % [name.inspect, @template_set]
- end
-
- # Returns the CSS stylesheet content for the Wiki. This previously
- # returned the <link> to the stylesheet, but instead returns a <style>
- # block in the head so that the CSS is kept with the template set, which
- # may be kept outside of the HTML area.
- def css_link
- %Q[<style type="text/css" media="screen,print">#{File.read(File.join(@template_path, @template_set, @css))}</style>]
- end
-
- # Creates a new configuration object.
- def initialize(exportable = {})
- rc = exportable['ruwiki-config'] || {}
- @debug = (rc['debug'] == "false") ? false : true
- @default_project = rc['default-project'] || "Default"
- @default_page = rc['default-page'] || "ProjectIndex"
- @auth_mechanism = rc['auth-mechanism'] || nil
-
- case rc['auth-options']
- when nil, ""
- @auth_options = {}
- else
- @auth_options = Ruwiki::Exportable.load(rc['auth-options'])['default']
- end
-
- case rc['storage-type']
- when nil, ""
- @storage_type = 'flatfiles'
- else
- @storage_type = rc['storage-type']
- end
-
- # in 'type!name:<Tab>value\n' format.
- if rc['storage-options'].nil? or rc['storage-options'].empty?
- @storage_options = Hash.new { |hh, kk| hh[kk] = {} }
- else
- @storage_options = Ruwiki::Exportable.load(rc['storage-options'])
- @storage_options.keys.each do |key|
- @storage_options[key] = @storage_options.delete(key)
- end
- end
- if @storage_options.empty?
- @storage_options[@storage_type]['extension'] = "ruwiki"
- @storage_options[@storage_type]['data-path'] = "./data"
- @storage_options[@storage_type]['format'] = "exportable"
- end
-
- @storage_options.each_value do |vv|
- if vv['extension'].nil? or vv['extension'].empty?
- vv['extension'] = "ruwiki"
- end
- if vv['data-path'].nil? or vv['data-path'].empty?
- vv['data-path'] = "./data"
- end
- end
-
- @template_path = rc['template-path'] || "./templates/"
- @template_set = rc['template-set'] || "default"
- @css = rc['css'] || "ruwiki.css"
- @webmaster = rc['webmaster']
- @title = rc['title'] || "Ruwiki"
- @time_format = rc['time-format'] || "%H:%M:%S"
- @date_format = rc['date-format'] || "%Y.%m.%d"
- @datetime_format = rc['datetime-format'] || "#{@date_format} #{@time_format}"
- case rc['language']
- when nil, ""
- self.language = Ruwiki::Lang::EN
- else
- self.language = Ruwiki::Lang::const_get(rc['language'].upcase)
- end
- end
-
- # Verifies that required configuration options are actually set. Right
- # now, it only checks the values that are defaulted to +nil+.
- def verify
- raise ConfigError, message[:no_webmaster_defined] if @webmaster.nil? or @webmaster.empty?
- raise ConfigError, message[:invalid_template_dir] % [@template_path] unless File.exists?(@template_path) and File.directory?(@template_path)
- tt = File.join(@template_path, @template_set)
- raise ConfigError, message[:no_template_set] % [@template_set] unless File.exists?(tt) and File.directory?(tt)
- end
-
- # Provides the canonical export hash.
- def export
- exportable = super
-
- rc = exportable['ruwiki-config']
-
- rc['auth-options'] = Ruwiki::Exportable.dump({ 'default' => rc['auth-options']})
-
- rc['storage-options'] = Ruwiki::Exportable.dump(rc['storage-options'])
- rc['storage-type'] = rc['storage-type'].to_s
- rc['language'] = "#{rc['language']}".sub(/^.*?::([A-Z]+)$/, '\1').downcase
- exportable
- end
-
- class << self
- def write(file, config)
- if file.respond_to?(:write)
- file.puts(config.dump)
- else
- File.open(file, 'wb') { |ff| ff.puts(config.dump) }
- end
- end
-
- def read(file)
- data = nil
- if file.respond_to?(:read)
- data = file.read
- else
- File.open(file, 'rb') { |ff| data = ff.read }
- end
- hash = Ruwiki::Exportable.load(data)
-
- Ruwiki::Config.new(hash)
- end
- end
-
- class ConfigError < StandardError; end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/exportable.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/exportable.rb
deleted file mode 100644
index c18290f..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/exportable.rb
+++ /dev/null
@@ -1,192 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # == Synopsis
- # Generalises a marshaling format that is easily read and edited by humans
- # and is relatively easy to manage by software. When an attribute is marked
- # #exportable, the name of the attribute is transformed and stored in
- # a two-level hash, e.g.:
- #
- # exportable_group 'group1'
- # exportable :var_1
- # exportable :var_2
- # exportable_group 'group2'
- # exportable :var_3
- # exportable :var_4
- #
- # Results in an exportable hash of:
- #
- # { 'group1' =>
- # { 'var-1' => @var1,
- # 'var-2' => @var2, },
- # 'group2' =>
- # { 'var-3' => @var3,
- # 'var-4' => @var4, }, }
- #
-module Ruwiki::Exportable
- class InvalidFormatError < RuntimeError; end
-
- class << self
- # Adds two methods and an attribute to the class that is including Exportable
- #
- # <tt>__exportables</tt>:: Contains the list of exportable symbols by group.
- # <tt>exportable_group</tt>:: Defines the current group for exportable
- # symbols. Default is 'default'.
- # <tt>exportable</tt>:: Accepts two arguments, the attribute being
- # exported and an option hash, containing the
- # values :name and :group, where :name
- # indicates the name of the attribute (so
- # that the default name transformation is
- # not applied) and :group overrides the
- # current #exportable_group. By default, the
- # name of the attribute is transformed such
- # that underscores are converted to dashes
- # (<tt>var_1</tt> becomes 'var-1').
- def append_features(mod)
- super
-
- class << mod
- attr_reader :__exportables
-
- define_method(:exportable_group) do |name|
- @__exportable_group = name || 'default'
- end
-
- define_method(:exportable) do |*symset|
- symbol = symset.shift
- options = symset.shift || {}
-
- @__exportables ||= {}
-
- options[:name] ||= symbol.to_s.gsub(/_/, '-')
- options[:group] ||= @__exportable_group || 'default'
-
- @__exportables[options[:group]] ||= {}
- @__exportables[options[:group]][options[:name]] = "@#{symbol.to_s}".intern
- end
- end
- end
-
- # Looks for comments. Comments may ONLY be on single lines.
- COMMENT_RE = %r{^#}
- # Looks for newlines
- NL_RE = %r{\n}
- # Looks for a line that indicates an exportable value. See #dump.
- HEADER_RE = %r{^([a-z][-a-z]+)!([a-z][-a-z]+):[ \t](.*)$}
- # Looks for an indented group indicating that the last group is
- # a multiline value.
- FIRST_TAB = %r{^[ \t]}
-
- # Dumps the provided exportable hash in the form:
- #
- # section!name:<Tab>Value
- # section!name:<Space>Value
- #
- # Multiline values are indented either one space or one tab:
- #
- # section!name:<Tab>Value Line 1
- # <Tab>Value Line 2
- # <Tab>Value Line 3
- # <Tab>Value Line 4
- #
- # All values in the exportable hash are converted to string
- # representations, so only values that can meaningfully be reinstantiated
- # from string representations should be stored in the exportable hash. It
- # is the responsibility of the class preparing the exportable hash
- # through Exportable#export to make the necessary transformations.
- def dump(export_hash)
- dumpstr = ""
-
- export_hash.keys.sort.each do |sect|
- export_hash[sect].keys.sort.each do |item|
- val = export_hash[sect][item].to_s.split(NL_RE).join("\n\t")
- dumpstr << "#{sect}!#{item}:\t#{val}\n"
- end
- end
-
- dumpstr
- end
-
- # Loads a buffer in the form provided by #dump into an exportable hash.
- # Skips comment lines.
- def load(buffer)
- hash = {}
- return hash if buffer.nil? or buffer.empty?
-
- # Split the buffer and eliminate comments.
- buffer = buffer.split(NL_RE).delete_if { |line| line =~ COMMENT_RE }
-
- if HEADER_RE.match(buffer[0]).nil?
- raise Ruwiki::Exportable::InvalidFormatError
- end
-
- sect = item = nil
-
- buffer.each do |line|
- line.chomp!
- match = HEADER_RE.match(line)
-
- # If there is no match, add the current line to the previous match.
- # Remove the leading \t, though.
- if match.nil?
- raise Ruwiki::Exportable::InvalidFormatError if FIRST_TAB.match(line).nil?
- hash[sect][item] << "\n#{line.gsub(FIRST_TAB, '')}"
- else
- sect = match.captures[0]
- item = match.captures[1]
- hash[sect] ||= {}
- hash[sect][item] = match.captures[2]
- end
- end
-
- hash
- end
- end
-
- # Converts #exportable attributes to an exportable hash, in the form:
- # { 'group1' =>
- # { 'var-1' => @var1,
- # 'var-2' => @var2, },
- # 'group2' =>
- # { 'var-3' => @var3,
- # 'var-4' => @var4, }, }
- #
- # Classes that #include Exportable are encouraged to override export to
- # ensure safe transformations of values. An example use might be:
- #
- # class TimeClass
- # include Ruwiki::Exportable
- #
- # def export
- # sym = super
- #
- # sym['default']['time'] = sym['default']['time'].to_i
- # sym
- # end
- #
- # In this way, the 'time' value is converted to an integer rather than the
- # default string representation.
- def export
- sym = {}
-
- self.class.__exportables.each do |group, gval|
- gname = group || @__exportable_group || 'default'
- gsym = {}
- gval.each do |name, nval|
- val = self.instance_variable_get(nval)
- gsym[name] = val unless val.nil?
- end
- sym[gname] = gsym
- end
-
- sym
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/handler.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/handler.rb
deleted file mode 100644
index c6a9375..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/handler.rb
+++ /dev/null
@@ -1,342 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Handler
- class << self
- # Generate a new Handler pair from a CGI request.
- def from_cgi(cgi, output_stream = $stdout)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::CGIRequest.new(cgi)
- o.response = Ruwiki::Handler::CGIResponse.new(cgi, output_stream)
- end
- end
-
- # Generate a new Handler pair from a WEBrick request.
- def from_webrick(req, res)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::WEBrickRequest.new(req)
- o.response = Ruwiki::Handler::WEBrickResponse.new(res)
- end
- end
- end
-
- # Returns the handler's request object.
- attr_accessor :request
- # Returns the handler's response object.
- attr_accessor :response
-
- # Creates the handler pair.
- def initialize(&block) #:yields: self
- @request = nil
- @response = nil
- yield self if block_given?
- end
-
- # Essentially a clone of WEBrick::Cookie for use with Ruwiki.
- class Cookie
- attr_reader :name
- attr_accessor :value
- attr_accessor :version
-
- FIELDS = %w(domain path secure comment max_age expires)
-
- FIELDS.each { |field| attr_accessor field.intern }
-
- def initialize(name, value)
- @name = name
- @value = value
- @version = 0 # Netscape Cookie
-
- FIELDS.each { |field| instance_variable_set("@#{field}", nil) }
-
- yield self if block_given?
- end
-
- def expires=(t) #:nodoc:
- @expires = if t.nil? or t.kind_of?(Time)
- t
- else
- Time.parse(t.to_s)
- end
- end
-
- def to_s
- ret = "#{@name}=#{@value}"
- ret << "; Version=#{@version.to_s}" if @version > 0
- ret << "; Domain=#{@domain}" if @domain
- ret << "; Expires=#{CGI::rfc1123_date(@expires)}" if @expires
- ret << "; Max-Age=#{CGI::rfc1123_date(@max_age)}" if @max_age
- ret << "; Comment=#{@comment}" if @comment
- ret << "; Path=#{@path}" if @path
- ret << "; Secure" if @secure
- ret
- end
- end
-
- # Represents an abstract incoming request. This insulates the rest of
- # the code from knowing whether parameters are passed as part of the
- # path, as parameters in the URL, or in some other fashion.
- class AbstractRequest
- def initialize(*args)
- end
- end
-
- # Handles all requests from web applications.
- #
- # Subclasses should provide:
- # @parameters:: Hash-like object that responds to #[] and #hash_key?]
- # @environment:: Hash-like object that responds to #[]
- class AbstractWebRequest < AbstractRequest
- # The parameters provided via the web request.
- attr_reader :parameters
- # The environment provided to the web request.
- attr_reader :environment
- # The request path.
- attr_reader :path
-
- # The list of cookies.
- attr_reader :cookies
-
- def each_parameter #:yields parameter, value:
- @parameters.each { |kk, vv| yield kk, vv }
- end
-
- def each_environment #:yields variable, value
- @environment.each { |kk, vv| yield kk, vv }
- end
-
- def each_cookie #:yields name, value:
- @cookies.each { |kk, vv| yield kk, vv }
- end
-
- # Return the URL of our server.
- def server_url
- res = "http://" # should detect whether we're in secure server mode.
- if @environment['HTTP_HOST']
- res << @environment['HTTP_HOST']
- else
- res << "#{@environment['SERVER_NAME']}:#{@environment['SERVER_PORT']}"
- end
- end
-
- # Return the URL of this script.
- def script_url
- server_url << @environment['SCRIPT_NAME'].to_s
- end
-
- # Return the URL of this request.
- def request_url
- res = script_url
- res << @environment['PATH_INFO'] if @environment['PATH_INFO']
- query = @environment['QUERY_STRING']
- res << "?#{@environment['QUERY_STRING']}" if query && !query.empty?
- res
- end
-
- # Convert a file path into a URL
- def make_url(project, path)
- "#{server_url}/#{project}/#{path}"
- end
-
- def determine_request_path
- @path = ""
- return @path if @environment['PATH_INFO'].nil?
- @path = @environment['PATH_INFO'].dup
- end
- end
-
- # Request for CGI-based activity to ruwiki.
- class CGIRequest < AbstractWebRequest
- def initialize(cgi, output_stream = $stdout)
- @environment = ENV
- @cgi = cgi
- @parameters = {}
- cgi.params.each { |kk, vv| @parameters[kk] = vv[0] }
- @cookies = {}
- cgi.cookies.each do |name, cookie|
- @cookies[name] = Ruwiki::Handler::Cookie.new(name, cookie.value) do |oc|
- oc.version = cookie.version if cookie.respond_to?(:version)
- oc.domain = cookie.domain
- oc.path = cookie.path
- oc.secure = cookie.secure
- oc.comment = cookie.comment if cookie.respond_to?(:comment)
- oc.expires = cookie.expires
- end
- end
- super
- end
- end
-
- # Request for WEBrick based servlet activity to ruwiki.
- class WEBrickRequest < AbstractWebRequest
- def initialize(req)
- @environment = req.meta_vars
- @parameters = req.query
- @cookies = {}
- req.cookies.each do |rqc|
- @cookies[rqc.name] = Ruwiki::Handler::Cookie.new(rqc.name, rqc.value) do |oc|
- oc.version = rqc.version
- oc.domain = rqc.domain
- oc.path = rqc.path
- oc.secure = rqc.secure
- oc.comment = rqc.comment
- oc.expires = rqc.expires
- oc.max_age = rqc.max_age
- end
- end
- super
- end
- end
-
- # Used to write responses in different execution environments such as
- # CGI and Webrick.
- #
- # If you want to create a new response object, you'll need to implement
- # #add_header, #write_headers, #write_cookies, and #<<.
- #
- # The Response object is instantiated with an output stream which must
- # supply +<<+ and +puts+ methods.
- class AbstractResponse
- # Add to the list of headers to be sent back to the client.
- def add_header(key, value)
- raise "Not implemented"
- end
-
- # Write the accumulated headers back to the client.
- def write_headers
- raise "Not implemented"
- end
-
- # Write the string to the client.
- def <<(string)
- raise "Not implemented"
- end
-
- def add_cookies(*cookies)
- cookies.each do |cookie|
- @cookies << cookie
- end
- end
-
- def write_cookies
- raise "Not implemented"
- end
-
- # output_stream must respond to #<< and #puts.
- def initialize(output_stream = $stdout)
- @headers = {}
- @cookies = []
- @written = false
- @status = nil
- @output_stream = output_stream
- end
-
- def written?
- @written
- end
- end
-
- # CGIResponse is the response object for CGI mode.
- class CGIResponse < AbstractResponse
- # output_stream must respond to #<< and #puts.
- def initialize(cgi, output_stream = $stdout)
- @cgi = cgi
- @done = {
- :headers => false,
- :cookies => false,
- :body => false
- }
- super(output_stream)
- end
-
- # Add the header pair for later output as a CGI header.
- def add_header(key, value)
- @headers[key] = value
- end
-
- # Write the headers to the stream. The headers can only be written
- # once.
- def write_headers
- return if @done[:headers]
- @headers.each { |key, value| @output_stream.puts "#{key}: #{value}\r\n" }
- write_cookies
- @output_stream.puts
- @done[:headers] = true
- end
-
- # Write the cookies to the stream. The cookies can only be written
- # once.
- def write_cookies
- return if @done[:cookies]
- @cookies.each do |cookie|
- @output_stream.puts "Set-Cookie: #{cookie.to_s}"
- end
- @done[:cookes] = true
- end
-
- # Output the string to the stream provided.
- def <<(string)
- @output_stream << string
- @written = true
- end
-
- def write_status(status)
- unless status.nil?
- @output_stream << status
- @written = true
- end
- end
- end
-
- # WEBrickResponse is the response object for WEBrick servlet mode.
- class WEBrickResponse < AbstractResponse
- def initialize(webrick_response)
- @response = webrick_response
- @cookies = []
- @done = {
- :headers => false,
- :cookies => false,
- :body => false
- }
- end
-
- def add_header(key, value)
- @response[key] = value
- end
-
- # Copy the cookies into the WEBrick::HTTPResponse cookies array.
- def write_cookies
- return if @done[:cookies]
- @cookies.each do |cookie|
- @response.cookies << cookie.to_s
- end
- @done[:cookes] = true
- end
-
- def write_headers
- write_cookies
- # Webrick will take care of this on its own.
- end
-
- def <<(string)
- @response.body << string.to_s
- @written = true
- end
-
- def write_status(status)
- unless status.nil?
- match = %r{^HTTP/(?:\d|\.)+ (\d+) .*}.match(status)
- @response.status = match.captures[0]
- @response.body << status
- @written = true
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/lang/de.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/lang/de.rb
deleted file mode 100644
index b9db0ef..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/lang/de.rb
+++ /dev/null
@@ -1,339 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Translation by Christian Neukirchen (chneukirchen@yahoo.de) on 22oct2003
-# Updated by Christian Neukirchen (purl.org/net/chneukirchen) on 27aug2004
-# Updated by Christian Neukirchen (purl.org/net/chneukirchen) on 09nov2004
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::DE is the German-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module DE
- Message = Hash.new { |hh, kk| hh[kk] = "Sprachdatei-FEHLER: Unbekannter Nachrichten-Typ #{k.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Unbekanntes Backend %1$s.",
- :cannot_create_project => "Kann %1$s nicht erstellen: %2$s",
- :cannot_destroy_project => "Kann %1$s nicht zerstören: %2$s",
- :cannot_destroy_topic => "Kann %1$s::%2$s nicht zerstören: %3$s",
- :cannot_obtain_lock => "Kann keine Sperre für %1$s::%2$s erhalten. Bitte in Kürze nochmal versuchen.",
- :cannot_release_lock => "Kann die Sperre für %1$s::%2$s nicht lösen. Bitte später nochmal versuchen.",
- :cannot_retrieve_topic => "Kann auf %1$s::%2$s nicht zugreifen: %3$s",
- :cannot_store_topic => "Kann %1$s::%2$s nicht speichern: %3$s",
- :cannot_list_topics => "Kann Themen für Projekt %1$s nicht auflisten: %2$s",
- :error_creating_lock => "Fehler beim Erzeugen der Sperre von %1$s::%2$s: %3$s",
- :error_releasing_lock => "Fehler beim Lösen der Sperre von %1$s::%2$s: %3$s",
- :flatfiles_no_data_directory => "Das Daten-Verzeichnis (%1$s) existiert nicht.",
- :no_access_list_projects => "Keine Berechtigung zum Auflisten der Projekte.",
- :no_access_list_topics => "Keine Berechtigung zum Auflisten der Themen von Projekt %1$s.",
- :no_access_to_create_project => "Keine Berechtigung um Projekt %1$s zu erzeugen.",
- :no_access_to_destroy_project => "Keine Berechtigung um Projekt %1$s zu zerstören.",
- :no_access_to_destroy_topic => "Keine Berechtigung um Thema %1$s::%2$s zu zerstören.",
- :no_access_to_read_topic => "Keine Berechtigung um Thema %1$s::%2$s zu lesen.",
- :no_access_to_store_topic => "Keine Berechtigung um Thema %1$s::%2$s zu speichern.",
- :page_not_in_backend_format => "%1$s::%2$s ist in einem von Backend %3$s nicht unterstütztem Format.",
- :project_already_exists => "Project %1$s existiert bereits.",
- :project_does_not_exist => "Project %1$s existiert nicht.",
- :search_project_fail => "Suche in Projekt %1$s nach Zeichenkette %2$s gescheitert.",
- :yaml_requires_182_or_higher => "YAML-Flatfile-Support existiert nur für Ruby 1.8.2 oder höher.",
- :not_editing_current_version => <<EOM ,
-Sie haben eine alte Version von %1$s::%2$s abgeschickt. Die Unterschiede
-zwischen ihrer und der jetzigen Version wurden kombiniert. Konfliktierende
-Zeilen zeigen beide Zeilen. Bitte gehen sie sicher, dass sie die gesammte
-Seite bearbeitet haben bevor sie nochmals speichern.
-EOM
- :no_empty_search_string => <<EOM ,
-Das Suchfeld darf nicht leer sein. Bitte etwas eingeben bevor der Suchknopf
-gedrückt wird.
-EOM
- :page_is_locked => "Die Seite ist bereits zur Bearbeitung gesperrt. Bitte warte ein paar Minuten und versuche es dann noch ein mal.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Die Konfiguration muss von Typ der Klasse Ruwiki::Config sein.",
- :invalid_template_dir => "Der angegebene Pfad für Schablonen (%1$s) existiert nicht oder ist kein Verzeichnis.",
- :no_template_found => "Keine Schablone %1$s im Schablonen-Set '%2$s' gefunden.",
- :no_template_set => "Es gibt kein Schablonen-Set '%1$s' im Schablonen-Pfad.",
- :no_webmaster_defined => "Konfigurations-Fehler: Kein Webmaster definiert.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fataler Fehler",
- :editing => "Editieren",
- :error => "Fehler",
- :invalid_path_info_value => "Fataler Fehler in der Web-Umgebung. PATH_INFO = %1$s",
- # Should this really get translated? --chris
- :render_arguments => "Ruwiki#render muss mit zwei oder mehr Argumenten aufgerufen werden.",
- :unknown_feature => "Unbekanntes Feature %1$s.",
- :topics_for_project => "Themen for Projekt ::%1$s",
- :project_topics_link => "(Themen)",
- :wiki_projects => "Projekte in %1$s",
- :no_projects => "Keine Projekte bekannt.",
- :no_topics => "Keine Themen in Projekt %1$s.",
- :search_results_for => "= Suchergebnisse für: %1$s",
- :number_of_hits => "%d Treffer",
-
- # Labels
- :label_search_project => "Durchsuche Projekt",
- :label_search_all => "Alles",
- :label_search => "Suche: ",
- :label_project => "Projekt: ",
- :label_topic => "Thema: ",
- :label_edit => "Editieren",
- :label_recent_changes => "Aktuelle Änderungen",
- :label_topics => "Themen",
- :label_projects => "Projekte",
- :label_editing => "Editieren",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Anmerkung: ",
- :label_comment_accelerator => "R",
- :label_save => "Speichern",
- :label_save_accelerator => "S",
- :label_cancel => "Abbrechen",
- :label_cancel_accelerator => "A",
- :label_preview => "Vorschau",
- :label_preview_accelerator => "V",
- :label_original_text => "Ursprüngliche Version",
- :label_raw => "Formatfrei",
- :label_formatted => "Formatiert",
- :label_send_report_by => "Schicken Sie dem Webmaster einen Report via Email.",
- :label_send_report => "Report schicken.",
- :label_saved_page => "Gespeicherte Seite: ",
-
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Benutzung: %1$s [Optionen] <Verzeichnis>+",
- :converter_format_desc => [ "Konvertiert gefundene Dateien (Jetziges",
- "Format egal) in das angegebene Format",
- "Standard ist flatfiles. Erlaubte",
- "Formate sind: yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Erzeugt Backups der aktualisierten",
- "Dateien. Standard ist --backup." ],
- :converter_backupext_desc => [ 'Gibt die Backup-Erweiterung an. Standard',
- 'ist "~", das dem Datendateinamen',
- 'angehängt wird.' ],
- :converter_backupext_error => "Die Backup-Erweiterung darf nicht leer sein.",
- :converter_extension_desc => [ "Gibt die Erweiterung der Ruwiki-",
- "Datendateien an. Standard ist .ruwiki" ],
- :converter_extension_error => "Die Erweiterung darf nicht leer sein.",
- :converter_noextension_desc => [ "Gibt an, dass Ruwiki-Datendateien",
- "keine Dateierweiterung haben." ],
- :converter_quiet_desc => [ "Still sein. Standard sind normale",
- "Mitteilungen." ],
- :converter_language_desc => [ "Sprache auf LANG setzen. Standard ist",
- "en (Englisch). Bekannte Sprachen sind:",
- "en es de" ],
- :converter_verbose_desc => [ "Gesprächig sein. Standard sind normale",
- "Mitteilungen." ],
- :converter_help_desc => [ "Diesen Text zeigen." ],
- :converter_num_arguments => "Fehler: Nicht genug Parameter.",
- :converter_directory => "Verzeichnis",
- :converter_converting_from => "Wandle von %1$s nach %2$s um... ",
- :converter_done => "fertig.",
- :converter_not_ruwiki => "Keine Ruwiki-Datei; übersprungen.",
- :converter_nosave_modified => "Kann veränderte Datei %1$s nicht speichern.",
- :converter_page_format_error => "Fehler: Kann Seitenformat nicht erkennen.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Unbekannter Befehl: %1$s",
- :manager_help_commands => <<EOH ,
-Es gibt diese 'ruwiki'-Befehle:
-
- ruwiki install Standard-Entwicklungspaket installieren.
- ruwiki package Ruwiki-Installation einpacken.
- ruwiki unpackage Ruwiki-Installation auspacken.
- ruwiki service Win32::Service für Ruwiki verwalten.
-
-EOH
- :manager_help_help => <<-EOH ,
-Diese Hilfsnachricht zeigt, wie man mehr Informationen zu diesem
-Kommandozeilenwerkzeug erhalten kann:
-
- ruwiki help commands Alle 'ruwiki' Befehle anzeigen.
- ruwiki help <BEFEHL> Hilfe zu <BEFEHL> zeigen.
- (e.g., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Fehlender Parameter für Option: %1$s",
- :manager_dest_not_directory => "Das Ziel (%1$s) ist kein Verzeichnis.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPTIONEN] [--to ZIEL]
-
-Erzeugt eine neue Ruwiki-Instanz. Standardmäßig installiert dies die Daten,
-Schablonen und eine Standard-Konfigurationsdatei im derzeitigen Verzeichnis.
-Das Ziel kann mit --to geändert werden, und was installiert werden soll mit
-der OPTIONEN-Liste. Die Elemente der OPTIONEN-Liste dürfen durch Leerzeichen,
-Komma oder Semikola getrennt werden. Daher haben
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-alle die gleiche Wirkung. Die Groß-/Kleinschreibung spielt keine Rolle.
-Die OPTIONEN sind:
-
- servlet # Den Ruwiki servlet stub installieren
- service # Den Ruwiki Win32::Service stub installieren
- CGI # Das Ruwiki CGI-Skript installieren
- data # Ruwiki-Daten, Schablonen, und Konfiguration installieren
-
-Optionen können durch voranstellen von '-' oder 'no' abgeschaltet werden:
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-Dies würde das CGI-Skript, nicht aber die Daten installieren.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [QUELL] [--output PAKET] [--replace]
- ruwiki package [QUELL] [-o PAKET] [--replace]
-
-Packt die Ruwiki-Dateien (Daten, Schablonen und Programme) vom angegebenen
-QUELL-Verzeichnis oder dem derzeitigen Verzeichnis in das angegebene Paket
-(oder "./%1$s"). Sollte QUELL eine Ruwuki-Konfigurationsdatei sein (z.B.
-"%2$s"), dann wird sie verwendet, um Ort und Name der Daten- und Schablonen-
-Verzeichnisse zu erfahren.
-
- MERKE: Der Einpack-Prozess normalisiert die Daten- und Schablonen-
- Verzeichnisnamen relativ zum Einpackverzeichnis. Es werden
- niemals absolute Pfade sein.
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [QUELL] [--output VERZEICHNIS]
- ruwiki unpackage [QUELL] [-o VERZEICHNIS]
-
-Entpackt das gegebene Rukwiki-Paket (Standard: "./%1$s") in das angebene
-Verzeichnis (oder ".").
-EOH
- :manager_service_broken => "Kann keinen Win32-Service verwalten, wenn Win32::Service nicht installiert ist.",
- :manager_service_lo_argcount => "Ungenügene Parameteranzahl: %1$s",
- :manager_service_hi_argcount => "Zu viele Parameter: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NAME [BESCHREIBUNG] [Optionen]
- ruwiki service start NAME
- ruwiki service stop NAME
- ruwiki service delete NAME
-
-Verwaltet das Ruwiki WEBrick servlet als Windows-Service. Der Service muss
-benannt (NAME) sein. install unterstützt folgende zusätzliche Optionen:
-
- --rubybin RUBYPFAD Der Pfad zum Ruby-Binärverzeichnis.
- --exec SERVICEPFAD Der Pfad zum Service-Programm.
- --home PFADNACHAHAUSE Der Pfad zum Heimverzeichnis.
-EOH
- :manager_package_exists => "Das Paket %1$s existiert bereits.",
- :manager_service_installed => "Service %1$s installiert.",
- :manager_one_moment => "Moment, %1$s ...",
- :manager_service_started => "Service %1$s gestartet.",
- :manager_service_stopped => "Service %1$s gestoppt.",
- :manager_service_deleted => "Service %1$s gelöscht.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Verwendung: %1$s [Optionen]",
- :runner_general_options => "Allgemeine Optionen:",
- :runner_saveconfig_desc => [ "Sichert die Konfiguration nach FILENAME",
- "und beendet. Falls FILENAME nicht",
- "gegben ist, wird die Standardkonfig-",
- "urationsdatei verwendet. Alle Optionen",
- "werden von der bestehenen Konfiguration",
- "und der Kommandozeile und gesichert.",
- "Das Servlet wird nicht gestartet.",
- "Der Standardname ist:" ],
- :runner_config_desc => [ "Standardkonfiguration von FILENAME",
- "statt der Standardkonfigurationsdatei",
- "lesen. Optionen die bislang gesetzt",
- "wurden werden zu den Werten, die in der",
- "Konfigurationsdatei stehen,",
- " zurückgesetzt." ],
- :runner_webrick_options => "WEBrick-Optionen:",
- :runner_port_desc => [ "Lässt das Ruwiki-Servlet auf dem gegebenen",
- "Port laufen. Standard: 8808." ],
- :runner_address_desc => [ "Schränkt das Ruwiki-Servlet so ein, dass",
- "es nur die (Komma-separierten) Adressen",
- "akzepiert. Kann mehrfach angegeben werden",
- "Standardmäßig wird nicht eingeschränkt." ],
- :runner_local_desc => [ "Lässt das Ruwiki-Servlet nur lokale",
- "Verbindungen akzeptieren (127.0.0.1).",
- "Hebt vorige -A Adressen auf." ],
- :runner_mountpoint_desc => [ "Die relative URI unter der Ruwiki",
- 'zugreifbar wird. Standard: "/".' ],
- :runner_log_desc => [ "Protokolliere WEBrick. Standard ist --log." ],
- :runner_logfile_desc => [ "Die Datei, in die das WEBrick-Protokoll",
- "geschrieben wird. Standard: Standard-",
- "fehlerausgabe." ],
- :runner_threads_desc => [ "Setzt den WEBrick-Threadcount." ],
- :runner_ruwiki_options => "Ruwiki-Optionen:",
- :runner_language_desc => [ 'Wählt die Oberflächensprache für Ruwiki.',
- 'Standard: "en". Kann "en", "de", oder',
- '"es" sein.' ],
- :runner_webmaster_desc => [ 'Die Ruwiki-Wwebmaster Email-Adresse.',
- 'Standard: "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Aktiviert Ruwuki-Debugging. Standard:',
- '--no-debug.' ],
- :runner_title_desc => [ 'Gibt den Ruwiki-Titel an. Standard ist',
- '"Ruwiki".' ],
- :runner_defaultpage_desc => [ 'Eine andere Standardseite. Standard ist',
- '"ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'Eine andere Standardprojektseite.',
- 'Standard ist "Default".' ],
- :runner_templatepath_desc => [ 'Ort, an dem Ruwiki-Schablonen sind.',
- 'Standard ist "./templates".' ],
- :runner_templatename_desc => [ 'Name der Ruwiki-Schablonen. Default',
- 'Standard ist "default".' ],
- :runner_cssname_desc => [ 'Name der CSS-Datei im Schablonenpfad',
- 'Standard ist "ruwiki.css".' ],
- :runner_storage_desc => [ 'Wähle den Speichertyp:' ],
- :runner_datapath_desc => [ 'Ort, an dem Datendateien gespeichert sind.',
- 'Standard ist "./data".' ],
- :runner_extension_desc => [ 'Dateierweiterung für Datendateien.',
- 'Standard ist "ruwiki".' ],
- :runner_central_desc => [ 'Lässt Ruwiki mit den Daten des Standard-',
- 'RubyGem-Orts laufen .' ],
- :runner_general_info => "Allgemeine Information:",
- :runner_help_desc => [ "Zeigt diesen Text an." ],
- :runner_version_desc => [ "Zeigt die Ruwuki-Version." ],
- :runner_rejected_address => "Adresse %1$s abgewiesen. Nur Verbindungen von %2$s werden akzeptiert.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-WEBrick-Optionen:
- Port %2$d
- Erlaubte Adressen %3$s
- Mount Point %4$s
- Protokollieren? %5$s
- Protokollpfad %6$s
- Threads %7$s
-
-Ruwiki-Options:
- Webmaster %8$s
- Debugging? %9$s
- Titel %10$s
- Standardprojekt %11$s
- Standardseite %12$s
- Schablonenpfad %13$s
- Schablone %14$s
- CSS-Datei %15$s
-
- Speichertyp %16$s
- Datenpfad %17$s
- Dateierweiterung %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/lang/en.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/lang/en.rb
deleted file mode 100644
index de0771a..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/lang/en.rb
+++ /dev/null
@@ -1,334 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::EN is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module EN
- Message = Hash.new { |hh, kk| hh[kk] = "Language ERROR: Unknown message key #{kk.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Backend %1$s is unknown.",
- :cannot_create_project => "Cannot create project %1$s: %2$s",
- :cannot_destroy_project => "Cannot destroy project %1$s: %2$s",
- :cannot_destroy_topic => "Cannot destroy %1$s::%2$s: %3$s",
- :cannot_obtain_lock => "Unable to obtain a lock on %1$s::%2$s. Try again shortly.",
- :cannot_release_lock => "Unable to release the lock on %1$s::%2$s. Try again shortly.",
- :cannot_retrieve_topic => "Cannot retrieve %1$s::%2$s: %3$s",
- :cannot_store_topic => "Cannot store %1$s::%2$s: %3$s",
- :cannot_list_topics => "Cannot list topics for project %1$s: %2$s",
- :error_creating_lock => "Error creating lock on %1$s::%2$s: %3$s",
- :error_releasing_lock => "Error releasing lock on %1$s::%2$s: %3$s",
- :flatfiles_no_data_directory => "The data directory (%1$s) does not exist.",
- :no_access_list_projects => "No permission to list projects.",
- :no_access_list_topics => "No permission to list topics in project %1$s.",
- :no_access_to_create_project => "No permission to create project %1$s.",
- :no_access_to_destroy_project => "No permission to destroy project %1$s::%2$s.",
- :no_access_to_destroy_topic => "No permission to destroy topic %1$s::%2$s.",
- :no_access_to_read_topic => "No permission to retrieve the %1$s::%2$s.",
- :no_access_to_store_topic => "No permission to store the %1$s::%2$s.",
- :page_not_in_backend_format => "%1$s::%2$s is not in the format supported by the backend %3$s.",
- :project_already_exists => "Project %1$s already exists.",
- :project_does_not_exist => "Project %1$s does not exist.",
- :search_project_fail => "Failure searching project %1$s with string %2$s.",
- :yaml_requires_182_or_higher => "YAML flatfile support exists only for Ruby version 1.8.2 or higher.",
- :not_editing_current_version => <<EOM ,
-You have submitted an old version of %1$s::%2$s. The differences between
-your version and the current version of this page have been merged.
-Conflicting lines have both lines shown. Please ensure that you have edited
-the entire page before saving again.
-EOM
- :no_empty_search_string => <<EOM ,
-The search field may not be empty. Please enter something in the search box
-before pressing the search button.
-EOM
- :page_is_locked => "The page is locked for editing. Please wait a few minutes and try again.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Configuration must be of class Ruwiki::Config.",
- :invalid_template_dir => "The specified path for templates (%1$s) does not exist or is not a directory.",
- :no_template_found => "No template of %1$s found in template set %2$s.",
- :no_template_set => "There is no template set '%1$s' in the template path.",
- :no_webmaster_defined => "Configuration error: Webmaster is unset.",
- # Miscellaneous messages.
- :complete_utter_failure => "Complete and Utter Failure",
- :editing => "Editing",
- :error => "Error",
- :invalid_path_info_value => "Something has gone seriously wrong with the web environment. PATH_INFO = %1$s",
- :render_arguments => "Ruwiki#render must be called with zero or two arguments.",
- :unknown_feature => "Unknown feature %1$s.",
- :topics_for_project => "Topics for Project ::%1$s",
- :project_topics_link => "(topics)",
- :wiki_projects => "Projects in %1$s",
- :no_projects => "No known projects.",
- :no_topics => "No topics in project %1$s.",
- :search_results_for => "= Search results for: %1$s",
- :number_of_hits => "%1$d Hits",
-
- # Labels
- :label_search_project => "Search Project",
- :label_search_all => "All",
- :label_search => "Search: ",
- :label_project => "Project: ",
- :label_topic => "Topic: ",
- :label_edit => "Edit",
- :label_recent_changes => "Recent Changes",
- :label_topics => "Topics",
- :label_projects => "Projects",
- :label_editing => "Editing",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Edit Comment: ",
- :label_comment_accelerator => "O",
- :label_save => "Save",
- :label_save_accelerator => "S",
- :label_cancel => "Cancel",
- :label_cancel_accelerator => "C",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Original Text",
- :label_raw => "Raw",
- :label_formatted => "Formatted",
- :label_send_report_by => "Send the Wiki maintainer a report by email.",
- :label_send_report => "Send report.",
- :label_saved_page => "Saved page: ",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Usage: %1$s [options] <directory>+",
- :converter_format_desc => [ "Converts encountered files (regardless",
- "of the current format), to the specified",
- "format. Default is flatfiles. Allowed",
- "formats are: yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Create backups of upgraded files.",
- "Default is --backup." ],
- :converter_backupext_desc => [ 'Specify the backup extension. Default',
- 'is "~", which is appended to the data',
- 'filename.' ],
- :converter_backupext_error => "The backup extension must not be empty.",
- :converter_extension_desc => [ "Specifies the extension of Ruwiki data",
- "files. The default is .ruwiki" ],
- :converter_extension_error => "The extension must not be empty.",
- :converter_noextension_desc => [ "Indicates that the Ruwiki data files",
- "have no extension." ],
- :converter_quiet_desc => [ "Runs quietly. Default is to run with",
- "normal messages." ],
- :converter_language_desc => [ "Sets the language to LANG. Defaults",
- "to en (English). Known languages",
- "are: en es de" ],
- :converter_verbose_desc => [ "Runs with full message. Default is to",
- "run with normal messages." ],
- :converter_help_desc => [ "Shows this text." ],
- :converter_num_arguments => "Error: not enough arguments.",
- :converter_directory => "directory",
- :converter_converting_from => "converting from %1$s to %2$s ... ",
- :converter_done => "done.",
- :converter_not_ruwiki => "not a Ruwiki file; skipping.",
- :converter_nosave_modified => "cannot save modified %1$s.",
- :converter_page_format_error => "Error: Cannot detect the page format.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Unknown command: %1$s",
- :manager_help_commands => <<EOH ,
-The commands known to 'ruwiki' are:
-
- ruwiki install Installs the default deployment package.
- ruwiki package Packages a Ruwiki installation.
- ruwiki unpackage Unpackages a Ruwiki installation.
- ruwiki service Manages a Win32::Service for Ruwiki.
-
-EOH
- :manager_help_help => <<-EOH ,
-This is a basic help message containing pointers to more information on how
-to use this command-line tool. Try:
-
- ruwiki help commands list all 'ruwiki' commands
- ruwiki help <COMMAND> show help on <COMMAND>
- (e.g., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Missing parameter for option: %1$s",
- :manager_dest_not_directory => "The destination (%1$s) is not a directory.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPTIONS] [--to DEST]
-
-Creates a new Ruwiki instance. By default this installs the data, templates,
-and a default configuration file to the current directory. The destination
-can be changed with the --to option, and what is installed can be specified
-with the OPTIONS list. The OPTIONS list may be space, comma, or semi-colon
-separated. Thus,
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-are all equivalent. The options may be specified in any case. The
-installation OPTIONS are:
-
- servlet # Installs the Ruwiki servlet stub
- service # Installs the Ruwiki Win32::Service stub
- CGI # Installs the Ruwiki CGI script
- data # Installs the Ruwiki data, templates, and configuration
-
-Options may be disabled with by prepending a dash or 'no':
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-These will install the CGI script but not the data.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [SOURCE] [--output PACKAGE] [--replace]
- ruwiki package [SOURCE] [-o PACKAGE] [--replace]
-
-Packages the Ruwiki files (data, templates, and executables) from the
-specified SOURCE or the current directory into the specified output package
-(or "./%1$s"). If the SOURCE is a ruwiki configuration file (e.g.,
-"%2$s"), then that will be used to determine the location and name of
-the data and template directories.
-
- NOTE: The packaging process will normalize the data and templates
- directory names to be relative to the unpacking directory. They
- will NEVER be absolute paths.
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [SOURCE] [--output DIRECTORY]
- ruwiki unpackage [SOURCE] [-o DIRECTORY]
-
-Unpackages the provided Ruwiki package (default "./%1$s") into the
-specified directory (default ".").
-EOH
- :manager_service_broken => "Cannot manage a Win32 service if Win32::Service is not installed.",
- :manager_service_lo_argcount => "Insufficient arguments: %1$s",
- :manager_service_hi_argcount => "Too many arguments: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NAME [DESCRIPTION] [options]
- ruwiki service start NAME
- ruwiki service stop NAME
- ruwiki service delete NAME
-
-Manages the Ruwiki WEBrick servlet as a Windows service. The service must be
-NAMEd. install supports the following additional options:
-
- --rubybin RUBYPATH The path to the Ruby binary.
- --exec SERVICEPATH The path to the service executable.
- --home PATHTOHOME The path to the home directory.
-EOH
- :manager_package_exists => "Package %1$s already exists.",
- :manager_service_installed => "%1$s service installed.",
- :manager_one_moment => "One moment, %1$s ...",
- :manager_service_started => "%1$s service started.",
- :manager_service_stopped => "%1$s service stopped.",
- :manager_service_deleted => "%1$s service deleted.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Usage: %1$s [options]",
- :runner_general_options => "General options:",
- :runner_saveconfig_desc => [ "Saves the configuration to FILENAME and",
- "exit. If FILENAME is not used, then the",
- "default configuration file will be",
- "used. All options will be read from the",
- "existing configuration file and the",
- "command-line and saved. The servlet",
- "will not start. The default name is:" ],
- :runner_config_desc => [ "Read the default configuration from",
- "FILENAME instead of the default config",
- "file. Options set until this point will",
- "be reset to the values from those read",
- "configuration file." ],
- :runner_webrick_options => "WEBrick options:",
- :runner_port_desc => [ "Runs the Ruwiki servlet on the specified",
- "port. Default 8808." ],
- :runner_address_desc => [ "Restricts the Ruwiki servlet to accepting",
- "connections from the specified address or",
- "(comma-separated) addresses. May be",
- "specified multiple times. Defaults to all",
- "addresses." ],
- :runner_local_desc => [ "Restricts the Ruwiki servlet to accepting",
- "only local connections (127.0.0.1).",
- "Overrides any previous -A addresses." ],
- :runner_mountpoint_desc => [ "The relative URI from which Ruwiki will",
- 'be accessible. Defaults to "/".' ],
- :runner_log_desc => [ "Log WEBrick activity. Default is --log." ],
- :runner_logfile_desc => [ "The file to which WEBrick logs are",
- "written. Default is standard error." ],
- :runner_threads_desc => [ "Sets the WEBrick threadcount." ],
- :runner_ruwiki_options => "Ruwiki options:",
- :runner_language_desc => [ 'The interface language for Ruwiki.',
- 'Defaults to "en". May be "en", "de", or',
- '"es".' ],
- :runner_webmaster_desc => [ 'The Ruwiki webmaster email address.',
- 'Defaults to "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Turns on Ruwiki debugging. Defaults',
- 'to --no-debug.' ],
- :runner_title_desc => [ 'Provides the Ruwiki title. Default is',
- '"Ruwiki".' ],
- :runner_defaultpage_desc => [ 'An alternate default page. Default is',
- '"ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'An alternate default project. Default is',
- '"Default".' ],
- :runner_templatepath_desc => [ 'The location of Ruwiki templates. Default',
- 'is "./templates".' ],
- :runner_templatename_desc => [ 'The name of the Ruwiki templates. Default',
- 'is "default".' ],
- :runner_cssname_desc => [ 'The name of the CSS file in the template',
- 'path. Default is "ruwiki.css".' ],
- :runner_storage_desc => [ 'Select the storage type:' ],
- :runner_datapath_desc => [ 'The path where data files are stored.',
- 'Default is "./data".' ],
- :runner_extension_desc => [ 'The extension for data files.',
- 'Default is "ruwiki".' ],
- :runner_central_desc => [ 'Runs Ruwiki with the data in the default',
- 'RubyGem location.' ],
- :runner_general_info => "General info:",
- :runner_help_desc => [ "Shows this text." ],
- :runner_version_desc => [ "Shows the version of Ruwiki." ],
- :runner_rejected_address => "Rejected peer address %1$s. Connections are only accepted from %2$s.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-WEBrick options:
- Port %2$d
- Accepted Addresses %3$s
- Mount Point %4$s
- Logging? %5$s
- Log Destination %6$s
- Threads %7$s
-
-Ruwiki options:
- Webmaster %8$s
- Debugging? %9$s
- Title %10$s
- Default Project %11$s
- Default Page %12$s
- Template Path %13$s
- Template Set %14$s
- CSS Source %15$s
-
- Storage Type %16$s
- Data Path %17$s
- Extension %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/lang/es.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/lang/es.rb
deleted file mode 100644
index 4a9ee2a..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/lang/es.rb
+++ /dev/null
@@ -1,339 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Mauricio Julio Fernández Pradier (batsman.geo@yahoo.com)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::ES is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module ES
- Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Identificador de mensaje desconocido: #{kk.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Backend %1$s desconocido.",
- :cannot_create_project => "No pudo crearse el proyecto %1$s: %2$s",
- :cannot_destroy_project => "No pudo borrarse el proyecto %1$s: %2$s",
- :cannot_destroy_topic => "No pudo borrarse %1$s::%2$s: %3$s",
- :cannot_obtain_lock => "No pudo obtenerse el cerrojo para %1$s::%2$s. Reinténtelo de nuevo en breve.",
- :cannot_release_lock => "No pudo liberarse el cerrojo para %1$s::%2$s. Reinténtelo de nuevo en breve.",
- :cannot_retrieve_topic => "No pudo obtenerse %1$s::%2$s: %3$s",
- :cannot_store_topic => "No pudo almacenarse %1$s::%2$s: %3$s",
- :cannot_list_topics => "No se pudo listar los temas del proyecto %1$s: %2$s",
- :error_creating_lock => "Error al crear el cerrojo para %1$s::%2$s: %3$s",
- :error_releasing_lock => "Error al liberar el cerrojo para %1s::%2$s: %3$s",
- :flatfiles_no_data_directory => "El directorio de datos (%1$s) no existe.",
- :no_access_list_projects => "Permiso denegado al listar los proyectos.",
- :no_access_list_topics => "Permiso denegado al listar los temas del proyecto %1$s.",
- :no_access_to_create_project => "Permiso denegado al crear el proyecto %1$s.",
- :no_access_to_destroy_project => "Permiso denegado al borrar el proyecto %1$s::%2$s.",
- :no_access_to_destroy_topic => "Permiso denegado al borrar el borrar el tema %1$s::%2$s.",
- :no_access_to_read_topic => "Permiso denegado al acceder a %1$s::%2$s.",
- :no_access_to_store_topic => "Permiso denegado al almacenar %1$s::%2$s.",
- :page_not_in_backend_format => "%1$s::%2$s no está en un formato soportado por el backend %3$s.",
- :project_already_exists => "El proyecto %1$s ya existe.",
- :project_does_not_exist => "El proyecto %1$s no existe.",
- :search_project_fail => "Error al buscar la cadena %2$s en el proyecto %1$s.",
- :yaml_requires_182_or_higher => "El soporte para archivos YAML sólo está disponible en Ruby versión 1.8.2 o superior.",
- :not_editing_current_version => <<EOM ,
-Ha enviado una versión antigua de %1$s::%2$s. Las diferencias entre su versión
-y la actual han sido fusionadas. En caso de conflicto, las líneas de ambas
-versiones serán mostradas. Asegúrese de editar la página en su totalidad
-antes de salvar de nuevo.
-EOM
- :no_empty_search_string => <<EOM ,
-El campo de búsqueda no puede estar vacío. Por favor introduzca el texto
-a buscar antes de pulsar sobre el botón de búsqueda.
-EOM
- :page_is_locked => "La pagina no puede ser editada al estar bloqueada en este momento. Por favor espere unos minutos y vuelva a intentar.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "La configuración debe ser de clase Ruwiki::Config.",
- :invalid_template_dir => "El path para plantillas (%1$s) no existe o no es un directorio.",
- :no_template_found => "No pudo encontrarse la plantilla para %1$s en el conjunto %2$s.",
- :no_template_set => "No pudo encontrarse el conjunto de plantillas '%1$s' en el path.",
- :no_webmaster_defined => "Error de configuración: Webmaster no está definido.",
- # Miscellaneous messages.
- :complete_utter_failure => "Error catastrófico",
- :editing => "Edición",
- :error => "Error",
- :invalid_path_info_value => "Algo huele a podrido en su entorno Web. PATH_INFO = %1$s",
- :render_arguments => "Ruwiki#render debe ser llamado con cero o dos argumentos.",
- :unknown_feature => "Característica desconocida: %1$s.",
- :topics_for_project => "Temas del Proyecto ::%1$s",
- :project_topics_link => "(temas)",
- :wiki_projects => "Proyectos en %1$s",
- :no_projects => "Ningún proyecto.",
- :no_topics => "El proyecto %1$s no tiene nigún tema.",
- :search_results_for => "= Resultados de la búsqueda de: %1$s",
- :number_of_hits => "%1$d Resultados",
-
- # Labels
- :label_search_project => "Buscar en projecto",
- :label_search_all => "Todo",
- :label_search => "Buscar: ",
- :label_project => "Proyecto: ",
- :label_topic => "Tema: ",
- :label_edit => "Editar",
- :label_recent_changes => "Cambios recientes",
- :label_topics => "Temas",
- :label_projects => "Proyectos",
- :label_editing => "Edición",
- :label_text => "Texto:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Editar Comentario: ",
- :label_comment_accelerator => "O",
- :label_save => "Salvar",
- :label_save_accelerator => "S",
- :label_cancel => "Cancelar",
- :label_cancel_accelerator => "C",
- :label_preview => "Previsualizar",
- :label_preview_accelerator => "P",
- :label_original_text => "Text Original",
- :label_raw => "Crudo",
- :label_formatted => "Formateado",
- :label_send_report_by => "Enviar notificación al administrador del Wiki por email.",
- :label_send_report => "Enviar notificación.",
- :label_saved_page => "Página salvada: ",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Modo de empleo: %1$s [opciones] <dir.>",
- :converter_format_desc => [ "Convertir los ficheros encontrados",
- "(independientemente de su formato), al",
- "formato especificado; por defecto ",
- "archivos planos. Formatos permitidos:",
- " yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Crear copias de seguridad de ficheros ",
- "actualizados. La opción por defecto es ",
- "--backup." ],
- :converter_backupext_desc => [ 'Especificar la extensión para las copias',
- 'de seguridad (por defecto "~") que se',
- 'añade al nombre del fichero de datos' ],
- :converter_backupext_error => [ "La extensión para copias de seguridad",
- "no debe estar vacía." ],
- :converter_extension_desc => [ "Especifica la extensión de los ficheros",
- "de datos de Ruwiki (por defecto .ruwiki)" ],
- :converter_extension_error => "La extensión no debe estar vacía.",
- :converter_noextension_desc => [ "Indica que los ficheros de datos de",
- "Ruwiki no tienen ninguna extensión." ],
- :converter_quiet_desc => [ "Ejecución silenciosa. Por defecto se ",
- "ejecuta con mensajes normales." ],
- :converter_language_desc => [ "Especifica el idioma a emplear con LANG.",
- "Por defecto 'en' (inglés).",
- "Idiomas disponibles: en es de" ],
- :converter_verbose_desc => [ "Información detallada de ejecución.",
- "Por defecto se ejecuta con un nivel de ",
- "detalle inferior." ],
- :converter_help_desc => [ "Mostrar este texto." ],
- :converter_num_arguments => "Error: número de argumentos insuficiente.",
- :converter_directory => "directorio",
- :converter_converting_from => "convertiendo de %1$s a %2$s ... ",
- :converter_done => "hecho.",
- :converter_not_ruwiki => "no es un fichero de Ruwiki; ignorando.",
- :converter_nosave_modified => "no pudo salvarse %1$s.",
- :converter_page_format_error => "Error: No pudo detectarse el formato de la página.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Comando desconocido: %1$s",
- :manager_help_commands => <<EOH ,
-Los comandos reconocidos por 'ruwiki' son:
-
- ruwiki install Instala el entorno por defecto.
- ruwiki package Empaqueta una instalación de Ruwiki.
- ruwiki unpackage Desempaqueta una instalación de Ruwiki.
- ruwiki service Gestiona un Win32::Service para Ruwiki.
-
-EOH
- :manager_help_help => <<-EOH ,
-Este es un mensaje de ayuda básico con referencias a información suplementaria
-relativa a esta herramienta de la línea de comandos. Intente:
-
- ruwiki help commands mostrar todos los comandos de ruwiki
- ruwiki help <COMANDO> mostrar ayuda sobre <COMANDO>
- (p.ej., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Falta parámetro para la opción: %1$s",
- :manager_dest_not_directory => "El destino (%1$s) no es un directorio.",
- :manager_service_broken => "No pudo crearse un servicio de Win32 al no estar instalado Win32::Service.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPCIONES] [--to DEST]
-
-Crea una instancia de Ruwiki. Por defecto, se instala los ficheros de datos,
-plantillas y la configuración por defecto en el directorio actual. El destino
-puede ser cambiado con la opción --to, y los elementos a instalar con la lista
-de OPCIONES, que puede ser delimitada por espacios, comas o puntos y comas.
-Así pues,
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-son equivalentes. Las opciones pueden especificarse en mayúsculas/minúsculas.
-Las opciones de instalación son:
-
- servlet # Instala el stub para el servlet Ruwiki
- service # Instala el stub para el Win32::Service Ruwiki
- CGI # Instala el script CGI Ruwiki
- data # Instala los datos, plantillas y configuración de Ruwiki
-
-Las opciones pueden deshabilitarse precediéndolas de un guión o 'no':
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-instalarán el script CGI pero no los datos.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [FUENTE] [--output PAQUETE] [--replace]
- ruwiki package [FUENTE] [-o PAQUETE] [--replace]
-
-Empaqueta los ficheros de Ruwiki (datos, plantillas y ejecutables) de la
-FUENTE especificada o el directorio actual en el archivo de salida
-especificado (o "../%1$s"). Si la FUENTE es un fichero de configuración
-de rukiwi (p.ej. "%2$s"), será empleado para determinar la localización
-y el nombre de los directorios de datos y plantillas.
-
- NOTA: El proceso de empaquetado normaliza los nombres de los
- ficheros de datos y plantillas para que sean relativos al
- directorio de desempaquetado. NUNCA serán paths absolutos.
-
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [FUENTE] [--output DIRECTORIO]
- ruwiki unpackage [FUENTE] [-o DIRECTORIO]
-
-Desempaqueta el paquete de Ruwiki provisto (por defecto "./%1$s")
-en el directorio indicado (por defecto ".").
-EOH
- :manager_service_lo_argcount => "Argumentos insuficientes: %1$s",
- :manager_service_hi_argcount => "Demasiados argumentos: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NOMBRE [DESCRIPCION] [opciones]
- ruwiki service start NOMBRE
- ruwiki service stop NOMBRE
- ruwiki service delete NOMBRE
-
-Gestiona el servlet Ruwiki para WEBrick como un servicio de Windows, bajo el
-NOMBRE indicado. install soporta además las opciones siguientes:
-
- --rubybin RUBYPATH Path del ejecutable Ruby.
- --exec SERVICEPATH Path del ejecutable del servicio.
- --home PATHTOHOME Path del directorio home.
-EOH
- :manager_package_exists => "El paquete %1$s ya existe.",
- :manager_service_installed => "Servicio %1$s instalado.",
- :manager_one_moment => "Un momento, %1$s ...",
- :manager_service_started => "Servicio %1$s iniciado.",
- :manager_service_stopped => "Servicio %1$s parado.",
- :manager_service_deleted => "Servicio %1$s borrado.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Modo de empleo: %1$s [opciones]",
- :runner_general_options => "Opciones generales:",
- :runner_saveconfig_desc => [ "Salvar la configuración en FILENAME y",
- "salir. Si no se emplea FILENAME, la",
- "configuración por defecto será usada.",
- "Todas las opciones serán leídas del",
- "fichero existente y de la línea de",
- "comandos y salvadas. El servlet no se",
- "arrancará. El nombre por defecto es:" ],
- :runner_config_desc => [ "Leer la configuración por defecto de",
- "FILENAME en vez del fichero por defecto",
- "Las opciones especificadas anteriormente",
- "serán sobrescritas" ],
- :runner_webrick_options => "Opciones de WEBrick:",
- :runner_port_desc => [ "Ejecutar el servlet Ruwiki en el puerto",
- "especificado; por defecto 8808." ],
- :runner_address_desc => [ "Aceptar únicamente conexiones desde las",
- "direcciones especificadas (separadas por",
- "comas). Puede usarse repetidamente. Por",
- "defecto todas las direcciones serán",
- "aceptadas" ],
- :runner_local_desc => [ "Aceptar únicamente conexiones locales",
- "(127.0.0.1). Anula las direcciones",
- "indicadas previamente en -A" ],
- :runner_mountpoint_desc => [ "URI relativo en el que Ruwiki estará",
- 'accesible. Por defecto "/".' ],
- :runner_log_desc => [ "Realizar log de la actividad de WEBrick.",
- "Por defecto se usa --log." ],
- :runner_logfile_desc => [ "Fichero en el que escribir los logs de",
- "WEBrick. Por defecto, el standard error." ],
- :runner_threads_desc => [ "Asigna al threadcount de WEBrick." ],
- :runner_ruwiki_options => "Opciones de Ruwiki:",
- :runner_language_desc => [ 'Idioma de la inferfaz de Ruwiki.',
- 'Por defecto "en". Puede ser "en", ',
- '"de", o "es".' ],
- :runner_webmaster_desc => [ 'Email del webmaster de Ruwiki.',
- 'Por defecto "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Activa debugging de Ruwiki. Por defecto',
- 'inhabilitado.' ],
- :runner_title_desc => 'Título del Ruwiki. Por defecto "Ruwiki".',
- :runner_defaultpage_desc => [ 'Página por defecto alternativa; por',
- 'defecto "ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'Proyecto por defecto. Por defecto',
- '"Default".' ],
- :runner_templatepath_desc => [ 'Localización de las plantillas.',
- 'Por defecto "./templates".' ],
- :runner_templatename_desc => [ 'Nombre de las plantillas. Por defecto',
- '"default".' ],
- :runner_cssname_desc => [ 'Nombre del fichero CSS en el directorio',
- 'de plantillas. Por defecto "ruwiki.css".' ],
- :runner_storage_desc => [ 'Tipo de almacenamiento:' ],
- :runner_datapath_desc => [ 'Path donde salvar los ficheros de datos.',
- 'Por defecto; "./data".' ],
- :runner_extension_desc => [ 'Extensión para ficheros de datos.',
- 'Por defecto "ruwiki".' ],
- :runner_central_desc => [ 'Ejecuta Ruwiki con los datos del',
- 'directorio RubyGem.' ],
- :runner_general_info => "Información general:",
- :runner_help_desc => [ "Muestra este texto." ],
- :runner_version_desc => [ "Muestra la versión de Ruwiki." ],
- :runner_rejected_address => "Dirección remota %1$s rechazada. Sólo se admiten conexiones desde %2$s.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-Opciones de WEBrick:
- Puerto %2$d
- Direcciones admitidas %3$s
- Punto de montaje %4$s
- Logging? %5$s
- Destino del log %6$s
- Hebras %7$s
-
-Opciones de Ruwiki:
- Webmaster %8$s
- Debugging? %9$s
- Título %10$s
- Proyecto por defecto %11$s
- Página por defecto %12$s
- Path para plantillas %13$s
- Conjunto de plantillas %14$s
- Fuente CSS %15$s
-
- Tipo de almacenamiento %16$s
- Path de datos %17$s
- Extensión %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/page.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/page.rb
deleted file mode 100644
index e94521f..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/page.rb
+++ /dev/null
@@ -1,262 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # The page class for Ruwiki. The page defines the data and meta-data for a
- # page.
-class Ruwiki::Page
- include Ruwiki::Exportable
-
- exportable_group 'ruwiki'
- # Returns the content version of the page. If the page has a greater
- # content version than this version of Ruwiki does, we should probably
- # throw an exception, because attempting to save such a page will cause
- # a loss of data. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +content-version+
- attr_reader :content_version
- exportable :content_version
- # Returns the version of Ruwiki from which this page was generated.
- # Informational only. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +version+
- attr_reader :ruwiki_version
- exportable :ruwiki_version, :name => 'version'
-
- exportable_group 'properties'
- # Returns or sets the displayed title of the page, which may differ from
- # the topic of the page. As of Ruwiki 0.8.0, this is not currently used
- # and it may disappear.
- #
- # Class:: +properties+
- # ID:: +title+
- attr_accessor :title
- exportable :title
- # Returns or sets the topic of the page, which may differ from the
- # title. This is used to set the topic on a page being saved.
- #
- # Class:: +properties+
- # ID:: +topic+
- attr_accessor :topic
- exportable :topic
- # Returns or sets the project of the page, which may differ from the
- # title. This is used to set the project on a page being saved.
- #
- # Class:: +properties+
- # ID:: +project+
- attr_accessor :project
- exportable :project
- # Returns or sets the creator of the page. Unless we know the user
- # (through the authentication mechanism, only partially implemented for
- # Ruwiki 0.9.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +creator+
- attr_accessor :creator
- exportable :creator
- # Returns or sets the creator's IP address. This should always be set.
- # It will have a value of "UNKNOWN" on the off-chance that something
- # prevents this from working.
- #
- # Class:: +properties+
- # ID:: +creator-ip+
- attr_accessor :creator_ip
- exportable :creator_ip
- # Returns or sets the date of creation.
- #
- # Class:: +properties+
- # ID:: +create-date+
- attr_accessor :create_date
- exportable :create_date
- # Returns or sets the last editor of the page. Unless we know the user
- # (through the authentication mechanism, only partially implemented for
- # Ruwiki 0.9.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +editor+
- attr_accessor :editor
- exportable :editor
- # Returns or sets the last editor's IP address. This should always be
- # set. It will have a value of "UNKNOWN" on the off-chance that
- # something prevents this from working.
- #
- # Class:: +properties+
- # ID:: +editor-ip+
- attr_accessor :editor_ip
- exportable :editor_ip
- # Returns or sets the date of the last edit.
- #
- # Class:: +properties+
- # ID:: +edit-date+
- attr_accessor :edit_date
- exportable :edit_date
- # Indicates whether the page is editable. Non-editable pages are
- # effectively static pages.
- #
- # Class:: +properties+
- # ID:: +editable+
- attr_accessor :editable
- exportable :editable
- # Indicates whether the page is indexable. Non-indexable pages are
- # invisible to compliant web robots, and their links may not be
- # followed.
- #
- # Class:: +properties+
- # ID:: +indexable+
- attr_accessor :indexable
- exportable :indexable
- # The current version of the page. The old version is always (#version
- # - 1).
- #
- # Class:: +properties+
- # ID:: +version+
- attr_accessor :version
- exportable :version
- # An array of complete tags that will appear in the HTML <HEAD> section.
- # Can be used to specify additional CSS, <META> tags, or even JavaScript
- # on a per-page basis. Currently unused.
- #
- # Class:: +properties+
- # ID:: +html-headers+
- attr_accessor :html_headers
- exportable :html_headers
- # The entropy of the page. This is a ratio of the number of lines
- # changed in the file vs. the total number of lines in the file. This
- # value is currently unused. (And, sad to say, I don't remember why
- # I included it. However, it's an interesting value that may be useful
- # in spam fighting techniques. It is currently stored in the meta-data,
- # but that may change moving forward.)
- #
- # Class:: +properties+
- # ID:: +entropy+
- attr_reader :entropy
- exportable :entropy
- # The edit comment for the current revision of the page.
- #
- # Class:: +properties+
- # ID:: +edit-comment+
- attr_accessor :edit_comment
- exportable :edit_comment
-
- exportable_group 'page'
- # The header content of the page. This is static content (in either Wiki
- # or HTML formats) that appears before the editable contents of the
- # page. If both this and Wiki-level header content are specified, this
- # will appear *after* the Wiki-level header content.
- #
- # Class:: +page+
- # ID:: +header+
- attr_accessor :header
- exportable :header
- # The footer content of the page. This is static content (in either Wiki
- # or HTML formats) that appears before the editable contents of the
- # page. If both this and Wiki-level footer content are specified, this
- # will appear *before* the Wiki-level footer content.
- #
- # Class:: +page+
- # ID:: +footer+
- attr_accessor :footer
- exportable :footer
- # The editable unformatted Wiki content of the page.
- #
- # Class:: +page+
- # ID:: +content+
- attr_accessor :content
- exportable :content
-
- # Creates a Ruwiki page. This must be created from the canonical export
- # hash.
- def initialize(exported = {})
- ruwiki = exported['ruwiki']
- @content_version = (ruwiki['content-version'] || Ruwiki::CONTENT_VERSION).to_i
- @ruwiki_version = ruwiki['version'] || Ruwiki::VERSION
-
- props = exported['properties']
- @title = props['title']
- @topic = props['topic'] || "NewTopic"
- @project = props['project'] || "Default"
- @creator = props['creator'] || ""
- @creator_ip = props['creator-ip'] || "UNKNOWN"
- @create_date = Time.at((props['create-date'] || Time.now.utc).to_i)
- @editor = props['editor'] || ""
- @editor_ip = props['editor-ip'] || "UNKNOWN"
- @edit_date = Time.at((props['edit-date'] || Time.now.utc).to_i)
- @edit_comment = props['edit-comment'] || ""
- case props['editable']
- when "false"
- @editable = false
- else
- @editable = true
- end
- case props['indexable']
- when "false"
- @indexable = false
- else
- @indexable = true
- end
- @entropy = (props['entropy'] || 0).to_f
- @html_headers = props['html-headers'] || []
- @version = (props['version'] || 0).to_i
-
- page = exported['page']
- @header = page['header'] || ""
- @content = page['content'] || ""
- @footer = page['footer'] || ""
-
- # Fix the possibility that the content might be an array of chunks.
- @content = @content.join("") if @content.kind_of?(Array)
-
- @content.gsub!(/\r/, "")
- end
-
- # Outputs the HTML version of the page.
- def to_html(markup)
- # Normalise the content, first
- @content.gsub!(/\r/, "")
- markup.parse(@content, @project)
- end
-
- # Provides the canonical export hash.
- def export
- sym = super
-
- sym.each_key do |sect|
- if sect == 'ruwiki'
- sym[sect]['content-version'] = Ruwiki::CONTENT_VERSION
- sym[sect]['version'] = Ruwiki::VERSION
- else
- sym[sect].each_key do |item|
- case [sect, item]
- when ['properties', 'create-date'], ['properties', 'edit-date']
- sym[sect][item] = sym[sect][item].to_i
- when ['properties', 'editable'], ['properties', 'indexable']
- sym[sect][item] = (sym[sect][item] ? 'true' : 'false')
- else
- sym[sect][item] = sym[sect][item].to_s
- end
- end
- end
- end
-
- sym
- end
-
- NULL_PAGE = {
- 'ruwiki' => {
- 'content-version' => Ruwiki::CONTENT_VERSION,
- 'version' => Ruwiki::VERSION
- },
- 'properties' => { },
- 'page' => { },
- }
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/servlet.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/servlet.rb
deleted file mode 100644
index 373482e..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/servlet.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'webrick'
-
-class Ruwiki::Servlet < WEBrick::HTTPServlet::AbstractServlet
- class << self
- attr_accessor :config
- end
-
- def initialize(config)
- @config = config
- end
-
- # Converts a POST into a GET.
- def do_POST(req, res)
- do_GET(req, res)
- end
-
- def do_GET(req, res)
- # Generate the reponse handlers for Ruwiki from the request and response
- # objects provided.
- wiki = Ruwiki.new(Ruwiki::Handler.from_webrick(req, res))
-
- # Configuration defaults to certain values. This overrides the defaults.
- wiki.config = Ruwiki::Servlet.config unless Ruwiki::Servlet.config.nil?
- wiki.config!
- wiki.config.logger = @config.logger
- wiki.run
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/template.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/template.rb
deleted file mode 100644
index af26151..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/template.rb
+++ /dev/null
@@ -1,553 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file is originally from rdoc by Dave Thomas (dave@pragprog.com).
-#
-# $Id$
-#++
-require 'cgi'
-
- # Ruwiki templating, based originally on RDoc's "cheap-n-cheerful" HTML
- # page template system, which is a line-oriented, text-based templating
- # system.
- #
- # Templates can contain:
- #
- # * The directive !INCLUDE!, which will include the next template from the
- # provided list. This is processed before any template substitution, so
- # repeating and optional blocks work on the values within the template
- # substitution.
- # * Substitutable variable values between percent signs (<tt>%key%</tt>).
- # Optional variable values can be preceded by a question mark
- # (<tt>%?key%</tt>).
- # * Label values between hash marks (<tt>#key#</tt>). Optional label
- # values can be preceded by a question mark (<tt>#?key#</tt>).
- # * Links (<tt>HREF:ref:name:</tt>).
- # * Repeating substitution values (<tt>[:key| stuff :]</tt>). The value of
- # +key+ may be an integer value or a range (in which case key will be
- # used as an iterator, providing the current value of key on successive
- # values), an array of scalar values (substituting each value), or an
- # array of hashes (in which case it works like repeating blocks, see
- # below). These must NOT be nested. Note that integer value counting is
- # one-based.
- # * Optional substitution values (<tt>[?key| stuff ?]</tt> or <tt>[!key|
- # stuff ?]</tt>. These must NOT be nested.
- # * Repeating blocks:
- # START:key
- # ... stuff
- # END:key
- # * Optional blocks:
- # IF:key
- # ... stuff
- # ENDIF:key
- # or:
- # IFNOT:key
- # ... stuff
- # ENDIF:key
- #
- # When generating the output, a hash of values is provided and an optional
- # hash of labels is provided. Simple variables are resolved directly from
- # the hash; labels are resolved as Symbols from the label hash or are
- # otherwise treated as variables. Labels are always resolved from a single
- # message hash.
- #
- # The +key+ for repeating blocks (one-line or multi-line) must be an array
- # of hashes. The repeating block will be generated once for each entry.
- # Blocks can be nested arbitrarily deeply.
- #
- # Optional blocks will only be generated if the test is true. IF blocks
- # test for the presence of +key+ or that +key+ is non-+nil+; IFNOT blocks
- # look for the absence or +nil+ value of +key+. IFBLANK blocks test for
- # the absence, +nil+ value, or emptiness of +key+; IFNOTBLANK blocks test
- # for the presence of +key+ and that it is neither +nil+ nor empty.
- #
- # Usage: Given a set of templates <tt>T1</tt>, <tt>T2</tt>, etc.
- #
- # values = { "name" => "Dave", "state" => "TX" }
- # fr = { :name => "Nom", :state => "Etat" }
- # en = { :name => "Name", :state => "State" }
- # tt = TemplatePage.new(T1, T2, T3)
- #
- # res = ""
- # tt.process(res, values, fr)
- # tt.process(res, values, en)
- #
-class Ruwiki::TemplatePage
- BLOCK_RE = %r{^\s*(IF|IFNOT|IFBLANK|IFNOTBLANK|ENDIF|START|END):(\w+)?}
- HREF_RE = %r{HREF:(\w+?):(\w+?):}
- LABEL_RE = %r{#(\??)(-?)(\w+?)#}
- VARIABLE_RE = %r{%(\??)(-?)(\w+?)%}
- IFLINE_RE = %r{\[([?!])(\w+?)\|(.*?)\?\]}
- BLOCKLINE_RE = %r{\[:(\w+?)\|(.*?):\]}
- INCLUDE_RE = %r{!INCLUDE!}
-
- DDLB_RES = [
- [ :check, %r{%check:(\w+?)%} ],
- [ :date, %r{%date:(\w+?)%} ],
- [ :popup, %r{%popup:(\w+?):(\w+?)%} ],
- [ :ddlb, %r{%ddlb:(\w+?):(\w+?)%} ],
- [ :vsortddlb, %r{%vsortddlb:(\w+?):(\w+?)%} ],
- [ :radio, %r{%radio:(\w+?):(\w+?)%} ],
- [ :radioone, %r{%radioone:(\w+?):(\w+?)%} ],
- [ :input, %r{%input:(\w+?):(\d+?):(\d+?)%} ],
- [ :text, %r{%text:(\w+?):(\d+?):(\d+?)%} ],
- [ :pwinput, %r{%pwinput:(\w+?):(\d+?):(\d+?)%} ],
- [ :pair, %r{%pair(\d)?:([^:]+)(\w+?)%} ]
- ]
-
- # Nasty hack to allow folks to insert tags if they really, really want to
- OPEN_TAG = "\001"
- CLOSE_TAG = "\002"
- BR = "#{OPEN_TAG}br#{CLOSE_TAG}"
-
- # A Context holds a stack of key/value pairs (like a symbol table). When
- # asked to resolve a key, it first searches the top of the stack, then the
- # next level, and so on until it finds a match (or runs out of entries).
- class Context
- def initialize
- @stack = []
- end
-
- def push(hash)
- @stack.push(hash)
- end
-
- def pop
- @stack.pop
- end
-
- # Find a scalar value, throwing an exception if not found. This method is
- # used when substituting the %xxx% constructs
- def find_scalar_raw(key)
- @stack.reverse_each do |level|
- if level.has_key?(key)
- val = level[key]
- return val unless val.kind_of?(Array)
- end
- end
- raise "Template error: can't find variable '#{key}'."
- end
-
- def find_scalar(key)
- find_scalar_raw(key) || ''
- end
-
- # Lookup any key in the stack of hashes
- def lookup(key)
- @stack.reverse_each do |level|
- return level[key] if level.has_key?(key)
- end
- nil
- end
- end
-
- # Simple class to read lines out of a string
- class LineReader
- attr_reader :lines
- def initialize(lines)
- @lines = lines
- end
-
- # read the next line
- def read
- @lines.shift
- end
-
- # Return a list of lines up to the line that matches a pattern. That last
- # line is discarded.
- def read_up_to(pattern)
- res = []
- while line = read
- if pattern.match(line)
- return LineReader.new(res)
- else
- res << line
- end
- end
- raise "Missing end tag in template: #{pattern.source}"
- end
-
- # Return a copy of ourselves that can be modified without affecting us
- def dup
- LineReader.new(@lines.dup)
- end
- end
-
- # +templates+ is an array of strings containing the templates. We start at
- # the first, and substitute in subsequent ones where the string
- # <tt>!INCLUDE!</tt> occurs. For example, we could have the overall page
- # template containing
- #
- # <html><body>
- # <h1>Master</h1>
- # !INCLUDE!
- # </body></html>
- #
- # and substitute subpages in to it by passing [master, sub_page]. This
- # gives us a cheap way of framing pages
- def initialize(*templates)
- result = templates.shift.dup
- templates.each { |content| result.sub!(INCLUDE_RE, content) }
- @lines = LineReader.new(result.split(/\r?\n/))
- end
-
- attr_reader :lines
-
- def set_options(opts = {})
- @message = opts[:messages] || {}
- @output = opts[:output] || $stdout
- end
-
- # Render templates as HTML. Compatibility method for Rublog and
- # Rdoc.
- def write_html_on(op, value_hash, message_hash = {})
- to_html(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as HTML
- def to_html(value_hash, options = {})
- set_options(options)
- esc = proc { |str| CGI.escapeHTML(str) }
- @output << process(value_hash, esc)
- end
-
- # Render templates as TeX. Compatibility method for Rublog and
- # Rdoc.
- def write_tex_on(op, value_hash, message_hash = {})
- to_tex(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as TeX
- def to_tex(value_hash, options = {})
- set_options(options)
-
- esc = proc do |str|
- str.
- gsub(/&lt;/, '<').
- gsub(/&gt;/, '>').
- gsub(/&amp;/) { '\\&' }.
- gsub(/([$&%\#{}_])/) { "\\#$1" }.
- gsub(/>/, '$>$').
- gsub(/</, '$<$')
- end
- str = ""
-
- str << process(value_hash, esc)
- @output << str
- end
-
- # Render templates as plain text. Compatibility method for Rublog and
- # Rdoc.
- def write_plain_on(op, value_hash, message_hash = {})
- to_plain(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as plain text.
- def to_plain(value_hash, options = {})
- set_options(options)
- esc = proc {|str| str}
- @output << process(value_hash, esc)
- end
-
- # Render the templates. The The <tt>value_hash</tt> contains key/value
- # pairs used to drive the substitution (as described above). The
- # +escaper+ is a proc which will be used to sanitise the contents of the
- # template.
- def process(value_hash, escaper)
- @context = Context.new
- sub(@lines.dup, value_hash, escaper).
- tr("\000", '\\').
- tr(OPEN_TAG, '<').
- tr(CLOSE_TAG, '>')
- end
-
- # Substitute a set of key/value pairs into the given template. Keys with
- # scalar values have them substituted directly into the page. Those with
- # array values invoke <tt>substitute_array</tt> (below), which examples a
- # block of the template once for each row in the array.
- #
- # This routine also copes with the <tt>IF:</tt>_key_ directive, removing
- # chunks of the template if the corresponding key does not appear in the
- # hash, and the START: directive, which loops its contents for each value
- # in an array
- def sub(lines, values, escaper)
- @context.push(values)
- skip_to = nil
- result = []
-
- while line = lines.read
- mv = line.match(BLOCK_RE)
-
- if mv.nil?
- result << expand(line.dup, escaper)
- next
- else
- cmd = mv.captures[0]
- tag = mv.captures[1]
- end
-
- case cmd
- when "IF", "IFNOT", "IFNOTBLANK", "IFBLANK"
- raise "#{cmd}: must have a key to test." if tag.nil?
-
- val = @context.lookup(tag)
- case cmd # Skip lines if the value is...
- when "IF" # false or +nil+ (not false => true)
- test = (not val)
- when "IFBLANK" # +nil+ or empty
- test = (not (val.nil? or val.empty?))
- when "IFNOT"
- test = val
- when "IFNOTBLANK" #
- test = (val.nil? or val.empty?)
- end
- lines.read_up_to(/^\s*ENDIF:#{tag}/) if test
- when "ENDIF"
- nil
- when "START"
- raise "#{cmd}: must have a key." if tag.nil?
-
- body = lines.read_up_to(/^\s*END:#{tag}/)
- inner = @context.lookup(tag)
- raise "unknown tag: #{tag}" unless inner
- raise "not array: #{tag}" unless inner.kind_of?(Array)
- inner.each { |vals| result << sub(body.dup, vals, escaper) }
- result << "" # Append the missing \n
- else
- result << expand(line.dup, escaper)
- end
- end
-
- @context.pop
-
- result.join("\n")
- end
-
- # Given an individual line, we look for %xxx%, %?xxx%, #xxx#, #?xxx#,
- # [:key| xxx :], [?key| stuff ?], [!key| stuff ?] and HREF:ref:name:
- # constructs, substituting as appropriate.
- def expand(line, escaper)
- # Generate a cross-reference if a reference is given. Otherwise, just
- # fill in the name part.
- line = line.gsub(HREF_RE) do
- ref = @context.lookup($1)
- name = @context.find_scalar($2)
-
- if ref and not ref.kind_of?(Array)
- %Q(<a href="#{ref}">#{name}</a>)
- else
- name
- end
- end
-
- # Look for optional content.
- line = line.gsub(IFLINE_RE) do
- type = $1
- name = $2
- stuff = $3
-
- case type
- when '?'
- test = @context.lookup(name)
- when '!'
- test = (not @context.lookup(name))
- end
-
- if test
- stuff
- else
- ""
- end
- end
-
- # Look for repeating content.
- line = line.gsub(BLOCKLINE_RE) do |match|
- name = $1
- stuff = $2
-
- val = @context.lookup(name)
- ss = ""
- case val
- when nil
- nil
- when Fixnum
- val.times { |ii| ss << stuff.sub(/%#{name}%/, "#{ii + 1}") }
- when Range
- val.each { |ii| ss << stuff.sub(/%#{name}%/, "#{ii}") }
- when Array
- if not val.empty? and val[0].kind_of?(Hash)
- val.each do |vv|
- @context.push(vv)
- ss << expand(stuff, escaper)
- @context.pop
- end
- else
- val.each { |ee| ss << stuff.sub(/%#{name}%/, "#{ee}") }
- end
- end
- ss
- end
-
- # Substitute in values for #xxx# constructs.
- line = line.gsub(LABEL_RE) do
- mandatory = $1.nil?
- escaped = $2.nil?
- key = $3.intern
- val = @message[key]
-
- if val.nil?
- raise "Template error: can't find label '#{key}'." if mandatory
- ""
- else
- val = val.to_s
- val = escaper.call(val) if escaped
- val.tr('\\', "\000")
- end
- end
-
- # Substitute in values for %xxx% constructs. This is made complex
- # because the replacement string may contain characters that are
- # meaningful to the regexp (like \1)
- line = line.gsub(VARIABLE_RE) do
- mandatory = $1.nil?
- escaped = $2.nil?
- key = $3
- val = @context.lookup(key)
-
- if val.nil?
- raise "Template error: can't find variable '#{key}'." if mandatory
- ""
- else
- val = val.to_s
- val = escaper.call(val) if escaped
- val.tr('\\', "\000")
- end
- end
-
- # Substitute DDLB controls:
- DDLB_RES.each do |ddlb|
- line = line.gsub(ddlb[1]) do
- self.send(ddlb[0], Regexp.last_match.captures)
- end
- end
-
- line
- rescue Exception => ex
- raise "Error in template: #{ex}\nOriginal line: #{line}\n#{ex.backtrace[0]}"
- end
-
- def check(*args)
- value = @context.find_scalar_raw(args[0])
- checked = value ? " checked" : ""
- "<input type=\"checkbox\" name=\"#{name}\"#{checked}>"
- end
-
- def vsortddlb(*args)
- ddlb(*(args.dup << true))
- end
-
- def ddlb(*args)
- value = @context.find_scalar(args[0]).to_s
- options = @context.lookup(args[1])
- sort_on = args[2] || 0
-
- unless options and options.kind_of?(Hash)
- raise "Missing options #{args[1]} for ddlb #{args[0]}."
- end
-
- res = %Q(<select name="#{args[0]}">)
-
- sorted = options.to_a.sort do |aa, bb|
- if aa[0] == -1
- -1
- elsif bb[0] == -1
- 1
- else
- aa[sort_on] <=> bb[sort_on]
- end
- end
-
- sorted.each do |key, val|
- selected = (key.to_s == value) ? " selected" : ""
- res << %Q(<option value="#{key}"#{selected}>#{val}</option>)
- end
- res << "</select>"
- end
-
- def date(*args)
- yy = "#{argv[0]}_y"
- mm = "#{argv[0]}_m"
- dd = "#{argv[0]}_d"
- %Q<#{input(yy, 4, 4)}&nbsp;.&nbsp;#{input(mm, 2, 2)}&nbsp;.&nbsp;#{input(dd, 2, 2)}>
- end
-
- def radioone(*args)
- radio(*(args.dup << ""))
- end
-
- def radio(*args)
- value = @context.find_scalar(argv[0]).to_s
- options = @context.lookup(argv[1])
- br = argv[2] || "<br />"
-
- unless options and options.kind_of?(Hash)
- raise "Missing options #{args[1]} for radio #{args[0]}."
- end
-
- res = ""
- options.keys.sort.each do |key|
- val = options[key]
- checked = (key.to_s == value) ? " checked" : ""
- res << %Q(<label>
- <input type="radio" name="#{args[0]}"
- value="#{key}"#{checked}">#{val}</label>#{br})
- end
- res
- end
-
- def text(*args)
- value = @context.find_scalar(args[0]).to_s
- %Q(<textarea name="#{args[0]}" cols="#{args[1]}" rows="#{args[2]}">
-#{CGI.escapeHTML(value)}
-</textarea>)
- end
-
- def pwinput(*args)
- input(*(args.dup << "password"))
- end
-
- def input(*args)
- name = args[0]
- value = @context.find_scalar(name).to_s
- width = args[1]
- max = args[2]
- iptype = args[3] || "text"
- %Q(<input type="#{iptype}" name="#{name}" value="#{value}" size="#{width}" maxsize="#{max}">)
- end
-
- def popup(*args)
- url = CGI.escapeHTML(@context.find_scalar(args[0]).to_s)
- text = @context.find_scalar(args[1]).to_s
- %Q|<a href="#{url}" target="Popup" class="methodtitle" onClick="popup('#{url}'); return false;">#{text}</a>|
- end
-
- def pair(*args)
- label = args[0]
- name = args[1]
- colsp = args[2]
-
- value = @context.find_scalar(name).to_s
- value = case value
- when "true" then "Yes"
- when "false" then "No"
- else value
- end
- td = (colsp.nil? or colsp.empty?) ? "<td>" : %Q{<td colspan="#{colsp}">}
- "#{Html.tag(label)}#{td}#{value}</td>"
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/utils.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/utils.rb
deleted file mode 100644
index c58a9f4..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/utils.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # So that Ruwiki doesn't have to be loaded in full to use the bloody thing.
-unless defined?(Ruwiki)
- class Ruwiki
- VERSION = "0.9.0"
- end
-end
-
-module Ruwiki::Utils
- RUN_PATH = Dir.pwd
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/utils/command.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/utils/command.rb
deleted file mode 100644
index ba7c060..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/utils/command.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # Implements the command pattern. Commands are used by the command-line
-class Ruwiki::Utils::CommandPattern
- class AbstractCommandError < Exception; end
- class UnknownCommandError < RuntimeError; end
- class CommandAlreadyExists < RuntimeError; end
- class MissingParameterError < ArgumentError
- def initialize(argument)
- @argument = argument
- end
-
- attr_reader :argument
- end
-
- class << self
- def add(command)
- command = command.new if command.kind_of?(Class)
-
- @commands ||= {}
- if @commands.has_key?(command.name)
- raise CommandAlreadyExists
- else
- @commands[command.name] = command
- end
-
- if command.respond_to?(:altname)
- unless @commands.has_key?(command.altname)
- @commands[command.altname] = command
- end
- end
- end
-
- def <<(command)
- add(command)
- end
-
- attr_accessor :default
- def default=(command) #:nodoc:
- if command.kind_of?(Ruwiki::Utils::CommandPattern)
- @default = command
- elsif command.kind_of?(Class)
- @default = command.new
- elsif @commands.has_key?(command)
- @default = @commands[command]
- else
- raise UnknownCommandError
- end
- end
-
- def command?(command)
- @commands.has_key?(command)
- end
-
- def command(command)
- if command?(command)
- @commands[command]
- else
- @default
- end
- end
-
- def [](cmd)
- self.command(cmd)
- end
-
- def default_ioe(ioe = {})
- ioe[:input] ||= $stdin
- ioe[:output] ||= $stdout
- ioe[:error] ||= $stderr
- ioe
- end
- end
-
- def [](args, opts = {}, ioe = {})
- call(args, opts, ioe)
- end
-
- def name
- raise AbstractCommandError
- end
-
- def call(args, opts = {}, ioe = {})
- raise AbstractCommandError
- end
-
- def help
- raise AbstractCommandError
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/utils/converter.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/utils/converter.rb
deleted file mode 100644
index 0261af8..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/utils/converter.rb
+++ /dev/null
@@ -1,297 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-
-module Ruwiki::Utils::Converter
- class << self
- TARGETS = %w(flatfiles yaml marshal)
-
- # Create the regular expressions that are used in Ruwiki 0.6.2
- OLD_HEADER_RE = /^\s*([a-z]+)\s*:\s*(.*)$/
- OLD_HEADER_END_RE = /^#EHDR$/
- DATA_HEADER_END_RE = /\A#EHDR\z/
- NL_RE = /\n/
-
- def with(obj)
- yield obj if block_given?
- end
-
- # Only allow this to be run once. Silently fail otherwise.
- def set_defaults
- return unless @options.nil?
- @options = OpenStruct.new
-
- with @options do |oo|
- oo.traverse_directories = true
- oo.backup_old_files = true
- oo.backup_extension = "~"
- oo.quiet = false
- oo.verbose = false
- oo.extension = 'ruwiki'
- oo.target_format = 'flatfiles'
- end
- end
-
- def message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def message(id)
- if @message[id].nil?
- []
- else
- @message[id]
- end
- end
-
- def display_options
- end
-
- def summary
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- set_defaults
-
- @input = input
- @output = output
- @error = error
-
- language = 'en'
- find_lang = argv.grep(%r{^--lang})
- find_lang.each do |ee|
- if ee =~ %r{^--lang=}
- language = ee.sub(%r{^--lang=}, '')
- else
- language = argv[argv.index(ee).succ]
- end
- end
-
- require "ruwiki/lang/#{language.downcase}"
- self.message = Ruwiki::Lang.const_get(language.upcase)
-
- argv.options do |opts|
- opts.banner = message(:converter_usage) % File.basename($0)
- opts.separator ''
- opts.on('--format=FORMAT', *message(:converter_format_desc)) do |ff|
- @options.target_format = ff
- end
- opts.on('--[no-]backup', *message(:converter_backup_desc)) do |bb|
- @options.backup_old_files = bb
- end
- opts.on('--backup-extension=EXTENSION', *message(:converter_backupext_desc)) do |ee|
- if ee.nil? or ee.empty?
- @error << message(:converter_backupext_error) << "\n" if ee.nil? or ee.empty?
- @error << "#{opts}\n"
- return 0
- end
- @options.backup_extension = ee
- end
- opts.on('--extension=EXTENSION', *message(:converter_extension_desc)) do |ee|
- if ee.nil? or ee.empty?
- @error << message(:converter_extension_error) << "\n" if ee.nil? or ee.empty?
- @error << "#{opts}\n"
- return 0
- end
- @options.extension = ee
- end
- opts.on('--no-extension', *message(:converter_noextension_desc)) do
- @options.extension = nil
- end
- opts.on('--lang=LANG', *message(:converter_language_desc)) do |lang|
- self.message = Ruwiki::Lang.const_get(lang.upcase)
- end
- opts.on('--quiet', *message(:converter_quiet_desc)) do |qq|
- @options.quiet = qq
- @options.verbose = (not qq)
- end
- opts.on('--verbose', *message(:converter_verbose_desc)) do |vv|
- @options.quiet = (not vv)
- @options.verbose = vv
- end
- opts.separator ''
- opts.on_tail('--help', *message(:converter_help_desc)) do
- @error << "#{opts}\n"
- return 0
- end
-
- opts.parse!
- end
-
- if argv.empty?
- @error << message(:converter_num_arguments) << "\n#{argv.options}\n" unless @options.quiet
- return 127
- end
-
- display_options if @options.verbose
-
- @options.target_format.capitalize!
- @options.target_format_class = Ruwiki::Backend.const_get(@options.target_format)
-
- argv.each { |file| process_file(file) }
-
- summary if not @options.quiet
- end
-
- # Process a single file.
- def process_file(file)
- if @options.backup_old_files
- return if file =~ /#{@options.backup_extension}/
- end
- @out << "#{file}: " unless @options.quiet
-
- if File.directory?(file) and @options.traverse_directories
- @out << message(:converter_directory) << "\n" unless @options.quiet
- Dir.chdir(file) { Dir['*'].each { |entry| process_file(entry) } }
- else
- begin
- page, page_format = load_page(file)
- @out << message(:converter_converting_from) % [ page_format, @options.target_format ] if @options.verbose
- save_page(file, page)
- @out << message(:converter_done) << "\n" unless @options.quiet
- rescue PageLoadException
- @out << message(:converter_not_ruwiki) << "\n" unless @options.quiet
- rescue PageSaveException
- @out << message(:cannot_nosave_modified) << "\n" % [ file ] unless @options.quiet
- end
- end
- end
-
- def load_page(file)
- data = File.read(file)
- page_format = nil
-
- if data =~ OLD_HEADER_END_RE
- page_format = 'OldFlatfiles'
-
- page = Ruwiki::Page::NULL_PAGE.dup
-
- unless data.empty?
- rawbuf = data.split(NL_RE).map { |ee| ee.chomp }
-
- loop do
- if rawbuf[0] =~ OLD_HEADER_END_RE
- rawbuf.shift
- break
- end
-
- match = OLD_HEADER_RE.match(rawbuf[0])
-
- unless match.nil?
- case match.captures[0]
- when 'topic'
- page['properties']['topic'] = match.captures[1]
- page['properties']['title'] = match.captures[1]
- when 'version'
- page['properties']['version'] = match.captures[1].to_i
- else
- nil
- end
- end
- rawbuf.shift
- end
-
- page['page']['content'] = rawbuf.join("\n")
-
- with page['properties'] do |pp|
- pp['project'] = File.basename(File.dirname(File.expand_path(file)))
- pp['editable'] = true
- pp['indexable'] = true
- pp['entropy'] = 0.0
- end
- end
- end
-
- # Try Marshal
- if page_format.nil?
- begin
- page = ::Marshal.load(data)
- page_format = 'Marshal'
- rescue Exception
- nil
- end
- end
-
- # Try YAML
- if page_format.nil?
- begin
- page = ::YAML.load(data)
- page_format = 'YAML'
- rescue Exception
- nil
- end
- end
-
- # Try the Flatfiles format
- if page_format.nil?
- begin
- page = Ruwiki::Backend::Flatfiles.load(data)
- page_format = 'Exportable'
- rescue Exception => ex
- nil
- end
- end
-
- if page_format.nil? # Cannot detect page type.
- @error << @message[:converter_page_format_error] << "\n"
- raise PageLoadException
- end
- [page, page_format]
- rescue PageLoadException
- raise
- rescue Exception => ex
- @error << %Q|#{ex.message}\n#{ex.backtrace.join("\n")}\n| if @options.verbose
- raise PageLoadException
- end
-
- def save_page(file, page)
- if @options.backup_extension != '~'
- backup = "#{file}.#{@options.backup_extension}"
- else
- backup = "#{file}#{@options.backup_extension}"
- end
-
- # Always backup the file -- we are transactional.
- FileUtils.cp(file, backup)
-
- if @options.target_format == 'Marshal'
- method = :print
- else
- method = :puts
- end
- File.open(file, 'wb') { |ff| ff.__send__(method, @options.target_format_class.dump(page)) }
- rescue Exception => ex
- FileUtils.mv(backup, file) if File.exists?(backup)
- @error << %Q|#{ex.message}\n#{ex.backtrace.join("\n")}\n| if @options.verbose
- raise PageSaveException
- ensure
- # If we aren't *supposed* to back up the file, then get rid of the
- # backup.
- if File.exists?(backup) and (not @options.backup_old_files)
- FileUtils.rm(backup)
- end
- end
-
- class PageLoadException < RuntimeError; end
- class PageSaveException < RuntimeError; end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/utils/manager.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/utils/manager.rb
deleted file mode 100644
index ef322f9..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/utils/manager.rb
+++ /dev/null
@@ -1,648 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-require 'stringio'
-require 'zlib'
-require 'ruwiki/exportable'
-require 'ruwiki/utils/command'
-require 'ruwiki/config'
-
-begin
- if defined?(Gem::Cache)
- require_gem 'archive-tar-minitar', '~> 0.5.1'
- else
- require 'archive/tar/minitar'
- end
-rescue LoadError => ex
- $stderr.puts ex.message
- raise
-end
-
-module Ruwiki::Utils::Manager
- DEFAULT_PACKAGE_NAME = 'ruwiki.pkg'
-
- def self.message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def self.message(id)
- @message[id]
- end
-
- class ManagerError < RuntimeError; end
-
- EXECUTABLES = %w(ruwiki.cgi ruwiki_servlet ruwiki_servlet.bat \
- ruwiki_servlet.cmd ruwiki_service.rb)
-
- class ManagerHelp < Ruwiki::Utils::CommandPattern
- def name
- "help"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- help_on = args.shift
- output = ""
-
- if Ruwiki::Utils::CommandPattern.command?(help_on)
- ioe[:output] << Ruwiki::Utils::CommandPattern[help_on].help
- elsif help_on == "commands"
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_help_commands)
- else
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_unknown_command) % [ help_on ] << "\n" % [ help_on ] unless help_on.nil? or help_on.empty?
- ioe[:output] << self.help
- end
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_help_help)
- end
- end
-
- class ManagerInstall < Ruwiki::Utils::CommandPattern
- def name
- "install"
- end
-
- def call(args, opts = {}, ioe = {})
- argv = []
-
- replace = false
- dest = "."
- name = nil
-
- while (arg = args.shift)
- case arg
- when '--to'
- dir = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if dir.nil?
- if File.exist?(dir)
- if not File.directory?(dir)
- raise ArgumentError, Ruwiki::Utils::Manager.message(:manager_dest_not_directory)
- end
- else
- FileUtils.mkdir_p(dir)
- end
- dest = dir
- when /;/o
- argv.push(*(arg.split(/;/o)))
- when /,/o
- argv.push(*(arg.split(/,/o)))
- else
- argv << arg
- end
- end
-
- options = { 'data' => true }
-
- while (arg = argv.shift)
- case arg
- when /^(?:-|no)(.*$)/
- options.delete($1)
- else
- options[arg] = true
- end
- end
-
- Ruwiki::Utils::Manager.install(dest, options)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_install_help)
- end
- end
-
- class ManagerPackage < Ruwiki::Utils::CommandPattern
- def name
- "package"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- argv = []
- replace = false
- dest = "."
- name = nil
-
- while (arg = args.shift)
- case arg
- when '--replace'
- replace = true
- when '-o', '--output'
- name = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if name.nil?
- dest = File.dirname(name)
- name = File.basename(name)
- else
- argv << arg
- end
- end
-
- if argv.size > 1
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_hi_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 1
- end
- source = argv.shift || "."
-
- Ruwiki::Utils::Manager.package(source, dest, name, replace)
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_package_help) % [ "./#{Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME}",
- Ruwiki::Config::CONFIG_NAME ]
- end
- end
-
- class ManagerUnpackage < Ruwiki::Utils::CommandPattern
- def name
- "unpackage"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- argv = []
- dir = "."
-
- while (arg = args.shift)
- case arg
- when '-o', '--output'
- dir = args.shift
- raise Ruwiki::Utils::CommandPatter::MissingParameterError.new(arg) if dir.nil? or not File.directory?(dir)
- else
- argv << arg
- end
- end
-
- if argv.size > 1
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_hi_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 1
- end
- source = argv.shift || Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME
-
- Ruwiki::Utils::Manager.unpackage(source, dir)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_unpackage_help) % [ "./#{Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME}" ]
- end
- end
-
- if RUBY_PLATFORM =~ /win32/
- class ManagerService < Ruwiki::Utils::CommandPattern
- def name
- "service"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
-
- if args.size < 2
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_lo_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 0
- end
-
- command = args.shift
- service = args.shift
-
- options ||= {}
- options[:service_name] = service
- options[:service_home] = File.expand_path(".")
-
- argv = []
- while (arg = args.shift)
- case arg
- when "--rubybin"
- options[:ruby_bin] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:ruby_bin].nil?
- when "--exec"
- options[:service_bin] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:service_bin].nil?
- when "--home"
- options[:service_home] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:service_home].nil?
- else
- argv << arg
- end
- end
-
- options[:service_desc] = args.join(" ") if args.size > 0
-
- case command
- when "install"
- options[:service_install] = true
- when "start"
- options[:service_start] = true
- when "stop"
- options[:service_stop] = true
- when "delete"
- options[:service_delete] = true
- else
- raise ArgumentError, Ruwiki::Utils::Manager.message(:manager_unknown_command) % [ command ]
- end
-
- Ruwiki::Utils::Manager.manage_windows_service(options, ioe)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_service_help)
- end
- end
- Ruwiki::Utils::CommandPattern << ManagerService
- end
-
- Ruwiki::Utils::CommandPattern << ManagerHelp
- Ruwiki::Utils::CommandPattern << ManagerInstall
- Ruwiki::Utils::CommandPattern << ManagerPackage
- Ruwiki::Utils::CommandPattern << ManagerUnpackage
- Ruwiki::Utils::CommandPattern.default = Ruwiki::Utils::CommandPattern["help"]
-
- class << self
- attr_accessor :shared
- attr_reader :ruwiki_servlet
- attr_reader :ruwiki_servlet_bat
- attr_reader :ruwiki_servlet_cmd
- attr_reader :ruwiki_service
- attr_reader :ruwiki_cgi
- attr_reader :ruwiki_pkg
- def shared=(shared)
- @shared = shared
- @ruwiki_servlet = File.join(@shared, "bin", "ruwiki_servlet")
- @ruwiki_servlet_bat = File.join(@shared, "bin", "ruwiki_servlet.bat")
- @ruwiki_servlet_cmd = File.join(@shared, "bin", "ruwiki_servlet.cmd")
- @ruwiki_service = File.join(@shared, "bin", "ruwiki_service.rb")
- @ruwiki_cgi = File.join(@shared, "bin", "ruwiki.cgi")
- @ruwiki_pkg = File.join(@shared, "share", "ruwiki",
- Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME)
- end
-
- def with(obj)
- yield obj if block_given?
- end
-
- def tar_files(list, name)
- ff = StringIO.new
- gz = Zlib::GzipWriter.new(ff)
- to = Archive::Tar::Minitar::Output.new(gz)
- list.each { |item| Archive::Tar::Minitar.pack_file(item, to) }
- data = ff.string
- group = {
- :name => name,
- :data => data,
- :mode => 0644,
- }
- return group
- rescue Exception => ex
- puts ex.message, ex.backtrace.join("\n")
- ensure
- to.close
- group[:size] = group[:data].size
- end
-
- def package(source, dest, name = nil, replace = false)
- # If the package name is nil, use the default name. If replace is
- # false, then append a number on the end if the file already exists.
- # Increment the number until we have a unique filename.
- if name.nil?
- pkg = File.join(dest, DEFAULT_PACKAGE_NAME)
- if File.exists?(pkg) and (not replace)
- pbn = "#{File.basename(DEFAULT_PACKAGE_NAME, '.pkg')}-%02d.pkg"
- ii = 1
- while File.exists?(pkg)
- pkg = File.join(dest, pbn % ii)
- ii += 1
- end
- end
- else
- pkg = File.join(dest, name)
- if File.exists?(pkg) and (not replace)
- raise ManagerError, Ruwiki::Utils::Manager.message(:manager_package_exists)
- end
- end
-
- files = []
-
- if File.directory?(source)
- Dir.chdir(source) do
- if File.exists?(Ruwiki::Config::CONFIG_NAME)
- cs = File.stat(Ruwiki::Config::CONFIG_NAME)
- files << {
- :name => Ruwiki::Config::CONFIG_NAME,
- :data => File.read(Ruwiki::Config::CONFIG_NAME),
- :mtime => cs.mtime,
- :mode => 0644,
- :size => cs.size
- }
- end
-
- EXECUTABLES.each do |ff|
- if File.exists?(ff)
- cs = File.stat(ff)
- files << {
- :name => ff,
- :data => File.read(ff),
- :mtime => cs.mtime,
- :mode => 0755,
- :size => cs.size
- }
- end
- end
-
- f_data = Dir["data/**/**"].select { |dd| dd !~ /CVS\// }
- f_data.unshift("data")
- f_data.map! do |dd|
- res = { :name => dd, :mode => 0644 }
- if File.directory?(dd)
- res[:mode] = 0755
- res[:dir] = true
- end
- res
- end
-
- f_tmpl = Dir["templates/**/**"].select { |tt| tt !~ /CVS\// }
- f_tmpl.unshift("templates")
- f_tmpl.map! do |tt|
- res = { :name => tt, :mode => 0644 }
- if File.directory?(tt)
- res[:mode] = 0755
- res[:dir] = true
- end
- res
- end
-
- files << tar_files(f_data, "data.pkg")
- files << tar_files(f_tmpl, "tmpl.pkg")
- end
- else
- stat = File.stat(source)
- files << {
- :name => File.basename(source),
- :data => File.read(source),
- :mtime => stat.mtime,
- :mode => 0644,
- :size => stat.size
- }
-
- EXECUTABLES.each do |ff|
- ff = File.join(File.dirname(source), ff)
- if File.exists?(ff)
- cs = File.stat(ff)
- files << {
- :name => ff,
- :data => File.read(ff),
- :mtime => cs.mtime,
- :mode => 0755,
- :size => cs.size
- }
- end
- end
-
- cc = Ruwiki::Exportable.load(files[0][:data])
- tp = cc['ruwiki-config']['template-path']
- tp = "./templates" if tp.nil? or tp.empty?
- so = cc['ruwiki-config']['storage-options']
-
- if so.nil? or so.empty?
- dp = "./data"
- else
- so = Ruwiki::Exportable.load(so)
- key = 'flatfiles'
- dp = so[key]['data-path']
- end
-
- dp = "./data" if dp.nil? or dp.empty?
- bndp = File.basename(dp)
- bntp = File.basename(tp)
-
- so[key]['data-path'] = bndp
- cc['ruwiki-config']['storage-options'] = Ruwiki::Exportable.dump(so)
- cc['ruwiki-config']['template-path'] = bntp
- files[0][:data] = Ruwiki::Exportable.dump(cc)
- files[0][:size] = files[0][:data].size
-
- Dir.chdir(File.dirname(dp)) do
- f_data = Dir["#{bndp}/**/**"].select { |dd| dd !~ /CVS\// }
- f_data.map! { |dd| { :name => dd, :mode => 0644 } }
- files << tar_files(f_data, "data.pkg")
- end
-
- Dir.chdir(File.dirname(tp)) do
- f_tmpl = Dir["#{bntp}/**/**"].select { |tt| tt !~ /CVS\// }
- f_tmpl.map! { |tt| { :name => tt, :mode => 0644 } }
- files << tar_files(f_tmpl, "tmpl.pkg")
- end
- end
-
- ff = File.open(pkg, "wb")
- gz = Zlib::GzipWriter.new(ff)
- tw = Archive::Tar::Minitar::Writer.new(gz)
-
- files.each do |entry|
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
- end
-
- nil
- rescue Exception => ex
- puts ex, ex.backtrace.join("\n")
- ensure
- tw.close if tw
- gz.close if gz
- end
-
- def unpackage(source, dest)
- ff = File.open(source, "rb")
- gz = Zlib::GzipReader.new(ff)
- Archive::Tar::Minitar::Input.open(gz) do |it|
- it.each do |entry|
- case entry.full_name
- when "data.pkg", "tmpl.pkg"
- pkg = StringIO.new(entry.read)
- pkgz = Zlib::GzipReader.new(pkg)
- Archive::Tar::Minitar::Input.open(pkgz) do |inner|
- inner.each { |item| inner.extract_entry(dest, item) }
- end
- else
- it.extract_entry(dest, entry)
- end
- end
- end
-
- nil
- end
-
- def install(dest, options = {})
- if options['servlet']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet, dest, :mode => 0755)
- if RUBY_PLATFORM =~ /win32/
- if File.exists?(Ruwiki::Utils::Manager.ruwiki_servlet_bat)
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet_bat, dest, :mode => 0755)
- end
- if File.exists?(Ruwiki::Utils::Manager.ruwiki_servlet_cmd)
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet_cmd, dest, :mode => 0755)
- end
- end
- end
-
- if RUBY_PLATFORM =~ /win32/ and options['service']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_service, dest, :mode => 0755)
- end
-
- if options['cgi']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_cgi, dest, :mode => 0755)
- end
-
- if options['data']
- unpackage(Ruwiki::Utils::Manager.ruwiki_pkg, dest)
- if options['service']
- cfn = File.join(dest, 'ruwiki.conf')
- cfg = nil
- File.open(cfn, "rb") { |f| cfg = f.read }
- cfg.gsub!(%r{\./data}, File.join(File.expand_path(dest), "data"))
- cfg.gsub!(%r{\./templates}, File.join(File.expand_path(dest), "templates"))
- File.open(cfn, "wb") { |f| f.write(cfg) }
- end
- end
- end
-
- if RUBY_PLATFORM =~ /win32/
- begin
- require 'win32/service'
- require 'rbconfig'
- HasWin32Service = true
- rescue LoadError
- HasWin32Service = false
- end
-
- # The work here is based on Daniel Berger's Instiki Service Tutorial.
- # http://rubyforge.org/docman/view.php/85/107/instiki_service_tutorial.txt
- def manage_windows_service(options, ioe)
- raise Ruwiki::Utils::Manager.message(:manager_service_broken) unless HasWin32Service
-
- service_name = options[:service_name] || 'RuwikiSvc'
-
- if options[:service_install]
- service_home = options[:service_home]
-
- program = options[:service_bin]
- if program.nil? or program.empty?
- program = File.join(service_home, "ruwiki_service.rb")
- elsif program !~ %r{[/\\]}
- program = File.join(service_home, program)
- end
- program = %<"#{program}">
-
- ruby = options[:ruby_bin] || %<"#{File.join(Config::CONFIG['bindir'], 'ruby.exe')}">
-
- service_desc = options[:service_desc] || 'Ruwiki'
-
- binpath = "#{ruby} #{program}".tr('/', '\\')
-
- service = Win32::Service.new
- service.create_service do |svc|
- svc.service_name = service_name
- svc.display_name = service_desc
- svc.binary_path_name = binpath
- svc.dependencies = [] # Required because of a bug in Win32::Service
- end
- service.close
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_installed) % [ service_name ] << "\n"
- end
-
- if options[:service_start]
- Win32::Service.start(service_name)
- started = false
- while (not started)
- status = Win32::Service.status(service_name)
- started = (status.current_state == "running")
- break if started
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_one_moment) % [ status.current_state ] << "\n"
- sleep 1
- end
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_started) % [ service_name ] << "\n"
- end
-
- if options[:service_stop]
- Win32::Service.stop(service_name)
- stopped = false
- while (not stopped)
- status = Win32::Service.status(service_name)
- stopped = (status.current_state == "stopped")
- break if stopped
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_one_moment) % [ status.current_state ] << "\n"
- sleep 1
- end
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_stopped) % [ service_name ] << "\n"
- end
-
- if options[:service_delete]
- Win32::Service.stop(service_name) rescue nil
- Win32::Service.delete(service_name)
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_deleted) % [ service_name ] << "\n"
- end
- end
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- ioe = {
- :input => input,
- :output => output,
- :error => error
- }
-
- language = 'en'
- find_lang = argv.grep(%r{^--lang})
- find_lang.each do |ee|
- eepos = argv.index(ee)
- if ee =~ %r{^--lang=}
- language = ee.sub(%r{^--lang=}, '')
- else
- language = argv[eepos.succ]
- argv.delete_at(eepos.succ)
- end
- argv.delete_at(eepos)
- end
-
- require "ruwiki/lang/#{language.downcase}"
- Ruwiki::Utils::Manager.message = Ruwiki::Lang.const_get(language.upcase)
-
- command = Ruwiki::Utils::CommandPattern[(argv.shift or "").downcase]
- return command[argv, {}, ioe]
- rescue Ruwiki::Utils::CommandPattern::MissingParameterError => ee
- ioe[:error] << Ruwiki::Utils::Manager.message(:manager_missing_parameter) % [ ee.argument ] << "\n"
- return 1
- rescue ArgumentError, ManagerError => ee
- ioe[:error] << ee.message << "\n"
- return 1
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/utils/servletrunner.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/utils/servletrunner.rb
deleted file mode 100644
index 91dc916..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/utils/servletrunner.rb
+++ /dev/null
@@ -1,296 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-require 'webrick'
-
-require 'ruwiki/utils'
-require 'ruwiki/exportable'
-require 'ruwiki/servlet'
-require 'ruwiki/lang/en'
-require 'ruwiki/lang/de'
-require 'ruwiki/lang/es'
-
-require 'optparse'
-require 'ostruct'
-
-module Ruwiki::Utils::ServletRunner
- COPYRIGHT = <<-"COPYRIGHT"
-Ruwiki #{Ruwiki::VERSION}
- Copyright © 2002 - 2004, Digikata and HaloStatue
-
- http://rubyforge.org/projects/ruwiki/
-
- Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-
-Licensed under the same terms as Ruby.
-
-$Id$
-COPYRIGHT
-
- class WEBrickConfig
- include Ruwiki::Exportable
-
- exportable_group 'webrick-config'
- attr_accessor :port
- exportable :port
- attr_accessor :addresses
- exportable :addresses
- attr_accessor :mount
- exportable :mount
- attr_accessor :do_log
- exportable :do_log
- attr_accessor :log_dest
- exportable :log_dest
- attr_accessor :threads
- exportable :threads
-
- def export
- hash = super
- sc = hash['webrick-config']
- sc['addresses'] = sc['addresses'].join(";")
- sc['do-log'] = (sc['do-log'] ? 'true' : 'false')
- hash
- end
-
- # Because the servlet can be started from the command-line, provide
- # defaults for all possible configuration options.
- def initialize(exported = {})
- sc = exported['webrick-config'] || {}
- @port = sc['port'] || 8808
- @mount = sc['mount'] || '/'
- @addresses = sc['addresses']
- @do_log = ((sc['do-log'] == 'false') ? false : true)
- @log_dest = sc['log-dest']
- @threads = sc['threads'] || 1
-
- if @addresses.nil? or @addresses.empty?
- @addresses = []
- else
- @addresses = @addresses.split(/;/)
- end
-
- if @log_dest.nil? or @log_dest.empty?
- @log_dest = "<STDERR>"
- end
- end
- end
-
- def self.message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def self.message(id)
- @message[id]
- end
-
- class << self
- # This is for the WEBrick version of Ruwiki. This has been abstracted to
- # accept a Config global variable to reconfigure Ruwiki after initial
- # creation.
- def read_config(filename)
- ch = {}
- if File.exists?(filename)
- File.open(filename, 'rb') { |ff| ch = Ruwiki::Exportable.load(ff.read) }
- end
-
- @sc = WEBrickConfig.new(ch)
- @rc = Ruwiki::Config.new(ch)
-
- if @rc.webmaster.nil? or @rc.webmaster.empty?
- @rc.webmaster = "webmaster@domain.tld"
- end
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- read_config(Ruwiki::Config::CONFIG_NAME)
-
- save_config = nil
-
- language = 'en'
- find_lang = argv.grep(%r{^--language})
- find_lang.each do |ee|
- if ee =~ %r{^--language=}
- language = ee.sub(%r{^--language=}, '')
- else
- language = argv[argv.index(ee).succ]
- end
- end
-
- require "ruwiki/lang/#{language.downcase}"
- @rc.language = Ruwiki::Lang.const_get(language.upcase)
- self.message = @rc.language
-
- argv.options do |oo|
- oo.banner = self.message(:runner_usage) % [ File.basename($0) ]
- oo.separator self.message(:runner_general_options)
- oo.on('--save-config [FILENAME]', *([ self.message(:runner_saveconfig_desc), Ruwiki::Config::CONFIG_NAME ].flatten)) { |fname|
- save_config = fname || Ruwiki::Config::CONFIG_NAME
- }
- oo.on('--config FILENAME', *self.message(:runner_config_desc)) { |fn|
- read_config(fn)
- }
- oo.separator ""
- oo.separator self.message(:runner_webrick_options)
- oo.on('-P', '--port PORT', Numeric, *self.message(:runner_port_desc)) { |port|
- @sc.port = port
- }
- oo.on('-A', '--accept ADDRESS,ADDRESS,ADDRESS', Array, *self.message(:runner_address_desc)) { |address|
- @sc.addresses += address
- }
- oo.on('-L', '--local', *self.message(:runner_local_desc)) {
- @sc.addresses = ["127.0.0.1"]
- }
- oo.on('-M', '--mount MOUNT-POINT', *self.message(:runner_mountpoint_desc)) { |mp|
- @sc.mount = mp
- }
- oo.on('--[no-]log', *self.message(:runner_log_desc)) { |log|
- @sc.do_log = log
- }
- oo.on('--logfile LOGFILE', *self.message(:runner_logfile_desc)) { |lf|
- @sc.log_dest = lf
- }
- oo.on('-T', '--threads THREADS', Integer, *self.message(:runner_threads_desc)) { |tc|
- @sc.threads = tc
- }
- oo.separator ""
- oo.separator self.message(:runner_ruwiki_options)
- oo.on('--language=LANGUAGE', *self.message(:runner_language_desc)) { |lang|
- nil
- }
- oo.on('--webmaster WEBMASTER', *self.message(:runner_webmaster_desc)) { |wm|
- @rc.webmaster = wm
- }
- oo.on('--[no-]debug', *self.message(:runner_debug_desc)) { |dd|
- @rc.debug = dd
- }
- oo.on('--title TITLE', *self.message(:runner_title_desc)) { |tt|
- @rc.title = tt
- }
- oo.on('--default-page PAGENAME', *self.message(:runner_defaultpage_desc)) { |dp|
- @rc.default_page = dp
- }
- oo.on('--default-project PAGENAME', *self.message(:runner_defaultproject_desc)) { |dp|
- @rc.default_project = dp
- }
- oo.on('--template-path TEMPLATE_PATH', *self.message(:runner_templatepath_desc)) { |tp|
- @rc.template_path = tp
- }
- oo.on('--templates TEMPLATES', *self.message(:runner_templatename_desc)) { |tp|
- @rc.template_set = tp
- }
- oo.on('--css CSS_NAME', *self.message(:runner_cssname_desc)) { |css|
- @rc.css = css
- }
- oo.on('--storage-type TYPE', Ruwiki::KNOWN_BACKENDS, *([self.message(:runner_storage_desc), Ruwiki::KNOWN_BACKENDS.join(", ")].flatten)) { |st|
- @rc.storage_type = st
- @rc.storage_options[@rc.storage_type]['data-path'] ||= "./data/"
- @rc.storage_options[@rc.storage_type]['extension'] ||= "ruwiki"
- }
- oo.on('--data-path PATH', *self.message(:runner_datapath_desc)) { |fdp|
- @rc.storage_options['flatfiles']['data-path'] = fdp
- }
- oo.on('--extension EXT', *self.message(:runner_extension_desc)) { |ext|
- @rc.storage_options['flatfiles']['data-path'] = fdp
- }
- if defined?(Gem::Cache)
- oo.separator ""
- oo.on('--central', *self.message(:runner_central_desc)) {
- gempath = Gem::Cache.from_installed_gems.search("ruwiki", "=#{Ruwiki::VERSION}").last.full_gem_path
- @rc.storage_type = 'flatfiles'
- @rc.storage_options['flatfiles']['data-path'] = "#{gempath}/data"
- @rc.storage_options['flatfiles']['extension'] = "ruwiki"
- @rc.storage_options['flatfiles']['format'] = "exportable"
- @rc.template_path = "#{gempath}/templates"
- @rc.template_set = "sidebar"
- }
- end
-
- # TODO: Add options for time, date, and datetime formats.
- oo.separator ""
- oo.separator self.message(:runner_general_info)
- oo.on_tail('--help', *self.message(:runner_help_desc)) {
- error << oo << "\n"
- return 0
- }
- oo.on_tail('--version', *self.message(:runner_version_desc)) {
- error << COPYRIGHT << "\n"
- return 0
- }
- oo.parse!
- end
-
- if save_config
- sc = @sc.export
- rc = @rc.export
- cf = sc.merge(rc)
-
- File.open(save_config, 'wb') { |ff| ff.puts Ruwiki::Exportable.dump(cf) }
- return 0
- end
-
- # If the list of accepted addresses is not empty, provide IP-based
- # restrictions.
- if not @sc.addresses.empty?
- localonly = lambda do |sock|
- if not @sc.addresses.include?(sock.peeraddr[3])
- raise WEBrick::ServerError, self.message(:runner_rejected_address) % [ sock.peeraddr[3], @sc.addresses.join(", ") ]
- end
- end
- else
- localonly = nil
- end
-
- if @sc.do_log
- if "<STDERR>" == @sc.log_dest
- dest = $stderr
- else
- dest = File.open(@sc.log_dest, "wb+")
- end
- logger = WEBrick::Log.new(dest, WEBrick::Log::DEBUG)
- else
- logger = nil
- end
-
- banner = self.message(:runner_banner) %
- [ Ruwiki::Utils::ServletRunner::COPYRIGHT, @sc.port,
- @sc.addresses.join(", "), @sc.mount, @sc.do_log, @sc.log_dest,
- @sc.threads, @rc.webmaster, @rc.debug, @rc.title,
- @rc.default_project, @rc.default_page, @rc.template_path,
- @rc.template_set, @rc.css, @rc.storage_type,
- @rc.storage_options[@rc.storage_type]['data-path'],
- @rc.storage_options[@rc.storage_type]['extension'] ]
-
- banner.each { |bb| logger.info(bb) } unless logger.nil?
-
- server = WEBrick::HTTPServer.new(:Port => @sc.port.to_i,
- :StartThreads => @sc.threads.to_i,
- :AcceptCallback => localonly,
- :Logger => logger)
- @rc.logger = logger
- Ruwiki::Servlet.config = @rc
-
- server.mount(@sc.mount, Ruwiki::Servlet)
- trap("INT") { server.shutdown; return 0 }
- server.start
- return 0
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki.rb
deleted file mode 100644
index ded37ee..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki.rb
+++ /dev/null
@@ -1,164 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
- # Ruwiki's Wiki markup class. This will convert the Wiki markup known by
- # Ruwiki (defined by Token classes). The algorithm is as follows:
- #
- # 1. For each known Token class, match each instance of it in the content
- # stream. Replace each instance in the content stream with a Token
- # marker: TOKEN_x or \TOKEN_x, where x is a digit representing the Token.
- # (\TOKEN_x is a special case of token matching. See
- # Ruwiki::Markup::Token for more information.) Store the Token for later
- # processing.
- # 2. Go back through the content, replacing each instance of \TOKEN_x with
- # the Token's defined restore value (which should be the same value as was
- # originally matched).
- # 3. Go through the content, replacing each instance of TOKEN_x with the
- # Token's defined replacement value.
- # 4. Go through the tokens, in reverse, and execute the post replacement
- # routine defined by the Token. (This may be necessary to collapse
- # consecutive HTML structures.)
- # 5. Return the parsed content and the collected metadata.
- #
- # == Tokens
- # Look at Ruwiki::Markup::Token describes how to create Token objects.
-class Ruwiki::Wiki
- def parse(content, project)
- content = clean(content)
- tokens = []
- project ||= @default_project
-
- Token.tokenlist.each do |token|
- content.gsub!(token.regexp) do |mm|
- match = Regexp.last_match
- tc = token.new(match, project, @backend, @script, @message, @title)
- tokens << tc
- if mm[0, 1] == '\\'
- "\\TOKEN_#{tokens.size - 1}"
- else
- "TOKEN_#{tokens.size - 1}"
- end
- end
- end
-
- replaced = []
- ss = true
- loop do
- break if replaced.size >= tokens.size
- break if ss.nil?
- ss = content.gsub!(/\\TOKEN_(\d+)/) { |mm|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].restore
- }
-
- ss = content.gsub!(/TOKEN_(\d+)/) { |mm|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].replace
- }
- end
-
- token_classes = tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
-
- content
- end
-
- attr_accessor :default_project
- attr_accessor :script
- attr_accessor :backend
- attr_accessor :message
-
- # Creates the markup class.
- def initialize(default_project, script, title)
- @default_project = default_project
- @script = script
- @title = title
- end
-
- # A regular expression that will prevent redirection.
- class << self
- attr_accessor :no_redirect
-
- def redirect(uri)
- if uri =~ %r{^https?://}
- if self.no_redirect and uri =~ self.no_redirect
- uri
- else
- "http://www.google.com/url?sa=D&amp;q=#{CGI.escape(uri)}"
- end
- else
- uri
- end
- end
- end
-
-private
- # Find HTML tags
- SIMPLE_TAG_RE = %r{<[^<>]+?>} # Ensure that only the tag is grabbed.
- HTML_TAG_RE = %r{\A< # Tag must be at start of match.
- (/)? # Closing tag?
- ([\w:]+) # Tag name
- (?:\s+ # Space
- ([^>]+) # Attributes
- (/)? # Singleton tag?
- )? # The above three are optional
- >}x
- ATTRIBUTES_RE = %r{([\w:]+)(=(?:\w+|"[^"]+?"|'[^']+?'))?}x
- STYLE_NOVD_RE = %r{(?:\s?(visibility|display):[^'";]+;?)}x
- ALLOWED_ATTR = %w(style title type lang dir class id cite datetime abbr) +
- %w(colspan rowspan compact start media)
- ALLOWED_HTML = %w(abbr acronym address b big blockquote br caption cite) +
- %w(code col colgroup dd del dfn dir div dl dt em h1 h2 h3) +
- %w(h4 h5 h6 hr i ins kbd li menu ol p pre q s samp small) +
- %w(span strike strong style sub sup table tbody td tfoot) +
- %w(th thead tr tt u ul var)
-
- # Clean the content of unsupported HTML and attributes. This includes
- # XML namespaced HTML. Sorry, but there's too much possibility for
- # abuse.
- def clean(content)
- content = content.gsub(SIMPLE_TAG_RE) do |tag|
- tagset = HTML_TAG_RE.match(tag)
-
- if tagset.nil?
- tag = Ruwiki.clean_entities(tag)
- else
- closer, name, attributes, single = tagset.captures
-
- if ALLOWED_HTML.include?(name.downcase)
- unless closer or attributes.nil?
- attributes = attributes.scan(ATTRIBUTES_RE).map do |set|
- if ALLOWED_ATTR.include?(set[0].downcase)
- if set[0] == 'style'
- set[1].gsub!(STYLE_NOVD_RE, '')
- end
- set.join
- else
- nil
- end
- end.compact.join(" ")
- tag = "<#{closer}#{name} #{attributes}#{single}>"
- else
- tag = "<#{closer}#{name}>"
- end
- else
- tag = Ruwiki.clean_entities(tag)
- end
- end
- tag.gsub(%r{((?:href|src)=["'])(#{Ruwiki::Wiki::RE_URI_SCHEME})}) { "#{$1}\\#{$2}" }
- end
- end
-end
-
-require 'ruwiki/wiki/tokens'
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens.rb
deleted file mode 100644
index 0ef744d..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
- # The base Token class. All Token classes must inherit from Token and
- # *must* implement the following methods:
- #
- # [self.regexp] The regular expression that the Token will be replacing.
- # [replace] The mechanism for replacing the Token with the desired
- # results.
- #
- # Token classes <i>should</i> implement the following method:
- # [self.rank] Default: <tt>5000</tt>. Affects the sort order.
- # Must return an integer.
- #
- # Token classes <i>may</i> implement the following methods:
- # [restore] Restores the token without replacement. Implements
- # the results of the escape character. NOTE: each
- # Token class is responsible for its own restore.
- # Tokens that are anchored to the beginning of a line
- # are the most likely to need to reimplement this.
- # [self.post_replace] Performs any necessary massaging of the data. See
- # the implementation of Ruwiki::Wiki::Lists for more
- # information.
-class Ruwiki::Wiki::Token
- @tokenlist = []
- @sorted = false
-
- class << self
- # Tokens should define rank if they must be first or last in
- # processing. Otherwise, they are sorted in the order defined.
- def rank
- 5000
- end
-
- # The Wiki parsing routine uses Token.tokenlist to determine the
- # tokens that are processed, and the order in which they are
- # processed. See Token.rank for more information.
- def tokenlist(sort = true)
- if sort and not @sorted
- @tokenlist.sort! { |aa, bb| aa.rank <=> bb.rank }
- @sorted = true
- end
- @tokenlist
- end
-
- def inherited(child_class) #:nodoc:
- # Make the child class post_replace a blank function because we
- # don't want to propogate the currently defined post_replace. The
- # current post_replace is specific to Token_Base only.
- class << child_class
- def self.post_replace(content)
- content
- end
- end
-
- @tokenlist << child_class
- @sorted = false
- end
-
- # The replacement regular expression.
- def regexp
- /TOKEN_(\d*)/o
- end
- end
-
- # All Token classes must match this header signature if they define
- # #initialize.
- #
- # [match] The MatchData object for this Token.
- # [project] The project being processed.
- # [backend] The backend for the wiki. This is used to determine if
- # the page or project exists. The object passed must
- # respond to #project_exists?(project) and
- # #page_exists?(page, project).
- # [script] The URI to the script.
- # [message] The message hash for localized messages.
- # [title] The title of the Wiki.
- def initialize(match, project, backend, script, message, title)
- @match = match
- @project = project
- @backend = backend
- @script = script
- @message = message
- @title = title
- end
-
- # The replacement method. Uses @match to replace the token with the
- # appropriate values.
- def replace
- "TOKEN_#{@match[1]}"
- end
-
- # Restores the token without replacement. By default, replaces
- # "dangerous" HTML characters.
- def restore
- Ruwiki.clean_entities(@match[0])
- end
-
- # The content may need massaging after processing.
- def self.post_replace(content)
- content
- end
-end
-
- # Load the tokens from the ruwiki/wiki/tokens directory.
-tokens_dir = 'ruwiki/wiki/tokens'
-
-$LOAD_PATH.each do |path|
- target = "#{path}/#{tokens_dir}"
- if File.exists?(target) and File.directory?(target)
- Dir::glob("#{target}/*.rb") do |token|
- begin
- require token
- rescue LoadError, TypeError
- nil
- end
- end
- end
- Ruwiki::Wiki::Token.tokenlist.each { |tk| tk.freeze }
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/00default.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/00default.rb
deleted file mode 100644
index 996e376..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/00default.rb
+++ /dev/null
@@ -1,209 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-# $debug = File.open("output.txt", "wb")
-
-class Ruwiki::Wiki
- # The Paragraph Token class changes blank lines to <p> tags. This class,
- # under the current implementation, should be *first* in the Token list
- # after Token.
- class Paragraph < Ruwiki::Wiki::Token
- # This Token is #rank 0, because it should be first in the Token list.
- def self.rank
- 0
- end
-
- # Matches blank lines. %r{^$}
- def self.regexp
- %r{(^$)}
- end
-
- def replace
- %Q(</p><p class="rwtk_Paragraph">)
- end
-
- # Ensures that <p> won't be surrounded by <br> tags.
- def self.post_replace(content)
- content.gsub!(%r{\A}, '<p class="rwtk_Paragraph">')
- content.gsub!(%r{\z}, '</p>')
- content.gsub!(%r{\n(</p>)}, '\1')
- content.gsub!(%r{(<p[^>]*>)\n}, '\1')
- content.gsub!(%r{(</p>)(<p[^>]*>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{<p[^>]*></p>}, '')
- content.gsub!(%r{^\n(<p[^>]*>)}, '\1')
- content
- end
- end
-
- # The Code Token class converts indented text to "unformatted" (<pre>)
- # text. This class should be *second* in the Token list.
- class Code < Ruwiki::Wiki::Token
- # This Token is #rank 1, because it should be second in the Token list.
- def self.rank
- 1
- end
-
- # Matches indented text. %r{^(\s+\S?.*)$}
- def self.regexp
-# %r{^(\s+.*)$}
- %r{^([ \t]+[^\n]*)\n?}
- end
-
- # Replaces the text to <pre>content</pre>.
- def replace
- content = Ruwiki.clean_entities(@match.captures[0])
-
- %Q{</p><pre class="rwtk_Code">#{content}</pre>\n}
- end
-
- # Converts cases of %r{</pre>(\n|<br ?/?>)<pre>} to \1.
- def self.post_replace(content)
- content.gsub!(%r{</pre>((\n)*</p>(\n)*)?<pre[^>]*>}, "\n")
- content.gsub!(%r{</pre>(\n|<br ?/?>)?<pre[^>]*>}, '\1')
- content.gsub!(%r{<p[^>]*>(<pre[^>]*>)}, '\1')
- content.gsub!(%r{</pre></p>}, '</pre>')
-# content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content
- end
- end
-
- RE_URI_SCHEME = %r{[-a-z0-9+.]{3,}?:}
- RE_URI_PATH = %r{[^\s<>\]]}
- RE_URI_TEXT = %r{[^\]]*}
-
- class << self
- def increment_numbered_links
- @numbered_links_count ||= 0
- @numbered_links_count += 1
- end
-
- def reset_numbered_links
- @numbered_links_count = 0
- end
- end
-
- # Converts URLs in the form of [url] to numbered links.
- class NumberedLinks < Ruwiki::Wiki::Token
-
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\]}
- end
-
- def replace
- extlink = @match.captures[0]
-
- name = "[#{Ruwiki::Wiki.increment_numbered_links}]"
-
- %Q{<a class="rwtk_NumberedLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{name}</a>}
- end
- end
-
- class Image < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- RE_IMAGE_OPTIONS=%r{([^=]+)=("[^"]+"|[^ ]+)}
-
- def self.regexp
- %r{\[image\s*:\s*(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)(\s+[^\]]+)?\]}
- end
-
- def replace
- options = { 'src' => %Q("#{@match.captures[0]}") }
- groups = @match.captures[1]
- unless groups.nil?
- groups.scan(RE_IMAGE_OPTIONS).each { |gg| options[gg[0].strip] = gg[1].strip }
- end
-
- unless options['numbered'].nil? or options['numbered'] == "false"
- options['title'] = %Q("[#{Ruwiki::Wiki.increment_numbered_links}]")
- options.delete('numbered')
- end
-
- options['title'] ||= options['alt']
- options['title'] ||= options['src']
- options['alt'] ||= options['title']
-
- ss = ""
- options.keys.sort.map { |kk| ss << %Q( #{kk}=#{options[kk]}) }
-
- %Q{<img class="rwtk_Image"#{ss} />}
- end
- end
-
- # Converts URLs in the form of [url name] to named links.
- class NamedLinks < Ruwiki::Wiki::Token
- def self.rank
- 3
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\s+(#{RE_URI_TEXT})\]}
- end
-
- def replace
- extlink = @match.captures[0]
- name = @match.captures[1]
-
- %Q{<a class="rwtk_NamedLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{name}</a>}
- end
- end
-
- # Converts URLs to links where the "name" of the link is the URL itself.
- class ExternalLinks < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{\b(#{RE_URI_SCHEME}#{RE_URI_PATH}+)}
- end
-
- def restore
- @match[0]
- end
-
- def replace
- extlink = @match.captures[0]
-
- %Q{<a class="rwtk_ExternalLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{extlink}</a>}
- end
- end
-
- # Creates a horizontal rule.
- class HRule < Ruwiki::Wiki::Token
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def replace
- %Q(<hr class="rwtk_HRule" />)
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(<p[^>]*>)*(<hr[^ />]* ?/?>)(</p>)*}, '\1')
- content.gsub!(%r{\n<hr />}, "</p>\n<hr />")
- content.gsub!(%r{<hr ?/?>\n<br ?/?>}, "<hr />")
- content.gsub!(%r{(\n|<br ?/?>)?<hr>(\n|<br ?/?>)?}, "<hr />")
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/01wikilinks.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/01wikilinks.rb
deleted file mode 100644
index 442a201..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/01wikilinks.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # This provides the basic WikiWord match. This supports WikiWord,
- # CPlusPlus, ThisIsALink, and C_Plus_Plus.
- RE_WIKI_WORDS = %r{[[:upper:]][\w_]*(?:[[:lower:]]+[[:upper:]_]|[[:upper:]_]+[[:lower:]])[\w_]*}
- # This provides wikipedia format matches, e.g., [[wikipedia links]]. The
- # only restriction on words in this format is that they must NOT begin
- # with an underscore ('_').
- RE_WIKIPEDIA_WORDS = %r{\[\[([^_].*?)\]\]}
- # This provides the basic Wiki Project match.
- RE_PROJECT_WORD = %r{[[:upper:]][[:lower:]]+}
-
- # This provides the Wiki view link format:
- VIEW_LINK = %Q[<a class="rwtk_WikiLink" href="%s">%s</a>]
- EDIT_LINK = %Q[<span class="rwtk_EditWikiLink">%s</span><a class="rwtk_WikiLink" href="%s">?</a>]
-
- # Creates a crosslink for a Project::WikiPage.
- class ProjectCrossLink < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::(#{RE_WIKI_WORDS})}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic.gsub(/_/, ' ')}"]
- else
- EDIT_LINK % ["#{project}::#{topic.gsub(/_/, ' ')}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a crosslink for a Project::WikiPage using a Wikipedia link
- # format.
- class ProjectCrossLinkWikipedia < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::#{RE_WIKIPEDIA_WORDS}}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic}"]
- else
- EDIT_LINK % ["#{project}::#{topic}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to the project index from ::Project.
- class ProjectIndex < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{(\B|\\)::(#{RE_PROJECT_WORD})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- project = @match.captures[1]
-
- if @backend.page_exists?('ProjectIndex', project)
- VIEW_LINK % ["#{@script}/#{project}/ProjectIndex", project]
- else
- if @backend.project_exists?(project)
- EDIT_LINK % [project, "#{@script}/#{project}/ProjectIndex/_edit"]
- else
- EDIT_LINK % [project, "#{@script}/#{project}/_create"]
- end
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project.
- class WikiLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\b|\\)(#{RE_WIKI_WORDS})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic.gsub(/_/, ' ')]
- else
- EDIT_LINK % [topic.gsub(/_/, ' '), "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project using a Wikipedia
- # link format.
- class WikipediaLinks < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(\B|\\)#{RE_WIKIPEDIA_WORDS}\B}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- ALT_TEXT = %r{(.+)\|(.+)}o
-
- def replace
- captures = @match.captures
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- at = ALT_TEXT.match(topic)
-
- if not at.nil?
- topic = at.captures[1]
- link = CGI.escape(at.captures[0])
- end
-
- if @backend.page_exists?(link, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic]
- else
- EDIT_LINK % [topic, "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/02actions.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/02actions.rb
deleted file mode 100644
index 8ad0950..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/02actions.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # Produces a list of topics.
- class TopicList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%topics\((#{Ruwiki::Wiki::RE_PROJECT_WORD})?\)$}
- end
-
- def replace
- project = @match.captures[0] || @project
-
- if @backend.project_exists?(project)
- topic_list = @backend.list_topics(project)
- else
- topic_list = []
- end
-
- if topic_list.empty?
- ss = @message[:no_topics] % [project]
- else
- ss = %Q(<h4 class="rwtk_Headings">#{@message[:topics_for_project] % [project]}</h4>\n<ul class="rwtk_Lists">\n)
- topic_list.each do |tt|
- ss << %Q(<li class="rwtk_Lists">)
- ss << VIEW_LINK % ["#{@script}/#{project}/#{tt}", "#{CGI::unescape(tt.gsub(/_/, ' '))}"]
- ss << "</li>\n"
- end
- ss << "</ul>\n"
- end
-
- ss
- end
- end
-
- class ProjectList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%projects\(\)$}
- end
-
- def replace
- proj_list = @backend.list_projects
-
- ss = %Q(<h4 class="rwtk_Headings">#{@message[:wiki_projects] % [@title]}</h4>\n<ul class="rwtk_Lists">\n)
- proj_list.each do |pp|
- ss << %Q(<li class="rwtk_Lists">)
- ss << VIEW_LINK % ["#{@script}/#{pp}/ProjectIndex", pp]
- ss << %Q! <a href='#{@script}/#{pp}/_topics' class='rw_minilink'>#{@message[:project_topics_link]}</a>!
- ss << "</li>\n"
- end
- ss << "</ul>\n"
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/abbreviations.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/abbreviations.rb
deleted file mode 100644
index b928085..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/abbreviations.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Converts abbreviations.
- class Abbreviations < Ruwiki::Wiki::Token
- ABBREVIATIONS = {
- "matz" => "Yukihiro Matsumoto",
- }
-
- def self.regexp
- %r!@\{([^\}]*)\}!
- end
-
- def replace
- kk = @match.captures[0]
- if kk.nil? or kk.empty?
- data = %Q(<dl class="rwtk_Abbreviations">)
- ABBREVIATIONS.each do |kk, vv|
- data << %Q(<dt class="rwtk_Abbreviations">#{kk}</dt><dd class="rwtk_Abbreviations">#{vv}</dd>)
- end
- data << %Q(</dl>)
- else
- if ABBREVIATIONS.has_key?(kk)
- data = ABBREVIATIONS[kk]
- else
- data = @match[0]
- end
- end
- data
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/calendar.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/calendar.rb
deleted file mode 100644
index c78dc45..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/calendar.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces a mini-calendar with dates as WikiWords.
- class Calendar < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?%calendar\((?:(today)|(\d+),\s*(\d+))(?:,\s*(#{RE_PROJECT_WORD}))?\)}
- end
-
- def self.make(year, month)
- result = []
- tt = Time.local(year, month, 1)
- rr = Array.new(tt.wday, nil)
- rr << 1
-
- 2.upto(31) do |ii|
- break if Time.local(year, month, ii).month != month
- rr << ii
- end
-
- rr += Array.new((- rr.size) % 7, nil)
-
- 0.step(rr.size - 1, 7) do |ii|
- result << rr[ii, 7]
- end
- result
- end
-
- def make_month_link(project, year, month, state = nil)
- ym = "%04d%02d" % [year, month]
- case state
- when :prev
- title = "&laquo; #{year}.#{month}"
- when :next
- title = "#{year}.#{month} &raquo;"
- else
- title = "#{project}::#{year}.#{month}"
- end
- url = "#{@script}/#{project}/#{ym}"
-
- if @backend.page_exists?(ym, project)
- VIEW_LINK % [url, title]
- else
- EDIT_LINK % [title, "#{url}/_edit"]
- end
- end
-
- def replace
- today = @match.captures[0]
- project = @match.captures[3] || @project
- now = Time.now
-
- if today.nil?
- year = @match.captures[1].to_i
- month = @match.captures[2].to_i
- else
- year = now.year
- month = now.month
- end
-
- if (year == now.year) and (month == now.month)
- show_today = now.day
- else
- show_today = nil
- end
-
- result = <<-"CALENDAR_HEAD"
-</p>
-<div class="rwtk_Calendar">
-<table class="rwtk_Calendar" summary="calendar for ::#{project}: #{year}.#{month}">
-<thead>
- CALENDAR_HEAD
-
- result << %Q{ <tr>\n<th colspan="7" class="rwtk_Calendar_current_month">}
- result << make_month_link(project, year, month)
- result << %Q{</th>\n </tr>\n <tr>\n<th colspan="2" class="rwtk_Calendar_prev_month">}
- result << make_month_link(project, year, month - 1, :prev)
- result << %Q{</th>\n<th colspan="3"></th>\n<th colspan="2" class="rwtk_Calendar_next_month">}
- result << make_month_link(project, year, month + 1, :next)
- result << "</th>\n"
-
- result << <<-"CALENDAR_HEAD2"
- </tr>
- <tr>
- <th class="rwtk_Calendar_weekend">Su</th>
- <th class="rwtk_Calendar_weekday">Mo</th>
- <th class="rwtk_Calendar_weekday">Tu</th>
- <th class="rwtk_Calendar_weekday">We</th>
- <th class="rwtk_Calendar_weekday">Th</th>
- <th class="rwtk_Calendar_weekday">Fr</th>
- <th class="rwtk_Calendar_weekend">Sa</th>
- </tr>
-</thead>
-<tbody>
- CALENDAR_HEAD2
-
- Calendar.make(year, month).each do |week|
- result << " <tr>\n"
- week.each do |day|
- if day.nil?
- result << %Q{ <td class="rwtk_Calendar_day"></td>\n}
- else
- date = "%04d%02d%02d" % [year, month, day]
- # Add the ability to create pages based on date here.
- if show_today == day
- result << %Q{ <td class="rwtk_Calendar_today">}
- else
- result << %Q{ <td class="rwtk_Calendar_day">}
- end
- if @backend.page_exists?(date, project)
- result << VIEW_LINK % ["#{@script}/#{project}/#{date}", day]
- else
- result << EDIT_LINK % [day, "#{@script}/#{project}/#{date}/_edit"]
- end
- result << %Q{</td>\n}
- end
- end
- result << " </tr>\n"
- end
-
- result << %Q(</tbody>\n</table>\n</div>\n<p class="rwtk_Paragraph">)
- result
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*>(\s*</?div(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?table(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?t(?:head|body|r)(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*<t[hd].+?</t[hd]>\s*)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/headings.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/headings.rb
deleted file mode 100644
index cfc3001..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/headings.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts headings.
- class Headings < Ruwiki::Wiki::Token
-# def self.rank
-# 5
-# end
-
- def self.regexp
- %r{^\\?(=+)\s+(.*)}
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def replace
- level = @match.captures[0].count("=")
- content = @match.captures[1]
- level = 6 if level > 6
- %Q(<h#{level} class="rwtk_Headings">#{content}</h#{level}>)
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(</h\d>)\n}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{(</h\d>)</p>\n<p>}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{<p[^>]*>(<h\d[^>]*>)}, '\1')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/lists.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/lists.rb
deleted file mode 100644
index 1615c2c..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/lists.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Produces Lists
- class Lists < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?([*#]+)\s+(.*)$}
- end
-
- def replace
- indent = @match.captures[0].scan(/./).map { |ee| ee == "*" ? 'ul' : 'ol' }
- content = @match.captures[1]
-
- pre = ''
- post = ''
- indent.each { |elem| pre << %Q(<#{elem} class="rwtk_Lists">) }
- indent.reverse_each { |elem| post << %Q(</#{elem}>) }
- %Q(#{pre}<li class="rwtk_Lists">#{content}</li>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- RE_NESTED_LISTS = %r{</[uo]l>\s*<[uo]l[^>]*>}
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*><([uo]l[^>]*)>}, '<\1>')
- content.gsub!(%r{</([uo]l)></p>}, '</\1>')
- content.gsub!(RE_NESTED_LISTS, '') while content =~ RE_NESTED_LISTS
- content
- end
- end
-
- # Produces block quotes.
- class Blockquotes < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((:+)|(>+))(\s+.*)$}
- end
-
- def replace
- content = @match.captures[3]
-
- if @match.captures[2].nil?
- char = ':'
- cite = ''
- else
- char = '>'
- cite = ' type="cite"'
- end
- indent = @match.captures[0].count(char)
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<blockquote#{cite} class="rwtk_Blockquotes">)
- post << %Q(</blockquote>)
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1].gsub(/^>/, '&gt;')
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</blockquote>(\n|<br ?/?>)?<blockquote[^>]*>}, '')
- content.gsub!(%r{(</?blockquote[^>]*>\n?)\s*}, '\1')
- content.gsub!(%r{</blockquote>(<blockquote[^>]*>)+}, '\1')
- content
- end
- end
-
- # Produces definition lists. Does not completely work correctly.
- class Definitions < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(;+)\s+(.+?)\s+:\s+(.*)}
- end
-
- def replace
- definition = @match.captures[2]
- term = @match.captures[1]
- indent = @match.captures[0].count(';')
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<dl class="rwtk_Definitions">)
- post << %Q(</dl>)
- end
- %Q(#{pre}<dt class="rwtk_Definitions">#{term}</dt><dd class="rwtk_Definitions">#{definition}</dd>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</dl>(\n|<br ?/?>)?<dl[^>]*>}, '')
- content.gsub!(%r{</dl>(<dl[^>]*>)+}, '\1')
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/rubylists.rb b/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/rubylists.rb
deleted file mode 100644
index b765ad1..0000000
--- a/ruwiki/tags/release-0.9.2/lib/ruwiki/wiki/tokens/rubylists.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Convert ruby-talk mailing list references (e.g., [ruby-talk:12345])
- # into named links.
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
-# %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/#{lm}">#{@match[0]}</a>)
- end
- end
-
- # Convert ruby-core/ext/dev/list/math mailing list references (e.g.,
- # [ruby-core:12345]) into named links.
- class OtherRubyLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-(list|doc|core|dev|ext|math):(\d+)\]}
- end
-
- def replace
- ln, lm = @match.captures[0..1]
- %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-#{ln}/#{lm}">#{@match[0]}</a>)
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/ruwiki b/ruwiki/tags/release-0.9.2/ruwiki
deleted file mode 100644
index 251a140..0000000
--- a/ruwiki/tags/release-0.9.2/ruwiki
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'ruwiki/utils'
-require 'ruwiki/utils/manager'
-
- # RPA Maintainers: Change this to the appropriate location on installation.
- # This is the right place for RubyGems, basically.
-ss = "#{File.dirname(File.expand_path(__FILE__))}/.."
-
-Ruwiki::Utils::Manager.shared = ss
-
-exit Ruwiki::Utils::Manager.run(ARGV)
diff --git a/ruwiki/tags/release-0.9.2/ruwiki.cgi b/ruwiki/tags/release-0.9.2/ruwiki.cgi
deleted file mode 100644
index 2e1ebee..0000000
--- a/ruwiki/tags/release-0.9.2/ruwiki.cgi
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
-config_file = File.join(Dir.pwd, Ruwiki::Config::CONFIG_NAME)
-
-if File.exists?(config_file)
- wiki.load_config(config_file)
- config = Ruwiki::Config.read(config_file)
- if config.webmaster.nil? or config.webmaster.empty?
- config.webmaster = "webmaster@domain.tld"
- end
-else
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
- wiki.config.webmaster = "webmaster@domain.tld"
-
-# wiki.config.debug = false
-# wiki.config.title = "Ruwiki"
-# wiki.config.default_page = "ProjectIndex"
-# wiki.config.default_project = "Default"
- # This next defaults to 'flatfiles'. Conversion of the default data will
- # be necessary to use other formats.
-# wiki.config.storage_type = 'flatfiles'
-# wiki.config.storage_options[wiki.config.storage_type][:data_path] = "./data/"
- wiki.config.storage_options[wiki.config.storage_type][:extension] = "ruwiki"
-# wiki.config.template_path = "./templates/"
-# wiki.config.template_set = "default"
-# wiki.config.css = "ruwiki.css"
-# wiki.config.time_format = "%H:%M:%S"
-# wiki.config.date_format = "%Y.%m.%d"
-# wiki.config.datetime_format = "%Y.%m.%d %H:%M:%S"
-end
-
-wiki.config!
-wiki.run
diff --git a/ruwiki/tags/release-0.9.2/ruwiki.conf b/ruwiki/tags/release-0.9.2/ruwiki.conf
deleted file mode 100644
index 72e4cc6..0000000
--- a/ruwiki/tags/release-0.9.2/ruwiki.conf
+++ /dev/null
@@ -1,22 +0,0 @@
-ruwiki-config!auth-options:
-ruwiki-config!css: ruwiki.css
-ruwiki-config!date-format: %Y.%m.%d
-ruwiki-config!datetime-format: %Y.%m.%d %H:%M:%S
-ruwiki-config!debug: true
-ruwiki-config!default-page: ProjectIndex
-ruwiki-config!default-project: Default
-ruwiki-config!language: en
-ruwiki-config!storage-options: flatfiles!data-path: ./data
- flatfiles!extension: ruwiki
-ruwiki-config!storage-type: flatfiles
-ruwiki-config!template-path: ./templates/
-ruwiki-config!template-set: default
-ruwiki-config!time-format: %H:%M:%S
-ruwiki-config!title: Ruwiki
-ruwiki-config!webmaster: webmaster@domain.tld
-webrick-config!addresses:
-webrick-config!do-log: true
-webrick-config!log-dest: <STDERR>
-webrick-config!mount: /
-webrick-config!port: 8808
-webrick-config!threads: 1
diff --git a/ruwiki/tags/release-0.9.2/ruwiki_convert b/ruwiki/tags/release-0.9.2/ruwiki_convert
deleted file mode 100644
index c290041..0000000
--- a/ruwiki/tags/release-0.9.2/ruwiki_convert
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
- # Load all of the known backends.
-require 'ruwiki/utils'
-require 'ruwiki/backend/flatfiles'
-require 'ruwiki/utils/converter'
-
-exit Ruwiki::Utils::Converter.run(ARGV)
diff --git a/ruwiki/tags/release-0.9.2/ruwiki_service.rb b/ruwiki/tags/release-0.9.2/ruwiki_service.rb
deleted file mode 100644
index bd66d49..0000000
--- a/ruwiki/tags/release-0.9.2/ruwiki_service.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'win32/service'
-require 'ruwiki/utils/servletrunner'
-
-class Ruwiki::Utils::Daemon < Win32::Daemon
- LOCATION = File.dirname(File.expand_path(__FILE__))
-
- def initialize
- @logfile = File.open(File.join(LOCATION, "ruwiki_service.log"), "ab+")
- rescue Exception => e
- File.open(File.join(LOCATION, "temp.log"), "a+") do |f|
- f.puts "Logfile error: #{e}"
- f.puts "Backtrace:\n#{e.backtrace.join(', ')}"
- end
- exit
- end
-
- def service_main
- ARGV.replace(["--config", File.join(LOCATION, Ruwiki::Config::CONFIG_NAME),
- "--logfile", File.join(LOCATION, "ruwiki_servlet.log")])
- Ruwiki::Utils::ServletRunner.run(ARGV, @logfile, @logfile, @logfile)
- rescue Exception => e
- file = LOCATION + '/temp.log'
- File.open(file, "a+") do |f|
- f.puts "Error: #{e}"
- f.puts "Backtrace: #{e.backtrace.join(', ')}"
- end
- exit
- end
-end
-
-daemon = Ruwiki::Utils::Daemon.new
-daemon.mainloop
diff --git a/ruwiki/tags/release-0.9.2/ruwiki_servlet b/ruwiki/tags/release-0.9.2/ruwiki_servlet
deleted file mode 100644
index 224ab3f..0000000
--- a/ruwiki/tags/release-0.9.2/ruwiki_servlet
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'ruwiki/utils/servletrunner'
-
-exit Ruwiki::Utils::ServletRunner.run(ARGV)
diff --git a/ruwiki/tags/release-0.9.2/templates/default/body.tmpl b/ruwiki/tags/release-0.9.2/templates/default/body.tmpl
deleted file mode 100644
index baaa259..0000000
--- a/ruwiki/tags/release-0.9.2/templates/default/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow,noarchive" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.9.2/templates/default/content.tmpl b/ruwiki/tags/release-0.9.2/templates/default/content.tmpl
deleted file mode 100644
index 7f662b2..0000000
--- a/ruwiki/tags/release-0.9.2/templates/default/content.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.2/templates/default/controls.tmpl b/ruwiki/tags/release-0.9.2/templates/default/controls.tmpl
deleted file mode 100644
index 8f855c2..0000000
--- a/ruwiki/tags/release-0.9.2/templates/default/controls.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_header">
- <form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- <!-- Right-hand tabs must go in reverse order! -->
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.9.2/templates/default/edit.tmpl b/ruwiki/tags/release-0.9.2/templates/default/edit.tmpl
deleted file mode 100644
index 9e5dbb5..0000000
--- a/ruwiki/tags/release-0.9.2/templates/default/edit.tmpl
+++ /dev/null
@@ -1,27 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_navbar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_navbar_righttab" id="rw_editing_tab"><strong><em>#label_editing#</em> #%page_version%</strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <div class="rw_content">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.2/templates/default/error.tmpl b/ruwiki/tags/release-0.9.2/templates/default/error.tmpl
deleted file mode 100644
index a3887b2..0000000
--- a/ruwiki/tags/release-0.9.2/templates/default/error.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.2/templates/default/footer.tmpl b/ruwiki/tags/release-0.9.2/templates/default/footer.tmpl
deleted file mode 100644
index 48146ea..0000000
--- a/ruwiki/tags/release-0.9.2/templates/default/footer.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_footer">
-<!--<form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- {!-- Right-hand tabs must go in reverse order! --}
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>-->
-</div>
diff --git a/ruwiki/tags/release-0.9.2/templates/default/ruwiki.css b/ruwiki/tags/release-0.9.2/templates/default/ruwiki.css
deleted file mode 100644
index cfe7bf6..0000000
--- a/ruwiki/tags/release-0.9.2/templates/default/ruwiki.css
+++ /dev/null
@@ -1,297 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_footer
-{
-/*position: absolute;
- width: 100%;
- bottom: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;*/
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_footer { position: fixed; }
-
-body > div#rw_footer > .rw_navbar { position: fixed; bottom: 0; }
-body > div#rw_footer > .rw_navbar > div { position: relative; top: -2em; }
-
-body
-{
- margin: 0.5em;
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_navbar
-{
- width: 100%;
- margin: 0;
- padding: 0.1em;
- font-size: 0.7em;
- border: 1px solid black;
- color: white;
- background-color: #27C;
- height: 0.5em;
- z-index: 2;
-}
-
-.rw_navbar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_navbar a:visited
-{
- color: #2E7;
- font-weight: normal;
- border-bottom: 1px dashed #2E7;
-}
-
-.rw_navbar a:hover
-{
- text-decoration: none;
-}
-
-.rw_navbar_tab
-{
- float: left;
- background-color: #27C;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_navbar_tab:hover
-{
- background-color: #49E;
-}
-
-.rw_navbar_righttab
-{
- float: right;
- padding-left: 0.8em;
- padding-top: 0.3em;
- padding-right: 0.8em;
- border: 1px solid #059;
- background-color: #27C;
- margin: 0 0.3em;
- height: 2em;
-}
-
-.rw_navbar_righttab:hover
-{
- background-color: #49E;
-}
-
-.rw_content
-{
- clear: both;
- margin-top: 2em;
- margin-left: 3em;
- margin-right: 3em;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- font-weight: bolder;
- clear: both;
- font-size: 90%;
- padding: 1em;
- margin-top: 3em;
- margin-left: 5em;
- margin-right: 5em;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #27C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #27C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab { background-color: #C72; }
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
-
diff --git a/ruwiki/tags/release-0.9.2/templates/default/save.tmpl b/ruwiki/tags/release-0.9.2/templates/default/save.tmpl
deleted file mode 100644
index 04069b1..0000000
--- a/ruwiki/tags/release-0.9.2/templates/default/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.2/templates/sidebar/body.tmpl b/ruwiki/tags/release-0.9.2/templates/sidebar/body.tmpl
deleted file mode 100644
index 2f3c10f..0000000
--- a/ruwiki/tags/release-0.9.2/templates/sidebar/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.9.2/templates/sidebar/content.tmpl b/ruwiki/tags/release-0.9.2/templates/sidebar/content.tmpl
deleted file mode 100644
index fa2d67e..0000000
--- a/ruwiki/tags/release-0.9.2/templates/sidebar/content.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.9.2/templates/sidebar/controls.tmpl b/ruwiki/tags/release-0.9.2/templates/sidebar/controls.tmpl
deleted file mode 100644
index 6e12b22..0000000
--- a/ruwiki/tags/release-0.9.2/templates/sidebar/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_titlebar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_titlebar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.2/templates/sidebar/edit.tmpl b/ruwiki/tags/release-0.9.2/templates/sidebar/edit.tmpl
deleted file mode 100644
index eb04395..0000000
--- a/ruwiki/tags/release-0.9.2/templates/sidebar/edit.tmpl
+++ /dev/null
@@ -1,27 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_titlebar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_titlebar_tab" id="rw_editing_tab"><strong><em>#label_editing#</em> #%page_version%</strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <div class="rw_content_edit">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.2/templates/sidebar/error.tmpl b/ruwiki/tags/release-0.9.2/templates/sidebar/error.tmpl
deleted file mode 100644
index 5a2882e..0000000
--- a/ruwiki/tags/release-0.9.2/templates/sidebar/error.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.2/templates/sidebar/footer.tmpl b/ruwiki/tags/release-0.9.2/templates/sidebar/footer.tmpl
deleted file mode 100644
index 6dfc390..0000000
--- a/ruwiki/tags/release-0.9.2/templates/sidebar/footer.tmpl
+++ /dev/null
@@ -1,22 +0,0 @@
-<div class="rw_footer">
- <form class="rw_footer_tab" action="_search">
- <div>
- <input class="rw_search_box" type="text" name="q" size="10" />
- </div>
- <div>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- </div>
- </form>
- <div class="rw_footer_tab">
- <dl>
- <dt>%page_project%::</dt>
- <dd><a href="%cgi_url%/%page_project%/_topics">#label_topics#</a><br />
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </dd>
- </div>
- <div class="rw_footer_tab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.9.2/templates/sidebar/ruwiki.css b/ruwiki/tags/release-0.9.2/templates/sidebar/ruwiki.css
deleted file mode 100644
index 0f2b4cc..0000000
--- a/ruwiki/tags/release-0.9.2/templates/sidebar/ruwiki.css
+++ /dev/null
@@ -1,347 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
-.rw_titlebar
-{
- margin: 0 auto;
- height: 0.5em;
-}
-
- /* Normal styling from here on out. */
-body
-{
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_titlebar
-{
- font-size: 0.7em;
- border: 1px solid #059;
- color: white;
- background-color: #5C9;
- height: 0.5em;
- width: 100%;
-}
-
-.rw_titlebar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_titlebar a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_titlebar a:hover
-{
- text-decoration: none;
-}
-
-.rw_titlebar_tab
-{
- float: left;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_titlebar_tab:hover
-{
- background-color: #4E9;
-}
-
-div.rw_footer
-{
- position: fixed;
- left: 72%;
- width: 20%;
- height: 100%;
- padding: 0.2em;
- padding-top: 0.5em;
-//background-color: #95C;
- font-size: 0.9em;
-}
-
-.rw_footer
-{
-}
-
-.rw_footer a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_footer a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_footer a:hover
-{
- text-decoration: none;
-}
-
-.rw_footer_tab
-{
- color: yellow;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0.3em;
- min-height: 2em;
- clear: both;
-}
-
-.rw_footer_tab div
-{
- text-align: right;
-}
-
-div#rw_content
-{
- padding: 50px 0 0 0;
- margin-left: 0;
- voice-family: "\"}\""; /* fake out IE5/Win */
- voice-family: inherit;
- margin-left: 16px;
-}
-
-body > div#rw_content
-{
- margin-left: 0;
-}
-
-.rw_content
-{
- padding-top: 0;
- margin-left: 3em;
- width: 65%;
- float: left;
-}
-
-.rw_content_edit
-{
- width: 90%;
- margin: 0 auto;
- padding: 2em;
- padding-top: 0;
- float: left;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- float: left;
- font-weight: bolder;
- font-size: 90%;
- padding: 0.5em;
- width: 65%;
- margin-top: 3em;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #59C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #59C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #59C;
- margin: 0.1em;
-}
-
-.rw_search_box
-{
- border: 1px dotted #59C;
- width: 100%;
- margin: 0.1em;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab
-{
- background-color: #C72;
- text-align: right;
- margin-right: 2em;
- float: right;
-}
-
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.9.2/templates/sidebar/save.tmpl b/ruwiki/tags/release-0.9.2/templates/sidebar/save.tmpl
deleted file mode 100644
index 7c4c31c..0000000
--- a/ruwiki/tags/release-0.9.2/templates/sidebar/save.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-<div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.9.2/templates/simple/body.tmpl b/ruwiki/tags/release-0.9.2/templates/simple/body.tmpl
deleted file mode 100644
index b3281d0..0000000
--- a/ruwiki/tags/release-0.9.2/templates/simple/body.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.9.2/templates/simple/content.tmpl b/ruwiki/tags/release-0.9.2/templates/simple/content.tmpl
deleted file mode 100644
index 2da5e62..0000000
--- a/ruwiki/tags/release-0.9.2/templates/simple/content.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content -->
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.2/templates/simple/controls.tmpl b/ruwiki/tags/release-0.9.2/templates/simple/controls.tmpl
deleted file mode 100644
index 29cdf3a..0000000
--- a/ruwiki/tags/release-0.9.2/templates/simple/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <a href="%cgi_url%/%page_project%/">%page_project%</a>
- &raquo;
- %page_topic%
- [?editable|<a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">[#label_edit#]</a>?]
-</div>
diff --git a/ruwiki/tags/release-0.9.2/templates/simple/edit.tmpl b/ruwiki/tags/release-0.9.2/templates/simple/edit.tmpl
deleted file mode 100644
index b42759d..0000000
--- a/ruwiki/tags/release-0.9.2/templates/simple/edit.tmpl
+++ /dev/null
@@ -1,25 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <strong>%page_topic%</strong>
- &raquo;
- <strong>%page_project%</strong>
- [<strong><em>#label_editing#</em> #%page_version%</strong>]
-</div>
-
-<div class="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
-</div>
diff --git a/ruwiki/tags/release-0.9.2/templates/simple/error.tmpl b/ruwiki/tags/release-0.9.2/templates/simple/error.tmpl
deleted file mode 100644
index ac898ea..0000000
--- a/ruwiki/tags/release-0.9.2/templates/simple/error.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- |
- <strong><em>%name%</em></strong>
-</div>
-<div class="rw_content">
-<h1>%name%</h1>
-<p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
-<p>%backtrace%</p>
-</div>
diff --git a/ruwiki/tags/release-0.9.2/templates/simple/footer.tmpl b/ruwiki/tags/release-0.9.2/templates/simple/footer.tmpl
deleted file mode 100644
index 2e7893b..0000000
--- a/ruwiki/tags/release-0.9.2/templates/simple/footer.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<form class="rw_navbar" action="_search">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- |
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>,
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- |
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
-</form>
diff --git a/ruwiki/tags/release-0.9.2/templates/simple/ruwiki.css b/ruwiki/tags/release-0.9.2/templates/simple/ruwiki.css
deleted file mode 100644
index 57d1a09..0000000
--- a/ruwiki/tags/release-0.9.2/templates/simple/ruwiki.css
+++ /dev/null
@@ -1,192 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #fafafa;
-}
-
-.rw_navbar
-{
- font-weight: bold;
- font-size: 1.1em;
- padding: 0.3em;
-}
-
-.rw_navbar a
-{
- border-bottom: 1px dashed black;
- font-weight: bold;
-}
-.rw_navbar a:visited
-{
- color: maroon;
- border-bottom: 1px dashed maroon;
-}
-.rw_navbar a:hover { background-color: #afafaf; }
-
-.rw_content
-{
- background-color: white;
- border: 1px dashed grey;
- padding: 0.5em;
- margin-left: 1em;
- margin-right: 1em;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- font-weight: bolder;
- font-size: 90%;
- padding: 0.5em;
- margin-left: 3em;
- margin-right: 3em;
-}
-
-
-.rw_edit_content
-{
- border: 1px solid black;
- padding: 0.3em;
- width: 95%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px solid black;
- padding: 0.3em;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px solid black;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form { }
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px solid black;
-}
-
-.rw_pagelink { text-decoration: none; }
-.rw_projectxlink { }
-.rw_projectindex { }
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title { }
-
-.rw_edit_format div
-{
-}
-
-.rw_search_button
-{
- border: 1px solid black;
-}
-
-.rw_search_box
-{
- border: 1px solid black;
-}
-
-.rw_search_box:hover { }
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_saved_page_announcement { }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { border: none; }
-.rwtk_NumberedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_NamedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_ExternalLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_RubyTalkLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_OtherRubyLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dashed grey; }
-.rwtk_WikiLink { text-decoration: none; }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.9.2/templates/simple/save.tmpl b/ruwiki/tags/release-0.9.2/templates/simple/save.tmpl
deleted file mode 100644
index 51de9f4..0000000
--- a/ruwiki/tags/release-0.9.2/templates/simple/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.2/tests/harness.rb b/ruwiki/tags/release-0.9.2/tests/harness.rb
deleted file mode 100644
index 80e7eeb..0000000
--- a/ruwiki/tags/release-0.9.2/tests/harness.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-ENV["REQUEST_METHOD"] = "HEAD"
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_type = 'flatfiles'
-
-dp = nil
-dp = "../data" if File.exists?("../data")
-dp = "./data" if File.exists?("./data")
-raise "Cannot find either ./data or ../data for tests. Aborting." if dp.nil?
-
-$wiki.config.storage_options['flatfiles']['data-path'] = dp
-$wiki.config.storage_options['flatfiles']['format'] = "exportable"
-$wiki.config.storage_options['flatfiles']['extension'] = "ruwiki"
-
-tp = nil
-tp = "../templates" if File.exists?("../templates")
-tp = "./templates" if File.exists?("./templates")
-raise "Cannot find either ./templates or ../templates for tests. Aborting." if tp.nil?
-
-$wiki.config.template_path = tp
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.9.2/tests/tc_backend_flatfile.rb b/ruwiki/tags/release-0.9.2/tests/tc_backend_flatfile.rb
deleted file mode 100644
index c3c815c..0000000
--- a/ruwiki/tags/release-0.9.2/tests/tc_backend_flatfile.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-require 'fileutils'
-
-class TestBackendFlatfiles < Test::Unit::TestCase
- def setup
- @ffopts = { 'data-path' => "./test/data", 'extension' => nil }
-
- # generate a database
- raise "Setup Error: #{@ffopts['data-path']} exists" if File.exists?(@ffopts['data-path'])
-
- @flatbase = {
- 'Proj1' => ['ProjectIndex:all projects must have this',
- 'P1TopicOne:this is the content',
- 'P1TopicTwo:more content'],
- 'Proj2' => ['ProjectIndex:all projects must have this',
- 'P2TopicOne:this is the content',
- 'P2TopicTwo:more content',
- 'P2TopicThree:even more more content']
- }
-
- @flatbase.each do |key, val|
- prjdir = "#{@ffopts['data-path']}/#{key}"
- FileUtils.mkdir_p(prjdir) rescue nil
- val.each do |topcon|
- topic, content = topcon.split(":")
- File.open("#{prjdir}/#{topic}", "w") do |fh|
- fh.puts "page!content:\x09#{content}"
- end
- end
- end
-
- @backend = nil
- @pg = nil
- end
-
- def teardown
- # remove testing flatabase
- FileUtils.rm_rf(@ffopts['data-path'])
- Dir.rmdir("./test") # ugly but it works
- end
-
- def test_list_projects
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- # should be ['Proj1', 'Proj2']
- assert_equal(@flatbase.keys, @backend.list_projects)
- end
-
- def test_list_topics
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- @flatbase.keys.sort.each do |proj|
- got_topics = @backend.list_topics(proj)
- exp_topics = @flatbase[proj].map { |ent| ent.split(':')[0] }
- assert_equal(exp_topics.sort, got_topics.sort)
- end
- end
-
- # test simple one word lookups
- # need to add more complex search strings
- def test_search_project
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- assert_equal({'ProjectIndex' => 1,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 0 }.to_a.sort,
- @backend.search_project('Proj1', 'this').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 0,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'more').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'topic').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'content').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P2TopicOne' => 0,
- 'P2TopicTwo' => 1,
- 'P2TopicThree' => 2 }.to_a.sort,
- @backend.search_project('Proj2', 'more').to_a.sort)
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/tests/tc_bugs.rb b/ruwiki/tags/release-0.9.2/tests/tc_bugs.rb
deleted file mode 100644
index 477cbeb..0000000
--- a/ruwiki/tags/release-0.9.2/tests/tc_bugs.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-
-# see if we can reproduce the LicenseandAuthor hang
-# described in bug id 147 on rubyforge
-class TC_LicenseAndAuthorHang < Test::Unit::TestCase
- def setup
- @ffopts = { }
- dp = nil
- dp = "../data" if File.exists?("../data")
- dp = "./data" if File.exists?("./data")
- raise "Cannot find either ./data or ../data for tests. Aborting." if dp.nil?
-
- @ffopts['data-path'] = dp
- @ffopts['format'] = 'exportable'
-
- @backend = nil
- @pg = nil
- end
-
- # load "to the metal"
- def test_ffload
- assert_nothing_raised do
- @backend = ::Ruwiki::Backend::Flatfiles.new(@ffopts)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.load('LicenseAndAuthorInfo.ruwiki', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-
- # abstract backend retreive
- def test_beload
- @backend = nil
- assert_nothing_raised do
- mock_ruwiki = OpenStruct.new
- mock_ruwiki.config = OpenStruct.new
- mock_ruwiki.config.message = {}
- mock_ruwiki.config.storage_options = { 'flatfiles' => @ffopts }
-
- @backend = ::Ruwiki::BackendDelegator.new(mock_ruwiki, 'flatfiles')
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.retrieve('LicenseAndAuthorInfo', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-end
-
-# if __FILE__ == $0
-# ObjectSpace.each_object { |o| tests << o if o.kind_of?(Class) }
-# tests.delete_if { |o| !o.ancestors.include?(Test::Unit::TestCase) }
-# tests.delete_if { |o| o == Test::Unit::TestCase }
-
-# tests.each { |test| Test::Unit::UI::Console::TestRunner.run(test) }
-# end
diff --git a/ruwiki/tags/release-0.9.2/tests/tc_exportable.rb b/ruwiki/tags/release-0.9.2/tests/tc_exportable.rb
deleted file mode 100644
index b067240..0000000
--- a/ruwiki/tags/release-0.9.2/tests/tc_exportable.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-class Ruwiki; end if __FILE__ == $0
-
-require 'ruwiki/exportable'
-require 'test/unit'
-
- class TCExportable < Test::Unit::TestCase
- class Exportable
- include Ruwiki::Exportable
-
- attr_accessor :a, :b, :long_name, :altname, :xform, :group2
- exportable :a
- exportable :long_name
- exportable :altname, :name => 'alt-name'
- exportable :group2, :group => 'group2'
- end
-
- def test_exportable
- __exportables = {
- 'default' => {
- 'a' => '@a'.intern,
- 'long-name' => '@long_name'.intern,
- 'alt-name' => '@altname'.intern,
- },
- 'group2' => {
- 'group2' => '@group2'.intern
- }
- }
- __values = {
- 'default' => {
- 'a' => 'a',
- 'long-name' => 'c',
- 'alt-name' => 'd',
- },
- 'group2' => { 'group2' => 'e' }
- }
- xx = nil
- ss = nil
- assert_nothing_raised do
- xx = Exportable.new
- xx.a = "a"
- xx.b = "b"
- xx.long_name = "c"
- xx.altname = "d"
- xx.xform = 22/7
- xx.group2 = "e"
- ss = xx.export
- end
- assert_equal(__exportables, xx.class.__exportables)
- assert_equal(__values, ss)
- end
- end
diff --git a/ruwiki/tags/release-0.9.2/tests/tc_template.rb b/ruwiki/tags/release-0.9.2/tests/tc_template.rb
deleted file mode 100644
index c4da672..0000000
--- a/ruwiki/tags/release-0.9.2/tests/tc_template.rb
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'test/unit'
-require 'harness'
-
-class TestTemplates < Test::Unit::TestCase
- def test_include
- a = "a!INCLUDE!c"
- b = "b"
- t = Ruwiki::TemplatePage.new(a, b)
- assert_equal(["abc"], t.lines.lines)
- end
-
- def test_variables
- a = "a%b%c"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.write_plain_on("", v))
- end
-
- def test_optional_variables
- a = "a%b%%?c%d"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.write_plain_on("", v))
-
- v["c"] = "c"
- assert_equal("abcd", t.write_plain_on("", v))
- end
-
- def test_labels
- a = "a#b#c"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.write_plain_on("", v, m))
- end
-
- def test_optional_labels
- a = "a#b##?c#d"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.write_plain_on("", v, m))
-
- m[:c] = "c"
- assert_equal("abcd", t.write_plain_on("", v, m))
- end
-
- def test_hrefs
- a = "HREF:a:b:"
- t = Ruwiki::TemplatePage.new(a)
- v = { "b" => "b" }
-
- assert_equal("b", t.write_plain_on("", v))
-
- s = ""
- v["a"] = "link"
- assert_equal(%Q(<a href="link">b</a>), t.write_plain_on("", v))
- end
-
- def test_repeat_subst
- v1 = { "a" => 3 }
- v2 = { "a" => 2...4 }
- v3 = { "a" => -4...-2 }
- v4 = { "a" => [3, 1, 4, 1, 5, 9] }
- v5 = { "a" => [{ "a" => 3 }, { "a" => 1 }, { "a" => 4 }, { "a" => 1 }, { "a" => 5 }, { "a" => 9 }] }
-
- a = "[:a|xy:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("xyxyxy", t.write_plain_on("", v1))
- assert_equal("xyxy", t.write_plain_on("", v2))
- assert_equal("xyxy", t.write_plain_on("", v3))
- assert_equal("xyxyxyxyxyxy", t.write_plain_on("", v4))
- assert_equal("xyxyxyxyxyxy", t.write_plain_on("", v5))
-
- a = "[:a|%a%:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("123", t.write_plain_on("", v1))
- assert_equal("23", t.write_plain_on("", v2))
- assert_equal("-4-3", t.write_plain_on("", v3))
- assert_equal("314159", t.write_plain_on("", v4))
- assert_equal("314159", t.write_plain_on("", v5))
- end
-
- def test_optional_subst
- v1 = { "a" => "a" }
- v2 = { "a" => nil }
- a1 = "[?a|xy?]"
- a2 = "[!a|xy?]"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
-
- assert_equal("xy", t1.write_plain_on("", v1))
- assert_equal("", t1.write_plain_on("", v2))
- assert_equal("", t2.write_plain_on("", v1))
- assert_equal("xy", t2.write_plain_on("", v2))
- end
-
- def test_repeat_block
- a1 = "START:a\nxy\nEND:a"
- a2 = "START:a\nx%b%y\nEND:a"
- a3 = "START:\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- v = { "a" => [{ "b" => 3 }, { "b" => 1 }, { "b" => 4 }, { "b" => 1 }, { "b" => 5 }, { "b" => 9 }] }
-
- assert_equal("xy\nxy\nxy\nxy\nxy\nxy\n", t1.write_plain_on("", v))
- assert_equal("x3y\nx1y\nx4y\nx1y\nx5y\nx9y\n", t2.write_plain_on("", v))
- assert_raises(RuntimeError) { t3.write_plain_on("", v) }
- end
-
- def test_optional_block
- a1 = "IF:a\nxy\nENDIF:a"
- a2 = "IF:\nxy\nEND:"
- a3 = "IFNOT:a\nxy\nENDIF:a"
- a4 = "IFNOT:\nxy\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- t4 = Ruwiki::TemplatePage.new(a4)
- v1 = { "a" => true }
- v2 = { "a" => nil }
-
- assert_equal("xy", t1.write_plain_on("", v1))
- assert_equal("", t1.write_plain_on("", v2))
- assert_raises(RuntimeError) { t2.write_plain_on("", v1) }
- assert_equal("", t3.write_plain_on("", v1))
- assert_equal("xy", t3.write_plain_on("", v2))
- assert_raises(RuntimeError) { t4.write_plain_on("", v1) }
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/tests/tc_tokens.rb b/ruwiki/tags/release-0.9.2/tests/tc_tokens.rb
deleted file mode 100644
index 929701a..0000000
--- a/ruwiki/tags/release-0.9.2/tests/tc_tokens.rb
+++ /dev/null
@@ -1,335 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'test/unit'
-require 'harness'
-
-class TokenTestCases < Test::Unit::TestCase
- def setup
- @mrw = MockRuwiki.new
- end
-
- class MockRuwiki
- def initialize
- @project = "Default"
- @tokens = []
- @script = "<uri>"
- @message = Hash.new { |h, k| h[k] = "#{k.inspect}" }
- @title = "Ruwiki"
- end
-
- def __tokenize(content, token)
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, @project, $wiki.backend, @script, @message, @title)
- @tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{@tokens.size - 1}"
- else
- "TOKEN_#{@tokens.size - 1}"
- end
- end
- content
- end
-
- def __replace(content)
- replaced = []
- s = true
- loop do
- break if replaced.size >= @tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].restore
- end
-
- s = content.gsub!(/TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].replace
- end
- end
- content
- end
-
- def __post_replace(content)
- token_classes = @tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
- content
- end
-
- end
-
- def __process(token, content, tokenized, replaced, result)
- assert_equal(tokenized, content = @mrw.__tokenize(content, token), "Tokenization failure.")
- assert_equal(replaced, content = @mrw.__replace(content), "Replacement failure.")
- assert_equal(result, content = @mrw.__post_replace(content), "Post-replace failure.")
- end
-
- def __display(token, content)
- p tokenized = @mrw.__tokenize(content.dup, token)
- p replaced = @mrw.__replace(tokenized.dup)
- p result = @mrw.__post_replace(replaced.dup)
- end
-
- def test_Paragraph
- token = Ruwiki::Wiki::Paragraph
- content = "\nABC\n\nabc\n"
- tkv = "TOKEN_0\nABC\nTOKEN_1\nabc\n"
- rpv = %Q(</p><p class="rwtk_Paragraph">\nABC\n</p><p class="rwtk_Paragraph">\nabc\n)
- res = %Q(<p class="rwtk_Paragraph">ABC</p>\n<p class="rwtk_Paragraph">abc</p>)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Image
- token = Ruwiki::Wiki::Image
- content = "[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_0"
- rpv = %Q(<img class="rwtk_Image" alt="http://www.halostatue.ca/graphics/maple_leaf.gif" src="http://www.halostatue.ca/graphics/maple_leaf.gif" title="http://www.halostatue.ca/graphics/maple_leaf.gif" />)
- res = rpv
-
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_1"
- content = %Q([image : http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" title="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="Maple Leaf" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_2"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true])
- rpv = %Q(<img class="rwtk_Image" alt="[1]" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[1]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_3"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true alt="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[2]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- content = "\[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_4"
- rpv = content
- res = content
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Code
- content = " line 1\n line 2\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_0TOKEN_1line 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2</pre>\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
-
- content = " line 1\n line 2\n \n\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_2TOKEN_3TOKEN_4\nline 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\n</p><pre class="rwtk_Code"> </pre>\n\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2\n </pre>\n\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NumberedLinks
- token = Ruwiki::Wiki::NumberedLinks
- Ruwiki::Wiki.reset_numbered_links
- content = "[http://www.yahoo.com] [http://www.ruby-lang.org] \\[http://www.rubyforge.org]"
- tkv = "TOKEN_0 TOKEN_1 \\TOKEN_2"
- uri = CGI.escape("http://www.yahoo.com")
- rpv = %Q{<a class="rwtk_NumberedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">[1]</a> <a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[2]</a> [http://www.rubyforge.org]}
- res = %Q{<a class="rwtk_NumberedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">[1]</a> <a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[2]</a> [http://www.rubyforge.org]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NamedLinks
- token = Ruwiki::Wiki::NamedLinks
- content = "[http://www.yahoo.com Yahoo!] [http://www.ruby-lang.org Ruby] \\[http://www.rubyforge.org RubyForge]"
- tkv = "TOKEN_0 TOKEN_1 \\TOKEN_2"
- uri = CGI.escape("http://www.yahoo.com")
- rpv = %Q{<a class="rwtk_NamedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">Yahoo!</a> <a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
- res = %Q{<a class="rwtk_NamedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">Yahoo!</a> <a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ExternalLinks
- token = Ruwiki::Wiki::ExternalLinks
- content = "http://www.yahoo.com http://www.ruby-lang.org \\http://www.rubyforge.org"
- tkv = "TOKEN_0 TOKEN_1 \\TOKEN_2"
- uri = CGI.escape("http://www.yahoo.com")
- rpv = %Q{<a class="rwtk_ExternalLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">http://www.yahoo.com</a> <a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
- res = %Q{<a class="rwtk_ExternalLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">http://www.yahoo.com</a> <a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_HRule
- token = Ruwiki::Wiki::HRule
- content = "----\n\\----"
- tkv = "TOKEN_0\n\\TOKEN_1"
- rpv = %Q(<hr class="rwtk_HRule" />\n----)
- res = %Q(<hr class="rwtk_HRule" />\n----)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLink
- token = Ruwiki::Wiki::ProjectCrossLink
- content = "Ruwiki::ChangeLog \\Ruwiki::To_Do Ruwiki::NotExist \\Ruwiki::NotExist"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLinkWikipedia
- token = Ruwiki::Wiki::ProjectCrossLinkWikipedia
- content = "Ruwiki::[[ChangeLog]] \\Ruwiki::[[To_Do]] Ruwiki::[[Does Not Exist]] \\Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 Ruwiki::[[_invalid]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectIndex
- token = Ruwiki::Wiki::ProjectIndex
- content = "::Ruwiki \\::Ruwiki ::Newproject \\::Newproject"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikiLinks
- token = Ruwiki::Wiki::WikiLinks
- content = "ProjectIndex \\ProjectIndex AustinZiegler \\AustinZiegler Alan_Chen \\Alan_Chen"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikipediaLinks
- token = Ruwiki::Wiki::WikipediaLinks
- content = "[[ProjectIndex]] \\[[ProjectIndex]] [[Austin Ziegler]] \\[[Austin Ziegler]] [[_Alan Chen]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 [[_Alan Chen]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Abbreviations
- token = Ruwiki::Wiki::Abbreviations
- content = "@{matz}\n@{}\n\\@{matz}"
- tkv = "TOKEN_0\nTOKEN_1\n\\TOKEN_2"
- rpv = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
- res = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Headings
- token = Ruwiki::Wiki::Headings
- content = "= header 1\n== header 2\n=== header 3\n==== header 4\n===== header 5\n====== header 6\n======= header 7->6\n\\== noheader 2\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\nTOKEN_6\n\\TOKEN_7\n"
- rpv = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n== noheader 2\n)
- res = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n<p class="rwtk_Paragraph">== noheader 2\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Blockquotes
- token = Ruwiki::Wiki::Blockquotes
- content = ": level 1\n:: level 2\n::: level 3\n: level 1, para 2\n\\: not a blockquote\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<blockquote class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n: not a blockquote\n)
- res = %Q(<blockquote class="rwtk_Blockquotes">level 1<blockquote class="rwtk_Blockquotes">level 2<blockquote class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n: not a blockquote\n)
- __process(token, content, tkv, rpv, res)
-
- content = "> level 1\n>> level 2\n>>> level 3\n> level 1, para 2\n\\> not a blockquote\n"
- tkv = "TOKEN_5\nTOKEN_6\nTOKEN_7\nTOKEN_8\n\\TOKEN_9\n"
- rpv = %Q(<blockquote type="cite" class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- res = %Q(<blockquote type="cite" class="rwtk_Blockquotes">level 1<blockquote type="cite" class="rwtk_Blockquotes">level 2<blockquote type="cite" class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Definitions
- token = Ruwiki::Wiki::Definitions
- content = "; word1 : val1\n;; word2 : val2\n;;; word3 : val3\n; word1/2 : val1/2\n\\; not-a-word : not-a-val\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd></dl></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl></dl>\n<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
- res = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
-
-# __display(token, content)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Lists
- content = "* level 1\n** level 2\n*** level 3\n*** level 3, item 2\n** level 2, item 2\n* level 1, item 2\n\\* not an item\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\n\\TOKEN_6\n"
- rpv = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ul></ul>\n<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- res = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ul><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n## level 2\n### level 3\n### level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_7\nTOKEN_8\nTOKEN_9\nTOKEN_10\nTOKEN_11\nTOKEN_12\n\\TOKEN_13\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ol><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n*# level 2\n*** level 3\n*#* level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_14\nTOKEN_15\nTOKEN_16\nTOKEN_17\nTOKEN_18\nTOKEN_19\n\\TOKEN_20\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ol></ul>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
- end
-
-
- def test_RubyTalkLinks
- token = Ruwiki::Wiki::RubyTalkLinks
- content = "[ruby-talk:12345] \\[ruby-talk:12345]"
- tkv = "TOKEN_0 \\TOKEN_1"
-# rpv = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
- rpv = %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
-# res = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
- res = %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_OtherRubyLinks
- token = Ruwiki::Wiki::OtherRubyLinks
- content = "[ruby-list:123] \\[ruby-list:123] [ruby-doc:123] \\[ruby-doc:123] [ruby-core:123] \\[ruby-core:123] [ruby-dev:123] \\[ruby-dev:123] [ruby-ext:123] \\[ruby-ext:123] [ruby-math:123] \\[ruby-math:123]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5 TOKEN_6 \\TOKEN_7 TOKEN_8 \\TOKEN_9 TOKEN_10 \\TOKEN_11"
- rpv = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
- res = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
-
- __process(token, content, tkv, rpv, res)
- end
-end
diff --git a/ruwiki/tags/release-0.9.2/tests/testall.rb b/ruwiki/tags/release-0.9.2/tests/testall.rb
deleted file mode 100755
index f2e9100..0000000
--- a/ruwiki/tags/release-0.9.2/tests/testall.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-$stderr.puts "Checking for test cases:"
-Dir['tc_*.rb'].each do |testcase|
- $stderr.puts "\t#{testcase}"
- load testcase
-end
-$stderr.puts " "
diff --git a/ruwiki/tags/release-0.9.3/Rakefile b/ruwiki/tags/release-0.9.3/Rakefile
deleted file mode 100644
index e1739e4..0000000
--- a/ruwiki/tags/release-0.9.3/Rakefile
+++ /dev/null
@@ -1,207 +0,0 @@
-#! /usr/bin/env rake
-$LOAD_PATH.unshift('lib')
-
-require 'rubygems'
-require 'rake/gempackagetask'
-require 'ruwiki'
-require 'ruwiki/utils'
-require 'ruwiki/utils/manager'
-require 'zlib'
-
-DISTDIR = "ruwiki-#{Ruwiki::VERSION}"
-TARDIST = "../#{DISTDIR}.tar.gz"
-
-DATE_RE = %r<(\d{4})[./-]?(\d{2})[./-]?(\d{2})(?:[\sT]?(\d{2})[:.]?(\d{2})[:.]?(\d{2})?)?>
-
-if ENV['RELEASE_DATE']
- year, month, day, hour, minute, second = DATE_RE.match(ENV['RELEASE_DATE']).captures
- year ||= 0
- month ||= 0
- day ||= 0
- hour ||= 0
- minute ||= 0
- second ||= 0
- ReleaseDate = Time.mktime(year, month, day, hour, minute, second)
-else
- ReleaseDate = nil
-end
-
-desc "Run Ruwiki unit tests."
-task :test do |t|
- require 'test/unit/testsuite'
- require 'test/unit/ui/console/testrunner'
-
- runner = Test::Unit::UI::Console::TestRunner
-
- $LOAD_PATH.unshift('tests')
- $stderr.puts "Checking for test cases:" if t.verbose
- Dir['tests/tc_*.rb'].each do |testcase|
- $stderr.puts "\t#{testcase}" if t.verbose
- load testcase
- end
-
- suite = Test::Unit::TestSuite.new("Ruwiki Tests")
-
- ObjectSpace.each_object(Class) do |testcase|
- suite << testcase.suite if testcase < Test::Unit::TestCase
- end
-
- runner.run(suite)
-end
-
-task :clean_data do
- Dir["data/**/*"].each do |file|
- FileUtils.rm_f(file) if file =~ /(?:rdiff|lock|~)$/
- end
-end
-
-desc "Build the default Ruwiki deployment package."
-task :package_data => [ :clean_data ] do
- Ruwiki::Utils::Manager.package(".", ".", nil, false)
-end
-
-task :make_readonly do
- data = nil
- Dir["data/**/*.ruwiki"].each do |file|
- File.open(file, "rb") { |f| data = f.read }
- FileUtils.cp(file, "#{file}.orig")
- if data =~ %r{properties!editable:}o
- data.gsub!(%r{^properties!editable:[ \t].*?$}, "properties!editable:\tfalse")
- else
- data << "properties!editable:\tfalse\n"
- end
- File.open(file, "wb") { |out| out.write(data) }
- end
-end
-
-task :clean_readonly do
- Dir["data/**/*.ruwiki"].each do |file|
- orig = "#{file}.orig"
- FileUtils.mv(orig, file) if File.exists?(orig)
- end
-end
-
-spec = Gem::Specification.new do |s|
- s.name = %q(ruwiki)
- s.version = Ruwiki::VERSION
- s.summary = %q{A simple, extensible, and fast Wiki-clone.}
-
- s.add_dependency('diff-lcs', '~> 1.1.2')
- s.add_dependency('archive-tar-minitar', '~> 0.5.1')
-
- s.has_rdoc = true
- s.rdoc_options = ["--title", "Ruwiki - An Extensible Wiki", "--main", "Readme.tarfile", "--line-numbers"]
- s.extra_rdoc_files = %w(Readme.tarfile Readme.rubygems)
-
- s.bindir = 'bin'
- s.executables = Dir['bin/**/*'].delete_if do |item|
- item =~ %r{(?:\bCVS\b|\.svn\b|[Rr]akefile|install.rb$|~$|gem(?:spec)?$)}
- end.map { |item| item.gsub(%r{^bin/}, "") }
- s.autorequire = %q{ruwiki}
- s.require_paths = %w{lib}
-
- s.test_files = %w{tests/testall.rb}
-
- files = Dir["**/*"].delete_if do |item|
- item =~ %r{\bCVS\b |
- \.svn\b |
- \.bak$ |
- [Rr]akefile |
- install\.rb$ |
- ~$ |
- gem(spec)?$ |
- lib/archive |
- lib/diff |
- \.ruwiki\.orig$}x
- end
- files << "ruwiki.pkg"
- s.files = files
-
- s.author = %q{Austin Ziegler and Alan Chen}
- s.email = %q{ruwiki-discuss@rubyforge.org}
- s.rubyforge_project = %q(ruwiki)
- s.homepage = %q{http://ruwiki.rubyforge.org/}
-
- description = []
- File.open("Readme.rubygems") do |file|
- file.each do |line|
- line.chomp!
- break if line.empty?
- description << "#{line.gsub(/\[\d\]/, '')}"
- end
- end
- s.description = description[2..-1].join(" ")
-end
-desc "Build the RubyGem for Ruwiki."
-task :gem => [ :test ]
-task :gem => [ :update_version ]
-task :gem => [ :package_data ]
-task :gem => [ :make_readonly ]
-Rake::GemPackageTask.new(spec) do |g|
- g.need_tar = false
- g.need_zip = false
- g.package_dir = ".."
-end
-
-VERSION_STRING_RE = %r{\\?%RV#%}
-
-desc "Update the version of Ruwiki to #{Ruwiki::VERSION} in documentation files."
-task :update_version do
- FileList["data/**/*.ruwiki", "Readme*"].to_a.each do |file|
- data = File.read(file)
- data.gsub!(VERSION_STRING_RE) do |match|
- if match[0] == '\\'
- match
- else
- Ruwiki::VERSION
- end
- end
- File.open(file, "wb") { |f| f.write(data) }
- end
-end
-
-desc "Build a Ruwiki .tar.gz distribution."
-task :tar => [ TARDIST ]
-file TARDIST => [ :test, :update_version ] do |t|
- current = File.basename(Dir.pwd)
- Dir.chdir("..") do
- begin
- files = Dir["#{current}/**/*"].select { |dd| dd !~ %r{(?:/CVS/?|~$)} }
- files.delete_if { |dd| dd =~ %r{Rakefile} }
- files.map! do |dd|
- mtime = ReleaseDate || File.stat(dd).mtime
- ddnew = dd.gsub(/^#{current}/, DISTDIR)
- if File.directory?(dd)
- { :name => ddnew, :mode => 0755, :dir => true, :mtime => mtime }
- else
- if dd =~ %r{bin/}
- mode = 0755
- else
- mode = 0644
- end
- data = File.read(dd)
- { :name => ddnew, :mode => mode, :data => data, :size => data.size,
- :mtime => mtime }
- end
- end
-
- ff = File.open(t.name.gsub(%r{^\.\./}o, ''), "wb")
- gz = Zlib::GzipWriter.new(ff)
- tw = Archive::Tar::Minitar::Writer.new(gz)
-
- files.each do |entry|
- if entry[:dir]
- tw.mkdir(entry[:name], entry)
- else
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
- end
- end
- ensure
- tw.close if tw
- gz.close if gz
- end
- end
-end
-
-desc "Build everything."
-task :default => [ :tar, :gem, :clean_readonly ]
diff --git a/ruwiki/tags/release-0.9.3/Readme.rubygems b/ruwiki/tags/release-0.9.3/Readme.rubygems
deleted file mode 100644
index 240fe57..0000000
--- a/ruwiki/tags/release-0.9.3/Readme.rubygems
+++ /dev/null
@@ -1,86 +0,0 @@
-Ruwiki %RV#%
-------------
-Ruwiki is a simple, extensible Wiki-clone written in Ruby. It supports both
-CGI and WEBrick interfaces, templates, and CSS formatting. This Wiki differs
-from most other Wikis in that it supports project namespaces, so that two
-topics may be named the same for differing projects without colliding or
-having to resort to odd naming conventions. Please see the ::Ruwiki project in
-the running Wiki for more information. Ruwiki %RV#% has German and Spanish
-translations available.
-
-Upgrading
----------
-Ruwiki %RV#% has a flatfile format that is incompatible with older versions of
-Ruwiki. If you are upgrading from one of these versions, you must use the
-bin/convert. The simple case will be (assuming that your data files are in
-./data):
-
- % convert ./data
-
-The convert utility is automatically installed by RubyGems.
-
-Requirements
-------------
-Ruwiki currently requires:
- * Ruby 1.8
- * Diff::LCS 1.2.0
- * Archive::Tar::Minitar 0.5.1
-
-The YAML backend requires Ruby 1.8.2 after preview2. You should have been
-prompted to load these dependencies on installation.
-
-Quick Start (WEBrick Readonly)
-------------------------------
-1. Type:
-
- % ruwiki_servlet --gem-data
-
-2. Point your web browser to <http://localhost:8808/>.
-
-Quick Start (CGI)
------------------
-1. Create a directory in a place that your webserver can execute CGI programs
- and type:
-
- % ruwiki install cgi,data --to <directory>
-
-2. Ensure that ruwiki.cgi is executable on your webserver.
-3. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Create a directory to store your data and templates and type:
-
- % ruwiki install data --to <directory>
-
-2. Type:
-
- % ruwiki_servlet
-
-3. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of Ruwiki
-without editing the servlet; use ruwiki_servlet --help for more information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-Credits
--------
-* This software includes portions of Diff::LCS by Austin Ziegler, available
- for download from the Ruwiki RubyForge project:
- [http://rubyforge.org/projects/ruwiki/]
-* Portions of this software are derived from Dave Thomas's RDoc system, now
- part of the Ruby distribution.
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen].
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández].
-
-$Id$
diff --git a/ruwiki/tags/release-0.9.3/Readme.tarfile b/ruwiki/tags/release-0.9.3/Readme.tarfile
deleted file mode 100644
index a3f4ea6..0000000
--- a/ruwiki/tags/release-0.9.3/Readme.tarfile
+++ /dev/null
@@ -1,65 +0,0 @@
-Ruwiki %RV#%
-------------
-Ruwiki is a simple, extensible Wiki-clone written in Ruby. It supports both
-CGI and WEBrick interfaces, templates, and CSS formatting. This Wiki differs
-from most other Wikis in that it supports project namespaces, so that two
-topics may be named the same for differing projects without colliding or
-having to resort to odd naming conventions. Please see the ::Ruwiki project in
-the running Wiki for more information. Ruwiki %RV#% has German and Spanish
-translations available.
-
-Upgrading
----------
-Ruwiki %RV#% has a flatfile format that is incompatible with versions of
-Ruwiki older than 0.8.0. If you are upgrading from one of these versions, you
-must use the bin/convert. The simplest case will be (assuming that your data
-files are in ./data):
-
- % bin/convert ./data
-
-Requirements
-------------
-Ruwiki currently requires:
- * Ruby 1.8
- * Diff::LCS 1.2.0
- * Archive::Tar::Minitar 0.5.1
-
-The YAML backend requires Ruby 1.8.2 after preview2. Portions of Diff::LCS and
-Archive::Tar::Minitar have been included in this version of Ruwiki.
-
-Quick Start (CGI)
------------------
-1. Place the Ruwiki directory in a place that your webserver can execute CGI
- programs and ensure that ruwiki.cgi is executable on your webserver.
-2. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Run bin/ruwiki_servlet (ruby bin/ruwiki_servlet under Windows).
-2. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of Ruwiki
-without editing the servlet; use ruwiki_servlet --help for more information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-Credits
--------
-* This software includes portions of Diff::LCS and Archive::Tar::Minitar by
- Austin Ziegler, available for download from the Ruwiki RubyForge project:
- [http://rubyforge.org/projects/ruwiki/]
-* Portions of this software are derived from Dave Thomas's RDoc system, now
- part of the Ruby distribution.
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen].
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández].
-
-$Id$
diff --git a/ruwiki/tags/release-0.9.3/contrib/enscript-token.rb b/ruwiki/tags/release-0.9.3/contrib/enscript-token.rb
deleted file mode 100644
index 08c2018..0000000
--- a/ruwiki/tags/release-0.9.3/contrib/enscript-token.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# This token by Javier Fontan <jfontan@pc3d.cesga.es>.
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-require "open3"
-
-class Ruwiki::Wiki::CodeColor < Ruwiki::Wiki::Token
- def self.rank
- 0
- end
-
- def self.regexp
- %r<\{\{\{(?::(\w+)\b)?(.*?)\}\}\}>m
- end
-
- def replace
- cap = @match.captures
-
- if cap[0].nil?
- language = "ruby"
- else
- language = cap[0]
- end
-
- text = cap[1]
-
- i, o, e = Open3.popen3("enscript -B --color=emacs -Whtml -E#{language} -o -")
- i.print text
- i.close
-
- re_script = %r{(<pre>.*?</pre>)}mio
- c = o.readlines[1..-1].join("\n")
- re_script.match(c).captures[0]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<pre>\n}im, '<pre class="rwtk_CodeColor>')
- content.gsub!(%r{\n</pre>}im, '</pre>')
- content.gsub!(%r{<font color="(.+?)">}im, '<span style="color: \1">')
- content.gsub!(%r{</font>}im, '</span>')
- content.gsub!(%r{<B>}i, '<b>')
- content.gsub!(%r{</B}i, '</b>')
- content
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/contrib/rublog_integrator.rb b/ruwiki/tags/release-0.9.3/contrib/rublog_integrator.rb
deleted file mode 100644
index 504d9d6..0000000
--- a/ruwiki/tags/release-0.9.3/contrib/rublog_integrator.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This integrator based on work by Chad Fowler.
-#
-# $Id$
-#++
-
-# NOTE: This is not currently compatible with Ruwiki 0.8.0
-#
-# require 'ruwiki/wiki/handler'
-
-class Ruwiki::RubLogHandler < Ruwiki::Wiki::Handler
- def initialize(entries)
- @entries = entries
- end
-
- def page_exists?(page, project)
-# puts "pP: #{page}, #{project}"
- matches = @entries.find_entries_with_root_name(page)
- matches.each { |entry| return true if(entry.dir_name =~ /#{project}/) }
- false
- end
-
- def project_exists?(project)
- true
- end
-
- def script_url
-# request.environment['SCRIPT_NAME']
-# !!SMELL!!
- ENV['SCRIPT_NAME']
- end
-end
-
- # An experimental convertor for Ruwiki
-class RuwikiConvertor < BaseConvertor
- handles "wiki"
-
- def get_title(f)
- title = "---Untitled---"
- loop do
- line = f.gets
- if(line =~ /^topic: (\S+)/) then
- title = $1
- elsif(line =~ /^\#EHDR/) then
- return title
- end
- end
- end
-
- def convert_html(file_entry, f, all_entries)
- title = get_title(f)
- markup = Ruwiki::Wiki.new('Default', Ruwiki::RubLogHandler.new(all_entries))
- body = markup.parse(f.readlines.join("\n"), file_entry.dir_name)
- HTMLEntry.new(title, body, self)
- end
-
- # FIXME: Need to check this one
- def convert_plain(file_name, f, all_entries)
- f.read
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/data/Default/ProjectIndex.ruwiki b/ruwiki/tags/release-0.9.3/data/Default/ProjectIndex.ruwiki
deleted file mode 100644
index 28807a7..0000000
--- a/ruwiki/tags/release-0.9.3/data/Default/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,48 +0,0 @@
-page!content: = Ruwiki
- Ruwiki is a simple, extensible Wiki written in Ruby. It supports both
- CGI and \WEBrick interfaces, templates, and CSS formatting.
- Additionally, it supports project namespaces, so that two pages can be
- named the same for differing projects without colliding or odd naming
- conventions. Please see the ::Ruwiki project for more information.
-
- Ruwiki is also an internationalised Wiki, although more testing,
- especially testing with multibyte character encodings and Unicode
- (UTF-8) is required. There are German and Spanish localisations of the
- messages included with the Ruwiki distribution.
-
- The current version is %RV#%. Enhancements and changes include:
- * a deployment system, whereby Ruwiki deployments can be installed from a package manager like that used for RPA (rpa-base) or \RubyGems (see Ruwiki::RuwikiUtilities);
- * support for Ruwiki as a Windows service on NT, 2000, XP, and 2003 systems;
- * demotion of YAML and Marshal storage types to formats of the Flatfiles storage type;
- * external user authentication (currently to \RubyForge only);
- * antispam efforts including robot and IP exclusion and URL redirection (see Ruwiki::[[Antispam]]); and
- * protection against cross-site scripting (XSS) attacks with HTML and CSS cleaning.
- The full list of changes can be found in Ruwiki::ChangeLog, with
- discussions of various features in Ruwiki::WikiMarkup,
- Ruwiki::Configuring_Ruwiki, and Ruwiki::Extending_Ruwiki.
-
- If you are upgrading from a version of Ruwiki older than 0.8.0, please
- read Ruwiki::RuwikiUtilities.
-
- Certain Ruwiki \APIs are considered stable at this point, others will
- be changing leading up to 1.0. Some of this is discussed in
- Ruwiki::To_Do, with further architectural discussions in
- Ruwiki::[[Roadmap]].
-
- %projects()
-
- Please review ::Tutorial and ::Ruwiki if you are unfamiliar with the
- concept of Wikis in general. If you want to play with \WikiFormatting
- for Ruwiki, use the Ruwiki::SandBox.
-
- [http://rubyforge.org/projects/ruwiki Ruwiki development] is hosted at
- [http://rubyforge.org RubyForge]. The current release of Ruwiki can
- always be [http://rubyforge.org/frs/?group_id=84 downloaded] from
- \RubyForge or the development (unstable) version can be obtained from
- CVS.
-properties!project: Default
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/Antispam.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/Antispam.ruwiki
deleted file mode 100644
index d84ca5a..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/Antispam.ruwiki
+++ /dev/null
@@ -1,83 +0,0 @@
-page!content: = Ruwiki %RV#% Antispam
- Wiki-spam, like email spam, is a major problem. Ruwiki is going to have
- extensive configurable tools for fighting spam. As it is, there are
- several tools built into Ruwiki to assist in the fight against these
- pond scum, but the tool development is certainly not complete.
-
- == External URI Redirection
- Although this will not greatly assist in the reduction of wiki spam,
- all external \URIs are redirected through an URI on Google that is
- designed specifically to remove \PageRank from links. The mechanism
- currently works on all manually-specified external \URIs and is not
- configurable without changing the URI tokenisation code. Thus, links
- that are generated by \[ruby-talk:12345] will not be redirected through
- Google, but direct links will be.
-
- New to Ruwiki 0.9.1, \URIs may be whitelisted with
- <tt>./data/clean.uri</tt>. The list of \URIs in <tt>clean.uri</tt> are
- &#8220;extended&#8221; Ruby regular expressions, one optional
- expression to a line. Spaces are not significant and comments are
- allowed. If you want to recognise a space in your regular expression,
- do so either with a character class ([ ]) or the whitespace
- meta-character (\s). Hash marks must be escaped (\#) or they will be
- treated as comment markers. Blank or comment-only lines are ignored.
- All other lines will be joined together.
-
- As noted, this will not necessarily reduce wiki spam, but it will deny
- spammers the entire benefit of spamming a wiki implemented with Ruwiki.
-
- == Reacting to Spammers and Robots
- Ruwiki %RV#% includes the ability to present alternative versions of
- itself to certain user agents and/or IP addresses based on a list. In
- the future, both the lists and the faces presented will be configurable
- (highly configurable, at that -- watch this space), but in this version
- of Ruwiki, there are three possible versions to be displayed:
- # Normal Ruwiki. This is a normally displayable and editable wiki.
- # Read-only Ruwiki. This is displayed to benign robots and users who have demonstrated that they cannot be trusted with edit access. The primary effect is to make command pages neither indexable, archivable, nor link-followable, and to remove certain links from visibility for these user agents.
- # Forbidden Ruwiki. The user gets an HTTP response of 403 Forbidden. This is displayed to malign (email-collecting) robots and users who have demonstrated that they are malicious and bent upon defacing the wiki.
-
- While Ruwiki provides these lists, and provides an extensive list of
- both malign and benign robots, it is up to the administrators of the
- wiki to ensure that they are kept up to date.
-
- The lists themselves are &#8220;extended&#8221; Ruby regular
- expressions, one optional expression to a line. Spaces are not
- significant and comments are allowed. If you want to recognise a space
- in your regular expression, do so either with a character class ([ ]) or
- the whitespace meta-character (\s). Hash marks must be escaped (\#) or
- they will be treated as comment markers. Blank or comment-only lines are
- ignored. All other lines will be joined together.
-
- foo
- bar
-
- becomes:
-
- %r{foo|bar}x
-
- The file are stored in the data directory for the running instance of
- Ruwiki (e.g., <tt>./data</tt>):
-
- ./data/agents.banned
- ./data/agents.readonly
- ./data/hostip.banned
- ./data/hostip.readonly
-page!footer:
-page!header:
-properties!create-date: 1103593880
-properties!creator:
-properties!creator-ip: UNKNOWN
-properties!edit-comment:
-properties!edit-date: 1103593880
-properties!editable: true
-properties!editor:
-properties!editor-ip: 127.0.0.1
-properties!entropy: 0.0
-properties!html-headers:
-properties!indexable: false
-properties!project: Ruwiki
-properties!title: Antispam
-properties!topic: Antispam
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/BugTracking.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/BugTracking.ruwiki
deleted file mode 100644
index 5f24cc7..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/BugTracking.ruwiki
+++ /dev/null
@@ -1,32 +0,0 @@
-page!content: = Ruwiki %RV#% Bug Tracking
- This page is for tracking bugs in Ruwiki. Only bugs from recent
- distributions are tracked. In addition to this source-based bug
- tracking, there is the [http://rubyforge.org RubyForge]
- [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug
- tracker] for Ruwiki.
-
- Those interested in Ruwiki development may also find the Ruwiki::To_Do
- list and the Ruwiki::[[Roadmap]] useful. The format of the bug list is
- &ldquo;version: description&rdquo;.
-
- == Open Bugs
- The version number is the version in which the bug was first reported.
- * 0.6.2: Not all formatting is applied consistently. The token rankings may need adjusting. Eivind Eklund has suggested a scheme that may help with this, but it will require architectural adjustment and will probably slow things down.
-
- ----
- == Closed Bugs
- The version number is the version in which the bug was fixed.
- * 0.9.0: Fixed a problem with old page edits being applied inappropriately.
- * 0.8.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=707&group_id=84&atid=407 Sub-Numbered bullets don&rsquo;t increment]. Fixed a list numbering problem. I think that lists are a bit slower now, but they are completely accurate.
- * 0.7.0: Fixed a link detection problem in \[wikiword] format. Thanks to [mailto:eivind@FreeBSD.org Eivind Eklund] for the patch.
- * 0.7.0: Fixed a problem with &lt;pre&gt; paragraph detection and generation.
- * 0.7.0: Fixed a problem with &lt;p&gt; generation.
- * 0.7.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=197&group_id=84&atid=407 Run-away ruby on some links in default distribution]. This may be related to a runaway header problem that was reported to me on IRC some time back that I believe has been fixed. Please advise.
- * 0.6.1: Projects aren&rsquo;t created appropriately.
- * 0.6.1: Saving without editing (or repost) appears to cause problems. A fix has been applied to attempt to address this. Pages that have not been changed will not be saved.
-properties!project: Ruwiki
-properties!title: BugTracking
-properties!topic: BugTracking
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/ChangeLog.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/ChangeLog.ruwiki
deleted file mode 100644
index 018b151..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/ChangeLog.ruwiki
+++ /dev/null
@@ -1,116 +0,0 @@
-page!content: = Ruwiki %RV#% ChangeLog
- Uncompleted to-do items can be found in To_Do. Bugs in Ruwiki are
- tracked in BugTracking.
-
- == 0.9.3
- * Fixed a deployment problem because a RPA-modified file was checked in, preventing it from working on RubyGems.
-
- == 0.9.2
- * Fixed a problem with token handling where the first token was nil.
-
- == 0.9.1
- * Fixed a couple of problems with the Ruwiki deployment system surrounding Win32::Service management.
- * Added a Google redirect exclusion list to the configuration.
- * Fixed a problem where last lines of code blocks may not be properly marked.
- * Changed relevant timestamps to UTC.
- * Fixed a problem with Google redirection not working.
- * Fixed a problem with some pages not being displayed as links in the topic listing; only affected some pages created with the Wikipedia form of naming.
- * Fixed a problem with tokens being redefined. Once a token is defined, its class is frozen; the token reader will silently ignore TypeError exceptions.
-
- == 0.9.0
- * Created a Ruwiki deployment system. Various steps were required to accomplish this:
- ** Moved executable files to bin/ for better packaging; moved core servlet code and other utilities to Ruwiki::Utils namespace.
- ** Renamed bin/convert to bin/ruwiki_convert. This will ultimately be moved into the ruwiki command.
- ** Refactored Flatfile format (section!\item:<Tab>value) to Ruwiki::Exportable, loosened the format restrictions to allow for either section!\item:<Tab>value or section!\item:<Space>value.
- ** Incorporated Ruwiki::Exportable into Ruwiki::Config to allow for the saving of configuration files.
- ** Incorporated Ruwiki::Exportable into Ruwiki::\Utils::ServletRunner to allow for the saving of configuration files.
- ** Added Ruwiki manager code for installation and management of Ruwiki deployments.
- ** Added code for running the Ruwiki servlet as a Windows service on Win32. (Currently minimally tested and unworking.)
- ** Added --central to bin/ruwiki_servlet, to run a read-only instance of Ruwiki using the centralised data from RPA or \RubyGems.
- * Removed YAML and Marshal storage types as separate classes and incorporated them as formats of the Flatfiles storage type. Added the 'format' option to the Flatfiles storage_options hash.
- * Added draft \APIs for authentication, robot exclusion, IP exclusion, and HTML cleaning.
- ** Implemented initial authentication for \RubyForge. It verifies a user against their current \RubyForge cookie.
- ** Implemented known robot list. It may require further refinement. It contains two classes of robots:
- *** Read-only: known to be good (like the Googlebot) or neutral (most other crawlers). They are permitted to read, index, and follow links on all non-command pages.
- *** Banned: known to be bad, essentially spam-crawlers. These robots will uniformly get a 403 Forbidden result.
- ** Implemented IP exclusion list. It may require further refinement. It contains two classes of IPs:
- *** Read-only: IP addresses that are not permitted to edit the wiki. They will be treated as read-only robot exclusion.
- *** Banned: known to be bad, essentially spam-crawlers. These IPs will uniformly get a 403 Forbidden result.
- ** HTML cleaning has been implemented.
- *** HTML entities &amp;, &lt;, and &gt; will be escaped.
- *** Only HTML tags and attributes from a &ldquo;known good&rdquo; list will be passed through unchanged.
- *** CSS properties display and visibility will be silently eliminated from embedded HTML.
- *** Although (mostly) valid XHTML is generated, Ruwiki does not currently support tags or attributes in namespaces. If and when this is enabled, it will be enabled on a namespace-by-namespace basis.
- * External URLs are redirected through a single point through the Google PageRank remover URI \http://www.google.com/url?sa=D&q=<em>uri</em>. There is no whitelisting for URIs at this point.
- * Added a Rakefile for packaging. Currently incomplete.
- * Modified the default template style to remove the bottom control bar, as it was blocking the last bit of text on some pages in lesser browsers.
- * Updated more documentation.
- * Added a message facility so that non-error messages can be communicated to the user.
- * Fixed a bug with submitting an old version of the code with an expired lock reverting changes. The changed versions are now merged automatically and re-presented to the user. It's a simplistic merge, to be improved in a later version of Ruwiki. A message is displayed to the user.
- * Modified searching for empty strings so that instead of throwing an error, a message is displayed to the user.
-
- == 0.8.0
- * AC: Added topic list (_topics) and project list (_projects) controls on templates and backend.
- * AZ: Added %topics() and %projects() tokens. See WikiMarkup for details.
- * AC: Added simple search on back-end (both project and global); search strings must be validated and cleansed before being sent to the back-end (the back-end must prepare the string for its own search mechanism). The back-end is wholly responsible for the searching of the pages.
- * AC: Added \RecentChanges list to backend and controls.
- * AZ: Changed default for Ruwiki::Config#storage_options[:flatfiles][:extension] to <tt>ruwiki</tt>.
- * AZ: Topic backlink search: searches for mentions of the topic in the other topics of the project.
- * AZ: New templating engine: The Rdoc templating engine has been greatly enhanced in preparation for some changes that will happen surrounding antispam capabilities.
- * AZ: Multiple flatfile-based backend support: tagged file (&ldquo;flatfiles&rdquo;), YAML (&ldquo;yaml&rdquo;), and Marshal (&ldquo;marshal&rdquo;).
- * AZ: A converter utility between backends.
- * AZ: Defined a canonical, extensible page transport format.
- * AZ: Defined a canonical, format-independent diff format.
- * AZ: Fixed list numbering problem. Modified lists to allow for mixed lists. See WikiMarkup for restrictions.
- * AZ: Removed automatic image conversion for \URIs that look like images. Now, images must be specified with the \[image:uri] format. See WikiMarkup for more details.
- * AZ: Fixed minor bugs in several tokens.
- * AZ: New look! Ruwiki now sports a new default look with CSS and template changes.
- * AZ: New look! Ruwiki has a &ldquo;simple&rdquo; template set.
- * AZ: New look! Ruwiki has a &ldquo;sidebar&rdquo; template set.
- * AZ: Fixed a long-standing bug with code tokens.
-
- == 0.7.0
- * Changed the tokenization API so that the #post_replace call is made at the Token class level instead of the instance level.
- * Improved HTML code generation.
- * Added servlet runner batch files for Windows. They <strong>will</strong> require modification to run properly.
- * Added %calendar(...) support. See WikiMarkup for more information.
-
- == 0.6.2
- * Removed dependencies on Ruwiki from a number of classes (Ruwiki::Backend, Ruwiki::Backend::Flatfiles, Ruwiki::Page, Ruwiki::Wiki, Ruwiki::Wiki::Tokens, and various tokens).
- * Ruwiki now initializes a \Ruwiki::BackendDelegator, which creates the requisite Ruwiki::Backend instance with Ruwiki::Config#storage_options.
- * Added German (Christian Neukirchen &lt;cneukirchin@yahoo.de&gt;) and Spanish translations (Mauricio Fernández &lt;batsman.geo@yahoo.com&gt;).
-
- == 0.6.1
- * Changed Ruwiki::Config#data_path to Ruwiki::Config#storage_options[:flatfiles][:data_path]. This represents a generalisation of storage type options so that the Ruwiki::Config object is not polluted with storage type options. Ruwiki::Config#storage_options keys should be the same Ruby Symbol as is used in Ruwiki::Config#storage_type.
- * Added Ruwiki::Config#storage_options[:flatfiles][:extension], based on a request by Chad Fowler. This allows you to have Project/\TopicFile actually stored as Project/\TopicFile.wiki if Ruwiki::Config#storage_options[:flatfiles][:extension] is set to <tt>wiki</tt>. The default for Ruwiki::Config#storage_options[:flatfiles][:extension] is <tt>nil</tt>.
- * Fixed incorrect references. I had been incorrectly attributing [http://sourceforge.net/projects/rdoc-wiki RDoc Wiki] to Dave Thomas. \RDoc Wiki is by Michael Neumann. However, the project I pulled from <strong>is</strong> by Dave Thomas, but it&rsquo;s [http://sourceforge.net/projects/rublog RubLog]. Apologies to both developers.
- * Added RuwikiTemplatingLibrary documentation.
- * Internationalized messages, except for the templating library.
- * Added configuration API for future work surrounding features. The existing wiki is mostly feature complete. Additional features (such as access controls) will be added through the feature interface.
- * Fixed project creation.
- * Fixed problems with \WikiWord links.
- * Added Wikipedia-style Wiki links (\[[list of words]]).
- * Fixed a potential problem with re-posted data or saving without editing.
- * Added the ability to put commands in the URL.
-
- == 0.6.0
- * Added Ruby mailing list reference support (e.g., \[ruby-talk:12345]).
- * Reorganised the code (again) to better support alternative frontends. Based, in part, on [http://sourceforge.net/projects/rublog RubLog] by Dave Thomas. (Reference corrected in 0.6.1.)
- * Added a [http://www.webrick.org WEBrick] servlet interface. Based, in part, on the \WEBrick servlet interface provided with \RubLog by Chad Fowler.
- * Added templates, using the [http://rdoc.sourceforge.net RDoc] template.rb library.
- * Changed the default topic to be \ProjectIndex instead of \DefaultProject.
- * Added a new \WikiWord format, \Wiki_Word_with_Spaces.
- * Completed lots of Ruwiki documentation.
- * Updated the save page.
- * Fixed a problem with the linking of project specific pages.
-
- == 0.5.0
- * Reorganized the code significantly to be easier to edit and extend.
- * Added abbreviation capabilities.
- * Cleaned up a lot of tokenizing code.
-properties!project: Ruwiki
-properties!title: ChangeLog
-properties!topic: ChangeLog
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/Configuring_Ruwiki.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/Configuring_Ruwiki.ruwiki
deleted file mode 100644
index bfb3c3b..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/Configuring_Ruwiki.ruwiki
+++ /dev/null
@@ -1,150 +0,0 @@
-page!content: = Configuring Ruwiki %RV#%
- Ruwiki is configured similarly as both a CGI and a \WEBrick servlet.
- The biggest distinction is that because the Wiki servlet is created
- after the \WEBrick server is created (during the dispatch to the
- servlet), it is necessary to configure the wiki with a global
- Ruwiki::Config object stored in Ruwiki::Servlet.config. This must be a
- valid Ruwiki::Config object. In the examples below,
- <em>wiki.config</em> may be simply considered a random Ruwiki::Config
- object.
-
- > This has changed in Ruwiki 0.9.0 from a global configuration object
- > named $config.
-
- : Additional configuration options will be added from time to time. The
- : form for specifying configuration may be changed prior to 1.0.
-
- If you are looking for discussion on templates, this has been moved to
- Extending_Ruwiki.
-
- == Ruwiki Configuration Options
- === wiki.config.title
- This configuration option names the Wiki; by default this is
- <tt>Ruwiki</tt>. This affects the display of the home link and the
- &lt;title&gt; element of pages.
-
- === wiki.config.webmaster
- The email address for the webmaster. This is used in generating error
- reports that can be emailed to the wiki&rsquo;s webmaster.
-
- === wiki.config.language
- This sets the internationalisation mechanism. It must be one of the
- known two-letter ISO language codes or a module under Ruwiki::Lang
- matching that description. See Extending_Ruwiki for more information.
- Ruwiki's default language is English ('en'), but there are translations
- for Spanish ('es') and German ('de') included. Localization is
- currently per wiki instance. In a servlet environment, this may mean
- that only a single language is recognised.
-
- === wiki.config.default_page, wiki.config.default_project
- These options indicate what will happen when the wiki&rsquo;s URL is
- specified without any parameters (the default page in the default
- project is opened), when a topic is specified without a project (the
- topic is opened in the default project), and when a project is
- specified without a topic (the default page is opened in the project).
-
- === wiki.config.storage_type, wiki.config.storage_options
- <tt>wiki.config.storage_type</tt> specifies the back-end storage
- mechanism as a Ruby Symbol. Currently, <tt>'flatfiles'</tt>,
- is supported. See Extending_Ruwiki for more information.
-
- <tt>wiki.config.storage_options</tt> is a hash of option hashes for
- each known storage type known to the Wiki. This must use the same
- Symbol as <tt>wiki.config.storage_type</tt> as the top-level hash key.
-
- ==== ...storage_options['flatfiles']['data-path']
- The directory in which the wiki files will be found. By default, this
- is &ldquo;<tt>./data/</tt>&rdquo;.
-
- ==== ...storage_options['flatfiles']['format']
- Specifies the storage format for the flatfiles backend. The default
- format is 'exportable', but may be set to 'yaml' or 'marshal' as well.
- The 'yaml' format will not work reliably with versions of Ruby before
- 1.8.2 preview 3.
-
- ==== ...storage_options['flatfiles']['extension']
- The extension of the wiki files. By default, this is
- &ldquo;ruwiki&rdquo;. For those upgrading from a version of Ruwiki
- before 0.8.0, note that you must explicitly set this value to
- <tt>nil</tt> if you wish to have no extension.
-
- === wiki.config.template_path
- This specifies the paths where the Wiki templates will be found. The
- process running the Wiki must have read access to the template_path.
-
- === wiki.config.template_set, wiki.config.css
- These two options indicate which template set will be used. Three
- template sets are provided in the release package:
- &ldquo;default&rdquo;, &ldquo;simple&rdquo;, and &ldquo;sidebar&rdquo;.
- The only CSS file used initially is &ldquo;ruwiki.css&rdquo;. Templates
- work such that they will be found in
- <em>template_path</em>/<em>template_set</em>. All CSS files are loaded
- from the template set directory and emitted as part of the output
- stream.
-
- : The bad side of this is that the CSS never caches on the client side
- : as it would if it were a separate file. However, as templates may not
- : be in a web-accessible directory, this is necessary.
-
- === wiki.config.time_format, wiki.config.date_format, wiki.config.datetime_format
- When the wiki displays date or time values, these formats are used.
- They are not currently accessible by tokens.
-
- === wiki.config.debug
- Adds additional information to the (rare) error reports. Defaults to
- <tt>false</tt>.
-
- === wiki.config.logger
- Sets or returns the logger. The logger, if set, must respond to the
- same methods as WEBrick::Logger.
-
- === wiki.config.auth_mechanism
- The authentication mechanism name as a String. Corresponds to a
- filename that will be found in ruwiki/auth. The authenticator must have
- a single class method, +authenticate+, which accepts the +request+, the
- +response+, and the +auth_options+. This API is a draft API and is
- likely to change in future versions of Ruwiki. In this version of
- Ruwiki, only one authentication mechanism will be found -- for dealing
- with authenticating users already logged into RubyForge.
-
- === wiki.config.auth_options
- Options for the authentication mechanism as a Hash. This will be passed
- to the authenticator defined in wiki.config.auth_mechanism. The
- <tt>auth_options</tt> are a single-level hash. They may be stored in
- the Ruwiki configuration file as:
-
- ruwiki-config!auth-options: default!user: pgsqluser
- default!pass: pgsqlpass
-
- == Ruwiki Servlet Options
- Most, if not all, of the configuration above can be achieved through
- command-line options of the ruwiki servlet.
-
- === Servlet Command-Line Options
- ; -P, --port <em>PORT</em> : Runs the Ruwiki servlet on the specified port. Default 8808.
- ; -A, --accept <em>ADDRESSES</em> : Restricts the Ruwiki servlet to accepting connections from the specified address or (comma-separated) addresses. May be specified multiple times. Defaults to all addresses.
- ; -L, --local : Restricts the Ruwiki servlet to accepting only local connections (127.0.0.1). Overrides any previous --accept addresses.
- ; -M, --mount <em>MOUNT_POINT</em> : The relative URI from which Ruwiki will be accessible. Defaults to &ldquo;/&rdquo;.
- ; --[no-]log : Log \WEBrick activity. Default is --log.
- ; --logfile <em>LOGFILE</em> : The file to which \WEBrick logs are written. Default is standard error.
- ; -T, --threads <em>THREADS</em> : Sets the \WEBrick threadcount.
-
- === Ruwiki Command-Line Options
- ; --language <em>LANGUAGE</em> : The interface language for Ruwiki. Defaults to &ldquo;en&rdquo;. May be &ldquo;en&rdquo;, &ldquo;de&rdquo;, or &ldquo;es&rdquo;.
- ; --webmaster <em>WEBMASTER</em> : The Ruwiki webmaster email address. Defaults to &ldquo;webmaster@domain.com&rdquo;.
- ; --[no-]debug : Turns on Ruwiki debugging. Defaults to --no-debug.
- ; --title <em>TITLE</em> : Provides the Ruwiki title. Default is &ldquo;Ruwiki&rdquo;.
- ; --default-page <em>PAGENAME</em> : An alternate default page. Default is &ldquo;\ProjectIndex&rdquo;.
- ; --default-project <em>PAGENAME</em> : An alternate default project. Default is &ldquo;Default&rdquo;.
- ; --template-path <em>TEMPLATE_PATH</em> : The location of Ruwiki templates. Default is &ldquo;./templates&rdquo;.
- ; --templates <em>TEMPLATES</em> : The name of the Ruwiki templates. Default is &ldquo;default&rdquo;.
- ; --css <em>CSS_NAME</em> : The name of the <acronym title="Cascading Style Sheets">CSS</acronym> file in the template path. Default is &ldquo;ruwiki.css&rdquo;.
- ; --storage-type <em>TYPE</em> : Select the storage type: flatfiles, yaml, marshal
- ; --flatfiles-data-path <em>PATH</em> : The path where data files are stored. Default is &ldquo;./data&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
- ; --flatfiles-extension <em>EXT</em> : The extension for data files. Default is &ldquo;ruwiki&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
-properties!project: Ruwiki
-properties!title: Configuring_Ruwiki
-properties!topic: Configuring_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/Extending_Ruwiki.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/Extending_Ruwiki.ruwiki
deleted file mode 100644
index fbc89b8..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/Extending_Ruwiki.ruwiki
+++ /dev/null
@@ -1,316 +0,0 @@
-page!content: = Extending Ruwiki %RV#%
- Ruwiki is relatively easily extended to support new features. There are
- four primary ways in which Ruwiki can be extended or modified by the
- end user: templates, translating Ruwiki messages and labels, markup
- tokens, and creating new backends.
-
- == Templates
- Templating is done with a heavily modified version of the \RDoc
- template.rb library included in the distribution of Ruwiki. The
- templating library allows for nested templates, and this is used
- extensively in Ruwiki. This library is documented in
- RuwikiTemplatingLibrary.
-
- There are four major templates: content, edit, save, and error. Each of
- these has a slightly different combination of template files used, and
- this means that there are different sets of variables available.
-
- The major templates are &ldquo;composite templates&rdquo; that are
- defined as follows:
- ; content or search : body.tmpl, content.tmpl, controls.tmpl, footer.tmpl
- ; edit or preview : body.tmpl, edit.tmpl
- ; save : body.tmpl, save.tmpl, controls.tmpl, footer.tmpl
- ; error : body.tmpl, error.tmpl
-
- === Common Variables
- The following template variables are presented for all composite
- templates.
- ; <tt>%css_link%</tt> : The contents of the CSS file for the template set.
- ; <tt>%home_link%</tt> : A link to the root page of the Wiki.
- ; <tt>%editable%</tt> : A boolean value to mark the page as editable or not. Used in a conditional block in the templates.
- ; <tt>%cgi_url%</tt> : The URL for the Wiki.
- ; <tt>%content%</tt> : The formatted content of the current page.
- ; <tt>%page_project%</tt> : The project for the current page.
- ; <tt>%page_raw_topic%</tt> : The topic for the current page, escaped for safe transmission over the web.
- ; <tt>%page_topic%</tt> : The printable topic for the current page.
- ; <tt>%url_project%</tt> : The URL to the current page&rsquo;s project.
- ; <tt>%url_topic_search%</tt> : The URL to search for the current topic in the current project.
- ; <tt>%link_topic_search%</tt> : A link to the current topic search.
-
- === Variables for :content, :save, :search, :edit, :preview
- ; <tt>%message%</tt> : A message presented at the top of the Wiki when Ruwiki needs to inform the user of something that is not an error.
-
- === Variables for :content, :save, :search
- ; <tt>%wiki_title%</tt> : The title of the Wiki.
- ; <tt>%label_topic_or_search%</tt> : Either <tt>#topic#</tt> or <tt>#search#</tt>.
- ; <tt>%page_topic_name%</tt> : The same as <tt>%page_topic%</tt>.
-
- === Variables for :edit, :preview
- ; <tt>%wiki_title%</tt> : The title of the Wiki with a tag to indicate that the page is being edited.
- ; <tt>%page_content%</tt> : The content of the page.
- ; <tt>%page_version%</tt> : The current version number of the page.
- ; <tt>%unedited_page_content%</tt> : The formatted, unedited content of the page.
- ; <tt>%pre_page_content%</tt> : A Web-escaped form of the page content.
- ; <tt>%edit_comment%</tt> : The current edit comment.
-
- === Variables for :error
- ; <tt>%wiki_title%</tt> : The title of the Wiki with an error message.
- ; <tt>%name%</tt> : The name of the error.
- ; <tt>%backtrace%</tt> : The backtrace of the error.
- ; <tt>%backtrace_email%</tt> : The backtrace of the error formatted for sending by email.
- ; <tt>%webmaster%</tt> : The email address of the webmaster.
-
- == Translating Ruwiki Messages
- : NOTE: The mechanism for specifying language may be changed in a
- : future version of Ruwiki, although the internationalisation mechanism
- : will not be changing.
-
- Ruwiki is internationalized. This method sets the Ruwiki error messages
- (and a few other messages) to the specified language Module. The
- language Module must have a constant Hash called <tt>Message</tt>
- containing a set of symbols and localized versions of the messages
- associated with them.
-
- If the file <em>ruwiki/lang/es.rb</em> contains the module
- <tt>Ruwiki::Lang::ES</tt>, the messages for RSS could be localized to
- Spanish thus:
-
- require 'ruwiki/lang/es'
- ...
- wiki.config.language = Ruwiki::Lang::ES
-
- Localization is currently per wiki instance. In a servlet environment,
- this may mean that only a single language is recognised.
-
- It is recommended that the hash be created with a default proc that
- reports unknown message keys.
-
- Message = Hash.new { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
-
- == Extending Ruwiki Markup
-
- : <strong>WARNING:</strong> These \APIs will change in Ruwiki 0.9.0,
- : replacing the instance variables @project, @backend, and @script with
- : a Handler object. There may be other changes as well.
-
- Ruwiki&rsquo;s WikiMarkup can be extended by creating a new
- Ruwiki::Wiki::Token. Tokens will be automatically loaded if they are
- placed in <em>ruwiki/wiki/tokens</em>.
-
- It is recommended that new tokens be added to the test cases in
- <tt>tests/tc_tokens.rb</tt>.
-
- The following Ruwiki::Wiki::Token class will convert strings in the
- forms of \[ruby-talk:12345] to links.
-
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- === Known Instance Variables
- ==== @match
- The match data for this token instance is is kept in @match. This is
- what will be used in #replace and #restore.
-
- ==== @project
- The project being processed.
-
- ==== @backend
- The Backend for the wiki. If you are using Ruwiki tokenizers outside of
- Ruwiki, this does not need to be a \BackendDelegator, but can be the
- direct Backend (which expects less information).
-
- ==== @script
- The URI to the script.
-
- ==== @message
- The message hash for displaying localised messages.
-
- ==== @title
- The title of the wiki instance.
-
- === Required Methods
- ==== ::regexp
- Ruwiki tokens are matched only through regular expression matches. As
- shown in the example above, the regular expression for ruby-talk
- mailing list posts is <tt>%r{\[ruby-\talk:(\d+)\]}</tt>. The purpose of
- the ::regexp method is to return the regexp for matching.
-
- For most inline matches, Ruwiki will ensure that the escape character
- (\) works automatically. For whole-line matches, it is necessary to
- match the escape character manually and provide a #restore method.
-
- As an example, the \HRule class implements these methods.
-
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- It may also be necessary to match escapes manually on inline matches
- that must be along word boundaries where the regular expression
- includes characters that normally match word boundaries. The project
- index match (e.g., \::Ruwiki) regular expression does this
- <tt>%r{(\B|\\)::([A-Z][a-z]+)}</tt>.
-
- ==== #replace
- This returns the formatted token. In the \RubyTalkLinks class above,
- the matched regular expression will be replaced with a hyperlink. The
- text of the hyperlink will be the matched text; the target of the
- hyperlink will include the first captured value.
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
-
- === Optional Methods
- ==== ::rank
- By default, a token will be processed in the order created. Tokens may
- be given a specific rank to ensure that they are processed in a
- particular order. The default rank is <tt>9999</tt>.
-
- ==== #restore
- Restores the token without replacement. Implements the results of the
- escape character. Each Token class is responsible for its own
- restoration. As noted in #regexp, whole-line tokens are most likely to
- need a #restore implementation.
-
- ==== ::post_replace
- Performs any necessary massaging of the data. The Lists token uses this
- to ensure that lists are collapsed together; the Paragraph token uses
- this to ensure that there are no empty paragraph tag pairs
- (&lt;p&gt;&lt;/p&gt;).
-
- : <strong>Note:</strong> This has been changed from Ruwiki 0.6.x.
- : Plugins written for the Ruwiki 0.6.x Token API will need to be
- : modified so that this is defined as:
-
- def self.post_replace
- ...
- end
-
- : as opposed to:
-
- def post_replace
- ...
- end
-
- == Extending Ruwiki Backends
- Ruwiki can support varying backends, as the backend interface has been
- abstracted completely from the data store. The backend
- <strong>must</strong>:
-
- # reside in <em>ruwiki/backends/</em> as <em>backend_name</em>.rb.
- # be registered by adding the <em>backend_name</em> as a symbol (e.g., :<em>backend_name</em>) to Ruwiki::KNOWN_BACKENDS.
- # inherit from Ruwiki::Backend.
- # exist as Ruwiki::Backend::<em>\Backend_name</em>.
-
- === Required Methods
- ==== #initialize(storage_options)
- The backend may only obtain its configuration information from an
- option hash provided by the \BackendDelegate. This is obtained from
- <tt>wiki.config.options[backend]</tt>. If a configuration error is
- detected during initialization, the backend should raise the
- \Ruwiki::Backend exception class \BackendError. This would be done
- with:
-
- raise Ruwiki::Backend::BackendError.new([:message_symbol, [message_parameters]])
-
- Backend writers should add appropriate messages to the
- <em>lang/en.rb</em> at a minimum. The \BackendDelegator will detect
- this and report the results appropriately.
-
- ==== #load(topic, project)
- The backend will be provided the name of the topic and project. It must
- return the selected page as a hash of hashes. The hash must match that
- of \Ruwiki::Page#export. It will be passed as the parameter to
- \Ruwiki:::Page.new.
-
- ==== #store(page)
- This method must store the provided Ruwiki::Page object. Current Ruwiki
- backend implementations store the Ruwiki::Page#export hash. This method
- is responsible for calling the private method Backend#make_diff and
- adding the result to the list of diffs for the page.
-
- ===== Backend#make_diff(oldpage, newpage)
- This method expects two page objects, or their Ruwiki::Page#export
- representation. It will return a hash representing the difference set
- between the two pages.
-
- ==== #obtain_lock(page, time, expire, address = 'UKNOWN')
- Obtains an exclusive lock on the page. The \BackendDelegator is called
- with the page, the address, and a timeout which is provided. The time
- is provided by the call to the BackendDelegate, and the expire is also
- provided by the call to the BackendDelegate which is given a timeout
- value (by default 600 seconds). If the lock is still in effect, a
- second call to #obtain_lock should renew the timeout on the lock.
-
- ==== #release_lock(page, address = 'UNKNOWN')
- Releases the exclusive lock on the page. The lock should not be released
- unless the IP address on the lock is the same or the lock has expired.
-
- ==== #project_exists?(project)
- Returns <tt>true</tt> if the project exists.
-
- ==== #page_exists?(topic, project = 'Default')
- Returns <tt>true</tt> if the page exists within the specified project.
-
- ==== #create_project(project)
- Attempts to create the project.
-
- ==== #search_project(project, search_string)
- String search all topic names and content in a project and return a
- hash of topic hits:
-
- topicname => hits
-
- ==== #list_projects
- Return an array of all projects.
-
- ==== #list_topics(project)
- Return an array of all topics within the project.
-
- === Future Methods
- Note that these methods are currently optional (they are not yet called
- from Ruwiki), but will become required moving forward as the functions
- are implemented in Ruwiki.
-
- ==== #destroy(page)
- Removes the page from the wiki. This should <strong>not</strong> remove
- the change history of the topic (in the event that the page has been
- removed maliciously). There will be a separate method to remove the
- page history.
-
- ==== #destroy_project(project)
- Attempts to destroy the project.
-
- === Optional Methods
- These methods are completely optional. They are guarded in the
- \BackendDelegate by a call to #respond_to?().
-
- ==== #global_search(search_string)
- The global search in the backend delegate is by default implemented as
- a looping search through all projects. A backend may have a more
- efficient backend global search mechanism. If the backend responds to
- #global_search, then the \BackendDelegate will use this method.
-properties!project: Ruwiki
-properties!title: Extending_Ruwiki
-properties!topic: Extending_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/LicenseAndAuthorInfo.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
deleted file mode 100644
index 5d1c20e..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
+++ /dev/null
@@ -1,29 +0,0 @@
-page!content: = Ruwiki Licence
- Ruwiki is copyright &copy; 2002 - 2004 [mailto:alan@digikata.com Alan
- Chen] and [mailto:ruwiki@halostatue.ca Austin Ziegler].
-
- Ruwiki is provided free of use and without any warranty express or
- implied. You may use, distribute, or modify Ruwiki under the conditions
- of Ruby&rsquo;s licence or the [http://www.gnu.org/copyleft/gpl.html
- GNU General Public Licence].
-
- * Ruwiki includes a modified version of rdoc/template.rb originally by Dave Thomas for use in \RDoc.
-
- == Translations
- * Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen] on 2003.10.22, with corrections by Mauricio Fern&aacute;ez. Note that the initial template translations (./templates/de/) were done via \AltaVista Babelfish and should not be blamed on Christian.
- * Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fern&aacute;ndez] on 2003.10.22. Note that the initial template translations (./templates/es/) were done via \AltaVista Babelfish and should not be blamed on Mauricio.
-
- == Austin&rsquo;s Other Projects
- Austin has also released several other projects available on the RAA that you may be interested in:
- * [http://raa.ruby-lang.org/list.rhtml?name=mime-types MIME::Types], \RubyForge [http://rubyforge.org/projects/mime-types project].
- * [http://raa.ruby-lang.org/list.rhtml?name=pdf-writer PDF::Writer], \RubyForge [http://rubyforge.org/projects/ruby-pdf project].
- * [http://raa.ruby-lang.org/list.rhtml?name=text-format Text::Format], \RubyForge [http://rubyforge.org/projects/text-format project].
- * [http://raa.ruby-lang.org/list.rhtml?name=trans-simple Transaction::Simple], \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=uninheritable Uninheritable], Transaction::Simple&rsquo;s \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=diff-lcs Diff::LCS], Ruwiki&rsquo;s \RubyForge [http://rubyforge.org/projects/ruwiki project].
-properties!project: Ruwiki
-properties!title: LicenseAndAuthorInfo
-properties!topic: LicenseAndAuthorInfo
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/ProjectIndex.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/ProjectIndex.ruwiki
deleted file mode 100644
index e370528..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,83 +0,0 @@
-page!content: = Ruwiki %RV#%
- This is the \ProjectIndex page for Ruwiki. For any given project, the
- \ProjectIndex topic will be the default topic for plain project links.
-
- == Features and Information
- * This wiki supports a variety of WikiFeatures that you may be interested in. The rules for WikiMarkup are similar to some other wikis, but there are a few unique markup capabilities in Ruwiki.
- * Configuring_Ruwiki is simple.
- * Extending_Ruwiki is almost as simple.
- * What you need to know for using Ruwiki's [[Antispam]] capabilities.
- * Who wrote Ruwiki? Read the LicenseAndAuthorInfo.
-
- == Requirements
- Ruwiki currently requires Ruby 1.8, Diff::LCS 1.1.2 and
- Archive::Tar::Minitar 0.5.1. These packages are included in the
- <em>packages/</em> directory in the
- <code>ruwiki-0.9.0-full.tar.gz</code> form of the distribution.
-
- The YAML backend requires Ruby 1.8.2 preview 3 or later.
-
- == Upgrading
- Ruwiki %RV#% has a flatfile format that is incompatible with versions
- of Ruwiki older than Ruwiki 0.8.0. If you are upgrading from one of
- these versions, you must use the bin/ruwiki_convert. The simple case
- will be (assuming that your data files are in ./data):
-
- % ruwiki_convert ./data
-
- The ruwiki_convert utility is automatically installed by \RubyGems and
- RPA. See RuwikiUtilities for more information. Note that this utility
- will probably be incorporated into the main Ruwiki utility in a future
- version.
-
- == Getting Started
- There are some differences between the startup of <tt>.tar.gz</tt>,
- \RubyGems, and RPA installations of Ruwiki.
-
- === \QuickStart (Read-only: \RubyGem and RPA Installation Only)
- Run:
- % ruwiki_servlet --central
-
- Point your web browser to \http://localhost:8808/.
-
- === \QuickStart (CGI)
- # Install the Ruwiki CGI (<tt>ruwiki.cgi</tt>) program in a place where your webserver can execute it.
- #* <strong>\RubyGem:</strong> <tt>ruwiki install cgi,data --to <em>directory</em></tt>
- #* <strong><tt>.tar.gz</tt>:</strong> Extract the Ruwiki directory to that directory. <tt>cp bin/ruwiki.cgi .</tt> <em>or</em> <tt>copy bin\ruwiki.cgi .</tt>
- # Point your web browser to the appropriate URL.
-
- === \QuickStart (\WEBrick)
- # Install the Ruwiki servlet or data.
- #* <strong>\RubyGem:</strong> <tt>ruwiki install data --to <em>directory</em></tt> <em>or</em> <tt>ruwiki install servlet,data --to <em>directory</em></tt>
- #* <strong><tt>.tar.gz</tt>:</strong> Extract the Ruwiki directory.
- # Run <tt>ruwiki_servlet</tt>. Under the <tt>.tar.gz</tt>, this would be <tt>bin/ruwiki_servlet</tt> <em>or</em> <tt>ruby bin\ruwiki_servlet</tt>
- # Point your web browser to \http://localhost:8808/.
-
- == Support
- * Troubles with Ruwiki? See TroubleShooting for some suggestions. Have a new problem? Add it to the main [http://ruwiki.rubyforge.org/ruwiki.cgi/Ruwiki/TroubleShooting TroubleShooting] page.
- * Subscribe to [http://rubyforge.org/mailman/listinfo/ruwiki-discuss ruwiki-discuss] ([http://rubyforge.org/pipermail/ruwiki-discuss/ archives]).
- * You can also use the [http://rubyforge.org/forum/?group_id=84 Ruwiki Public Forum] or the on \RubyForge.
-
- == Tracking Ruwiki Development
- The development progress of Ruwiki is kept primarily in the wiki
- itself, but the services of [http://rubyforge.org RubyForge] are used
- as well.
- * The BugTracking page in Ruwiki keeps track of open and closed bugs in Ruwiki. Bugs can also be found in the \RubyForge [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug tracker] and [http://rubyforge.org/tracker/?atid=408&group_id=84&func=browse Support Requests].
- * The To_Do list keeps track of major development goals for Ruwiki. Items for this list can be found on \RubyForge in [http://rubyforge.org/tracker/?atid=410&group_id=84&func=browse Feature Requests] and [http://rubyforge.org/tracker/?atid=409&group_id=84&func=browse Patches].
- * There is a mailing list to track CVS changes: [http://rubyforge.org/mailman/listinfo/ruwiki-checkin ruwiki-checkin] ([http://rubyforge.org/pipermail/ruwiki-checkin/ archives]).
-
- == Different Features?
- If this wiki doesn&rsquo;t have the right combination of features, (or if it
- just doesn&rsquo;t feel right) try these other Ruby-based Wikis:
-
- * [http://pimwiki.rubyforge.org/ PIMWiki]
- * [http://instiki.rubyforge.org/ Instiki]
- * [http://www.walrus-ruby.org/amrita/cgi-bin/aswiki/aswiki.cgi Amrita Wiki]
- * [http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=top RWiki]
- * [http://www.xpsd.com/MiniRubyWiki MiniRubyWiki]
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/Roadmap.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/Roadmap.ruwiki
deleted file mode 100644
index 50e311b..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/Roadmap.ruwiki
+++ /dev/null
@@ -1,224 +0,0 @@
-page!content: = Ruwiki %RV#%: The Road Ahead
- This roadmap is accurate as of the release of 0.9.0.
-
- What lies ahead for Ruwiki? The To_Do list will give a detailed list
- of what is to follow, but this list is not the roadmap. There is no
- clear indication of the reason for &mdash; and in some cases, the
- meaning of &mdash; the items on the list. The intention of this
- document is to expand on that list. As items are completed, they will
- be removed from this document.
-
- == A Note About Targets
- Ruwiki development is not proceeding as quickly as I would prefer, but
- it is continuing steadily. I am at times choosing to delay releases
- and bypass some versions because there are other pressing concerns; I
- am definitely aiming for quality here, not for timeliness.
-
- == Development Inputs
- The primary driver of development on Ruwiki is the needs of a few
- groups of people. First, both Alan and Austin use or will use Ruwiki
- at work. There are particular needs that both have. Austin will be
- replacing an installation of \PhpWiki with an installation of Ruwiki
- sometime in early 2005.
-
- Second, [http://www.rubygarden.org/ruby RubyGarden], and
- [http://www.rubyforge.org RubyForge], and the
- [http://rpa.rubygarden.org <acronym title="Ruby Production Archive">RPA</acronym>]
- have expressed an intention to replace the Perl-based \UseMod wiki
- with a Ruby-based wiki. The popular and easy-to-use Instiki
- (&ldquo;there is no step 3&rdquo;) is not an ideal choice for either
- because they either require or prefer a CGI-based wiki. Ruwiki has the
- desired level of performance and implemenation simplicity that
- impresses both groups, and it is the current preferred choice. Thus,
- the needs of both websites factor highly into the goals for Ruwiki.
-
- Third, Austin gave a talk on Ruwiki at \RubyConf 2004. Many of the
- features in the current release come from a development effort leading
- up to the talk and in the weeks following.
-
- Last, and certainly not least, feature requests and bug reports are a
- factor. One of the things that changed in Ruwiki 0.8.0 was the look
- and feel; admittedly, the look and feel in earlier versions was a bit
- garish, designed to fit in with a particular website more than be a
- general wiki theme. Users complained, and we changed this. The
- continual spam defacement of the \RubyGarden wiki suggested several
- possible improvements that could be made in Ruwiki to fight wiki spam;
- initial work has been implemented in Ruwiki 0.9.0 and more work
- remains. Additionally, Ruwiki is the first wiki with built-in
- deployment support for package management systems (such as \RubyGems
- and rpa-base), although Instiki has been modified for RPA by the RPA
- team to support limited installation in RPA locations.
-
- == Ruwiki 0.10.0: &ldquo;Are You Being Served?&rdquo;
- Ruwiki 0.8.0 introduced an incompatible change in the way that page
- diffs were stored, so users were advised to remove any existing .rdiff
- files. This isn&rsquo;t as problematic as it may sound, as until
- 0.10.0, there is no way to actually view the page diffs from Ruwiki
- itself.
-
- In Ruwiki 0.7.0, a new token was introduced: %calendar(). The concept
- here is a sound one that can be extended to make token addition
- easier. Currently, it is necessary for token writers to create their
- own regular expressions. The &ldquo;function token&rdquo; will be
- added &mdash; although the form may not be
- &ldquo;%<em>function-name</em>&rdquo; &mdash; that will work with
- either a line replacement or a word replacement so that the regular
- expression does not need to be written. Tests for the replacement will
- still need to be written, but standardizing new custom tokens will be
- a good thing.
-
- Chad Fowler&rsquo;s port of \RubLog&rsquo;s vector search will
- probably be added to this version.
-
- The presence of static HTML content (headers and footers) per page has
- been accounted for in Ruwiki 0.8.0, but it will not be displayed.
- Further, there is currently no way to specify or display static
- content for the wiki or the project. (A related problem here is that
- projects do not have any properties. This will become important as
- projects should be able to be marked private within a wiki in the
- future.)
-
- The purpose of the \WikiWikiWeb is to provide a collaborative,
- community knowledge editing environment. Unfortunately, the pondscum
- known as spammers have figured out that the \WikiWikiWeb provides a
- positive Google \PageRank, and having their links on our Wikis is
- benefits them. Just as they don&rsquo;t care about filling our
- mailboxes with junk, they don&rsquo;t care about defacing our
- community knowledge. Ruwiki 0.10.0 provides additional antispam
- defences.
-
- The \RecentChanges mechanism will be updated to make it possible to
- see the \GlobalRecentChanges list.
-
- The most significant change in Ruwiki 0.10.0 will be the modification
- of the request pipeline. This will not be visible to the end user, but
- it will be significant to users who wish to extend Ruwiki. Currently,
- Ruwiki processes all commands in ruwiki.rb. In Ruwiki 0.10.0, this
- will be changed to a dispatch mechanism, where Action objects are
- introduced, and ruwiki.rb dispatches requests to Action objects.
-
- <table summary="Pipeline" style="border: 1px solid black"><tr><td>
- +---------+ +-------------------+
- | Request |--------->| Authorize Request |
- +---------+ +-------------------+
- |
- v
- +-------------------+
- | Configure Ruwiki |
- +-------------------+
- |
- v
- +-------------------+
- | Parse Request |
- +-------------------+
- |
- v
- +-------------------+
- | Perform Action |
- +-------------------+
- |
- v
- +-------------------+
- | Prepare Response |
- +-------------------+
- |
- v
- +--------+ +----+--------------+
- | Page |<----------| Send Page |
- +--------+ +-------------------+
- </td></tr></table>
-
- The diagram above shows the general pipeline. The difference is that
- the action will be its own object. In general, it will need to know
- how to process certain URL formats.
-
- In the process of defining the action objects, \ActionCards will be
- created. Below is an example \ActionCard for the default action,
- <tt>_show</tt>. In \ActionCards, everything is relative to the Ruwiki
- root URI. Important to note is that \ActionCards are an ideal: they may
- not represent something that can be accomplished for 0.10.0, 0.11.0,
- or even 1.0. They do, however, represent the ultimate target.
-
- Ruwiki does some implicit URI rewriting in the general form of:
-
- <table summary="Ruwiki URI rewriting" style="border: 1px solid black; border-collapse: collapse">
- <tr><th style="border: 1px solid black">URI</th><th style="border: 1px solid black">Rewritten URI</th></tr>
- <tr><td style="border: 1px solid black">/</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Action</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action</td></tr>
- <tr><td style="border: 1px solid black">/Topic</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/</td><td style="border: 1px solid black">/Project/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/Action</td><td style="border: 1px solid black">/Project/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action</td></tr>
- <tr><td style="border: 1px solid black">/Project/Topic</td><td style="border: 1px solid black">/Project/Topic/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/Topic/Action</td><td style="border: 1px solid black">/Project/Topic/Action</td></tr>
- </table>
-
- <table summary="_show Action Card" style="border: 1px solid black"><tr><td>
- === Action: Show [_show] <strong>DEFAULT</strong>
- The Show action is the default action that will be performed when
- there is no action specified. Without any arguments, the latest
- version of the page will be displayed.
-
- ==== Action Arguments
- ; ?r=<em>revision</em> : Show the specified revision of the page.
- ; ?r : Show the list of revisions known to the page.
- ; ?r=<em>revision1</em>:<em>revision2</em> : Shows the difference of revision1 and revision2 for the page.
- ; ?r=:<em>revision</em> : Shows the difference between the current page and the specified revision.
- ; ?d=<em>yyyymmdd[:hh[mm[ss]]]</em> : Shows the last revision from at or before the specified date and time. If time is not specified, it is assumed to be 23:59:59.
-
- ==== Interaction Notes
- Without arguments, _show generates pages pages that are editable and
- indexable (<meta name="robots" content="index,follow,archive">). If
- any argument is specified, the page is still editable, but not
- indexable (<meta name="robots" content="noindex,nofollow,noarchive">).
- </td></tr></table>
-
- == Ruwiki 0.11.0: &ldquo;What&rsquo;s My Line?&rdquo;
- The antispam techniques introduced in 0.9.0 are positive steps in the
- fight against wiki defacement. They are hopefully effective, too. The
- problem is that because 0.9.0 doesn&rsquo;t offer users or user
- authentication, there&rsquo;s no way of safely allowing the edit of
- the antispam lists. Thus, to allow this and other potentially
- dangerous actions, a user and capability framework will be added to
- Ruwiki. This framework will allow for user identification,
- authentication, and authorization to indicate what users are allowed
- to perform what actions.
-
- Authenticated users will be able to bypass blacklist checking; thus,
- if &ldquo;msn.com&rdquo; is blocked, &ldquo;joe.blog@msn.com&rdquo;
- could still authenticate with Ruwiki and edit the pages. Some users
- will be able to manage user permissions (including user management),
- edit antispam lists, etc.
-
- Other actions will be added, including the ability to rename topics
- and move topics between projects. In both cases, the topic change
- history must be maintained.
-
- The documentation for Ruwiki will be substantially complete with this
- version, lacking only specific information on the features that will
- be added in Ruwiki 1.0.0.
-
- == Ruwiki 1.0.0: &ldquo;Yes, Minister&rdquo;
- A combined strength and weakness of Ruwiki is that it currently does
- little to protect against arbitrary HTML being inserted into the
- current topic. The allowed subset of HTML should be restricted to a
- safe subset to prevent cross-site-scripting attacks.
-
- Pages and projects have properties: we need to provide the ability to
- edit those properties. Part of the properties that should be editable
- include whether a page is frozen &mdash; this means that the page is
- no longer editable by any user (unless it is unfrozen) and is
- effectively a plain HTML page. Other properties include the static
- header and footer information in a page or project.
-
- Modern Wikis require an RSS feed. Ruwiki will provide one.
-
- == The Future: &ldquo;Yes, Prime Minister&rdquo;
- Ruwiki 1.0.0 does not represent the end of the line for Ruwiki, but
- what the future holds is unclear. We&rsquo;ll see what the future
- brings.
-properties!project: Ruwiki
-properties!title: Roadmap
-properties!topic: Roadmap
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
deleted file mode 100644
index d738c18..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
+++ /dev/null
@@ -1,155 +0,0 @@
-page!content: = Ruwiki %RV#% Templating
- Ruwiki uses a heavily modified version of the \RDoc
- &ldquo;cheap-n-cheerful&rdquo; HTML page template system. This a
- line-oriented, text-based templating system.
-
- == Templates
- Templates in the templating system are essentially plain strings with
- particular references to templating keys or an include directive.
-
- The template interacts with value and message hashes provided by
- Ruwiki. The keys known to the templates expected by Ruwiki are
- detailed in Extending_Ruwiki. Nested key references are found from the
- inside-out. That is, the closest resolving key to the current level is
- found, not the furthest resolving key.
-
- === Including Other Templates
- Templates may include other templates to any arbitrary level by using
- the <tt>!INCLUDE!</tt> directive. When the \TemplatePage is created,
- an array of template strings are provided; these will be used to
- satisfy <tt>!INCLUDE!</tt> directives. If there are not enough
- template strings provided, <tt>!INCLUDE!</tt> won&rsquo;t be
- translated.
-
- : This may change before Ruwiki reaches 1.0, so that templates are
- : named instead of iterated.
-
- === Simple Template Keys
- Strings of the format <tt>%<em>key</em>%</tt> or
- <tt>%?<em>key</em>%</tt> are simple template keys. <em>key</em> is
- looked up in the provided value hash and is presented as the string
- value of the result. <tt>%key%</tt> template keys are mandatory; if
- the key is not found in the value hash, an exception will be raised.
- <tt>%?key%</tt> template keys are optional; if they key is not found
- in the value hash, an empty string (&ldquo;&rdquo;) will be used.
-
- === Labels
- Strings of the format <tt>#<em>key</em>#</tt> or
- <tt>#?<em>key</em>#</tt> are labels. <em>key</em> is looked up in the
- provided message hash as a Symbol (e.g.,
- <tt><em>key</em>.intern</tt>). As with simple template keys,
- <tt>#key#</tt> labels are mandatory and <tt>#?key#</tt> labels are
- optional.
-
- === Links
- Strings of the format <tt>HREF:\ref:name</tt> will become HTML links.
- Both <em>ref</em> and <em>name</em> are keys to be looked up.
- <em>name</em> is mandatory; an exception will be raised if it is not
- found.
-
- === Control Structures
- The templating library supports both looping and conditional control
- structures in both single-line and multi-line forms. Single-line
- control structures <strong>may not</strong> be nested; multi-line
- control structures <strong>may</strong> be nested arbitrarily deeply.
-
- ==== Looping Control Structures
- There are two forms of looping control structures.
-
- [:key|stuff:]
-
- START:key
- ... stuff ...
- END:key
-
- ===== Single-Line Looping
- [:key|stuff:]
-
- The value of <em>key</em> may be <tt>nil</tt>, an integer value, a
- range, or an array. When <em>key</em> represents:
- # <tt>nil</tt>, the looping structure will be replaced with an empty string.
- # An integer, <em>stuff</em> will be repeated <em>key</em> times. Values from 1 to <em>key</em> will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # A range, <em>stuff</em> will be repeated once for each successive value in the range of <em>key</em>. Each value will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # An array, the behaviour will differ depending on the contents of the array.
- ## If the array contains hashes, the behaviour is the same as a multi-line looping construct. See below for details.
- ## Otherwise, the template iterates through the array, providing each value to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
-
- As an example, if we have:
-
- "[:b|%b% ]"
-
- # <tt>val["b"] = 3 -> "1&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = (0..2) -> "0&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = ["a", "B"] -> "a&nbsp;B&nbsp;"</tt>
-
- ==== Multi-Line Looping
- START:key
- ... stuff ....
- END:key
-
- The value of <tt>key</tt> must be an array of hashes. <tt>... stuff
- ...</tt> will be repeated once for each entry in the array. The hashes
- will be passed as nested value hashes.
-
- %a% [:b|%a% ]%a%
-
- When the above template string is run with the following hash:
-
- val["a"] = 1
- val["b"] = [ { "a" => 2 }, { "a" => 3 } ]
-
- The result is:
-
- 1 2 3 1
-
- The behaviour is the same for multi-line blocks.
-
- ==== Conditional Block Keys
- IF:key
- ... stuff ...
- ENDIF:key
-
- The block between <tt>\IF:key</tt> and <tt>\ENDIF:key</tt> will be included in
- the output only if the corresponding key is set in the value hash.
-
- == Example
- Given the set of templates T1, T2, and T3 (shown below), here&rsquo;s how we would
- use the templating system.
-
- values = { "name" => "Dave", "state" => "TX" }
- t = TemplatePage.new(T1, T2, T3)
- File.open(name, w) { |f| t.process(f, values) }
-
- or:
-
- <!-- Source -->
- val1 = { "name" => "Dave", "state" => "TX" }
- val2 = { "name" => "Dave" }
- msgs = { }
- res = ""
- t.process(res, values, msgs)
-
- <!-- T1 -->
- Templates can subsitute a wide variety of values.
- !INCLUDE!
-
- <!-- T2 -->
- Name: %name% !INCLUDE!
-
- <!-- T3 -->
- IF:state
- State: %state%
- ENDIF:state
-
- The result will be:
-
- Name: Dave
- State: TX
-
- Name: Dave
-properties!project: Ruwiki
-properties!title: RuwikiTemplatingLibrary
-properties!topic: RuwikiTemplatingLibrary
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/RuwikiUtilities.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/RuwikiUtilities.ruwiki
deleted file mode 100644
index aef7e1f..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/RuwikiUtilities.ruwiki
+++ /dev/null
@@ -1,156 +0,0 @@
-page!content: = Ruwiki %RV#% Utilities
- Ruwiki %RV#% provides two utilities and three sample programs for
- deployment.
-
- == Managing Ruwiki Deployments
- A major change to the way that Ruwiki %RV#% works as compared to
- versions of Ruwiki 0.8.0 or earlier is that Ruwiki %RV#% supports being
- installed in a central location by one of the two major packaging
- systems available for Ruby (\RubyGems and RPA). Managing these
- deployments is accomplished with the utility appropriately enough named
- <tt>ruwiki</tt>, stored in the directory of the distribution.
-
- This utility has little value for users of the standalone release
- (either of the versions packaged in tarfiles or zipfiles), but is
- developed because packaging systems present a particular challenge to
- Ruwiki, as simply running &ldquo;ruwiki_servlet&rdquo; with no
- arguments will look for the data files and the template files relative
- to the current directory. With \RubyGems, though, this would require
- that the user specify something like:
-
- ruwiki_servlet \
- --template-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.9.0/templates \
- --flatfiles-data-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.9.0/data
-
- This is not the preferred option because Wiki installations may be
- private and the /usr/local directory is a system-wide shared
- directory. Additionally, since Ruwiki works as a CGI, the system
- shared data and template paths will not be generally accessible (and
- should not be world-writeable!) to CGI executables.
-
- This utility also encapsulates Win32 service management through
- Win32::Service for the \WEBrick servlet runner.
-
- === <tt>ruwiki <command> [<em>parameters</em>]</tt>
- The <tt>ruwiki</tt> utility will recognise four different commands on
- all platforms and a fourth command on Windows. These commands are:
-
- ; help : Displays general help or command-specific help.
- ; install : Installs the default deployment package.
- ; package : Packages a Ruwiki installation.
- ; unpackage : Unpackages a Ruwiki installation.
- ; service : Manages a Win32::Service for Ruwiki.
-
- ==== <tt>ruwiki help commands</tt>
- The list of known commands can be displayed by providing this command.
-
- % ruwiki help commands
- ==== <tt>ruwiki help <command></tt>
- The help for the named command (one of install, package, unpackage, or
- service) will be displayed upon providing this command to the ruwiki
- utility.
-
- % ruwiki help install
- ==== <tt>ruwiki install [<em>OPTIONS</em>] [<em>--to DEST</em>]
- Creates a new Ruwiki instance in the current directory or the directory
- specified by the <tt>--to</tt> option. By default, the data, template,
- and a default configuration file are installed to the destination
- directory. OPTIONS may be one of the following:
-
- ; servlet : Installs the Ruwiki WEBrick servlet stub.
- ; service : Installs the Ruwiki Win32::Service stub.
- ; cgi : Installs the Ruwiki CGI script model.
- ; data : Default; installs the Ruwiki default data, templates, and configuraiton file.
-
- Installation option names can be disabled with a dash (&lsquo;-&rsquo;)
- or the word &lsquo;no&rsquo;, making &lsquo;-data&rsquo; and
- &lsquo;nodata&rsquo; functionally equivalent.
-
- % ruwiki install cgi data
- ==== <tt>ruwiki package [<em>SOURCE</em>] [<em>--output PACKAGE</em>|<em>-o PACKAGE</em>] [<em>--replace</em>]</tt>
- Packages the Ruwiki files (data, templates, and executables) from the
- specified source or the current directory into the specified output
- package (or &ldquo;./ruwiki.pkg&rdquo;). If the SOURCE is a ruwiki
- configuration file (e.g., &ldquo;ruwiki.conf&rdquo;), then that will be
- used to determine the location and name of the data and template
- directories.
-
- Specify <tt>--replace</tt> to replace the existing output package. If
- an output package is specified that already exists, then <tt>ruwiki
- package</tt> will refuse to output to the file unless
- <tt>--replace</tt> is specified. If an output package is not specified
- and <tt>--replace</tt> is not specified, then an incremental package
- will be generated (e.g., &ldquo;./ruwiki-1.pkg&rdquo;).
-
- : NOTE: The packaging process will normalize the data and templates
- : directory names to be relative to the unpacking directory. They will
- : NEVER be absolute paths.
-
- % ruwiki package
- ==== <tt>ruwiki unpackage [<em>SOURCE</em>] [<em>--output DIRECTORY</em>|<em>-o DIRECTORY</em>]</tt>
- Unpackages the provided Ruwiki package (default "./%1$s") into the
- specified directory (default ".").
-
- % ruwiki unpackage
- ==== <tt>ruwiki service <command> <NAME> [<em>command-options</em>]</tt>
- Manages a Ruwiki WEBrick servlet as a Win32 service (with the
- assistance of
- [http://raa.ruby-lang.org/list.rhtml?name=win32-service win32-service]).
- This works in ways similar to a daemon on Unix. The sub-commands
- available to <tt>ruwiki service</tt> are:
- ===== <tt>ruwiki service install NAME [DESCRIPTION] [options]</tt>
- Installs the Ruwiki WEBrick servlet as the named Win32 service.
- <tt>install</tt> accepts an optional description (all non-options will
- be included in the description). The options for <tt>install</tt> are:
- ; --rubybin RUBYPATH : The path to the Ruby binary.
- ; --exec SERVICEPATH : The path to the service executable.
- ; --home PATHTOHOME : The path to the home directory.
- ===== <tt>ruwiki service start NAME</tt>
- Starts the named Ruwiki service.
- ===== <tt>ruwiki service stop NAME</tt>
- Stops the named Ruwiki service.
- ===== <tt>ruwiki service delete NAME</tt>
- Deletes the named Ruwiki service.
-
- : NOTE: This command can probably be used to manage other Win32
- : services that respond to the appropriate commands.
-
- == Upgrading and Converting: ruwiki_convert
- : This section was formerly a separate entry in the Wiki entitled
- : &ldquo;Upgrading and Converting&rdquo;.
-
- The flatfile backend format in Ruwiki %RV#% is not compatible with that
- of versions of Ruwiki earlier than 0.8.0. There are a number of
- reasons for this, but because of this and that there are now three
- different backend formats, Ruwiki now has a converter utility between
- backends.
-
- There are two other incompatibilities of note:
- # Ruwiki now defaults to &ldquo;ruwiki&rdquo; as an extension (e.g., \ProjectIndex.ruwiki) to the storage files. This is, of course, is something that can be modified with a configuration option, but you may find it desirable to rename your files to match this naming convention.
- # The rdiff format is incompatible. It is recommended that you remove all .rdiff files from your data directory before using Ruwiki.
-
- === ruwiki_convert [options] <directory>+
- The converter utility will work on all files in a directory and its
- subdirectories.
-
- When a file is encountered, it will be examined to be a known form of a
- Ruwiki backend (marshal, yaml, flatfiles, or "old" flatfiles). If the
- file is not one of these forms, then the file is skipped. Otherwise, it
- is converted to the specified format. By default, the converted files
- will be backed up.
-
- ==== ruwiki_convert Options
- ; --format=FORMAT : Converts encountered files (regardless of the current format), to the specified format. Default is yaml. Allowed formats are: yaml marshal flatfiles
- ; --[no-]backup : Create backups of upgraded files. Default is --backup.
- ; --backup-extension=EXTENSION : Specify the backup extension. Default is "~", which is appended to the data filename.
- ; --extension=EXTENSION : Specifies the extension of Ruwiki data files. The default is .ruwiki
- ; --no-extension : Indicates that the Ruwiki data files have no extension.
- ; --quiet : Runs quietly. Default is to run with normal messages.
- ; --verbose : Runs with full messages. Default is to run with normal messages.
- ; --help : Shows this text.
-properties!project: Ruwiki
-properties!title: RuwikiUtilities
-properties!topic: RuwikiUtilities
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/SandBox.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/SandBox.ruwiki
deleted file mode 100644
index dfe4911..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/SandBox.ruwiki
+++ /dev/null
@@ -1,8 +0,0 @@
-page!content: This page is intended for users to play with freely to practice
- their \WikiFormatting.
-properties!project: Ruwiki
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/To_Do.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/To_Do.ruwiki
deleted file mode 100644
index 38242fd..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/To_Do.ruwiki
+++ /dev/null
@@ -1,50 +0,0 @@
-page!content: = Ruwiki %RV#% To Do Tracking
- Completed to-do items can be found in the ChangeLog. Bugs in Ruwiki
- are tracked in BugTracking.
-
- == Well-Defined To Do Items
- === Ruwiki 0.10.0
- ; Versioning : complete the change history interface. Change history is currently stored in a file <em>topic[.extension]</em>.rdiff. There is no way to display the change history at this point.
- ; Action objects : Actions will be generalised to pull the processing out of the main ruwiki.rb inasmuch as is possible.
- ; Function tokens : generalize the %&lt;function-name&gt;[(&lt;args&gt;)] calling method so that function tokens can be created without having to create a custom regular expression.
- ; Search work : There is further search work required. The current mechanism is effective, but inefficient, as it must load and convert each file in a project to a page and then search selectively within that page. The search mechanism must be improved.
- ; Frozen content : make it so that frozen content can be provided on a per-page or Wiki basis. Will provide both headers and footers. <strong>Note:</strong> Ruwiki 0.9.0 will only provide the ability to present the information, not create or modify it.
- ; Blacklisting : Allow the specification of an allow/deny list for \IPs or hostnames, aimed at blocking known spammers. Entries in this list can be permanent or temporary (e.g., &ldquo;* DENY&rdquo;, &ldquo;spammer.com DENY UNTIL 20040723&rdquo;, &ldquo;139.244.33.25 ALLOW&rdquo;).
- ; External URL redirection : Add whitelisting of known good external URIs.
- ; \GlobalRecentChanges : Recent changes for all projects.
- ;
- === Ruwiki 0.11.0
- ; Authentication : complete authentication to provide for a standard Ruwiki authentication mechanism, not just an external API. This may require changes to the existing external API. Allows for user creation and authentication. Authenticate users bypass blacklist checking; thus, if &ldquo;msn.com&rdquo; is blocked, joe.blog@msn.com could still authenticate with Ruwiki and edit the pages.
- ; Topic renaming : add the ability to rename a topic within a project. Topic change history should be maintained.
- ; Topic moving : add the ability to move and/or rename a topic between projects. Topic change history should be maintained.
- ; Complete documentation : Complete the documentation of Ruwiki.
- ; Antispam : Allow the on-line editing of antispam lists to authenticated and authorised users.
- === Ruwiki 1.0.0
- ; RSS Feed : Ruwiki must be able to offer \RecentChanges and \GlobalRecentChanges as RSS feeds. This may not be ideal with the current \RecentChanges format. It may be easier to move to a two-stage \RecentChanges format.
- ; Static content : Allow the creation and editing of static content.
- ; Frozen pages : provide the ability to freeze content in place; the page is no longer &ldquo;wiki&rdquo; editable and is effectively a plain HTML page.
- ; Page properties : provide the ability to generally edit the properties of a given page.
-
- == General Future To Do Items
- ; E-mail gateway : accept topic appends via e-mail.
- ; alternative backends : access other wiki data storage, or other formats, e.g. e-mail boxes in mh or mbox formats
- ; bug tracker backend : with alternate markup
- ; add setup and user config methods : for backend plugin classes, then we can use them with an interactive or gui tool frontend to setup data storage backends. The user might have to run as root or other user with database create permissions.
- ; add id="" to various markup elements (make id specific to topic) : Later we can allow users to tweak a page using uploaded css fragments which might get appended onto the standard css contents.
- ; ruby action : upload a ruby code fragment to add a smart &ldquo;action&rdquo; to that wiki page. Need some sort of security + approval system to handle this safely.
- ; Preview button : add a preview button to the save page.
- ; Alternative templating systems : not as high priority now that there&rsquo;s a real templating system in place.
- ; Alternative markup systems : potentially allow \RedCloth (Textile) and/or \BlueCloth (Markdown) to be processed for a page. This could be implemented as a %function.
- ; Project/topic security : allow certain projects to be restricted/authenticated for read/write based on user.
- ; Track last <em>n</em> links/topics : ?
- ; Write a markup debugger : ?
- ; Validate topic formatting from cgi : ?
- ; Validate project from cgi : ?
- ; Project-based backend : Allow different projects to have different backends.
- ; Arbitrary-depth project namespace support : Foo::Bar::\BazPage.
-properties!project: Ruwiki
-properties!title: To_Do
-properties!topic: To_Do
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/TroubleShooting.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/TroubleShooting.ruwiki
deleted file mode 100644
index 7ccfde4..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/TroubleShooting.ruwiki
+++ /dev/null
@@ -1,32 +0,0 @@
-page!content: = Ruwiki %RV#%
- = Ruwiki %RV#% Troubleshooting Tips
- Following are some tips contributed by users of Ruwiki. Remember:
- Ruwiki currently requires Ruby version 1.8; the YAML backend requires
- Ruby version 1.8.2 or the latest CVS of Ruby 1.9.
-
- == No such file or directory
- (Unix systems only.) If you get something like:
-
- % ./ruwiki_servlet
- : no such file or directory
-
- run the following in the Ruwiki directory:
-
- % find . | xargs dos2unix
-
- The developers of Ruwiki do what they can to ensure that Ruwiki is
- distributed in a way that works well for both Unix and Windows
- systems, but this will occasionally cause problems.
-
- == undefined method
- % ./ruwiki_servlet
- ./ruwiki_servlet:64: undefined method `[]=' for nil (NameError)
-
- This may appear if you are running Ruby 1.6. Ruwiki requires Ruby 1.8
- or higher; certain features require Ruby 1.8.2 preview 3 or better.
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/WikiFeatures.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/WikiFeatures.ruwiki
deleted file mode 100644
index e47ffdd..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/WikiFeatures.ruwiki
+++ /dev/null
@@ -1,16 +0,0 @@
-page!content: Ruwiki is a [http://www.ruby-lang.org Ruby]-based wiki. It is
- ideal for personal or small team use.
-
- Ruwiki:
- * Uses the [http://www.ruby-lang.org Ruby] language.
- * Runs quickly and easily as a CGI or \WEBrick servlet.
- * Uses a simple templating system and CSS for presentation.
- * Has flatfile storage with simple versioning.
- * Offers project namespaces. Different projects can have the same topic names and not collide. Thus, \Default::ReadMe and \Project::ReadMe are two different pages.
- * Offers a calendar for date-based collaborative editing.
-properties!project: Ruwiki
-properties!title: WikiFeatures
-properties!topic: WikiFeatures
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Ruwiki/WikiMarkup.ruwiki b/ruwiki/tags/release-0.9.3/data/Ruwiki/WikiMarkup.ruwiki
deleted file mode 100644
index 3480564..0000000
--- a/ruwiki/tags/release-0.9.3/data/Ruwiki/WikiMarkup.ruwiki
+++ /dev/null
@@ -1,260 +0,0 @@
-page!content: = Ruwiki Markup
- A [http://c2.com/cgi/wiki Wiki] obeys certain formatting rules to make
- it easy to format text without needing to know HTML. This Wiki obeys
- the following rules by default. Because Ruwiki is extensible, there may
- be additional formatting rules. These rules are those rules that apply
- as of Ruwiki %RV#%.
-
- == \WikiWords, \WikiProjects, Calendars, and External Resources
- While reading stuff on this Wiki, you will see some words mashed
- together with capitalisation (like \WikiWords). While this may seem odd
- at first, this feature allows internal links to be created across the
- Wiki.
-
- There are several allowable forms for \WikiWords.
- # Two or more words concatenated directly. Each word must begin with a capital letter and be followed by zero or more lowercase letters. Thus, \FooBar, \CPlusPlus, and \AbC are all valid \WikiWords, but ABC is not.
- # Two or more words concatenated with underscores. The first word must begin with a capital letter. This makes \Foo_Bar, \C_Plus_Plus, and \A_b_C valid \WikiWords. These \WikiWords will be displayed with spaces instead of underscores. \C_Plus_Plus will be displayed as &ldquo;C Plus Plus&rdquo;.
- # One or more words contained in double square brackets. This the form supported by [http://wikipedia.com/ Wikipedia], and looks like \[[A Wiki Phrase]]. These links will be displayed exactly as entered between the brackets.
- # One or more words contained in double square brackets with display text separated by a vertical bar. These \WikiWords look like \[[A Wiki Phrase|but show this text]]. The link will be to the page &ldquo;A Wiki Phrase&rdquo; and &ldquo;but show this text&rdquo; will be the hyperlink.
-
- If a \WikiWord is found that does not have a page defining the
- \WikiWord, then the word will be shown with a hyperlink question mark
- following it, allowing the \WikiWord to be created.
-
- === \WikiProjects
- This Wiki supports &ldquo;projects.&rdquo; Within each project, a given
- \WikiWord is unique. Thus, if you have a Default project and a Ruwiki
- project, you can have two pages called \ReadMe. Any given \WikiWord
- refers only to topics within its project. That is, if I have \WikiWord
- in the \ReadMe topic of the Default project, it will refer to the
- \WikiWord topic of the Default project. (Another term for this
- capability is &ldquo;namespaces.&rdquo;)
-
- A cross-project link is composed of the project&rsquo;s name, two colons
- (::), and the \WikiWord desired. Thus, from \Default::ReadMe, I can
- have \Ruwiki::ReadMe as a link. The project index can be referred to
- with \::Project. This is the same as doing \Project::ProjectIndex.
- Thus, \::Ruwiki becomes ::Ruwiki, which is the same as
- \Ruwiki::ProjectIndex (Ruwiki::ProjectIndex).
-
- === Project Lists and Topic Lists
- The list of known projects may be listed with the %projects() token;
- the list of known topics for the current project may be listed with the
- %topics() link. An arbitrary project may be provided to the %topics()
- token, as in %topics(Default).
-
- %topics(Default)
-
- %projects()
-
- === Calendars
- Ruwiki supports a miniature calendar. Future versions of Ruwiki will
- allow for calendar aggregation. Using the %calendar function, a
- calendar section will be generated:
-
- %calendar(<year>, <month>[, <project>])
- %calendar(today[, <project>])
-
- %calendar accepts either the English word &ldquo;today&rdquo; (displaying the
- calendar for the current month and year) or a specific month and year
- for display. A calendar for the specified month will be generated
- where each date in the month is treated as a \WikiWord (as are the
- links to the current month, the previous month, and the next month)
- ready for display or editing. As with all other \WikiWord links in
- Ruwiki, a project may be specified in %calendar, making
- &ldquo;%calendar(today, Ruwiki)&rdquo; different from &ldquo;%calendar(today, Default)&rdquo;.
-
- %calendar(today)
- %calendar(1999, 08, Default)
-
- === External Resources
- Ruwiki behaves intelligently about resources external to the Wiki
- itself.
-
- ==== External Links
- \URLs to external resources are automatically detected for web
- addresses, FTP addresses, newsgroups, and email links. They are
- automatically converted to clickable \URLs. Be aware that some things
- that look like URL schemas may be make clickable but are not really
- \URLs.
-
- * \http://www.ruby-lang.org becomes http://www.ruby-lang.org
-
- \URLs may be named with the [url name] syntax. If the name is omitted,
- the URL will be numbered. Numbering is contained to within the page.
-
- * \[http://www.rubygarden.org RubyGarden] becomes [http://www.rubygarden.org RubyGarden].
- * \[http://www.halostatue.ca] and \[http://www.halostatue.ca/ruby] become [http://www.halostatue.ca] and [http://www.halostatue.ca/ruby].
-
- ==== Images
- : <strong>Changed in Ruwiki 0.8.0!</strong>
-
- In preparation for the anti-wiki-spam features of Ruwiki 0.9.0, it has
- been necessary to remove the ability for \URLs to be converted into
- inline images automatically. Inline images are now created with the
- image markup format, generally of the format \[image:URI options]. The
- <em>options</em> format is generally the same format as an HTML
- attribute (<em>name="value"</em>; the quotes are optional for
- single-word option values) and any valid HTML attribute is also a
- valid <em>option</em>. There is one special <em>option</em>,
- <tt>numbered</tt>. This value, if set to any other value than &ldquo;false&rdquo;,
- will set the <tt>title</tt> of the image to a numbered link.
-
- If the <tt>title</tt> attribute is not specified, it will be set from
- the <tt>alt</tt> attribute (if specified) or the image&rsquo;s URL. If the
- <tt>alt</tt> attribute is not specified, it will be set from the
- <tt>title</tt> attribute.
-
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif] [image:http://www.halostatue.ca/graphics/maple_leaf.gif]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true] [image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"]
-
- ==== Ruby Mailing Lists
- If a Ruby mailing list message tag is provided, it will be converted appropriately.
-
- * \[ruby-talk:12345] will become [ruby-talk:12345]
- * \[ruby-core:12345] will become [ruby-core:12345]
- * \[ruby-doc:12345] will become [ruby-doc:12345]
-
- == Headings and Lists
- === Headings
- Use equals signs (=) for headings. Up to six equals signs can be used
- for HTML headings 1 - 6.
-
- \===== Heading five<br />
- \====== Heading six
- ===== Heading five
- ====== Heading six
-
- === Lists
- ==== Bulleted Lists
- Use asterisks (*) to create bulleted lists. More asterisks means more
- levels.
-
- \* level 1<br />
- \** level 2<br />
- \*** level 3
-
- * level 1
- ** level 2
- *** level 3
-
- ==== Numbered Lists
- Use hash marks (#) for numbered lists. More hash marks means deeper
- levels.
-
- \# level 1<br />
- \## level 2<br />
- \### level 3<br />
- \### level 3.2<br />
- \## level 2.2<br />
- \# level 1.2
-
- # level 1
- ## level 2
- ### level 3
- ### level 3.2
- ## level 2.2
- # level 1.2
-
- ==== Definition Lists
- Definitions can be created similar to other lists. Unlike &ldquo;standard&rdquo;
- lists, though, definition lists have both the term and the definition.
- They are specified like so. As with other lists, repeating the first
- item (;) will increase the indentation level. The browser may not
- respect this.
-
- \; term : definition<br />
- \;; term2 : definition<br />
- \;;; term3 : definition
-
- ; term : definition
- ;; term2 : definition
- ;;; term3 : definition
- == Paragraph Formatting
- === Rules
- Four or more dashes ("----") on a line by itself makes a horizontal
- rule, like so:
-
- \----
- ----
- === Paragraphs
- A blank line (it may have whitespace on it) marks a new paragraph. All
- other lines are joined together (excepting headers, lists, and rules).
-
- This line is a new paragraph.
-
- === Block Indent Paragraphs
- Paragraphs can be indented by beginning the paragraph with one or more
- colons (:).
-
- \: Indent Level 1<br />
- \:: Indent Level 2<br />
- \::: Indent Level 3
-
- : Indent Level 1
- :: Indent Level 2
- ::: Indent Level 3
-
- Paragraphs may be indented as &ldquo;cites&rdquo; by using one or more
- greater-than signs (>) at the beginning of the line.
-
- \> Indent Level 1<br />
- \>> Indent Level 2<br />
- \>>> Indent Level 3
-
- > Indent Level 1
- >> Indent Level 2
- >>> Indent Level 3
-
- === Code
- Text that is indented will be presented as formatted in a monospaced
- font. The only change is to escape HTML entities &lt; (&amp;lt;), &gt;
- (&amp;gt;), and &amp; (&amp;amp;).
-
- def replace
- content = @match[1]
- %Q{<pre>#{content}</pre>}
- end
-
- == Miscellaneous Formatting
- === HTML
- The Ruwiki engine currently passes through HTML without changes. Thus,
- &lt;strong&gt;strong&lt;/strong&gt; would be shown as
- <strong>strong</strong>. <strong><em>Note:</em></strong> This
- capability could be very dangerous as it could expose the Wiki to
- cross-site scripting (XSS) vulnerabilities. This will be remedied
- prior to the 1.0 release of Ruwiki.
-
- === Abbreviations
- Certain abbreviations may be known to the Wiki. While there is not yet
- any way for a user to query what abbreviations are known, if the
- abbreviations are told to the users, they may be used. Abbreviations
- are presented with @{key}, where <em>key</em> is the abbreviation
- desired. This Wiki, for example, knows that \@{matz} means &ldquo;@{matz}&rdquo;.
- The special form \@{} will produce the current list of known
- abbreviations. Unknown abbreviations will simply be put back into the
- data stream unchanged. Thus, \@{unknownkey} results in @{unknownkey}.
-
- ==== Known Abbreviations
- @{}
-
- === Preventing Formatting
- If you wish to prevent a word or sequence from being interpreted, put
- a backslash (\) in front of it. This works on all formatting options
- except paragraph positioning. Thus, if I want to prevent a \WikiWord
- from being turned into a hyperlink, I need to backslash it:
- \\WikiWord.
-
- === Other Possible Considerations
- I&rsquo;m looking at adding styles similar to what is shown on the Wiki
- below.
-
- * http://www.pmichaud.com/wiki/PmWiki/WikiStyles
-properties!project: Ruwiki
-properties!title: WikiMarkup
-properties!topic: WikiMarkup
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Tutorial/AddingPages.ruwiki b/ruwiki/tags/release-0.9.3/data/Tutorial/AddingPages.ruwiki
deleted file mode 100644
index c405b70..0000000
--- a/ruwiki/tags/release-0.9.3/data/Tutorial/AddingPages.ruwiki
+++ /dev/null
@@ -1,15 +0,0 @@
-page!content: = Adding Pages
- To add a new page to Ruwiki, all you need to do is come up with a
- meaningful title, turn it into a \WikiWord (see Ruwiki::WikiMarkup) and
- Ruwiki will automatically recognise it as a reference to a page that
- does not yet exist.
-
- At the end of the new \WikiWord is a hyperlinked question mark;
- clicking on this will open the edit page for the new \WikiWord in
- Ruwiki.
-properties!project: Tutorial
-properties!title: AddingPages
-properties!topic: AddingPages
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Tutorial/AddingProjects.ruwiki b/ruwiki/tags/release-0.9.3/data/Tutorial/AddingProjects.ruwiki
deleted file mode 100644
index 6f27415..0000000
--- a/ruwiki/tags/release-0.9.3/data/Tutorial/AddingProjects.ruwiki
+++ /dev/null
@@ -1,15 +0,0 @@
-page!content: = Adding Projects
- To add a new project to Ruwiki, all you need to do is come up with a
- meaningful one-word name, and then turn it into a project link, e.g.,
- \::Project. Projects may <strong>only</strong> be a single word &mdash;
- they are not normal \WikiWords (see Ruwiki::WikiMarkup for details).
- Ruwiki will recognise this as a project that does not yet exist. At the
- end of the Project link is a hyperlinked question mark; clicking on
- this will open the \Project::ProjectIndex in Ruwiki for editing and
- create the new project.
-properties!project: Tutorial
-properties!title: AddingProjects
-properties!topic: AddingProjects
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Tutorial/ProjectIndex.ruwiki b/ruwiki/tags/release-0.9.3/data/Tutorial/ProjectIndex.ruwiki
deleted file mode 100644
index 25aaefd..0000000
--- a/ruwiki/tags/release-0.9.3/data/Tutorial/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,10 +0,0 @@
-page!content: = Ruwiki %RV#% Tutorial
- This tutorial is incomplate.
-
- %topics(Tutorial)
-properties!project: Tutorial
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/Tutorial/SandBox.ruwiki b/ruwiki/tags/release-0.9.3/data/Tutorial/SandBox.ruwiki
deleted file mode 100644
index 0488031..0000000
--- a/ruwiki/tags/release-0.9.3/data/Tutorial/SandBox.ruwiki
+++ /dev/null
@@ -1,8 +0,0 @@
-page!content: This page is intended for users to play with freely to practice
- their \WikiFormatting.
-properties!project: Tutorial
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/tags/release-0.9.3/data/agents.banned b/ruwiki/tags/release-0.9.3/data/agents.banned
deleted file mode 100644
index 93500d9..0000000
--- a/ruwiki/tags/release-0.9.3/data/agents.banned
+++ /dev/null
@@ -1,60 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of User Agent strings which will be greeted
-# with "403 Forbidden" responses by Ruwiki. These are generally known email
-# harvesters or link directory builders for reciprocal link partners. These
-# may also be robots that routinely ignore the robots.txt file.
-#
-# This list is generated from a wide variety of sources including:
-# * http://www.clockwatchers.com/robots_list.html
-# * http://searchenginewatch.com/webmasters/article.php/2167991
-# * http://www.neilgunton.com/spambot_trap/
-# * http://www.robotstxt.org/wc/active/all.txt
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# foo
-# bar
-#
-# becomes:
-#
-# %r{foo|bar}x
-#++
-
- # Known email harvesters
-(?i:^nicerspro)
-(?i:^teleport)
-^CherryPicker
-^Crescent # Crescent Internet ToolPak
-^EmailCollector
-^EmailSiphon
-^EmailWolf
-^ExtractorPro
-^Microsoft\sURL
-^WebEMailExtrac
-
- # Link directory builders.
-^LinkWalker
-^Zeus.*Webster
-
- # Strongly suspected spoofed user agents from spam harvesters. These user
- # agents have been reported patterns by other antispam fighters.
-^[A-Z]+$
-^Internet\sExplore\s5.x
-^Mozilla.*NEWT
-^Mozilla\/4.0$
-MSIECrawler
diff --git a/ruwiki/tags/release-0.9.3/data/agents.readonly b/ruwiki/tags/release-0.9.3/data/agents.readonly
deleted file mode 100644
index e7168c5..0000000
--- a/ruwiki/tags/release-0.9.3/data/agents.readonly
+++ /dev/null
@@ -1,321 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of User Agent strings which will be given
-# readonly versions of the wiki instance.
-#
-# This list is generated from a wide variety of sources including:
-# * http://www.clockwatchers.com/robots_list.html
-# * http://searchenginewatch.com/webmasters/article.php/2167991
-# * http://www.neilgunton.com/spambot_trap/
-# * http://www.robotstxt.org/wc/active/all.txt
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# foo
-# bar
-#
-# becomes:
-#
-# %r{foo|bar}x
-#++
-
-(?:^.*HTTrack)
-(?:^.*LWP)
-(?:^Digimarc)
-(?:ChristCrawler.com|ChristCrawler@ChristCENTRAL.com)
-(?:Net|Web)Mechanic
-(?:PerlCrawler|Xavatoria)/
-(?:pjspider|PortalJuice.com)
-(?:spider_monkey|mouse.house)
-(?:tach_bw|Black\sWidow)
-(?:topiclink|TLSpider)
-(?i:(?-i:ComputingSite\s)?Robi)
-(?i:^curl)
-(?i:^googlebot)
-(?i:^gulliver) # NorthernLight
-(?i:^Scooter) # Altavista
-(?i:^w[@a]pSpider)
-(?i:infoseek) # InfoSeek
-^ABCdatos\sBotLink # http://www.abcdatos.com/botlink/
-^AITCSRobot/
-^anthill
-^appie
-^Arachnoidea # Euroseek
-^Arachnophilia
-^arale
-^araneo
-^AraybOt
-^ArchitextSpider # Excite, WebCrawler
-^ariadne
-^arks
-^Ask\s?Jeeves/Teoma
-^ASpider/
-^ATN_Worldwide
-^Atomz
-^AURESYS/
-^BackRub/
-^BaySpider
-^bbot
-^Big\sBrother
-^Bjaaland
-^BlackWidow
-^borg-bot/
-^(?i:boxseabot)
-^BSpider/
-^CACTVS\sChemistry\sSpider
-^calif
-^Checkbot/
-^cienciaficcion.net
-^CMCM/
-^combine
-(?i:^confuzzledbot)
-^CoolBot
-^cosmos
-^crawlpaper
-^cusco
-^cyberspyder
-(?i:^cydralspider)
-^desert\s?realm
-^Deweb
-^Die\sBlinde\sKuh
-^dienstspider/
-^digger
-^Digger
-^DIIbot
-^dlw3robot/
-^DNAbot/
-^downloadexpress
-^DragonBot
-^Duppies
-^dwcp
-^ebiness
-^ecollector
-^EIT-Link-Verifier-Robot/
-^elfinbot
-^Emacs-w3/
-^EMC\sSpider
-(?i:^esculapio)
-^ESI
-^esther
-^Evliya\sCelebi
-^explorersearch
-^fast # Fast/AllTheWeb
-^fastcrawler
-^FDSE
-^FELIX\s?IDE
-^fido
-^Fish-Search-Robot
-^fouineur
-^Freecrawl
-^FunnelWeb-
-^gammaSpider
-^gazz
-^gcreep
-^gestalttIconoclast/
-^Getterrobo-?Plus
-^GetURL\.rexx
-^golem
-^grabber
-^griffon
-^Gromit
-^gulper
-^hambot
-^havIndex
-^HKU\sWWW\sRobot
-^Hometown\sSpider\sPro
-^Hämähäkki
-^hotwired
-^htdig
-^htmlgobble
-^IAGENT/
-^iajabot
-^IBM_Planetwide
-^image\.kapsi\.net
-^IncyWincy
-^Informant
-^InfoSpiders
-^INGRID/
-^inspectorwww
-^Internet\sCruiser\sRobot
-^irobot
-^Iron33
-^IsraeliSearch/
-^JavaBee
-^JBot
-^jcrawler
-^jobo
-^Jobot/
-^JoeBot/
-^JubiiRobot/
-^jumpstation
-^Katipo/
-^KDD-Explorer
-^KIT-Fireball # Fireball.de
-^ko_yappo_robot
-^label-grabber
-^LabelGrab/
-^larbin
-^legs
-^Linkidator
-^LinkScan\s(?:Server|Workstation)
-^Lockon
-^logo\.gif\scrawler
-^logo_gif_crawler
-^Lycos_Spider_(T-Rex) # Lycos
-^M/
-^Magpie/
-^marvin
-^mattie
-^mediafox
-^MerzScope
-^MindCrawler
-^moget
-^MOMspider/
-^Monster
-^Motor
-^Mozilla/3\.01\s(Win95;\sI) # InfoSeek
-^Mozilla\/3.0.+Indy\sLibrary
-^msnbot
-^muncher
-(?i:^muninn)
-^MuscatFerret
-^MwdSearch
-^NDSpider/
-^NEC-MeshExplorer
-^Nederland.zoek
-^Net.Vampire
-^NetCarta
-^NetScoop
-^newscan-online
-^NHSEWalker/
-^Nomad
-^NorthStar
-^NPBot # Detects IP violations(?)
-^ObjectsSearch
-^Occam
-^Openbot # OpenFind
-^Openfind
-^Orbsearch
-^PackRat
-^pageboy
-^parasite
-^patric
-^PBWF
-^pegasus
-^Peregrinator-Mathematics/
-^PGP-KA/
-^phpdig
-^piltdownman
-^Pimptrain
-^Pioneer
-^Plucker
-^PlumtreeWebAccessor
-^Poppi/
-^PortalBSpider
-^psbot
-^Raven
-^Resume\sRobot
-^RHCS
-^RixBot
-^Road\s?Runner
-^Robbie
-^RoboCrawl
-^robofox
-^Robot\sdu\sCRIM
-^Robozilla/
-^root/
-^Roverbot
-^RuLeS/
-^SafetyNet\sRobot
-^Search-AU
-^searchprocess
-^searchterms\.it
-^Senrigan
-^SG-Scout
-^Shagseeker
-^Shai'Hulud
-^sharp-info-agent
-^SimBot
-^Site\sValet
-^sitecheck
-^SiteTech-Rover
-^SLCrawler
-^Sleek\sSpider
-^Slurp # Inktomi, AOL
-^snooper
-^solbot
-^speedy
-^SpiderBot
-^spiderline
-^SpiderMan
-^SpiderView
-^ssearcher
-^suke
-^suntek
-(?i:http://www.sygol.com)
-^T-H-U-N-D-E-R-S-T-O-N-E
-^Tarantula/
-^tarspider
-^TechBOT
-^Templeton
-^TeomaAgent # Teoma
-^TITAN
-^titin
-^TurnitinBot # Plagiarism detector
-^UCSD-Crawler
-^UdmSearch
-^udmsearch
-^Ukonline
-^uptimebot
-^URL\sSpider\sPro
-^urlck
-^Valkyrie
-^verticrawl
-^Victoria
-^vision-search
-^void-bot
-^Voyager
-^VWbot_K
-^w3index
-^W3M2/
-^w3mir
-^WebBandit
-^webcatcher
-^WebCopier
-^WebCopy
-^WebFetcher/
-^weblayers/
-^WebLinker/
-^WebMoose
-^webquest
-^WebReaper
-^webs
-^webspider
-^webvac
-^webwalk
-^WebWalker
-^WebWatch
-^wget
-^whowhere
-^winona
-^wired-digital-newsbot/
-^wlm
-^WOLP
-^WWWC
-^WWWWanderer
-^XGET
-^ZyBorg # WiseNut/LookSmart
diff --git a/ruwiki/tags/release-0.9.3/data/clean.uri b/ruwiki/tags/release-0.9.3/data/clean.uri
deleted file mode 100644
index cf38b6f..0000000
--- a/ruwiki/tags/release-0.9.3/data/clean.uri
+++ /dev/null
@@ -1,37 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of URIs or partial URIs that will not be
-# redirected by the automatic redirection technique. It is recommended that the
-# Regular Expression be specific and be anchored to prevent "similar" URIs from
-# being handled poorly. Non HTTP/HTTPS URIs are not redirected at this time.
-#
-# This file is in "extended" regular expression format, one optional expression
-# to a line. Spaces are not significant and comments are allowed. If you want
-# to recognise a space in your regular expression, do so either with a
-# character class ([ ]) or the whitespace meta-character (\s). Hash marks must
-# be escaped (\#) or they will be treated as comment markers. Blank or
-# comment-only lines are ignored. All other lines will be joined together:
-#
-# ^http://[^/]*?ruby-lang.org/?.*$
-# ^http://[^/]*?rubyforge.org/?.*$
-#
-# becomes:
-#
-# %r{^http://[^/]*?ruby-lang.org/?.*$|^http://[^/]*?rubyforge.org/?.*$}
-#++
-(?ix-m:^http://[^/]*?ruby-lang.org/?.*$)
-(?ix-m:^http://[^/]*?rubyforge.org/?.*$)
-(?ix-m:^http://rubyforge.halostatue.info/?.*$)
-(?ix-m:^http://[^/]*?ruwiki.org/?.*$)
-(?ix-m:^http://[^/]*?ruby-doc.org/?.*$)
-(?ix-m:^http://[^/]*?pragmaticprogrammers.com/?.*$)
-(?ix-m:^http://127\.0\.0\.(\d|\d\d|1\d\d|2[0-4]\d|25[0-5])/?.*$)
-(?ix-m:^http://localhost/?.*$)
diff --git a/ruwiki/tags/release-0.9.3/data/hostip.banned b/ruwiki/tags/release-0.9.3/data/hostip.banned
deleted file mode 100644
index b7f3c55..0000000
--- a/ruwiki/tags/release-0.9.3/data/hostip.banned
+++ /dev/null
@@ -1,30 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of IP address strings which will be greeted with
-# "403 Forbidden" responses by Ruwiki. These are generally known email
-# harvesters or link directory builders for reciprocal link partners. These may
-# also be robots that routinely ignore the robots.txt file.
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will be
-# joined together:
-#
-# 192\.168\.0\..*
-# 127\.0\.0\..*
-#
-# becomes:
-#
-# %r{192\.168\.0\..*|127\.0\.0\..*}
-#++
diff --git a/ruwiki/tags/release-0.9.3/data/hostip.readonly b/ruwiki/tags/release-0.9.3/data/hostip.readonly
deleted file mode 100644
index 55d589c..0000000
--- a/ruwiki/tags/release-0.9.3/data/hostip.readonly
+++ /dev/null
@@ -1,28 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of IP address strings which will be given
-# readonly versions of the wiki instance.
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# 192\.168\.0\..*
-# 127\.0\.0\..*
-#
-# becomes:
-#
-# %r{192\.168\.0\..*|127\.0\.0\..*}
-#++
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki.rb
deleted file mode 100644
index d533763..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki.rb
+++ /dev/null
@@ -1,626 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-class Ruwiki
- VERSION = '0.9.3'
- CONTENT_VERSION = 2
-end
-
-require 'cgi'
-require 'ruwiki/handler'
-require 'ruwiki/auth'
-require 'ruwiki/template'
-require 'ruwiki/lang/en' # Default to the English language.
-require 'ruwiki/config'
-require 'ruwiki/backend'
-require 'ruwiki/wiki'
-require 'ruwiki/page'
-
- # = Ruwiki
- # Ruwiki is a simple, extensible Wiki written in Ruby. It supports both
- # CGI and WEBrick interfaces, templates, and CSS formatting. Additionally,
- # it supports project namespaces, so that two pages can be named the same
- # for differing projects without colliding or having to resort to odd
- # naming conventions. Please see the ::Ruwiki project in the running Wiki
- # for more information. Ruwiki has German and Spanish translations
- # available.
- #
- # == Quick Start (CGI)
- # 1. Place the Ruwiki directory in a place that your webserver can execute
- # CGI programs and ensure that ruwiki.cgi is executable on your webserver.
- # 2. Point your web browser to the appropriate URL.
- #
- # == Quick Start (WEBrick)
- # 1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
- # 2. Point your web browser to <http://localhost:8808/>.
- #
- # == Configuration
- # There are extensive configuration options available. The Ruwiki WEBrick
- # servlet offers command-line options that simplify the configuration of
- # Ruwiki without editing the servlet; use ruwiki_servlet --help for more
- # information.
- #
- # == Copyright
- # Copyright:: Copyright © 2002 - 2004, Digikata and HaloStatue, Ltd.
- # Authors:: Alan Chen (alan@digikata.com)
- # Austin Ziegler (ruwiki@halostatue.ca)
- # Licence:: Ruby's
-class Ruwiki
- ALLOWED_ACTIONS = %w(edit create)
- EDIT_ACTIONS = %w(save cancel)
- EDIT_VARS = %w(newpage version edcomment q)
- RESERVED = ['save', 'preview', 'cancel', EDIT_VARS].flatten
-
- # Returns the current configuration object.
- attr_reader :config
- # Returns the current Response object.
- attr_reader :response
- # Returns the current Request object.
- attr_reader :request
- # Returns the current Markup object.
- attr_reader :markup
- # Returns the current Backend object.
- attr_reader :backend
- # Sets the configuration object to a new configuration object.
- def config=(cc)
- raise self.message[:config_not_ruwiki_config] unless cc.kind_of?(Ruwiki::Config)
- @config = cc
- self.config!
- end
-
- def config!
- @markup.default_project = @config.default_project
- @markup.message = self.message
- end
-
- def load_config(filename)
- @config = Ruwiki::Config.read(filename)
- self.config!
- end
-
- # The message hash.
- def message
- @config.message
- end
-
- # Initializes Ruwiki.
- def initialize(handler)
- @request = handler.request
- @response = handler.response
-
- @config = Ruwiki::Config.new
-
- @path_info = @request.determine_request_path || ''
-
- @type = nil
- @error = {}
-
- @markup = Ruwiki::Wiki.new(@config.default_project,
- @request.script_url,
- @config.title)
- end
-
- # Initializes the backend for Ruwiki.
- def set_backend
- @backend = BackendDelegator.new(self, @config.storage_type)
- @markup.backend = @backend
- # Load the blacklists here because I don't as of yet know where else
- # to put them. :(
- @banned_agents = load_blacklist('agents.banned')
- @banned_hostip = load_blacklist('hostip.banned')
- @readonly_agents = load_blacklist('agents.readonly')
- @readonly_hostip = load_blacklist('hostip.readonly')
- # Prevent Google redirection against these URIs.
- Ruwiki::Wiki.no_redirect = load_blacklist('clean.uri')
- end
-
- def load_blacklist(filename)
- data = []
- filename = File.join(@config.storage_options[@config.storage_type]['data-path'], filename)
- ii = '^'
- jj = /^#{ii}/o
- File.open(filename, 'rb') do |f|
- f.each do |line|
- line.gsub!(%r{^\s*#.*$}, '')
- line.strip!
- if line.empty?
- data << nil
- else
- if line =~ jj
- data << "(?:#{line}\n)"
- else
- data << line
- end
- end
- end
- end
- data.compact!
- if data.empty?
- nil
- else
- Regexp.new(data.join("|"), Regexp::EXTENDED)
- end
- rescue
- return nil
- end
-
- def check_useragent
- addr = @request.environment['REMOTE_ADDR']
- user = @request.environment['HTTP_USER_AGENT']
-
- if user.nil? or user.empty?
- :forbidden
- elsif @banned_hostip and addr and addr =~ @banned_hostip
- :forbidden
- elsif @banned_agents and user =~ @banned_agents
- :forbidden
- elsif @readonly_hostip and addr and addr =~ @readonly_hostip
- :read_only
- elsif @readonly_agents and user =~ @readonly_agents
- :read_only
- else
- :clean
- end
- end
-
- # Runs the steps to process the wiki.
- def run
- @config.verify
- set_backend
- set_page
- process_page
- render
- rescue Exception => ee
- render(:error, ee)
- ensure
- output
- end
-
- # Initializes current page for Ruwiki.
- def set_page
- path_info = @path_info.split(%r{/}, -1).map { |ee| ee.empty? ? nil : ee }
-
- if path_info.size == 1 or (path_info.size > 1 and path_info[0])
- raise self.message[:invalid_path_info_value] % [@path_info] unless path_info[0].nil?
- end
-
- # path_info[0] will ALWAYS be nil.
- path_info.shift
-
- case path_info.size
- when 0 # Safety check.
- nil
- when 1 # /PageTopic OR /_edit
- set_page_name_or_action(path_info[0])
- when 2 # /Project/ OR /Project/PageTopic OR /Project/_edit OR /Project/create
- @project = path_info.shift
- set_page_name_or_action(path_info[0])
- else # /Project/PageTopic/_edit OR /Project/diff/3,4 OR something else.
- @project = path_info.shift
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- else
- @topic = item
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- end
- end
- end
-
-# @request.each_parameter { |key, val| puts "#{key} :: #{val.class}" }
-
- @project ||= @config.default_project
- @topic ||= @config.default_page
- end
-
- PROJECT_LIST_ITEM = %[%1$s (a href='\\%2$s/%1$s/_topics' class='rw_minilink')%3$s\\</a\\>]
-
- # Processes the page through the necessary steps. This is where the edit,
- # save, cancel, and display actions are present.
- def process_page
- content = nil
- formatted = false
-
- @page = Ruwiki::Page.new(@backend.retrieve(@topic, @project))
- @type = :content
-
- agent_ok = check_useragent
- case agent_ok
- when :read_only
- @page.editable = false
- case @action
- when 'edit', 'save', 'preview', 'cancel', 'search'
- @page.indexable = false
- end
- when :forbidden
- forbidden
- return
- else
- unless @config.auth_mechanism.nil?
- @auth_token = Ruwiki::Auth[@config.auth_mechanism].authenticate(@request, @response, @config.auth_options)
- @page.editable = @auth_token.permissions['edit']
- end
- end
-
- # TODO Detect if @action has already been set.
- @action ||= @request.parameters['action'].downcase if @request.parameters['action']
- @action ||= 'save' if @request.parameters['save']
- @action ||= 'cancel' if @request.parameters['cancel']
- @action ||= 'preview' if @request.parameters['preview']
-
- unless @page.editable
- case @action
- when 'edit', 'save', 'preview', 'cancel'
- @action = 'show'
- end
- end
-
- case @action
- when 'search'
- # get, validate, and cleanse the search string
- # TODO: add empty string rejection.
- srchstr = validate_search_string(@request.parameters['q'])
- if not srchstr.nil?
- srchall = @request.parameters['a']
-
- @page.editable = false
- @page.indexable = false
-
- @page.content = self.message[:search_results_for] % [srchstr]
- @page.topic = srchstr || ""
-
- unless srchall.nil?
- hits = @backend.search_all_projects(srchstr)
- else
- hits = @backend.search_project(@page.project, srchstr)
- end
-
- # turn hit hash into content
- hitarr = []
- # organize by number of hits
- hits.each { |key, val| (hitarr[val] ||= []) << key }
-
- rhitarr = hitarr.reverse
- maxhits = hitarr.size
- rhitarr.each_with_index do |tarray, rnhits|
- next if tarray.nil? or tarray.empty?
- nhits = maxhits - rnhits - 1
-
- if nhits > 0
- @page.content << "\n== #{self.message[:number_of_hits] % [nhits]}\n* "
- @page.content << tarray.join("\n* ")
- end
- end
-
- @type = :search
- else
- @sysmessage = self.message[:no_empty_search_string] % [ @page.project, @page.topic ]
- @type = :content
- end
- when 'topics'
- if @backend.project_exists?(@page.project)
- topic_list = @backend.list_topics(@page.project)
- else
- topic_list = []
- end
-
- @page.editable = false
-
- # todo: make this localized
- if topic_list.empty?
- @page.content = self.message[:no_topics] % [@page.project]
- else
- topic_list.map! do |tt|
- uu = CGI.unescape(tt)
- if (uu != tt) or (tt !~ Ruwiki::Wiki::RE_WIKI_WORDS)
- "[[#{CGI.unescape(tt)}]]"
- else
- tt
- end
- end
- @page.content = <<EPAGE
-= #{self.message[:topics_for_project] % [@page.project]}
-* #{topic_list.join("\n* ")}
-EPAGE
- end
-
- @type = :content
- when 'projects'
- proj_list = @backend.list_projects
-
- @page.editable = false
-
- if proj_list.empty?
- @page.content = self.message[:no_projects]
- else
- # TODO make this localized
- proj_list.map! { |proj| PROJECT_LIST_ITEM % [ proj, @request.script_url, self.message[:project_topics_link] ] }
- @page.content = <<EPAGE
-= #{self.message[:wiki_projects] % [@config.title]}
-* ::#{proj_list.join("\n* ::")}
-EPAGE
- end
-
- content = @page.to_html(@markup)
- content.gsub!(%r{\(a href='([^']+)/_topics' class='rw_minilink'\)}, '<a href="\1/_topics" class="rw_minilink">') #'
- content.gsub!(%r{\\&lt;}, '<')
- content.gsub!(%r{\\&gt;}, '>')
- formatted = true
- @type = :content
- when 'edit', 'create'
- # Automatically create the project if it doesn't exist or if the
- # action is 'create'.
- @backend.create_project(@page.project) if @action == 'create'
- @backend.create_project(@page.project) unless @backend.project_exists?(@page.project)
- @page.creator = @auth_token.name if @action == 'create' and @auth_token
- @page.indexable = false
- @lock = @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR']) rescue nil
-
- if @lock.nil?
- @type = :content
- @sysmessage = self.message[:page_is_locked]
- else
- content = nil
- formatted = true
- @type = :edit
- end
- when 'save', 'preview'
- np = @request.parameters['newpage'].gsub(/\r/, '').chomp
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.editor_ip = @request.environment['REMOTE_ADDR']
- @page.indexable = false
-
- save_ver = @backend.retrieve(@page.topic, @page.project)['properties']['version'].to_i
- sent_ver = @request.parameters['version'].to_i
-
- if sent_ver < save_ver
- @type = :edit
-
- np = np.split($/)
- content_diff = Diff::LCS.sdiff(np, @page.content.split($/), Diff::LCS::ContextDiffCallbacks)
- content_diff.reverse_each do |hunk|
- case hunk
- when Array
- hunk.reverse_each do |diff|
- case diff.action
- when '+'
-# np.insert(diff.old_position, "+#{diff.new_element}")
- np.insert(diff.old_position, "#{diff.new_element}")
- when '-'
- np.delete_at(diff.old_position)
-# np[diff.old_position] = "-#{diff.old_element}"
- when '!'
- np[diff.old_position] = "-#{diff.old_element}"
- np.insert(diff.old_position + 1, "+#{diff.new_element}")
- end
- end
- when Diff::LCS::ContextChange
- case hunk.action
- when '+'
- np.insert(hunk.old_position, "#{hunk.new_element}")
-# np.insert(hunk.old_position, "+#{hunk.new_element}")
- when '-'
- np.delete_at(hunk.old_position)
-# np[diff.old_position] = "-#{hunk.old_element}"
- when '!'
- np[hunk.old_position] = "-#{hunk.old_element}"
- np.insert(hunk.old_position + 1, "+#{hunk.new_element}")
- end
- end
- end
- @page.content = np.join("\n")
-
- edc = @request.parameters['edcomment']
- unless (edc.nil? or edc.empty? or edc == "*")
- @page.edit_comment = edc
- end
-
- @sysmessage = self.message[:not_editing_current_version] % [ @page.project, @page.topic ]
- else
- if @action == 'save'
- @page.editor = @auth_token.name if @auth_token
- op = @page.content
- else
- op = nil
- end
-
- if (np == op) and (@action == 'save')
- @type = :content
- else
- @page.content = np
- edc = @request.parameters['edcomment']
- unless (edc.nil? or edc.empty? or edc == "*")
- @page.edit_comment = edc
- end
-
- if @action == 'save'
- @type = :save
- @page.version = @request.parameters['version'].to_i + 1
- @backend.store(@page)
-
- # hack to ensure that Recent Changes are updated correctly
- if @page.topic == 'RecentChanges'
- recent = Ruwiki::Page.new(@backend.retrieve(@page.topic, @page.project))
- @page.content = recent.content
- end
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- else
- @type = :preview
- @lock = @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR'])
- content = nil
- formatted = true
- end
- end
- end
- when 'cancel'
-# @page.topic = @request.parameters['topic']
-# @page.project = @request.parameters['project']
-# @page.version = @request.parameters['version'].to_i
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- @type = :content
- else
- # TODO AZ: This should probably return a 501 Not Implemented or some
- # other error unless @action.nil?
- nil
- end
- content = @page.to_html(@markup) if not formatted
- rescue Exception => ee # rescue for def process_page
- @type = :error
- if ee.kind_of?(Ruwiki::Backend::BackendError)
- name = "#{self.message[:error]}: #{ee.to_s}"
- else
- name = "#{self.message[:complete_utter_failure]}: #{ee.to_s}"
- end
- @error[:name] = CGI.escapeHTML(name)
- @error[:backtrace] = ee.backtrace.map { |el| CGI.escapeHTML(el) }.join("<br />\n")
- content = nil
- ensure
- @content = content
- end # def process_page
-
- # Renders the page.
- def render(*args)
- if args.empty?
- type = @type
- error = @error
- else
- raise ArgumentError, self.message[:render_arguments] unless args.size == 2
- type = args[0]
- error = {
- :name => Ruwiki.clean_entities(args[1].inspect),
- :backtrace => args[1].backtrace.join("<br />\n")
- }
- @page = Ruwiki::Page.new(Ruwiki::Page::NULL_PAGE)
- end
-
- @rendered_page = ""
- values = {
- "css_link" => @config.css_link,
- "home_link" => %Q(<a href="#{@request.script_url}">#{@config.title}</a>),
- "cgi_url" => @request.script_url,
- "content" => @content,
- }
-
- if @page.nil?
- values["page_project"] = ""
- values["page_raw_topic"] = ""
- values["page_topic"] = ""
- values["editable"] = false
- values["indexable"] = false
- else
- values["page_project"] = @page.project
- values["page_raw_topic"] = @page.topic
- values["page_topic"] = CGI.unescape(@page.topic)
- values["editable"] = @page.editable
- values["indexable"] = @page.indexable
- end
-
- values["url_project"] = %Q(#{values["cgi_url"]}/#{values["page_project"]})
- values["url_topic_search"] = %Q(#{values["url_project"]}/_search?q=#{values["page_topic"]})
- values["link_topic_search"] = %Q(<a href='#{values["url_topic_search"]}'><strong>#{values["page_topic"]}</strong></a>)
- values["message"] = @sysmessage unless @sysmessage.nil?
-
- case type
- when :content, :save, :search
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}" if @page.nil?
- values["wiki_title"] ||= "#{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["label_topic_or_search"] = self.message[:label_topic]
- values["page_topic_name"] = values["page_topic"]
- if type == :content or type == :search
- template = TemplatePage.new(@config.template(:body), @config.template(:content), @config.template(:controls), @config.template(:footer))
- if type == :search
- values["label_topic_or_search"] = self.message[:label_search]
- else
- values["page_topic"] = values["link_topic_search"]
- end
- else
- # action type was save
- values["page_topic"] = values["link_topic_search"]
- template = TemplatePage.new(@config.template(:body), @config.template(:save), @config.template(:controls), @config.template(:footer))
- end
- when :edit, :preview
- template = TemplatePage.new(@config.template(:body), @config.template(:edit))
- values["wiki_title"] = "#{self.message[:editing]}: #{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_content"] = @page.content
- values["page_version"] = @page.version.to_s
- values["unedited_page_content"] = @page.to_html(@markup)
- values["pre_page_content"] = CGI.escapeHTML(@page.content)
- if @request.parameters["edcomment"].nil? or @request.parameters["edcomment"].empty?
- values["edit_comment"] = "*"
- else
- values["edit_comment"] = @request.parameters["edcomment"]
- end
- when :error
- template = TemplatePage.new(@config.template(:body), @config.template(:error))
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}"
- values["name"] = error[:name]
- values["backtrace"] = error[:backtrace]
- values["backtrace_email"] = error[:backtrace].gsub(/<br \/>/, '')
- values["webmaster"] = @config.webmaster
- end
-
- template.to_html(values, :messages => @config.message,
- :output => @rendered_page)
- end
-
- # Outputs the page.
- def output
- return if @response.written?
-# if @request.environment["HTTP_ACCEPT"] =~ %r{application/xhtml\+xml}
-# @response.add_header("Content-type", "application/xhtml+xml")
-# else
- @response.add_header("Content-type", "text/html")
-# end
- @response.add_header("Cache-Control", "max_age=0")
- @response.write_headers
- @response << @rendered_page
- end
-
- def forbidden
- protocol = @request.environment["SERVER_PROTOCOL"] || "HTTP/1.0"
- @response.write_status "#{protocol} 403 FORBIDDEN\nDate: #{CGI::rfc1123_date(Time.now)}\n\n"
- end
-
- # nil if string is invalid
- def validate_search_string(instr)
- return nil if instr.empty?
-
- modstr = instr.dup
-
- #TODO: add validation of modstr
- return modstr
- end
-
- def self.clean_entities(data)
- data.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;')
- end
-
-private
- RE_ACTION = %r{^_([[:lower:]]+)$}
-
- def set_page_name_or_action(item)
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- else
- @topic = item
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/auth.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/auth.rb
deleted file mode 100644
index ab4c923..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/auth.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Auth
- class << self
- def [](name)
- @delegate ||= {}
-
- if @delegate.has_key?(name)
- @delegate[name]
- else
- require "ruwiki/auth/#{name}"
- @delegate[name] = Ruwiki::Auth.const_get(name.capitalize)
- end
- end
- end
-
- class Token
- def initialize(name = nil, groups = [], permissions = {})
- @user_name = name
- @groups = groups
- @permissions = permissions
- end
-
- def found?
- not @user_name.nil?
- end
-
- def name
- @user_name
- end
-
- def member?(unix_group_name)
- @groups.include?(unix_group_name)
- end
-
- def groups
- @groups
- end
-
- def allowed?(action)
- @permission[action]
- end
-
- def permissions
- @permissions
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/auth/gforge.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/auth/gforge.rb
deleted file mode 100644
index 70895a1..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/auth/gforge.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-begin
- require 'gforge_auth'
-rescue LoadError
- class GForgeAuthenticator
- class AuthenticationResult
- def initialize(name = nil, groups = [])
- @user_name = name
- @groups = groups
- end
-
- def found?
- not @user_name.nil?
- end
-
- def user_name
- raise "No session associated with the given key was found" unless found?
- @user_name
- end
-
- def member?(unix_group_name)
- raise "No session associated with the given key was found" unless found?
- @groups.include?(unix_group_name)
- end
-
- def groups
- raise "No session associated with the given key was found" unless found?
- @groups
- end
- end
-
- def self.authenticate(sessionkey, options = {})
- sql = %Q(SELECT user_name FROM users u, user_session us WHERE us.session_hash = '#{sessionkey}' AND us.user_id = u.user_id;)
- res = %x{psql -q -t -U #{options['user']} #{options['pass']} -c \"#{sql}\"}
- rows = res.split(/\n/)
- return AuthenticationResult.new if rows.size != 1
-
- user_name = rows[0].strip
- sql = %Q(SELECT unix_group_name FROM groups g, users u, user_group ug WHERE u.user_name = '#{user_name}' AND ug.user_id = u.user_id AND g.group_id = ug.group_id)
-
- res = %x(psql -q -t -U #{options['user']} #{options['pass']} -c \"#{sql}\")
- groups = []
- res.split(/\n/).each {|row| groups << row.strip }
- AuthenticationResult.new(user_name, groups)
- end
- end
-end
-
-class Ruwiki::Auth::Gforge < Ruwiki::Auth
- def self.authenticate(request, response, options = {})
- options['user'] = options['user'].gsub!(%r{^(\w+)}, '\1')
- options['pass'] = options['pass'].gsub!(%r{^(\w+)}, '\1')
- session_key = request.cookies['session_ser'].value[0].split(%r{-\*-})[-1]
- token = GForgeAuthenticator.authenticate(session_key, options)
- token = Ruwiki::Auth::Token.new(token.user_name, token.groups)
- token.permissions.default = true if token.found?
- rescue
- token = Ruwiki::Auth::Token.new
- token.permissions.default = false
- ensure
- return token
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/backend.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/backend.rb
deleted file mode 100644
index 063666e..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/backend.rb
+++ /dev/null
@@ -1,318 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-begin
- if defined?(Gem::Cache)
- require_gem 'diff-lcs', '~> 1.1.2'
- else
- require 'diff/lcs'
- end
-rescue LoadError => ex
- $stderr.puts ex.message
- raise
-end
-
-class Ruwiki
- # The list of known backends.
- KNOWN_BACKENDS = %w(flatfiles)
-
- # The Ruwiki backend delegator. Ruwiki will always instantiate a version
- # of this class which delegates the actual method execution to the Backend
- # class. Error handling is handled by capturing (and possibly forwarding)
- # exceptions raised by the delegate class.
- class BackendDelegator
- def initialize(ruwiki, backend)
- @message = ruwiki.config.message
- @time_format = ruwiki.config.time_format || "%H:%M:%S"
- @date_format = ruwiki.config.date_format || "%Y.%m.%d"
- @datetime_format = ruwiki.config.datetime_format || "#{@date_format} #{@time_format}"
- options = ruwiki.config.storage_options
- options['default-page'] = ruwiki.config.default_page
-
- unless Ruwiki::KNOWN_BACKENDS.include?(backend)
- raise RuntimeError, @message[:backend_unknown] % [backend]
- end
-
- beconst = backend.capitalize
-
- require "ruwiki/backend/#{backend}"
-
- beoptions = options[backend]
- @delegate = Ruwiki::Backend.const_get(beconst).new(beoptions)
- rescue Ruwiki::Backend::BackendError => ex
- if ex.kind_of?(Array)
- raise Ruwiki::Backend::BackendError.new(nil), @message[ex.reason[0]] % ex.reason[1]
- else
- raise
- end
- end
-
- # Retrieve the specified topic and project page. Calls Backend#load
- # after verifying that the project exists.
- def retrieve(topic, project = 'Default')
- unless page_exists?(topic, project)
- exported = Ruwiki::Page::NULL_PAGE.dup
- exported['properties'] = {
- 'title' => topic,
- 'topic' => topic,
- 'project' => project,
- 'create-date' => Time.now.utc,
- 'edit-date' => Time.now.utc,
- 'editable' => true,
- 'indexable' => true,
- 'entropy' => 0.0,
- 'html-headers' => [],
- 'version' => 0
- }
- exported['page'] = {
- 'header' => nil,
- 'footer' => nil
- }
-
- if project_exists?(project)
- exported['page']['content'] = ""
- else
- exported['page']['content'] = @message[:project_does_not_exist] % [project]
- end
- return exported
- end
-
- return @delegate.load(topic, project)
- rescue Ruwiki::Backend::InvalidFormatError => ex
- raise Ruwiki::Backend::BackendError.new(nil), @message[:page_not_in_backend_format] % [project, topic, @delegate.class]
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_read_topic] % [project, topic]
- rescue Exception => ex
- mm = [project, topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_retrieve_topic] % mm
- end
-
- # Stores the specified topic and project page.
- def store(page)
- @delegate.store(page)
-
- # update change page
- begin
- recent_changes = nil
- if (page.topic == 'RecentChanges')
- recent_changes = page.dup
- else
- recent_changes = Page.new(retrieve('RecentChanges', page.project))
- end
-
- changeline = "\n; #{page.editor_ip} (#{Time.now.utc.strftime(@datetime_format)}), #{page.topic} : #{page.edit_comment}"
-
- # add changeline to top of page
- recent_changes.content = changeline + (recent_changes.content || "")
- @delegate.store(recent_changes)
- rescue Exception => ex
- raise "Couldn't save RecentChanges\n#{ex.backtrace}"
- end
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_store_topic] % [page.project, page.topic]
- rescue Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_store_topic] % mm
- end
-
- # Destroys the specified topic and project page.
- def destroy(page)
- @delegate.destroy(page)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_destroy_topic] % [page.project, page.topic]
- rescue Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_destroy_topic] % mm
- end
-
- # Releases the lock on the page.
- def release_lock(page, address = 'UNKNOWN')
- time = Time.now.utc.to_i
- @delegate.release_lock(page, time, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_release_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:error_releasing_lock] % mm
- end
-
- # Attempts to obtain a lock on the page. The lock
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- time = Time.now.utc.to_i
- expire = time + timeout
- @delegate.obtain_lock(page, time, expire, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_obtain_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:error_creating_lock] % mm
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- @delegate.project_exists?(project)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- @delegate.page_exists?(topic, project)
- end
-
- # Attempts to create the project.
- def create_project(project)
- @delegate.create_project(project)
- rescue Ruwiki::Backend::ProjectExists => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:project_already_exists] % [project]
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_create_project] % [project]
- rescue Exception => ex
- mm = [project, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_create_project] % mm
- end
-
- # Attempts to destroy the project.
- def destroy_project(project)
- @delegate.destroy_project(project)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_destroy_project] % [project]
- rescue Exception => ex
- mm = [project, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_destroy_project] % mm
- end
-
- def search_all_projects(searchstr)
- if @delegate.respond_to?(:search_all_projects)
- @delegate.search_all_projects(searchstr)
- else
- search_all_projects_default(searchstr)
- end
- end
-
- # Attempts to search all projects. This is the default
- # search_all_projects used unless the delegate implements
- # a specialized search_all_projects.
- def search_all_projects_default(searchstr)
- hits = {}
- list_projects.each do |project|
- lhits = search_project(project, searchstr)
- # Transform the keys from project local to global links.
- lhits.each { |key, val| hits["#{project}::#{key}"] = val }
- end
- hits
- end
-
- # Attempts to search a project
- def search_project(project, searchstr)
- #TODO: Validate searchstr is a safe regexp?
- @delegate.search_project(project, searchstr)
- rescue Exception => ex
- mm = [project, searchstr, ex.class, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:search_project_fail] % mm
- end
-
- # Return an array of projects
- def list_projects
- @delegate.list_projects
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_list_projects]
- rescue Exception => ex
- mm = ['', %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_list_projects] % mm
- end
-
- # Return an array of projects
- def list_topics(projname)
- @delegate.list_topics(projname)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_list_topics] % [projname]
- rescue Exception => ex
- mm = [projname, ex.message]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_list_topics] % mm
- end
- end
-
- # The Ruwiki backend abstract class and factory.
- class Backend
- class ProjectExists < RuntimeError #:nodoc:
- end
- class InvalidFormatError < RuntimeError #:nodoc:
- end
- class BackendError < RuntimeError #:nodoc:
- attr_reader :reason
-
- def initialize(reason, *args)
- if @reason.respond_to?(:message)
- @reason = reason.message
- else
- @reason = reason
- end
- end
- end
- def initialize(storage_options)
- end
-
- private
- NL_RE = %r{\n} #:nodoc:
-
- def map_diffset(diffset)
- diffset.map do |hunk|
- if hunk.kind_of?(Array)
- hunk.map { |change| change.to_a }
- else
- hunk.to_a
- end
- end
- end
-
- # Creates the current diff object. This is made from two
- # Ruwiki::Page#export hashes.
- def make_diff(oldpage, newpage)
- oldpage = oldpage.export if oldpage.kind_of?(Ruwiki::Page)
- newpage = newpage.export if newpage.kind_of?(Ruwiki::Page)
-
- diff = Hash.new
-
- newpage.keys.sort.each do |sect|
- newpage[sect].keys.sort.each do |item|
- oldval = oldpage[sect][item]
- newval = newpage[sect][item]
-
- case [sect, item]
- when ['properties', 'html-headers']
- # Protect against NoMethodError.
- oldval ||= []
- newval ||= []
- val = Diff::LCS.sdiff(oldval, newval, Diff::LCS::ContextDiffCallbacks)
- when ['ruwiki', 'content-version'], ['properties', 'version'],
- ['properties', 'entropy']
- val = Diff::LCS.sdiff([oldval], [newval], Diff::LCS::ContextDiffCallbacks)
- when ['properties', 'create-date'], ['properties', 'edit-date']
- val = Diff::LCS.sdiff([oldval.to_i], [newval.to_i], Diff::LCS::ContextDiffCallbacks)
- else
- # Protect against NoMethodError.
- val = Diff::LCS.sdiff(oldval.to_s.split(NL_RE), newval.to_s.split(NL_RE), Diff::LCS::ContextDiffCallbacks)
- end
-
- (diff[sect] ||= {})[item] = map_diffset(val) unless val.nil? or val.empty?
- end
- end
-
- diff_hash = {
- 'old_version' => oldpage['properties']['version'],
- 'new_version' => newpage['properties']['version'],
- 'edit-date' => newpage['properties']['edit-date'].to_i,
- 'editor-ip' => newpage['properties']['editor-ip'],
- 'editor' => newpage['properties']['editor'],
- 'diff' => diff
- }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/backend/flatfiles.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/backend/flatfiles.rb
deleted file mode 100644
index e9a9ae2..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/backend/flatfiles.rb
+++ /dev/null
@@ -1,216 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Flatfiles < Ruwiki::Backend
- # Initializes the Flatfiles backend. The known options for the Flatfiles
- # backend are documented below.
- #
- # data-path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # format:: The format of the files in the backend. By default,
- # this is 'exportable', a tagged data format produced by
- # Ruwiki::Exportable; alternative formats are 'yaml'
- # (::YAML.dump) and 'marshal' (::Marshal.dump).
- # default-page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- @data_path = options['data-path'] || File.join(".", "data")
- @extension = options['extension']
- @format = case options['format']
- when 'exportable', nil
- Ruwiki::Exportable
- when 'yaml'
- ::YAML
- when 'marshal'
- ::Marshal
- end
-
- if @extension.nil?
- @extension_re = /$/
- else
- @extension_re = /\.#{@extension}$/
- end
-
- @default_page = options['default-page'] || "ProjectIndex"
- if not (File.exists?(@data_path) and File.directory?(@data_path))
- raise Ruwiki::Backend::BackendError.new([:flatfiles_no_data_directory, [@data_path]])
- end
-
- super
- end
-
- # Destroys the topic page.
- def destroy(page)
- pf = page_file(page.topic, page.project)
- File.unlink(pf) if File.exists?(pf)
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- pd = project_directory(project)
- File.exists?(pd) and File.directory?(pd)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- pf = page_file(topic, project)
- project_exists?(project) and File.exists?(pf)
- end
-
- # Tries to create the project.
- def create_project(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::ProjectExists if File.exists?(pd)
- Dir.mkdir(pd)
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # String search all topic names and content in a project and
- # return a hash of topic hits.
- def search_project(project, searchstr)
- re_search = Regexp.new(searchstr, Regexp::IGNORECASE)
-
- hits = Hash.new { |hh, kk| hh[kk] = 0 }
- topic_list = list_topics(project)
-
- return hits if topic_list.empty?
-
- # search topic content
- topic_list.each do |topic|
- # search name
- hits[topic] += topic.scan(re_search).size
-
- # check content
- page = load(topic, project) rescue Ruwiki::Page::NULL_PAGE
- page['page'].each_value do |item|
- item = item.join("") if item.kind_of?(Array)
- item ||= ""
- hits[topic] += item.scan(re_search).size
- end
- end
-
- hits
- end
-
- def lock_okay?(page, time, address = 'UNKNOWN')
- lockokay = false
- lockfile = "#{page_file(page.topic, page.project)}.lock"
-
- if File.exists?(lockfile)
- data = File.read(lockfile).split(%r{!})
- # If the lock belongs to this address, we don't care how old it is.
- # Thus, release it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lockokay = true
- end
- end
-
- # Attempts to obtain a lock on the topic page. This must return the lock
- def obtain_lock(page, time, expire, address = 'UNKNOWN')
- lock = "#{address}!#{expire}"
-
- if lock_okay?(page, time, address)
- File.open("#{page_file(page.topic, page.project)}.lock", 'wb') { |lfh| lfh.puts lock }
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- lock
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, time, address = 'UNKNOWN')
- lockfile = "#{page_file(page.topic, page.project)}.lock"
-
- if lock_okay?(page, time, address)
- File.unlink(lockfile) if File.exists?(lockfile)
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- true
- end
-
- # list projects found in data path
- def list_projects
- Dir[File.join(@data_path, "*")].select do |dd|
- File.directory?(dd) and File.exist?(page_file(@default_page, File.basename(dd)))
- end.map { |dd| File.basename(dd) }
- end
-
- # list topics found in data path
- def list_topics(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::BackendError.new(:no_project) unless File.exist?(pd)
-
- Dir[File.join(pd, "*")].select do |ff|
- ff !~ /\.rdiff$/ and ff !~ /\.lock$/ and File.file?(ff) and ff =~ @extension_re
- end.map { |ff| File.basename(ff).sub(@extension_re, "") }
- end
-
- def project_directory(project) # :nodoc:
- File.join(@data_path, project)
- end
-
- def page_file(topic, project = 'Default') # :nodoc:
- if @extension.nil?
- File.join(project_directory(project), topic)
- else
- File.join(project_directory(project), "#{topic}.#{@extension}")
- end
- end
-
- def make_rdiff(page_file, new_page)
- diff_file = "#{page_file}.rdiff"
-
- old_page = self.class.load(pf) rescue Ruwiki::Page::NULL_PAGE
-
- diffs = []
- File.open(diff_file, 'rb') { |ff| diffs = Marshal.load(ff) } if File.exists?(diff_file)
- diffs << make_diff(old_page, new_page)
- changes = Marshal.dump(diffs)
-
- File.open(diff_file, 'wb') { |ff| ff << changes }
- end
-
- # Provides a HEADER marker.
- # Loads the topic page from disk.
- def load(topic, project)
- data = nil
- File.open(page_file(topic, project), 'rb') { |ff| data = ff.read }
-
- Ruwiki::Page::NULL_PAGE.merge(@format.load(data))
- rescue Ruwiki::Exportable::InvalidFormatError, TypeError, ArgumentError
- raise Ruwiki::Backend::InvalidFormatError
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = @format.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |ff| ff.puts newpage }
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/config.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/config.rb
deleted file mode 100644
index d01dca1..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/config.rb
+++ /dev/null
@@ -1,244 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # Ruwiki configuration.
-class Ruwiki::Config
- include Ruwiki::Exportable
-
- CONFIG_NAME = 'ruwiki.conf'
-
- exportable_group 'ruwiki-config'
- # Sets or returns the logger. The logger, if set, must respond to the same
- # methods as WEBrick::Logger.
- attr_accessor :logger
- # Sets or returns the time format whenever time is outputted in Ruwiki.
- # Default is <tt>%H:%M:%S</tt> (23:59:59).
- attr_accessor :time_format
- exportable :time_format
- # Sets or returns the date format whenever time is outputted in Ruwiki.
- # Default is <tt>%Y.%m.%d</tt> (2004.08.04).
- attr_accessor :date_format
- exportable :date_format
- # Sets or returns the date-time format whenever time is outputted in
- # Ruwiki. Default is <tt>%Y.%m.%d %H:%M:%S</tt> (2004.08.04 23:59:59).
- attr_accessor :datetime_format
- exportable :datetime_format
- # Adds additional information to the (rare) error reports. Defaults to
- # +false+.
- attr_accessor :debug
- exportable :debug
- # The default page for display when Ruwiki is called without any arguments.
- # Defaults to +ProjectIndex+
- attr_accessor :default_page
- exportable :default_page
- # The default project for display when Ruwiki is called without any
- # arguments or a project specification. Defaults to +Default+
- attr_accessor :default_project
- exportable :default_project
- # The authentication mechanism name as a String. Corresponds to
- # a filename that will be found in ruwiki/auth. The authenticator must
- # have a single class method, +authenticate+, which accepts the
- # +request+, the +response+, and the +#auth_options+. This API is
- # a draft API and is likely to change in future versions of Ruwiki. In
- # this version of Ruwiki, only one authentication mechanism will be
- # found -- for dealing with authenticating users already logged into
- # RubyForge.
- attr_accessor :auth_mechanism
- exportable :auth_mechanism
- # Options for the authentication mechanism as a Hash. This will be
- # passed to the authenticator defined in +#auth_mechanism+.
- attr_accessor :auth_options
- exportable :auth_options
- # The storage type as a String. Corresponds to a filename that will be
- # found in ruwiki/backend. NOTE: The yaml and marshal storage types have
- # been removed from Ruwiki 0.9.0, to be replaced with a single storage
- # type of Flatfiles. Now, the YAML and Marshal formats can be enabled by
- # setting options in the @storage_options field.
- attr_accessor :storage_type
- exportable :storage_type
- # The options for the specified storage type. This is a hash of hashes with
- # auto-vifification. See the storage type for available options.
- attr_reader :storage_options
- exportable :storage_options
- # The path for templates. Defaults to <tt>./templates/</tt>.
- attr_accessor :template_path
- exportable :template_path
- # The name of the Wiki. Defaults to <tt>ruwiki</tt>
- attr_accessor :title
- exportable :title
- # The email address of the webmaster for the Wiki. Defaults to +nil+.
- attr_accessor :webmaster
- exportable :webmaster
- # The name of the Ruwiki CSS file. Defaults to <tt>ruwiki.css</tt>.
- attr_accessor :css
- exportable :css
- # The template set. Templates are always named as
- # <template_path>/<template_set>/<template_name>. Template filename. Must
- # be reachable by File#read.
- attr_accessor :template_set
- exportable :template_set
- # Ruwiki is internationalized. This method sets the Ruwiki error
- # messages (and a few other messages) to the specified language Module.
- # The language Module must have a constant Hash called +Message+
- # containing a set of symbols and localized versions of the messages
- # associated with them.
- #
- # If the file 'ruwiki/lang/es.rb' contains the module
- # <tt>Ruwiki::Lang::ES</tt>, the error messages for RSS could be
- # localized to Español thus:
- #
- # require 'ruwiki/lang/es'
- # ...
- # wiki.config.language = Ruwiki::Lang::ES
- #
- # Localization is per wiki instance. In a servlet environment, this may
- # mean that only a single language is recognised.
- #
- # See Ruwiki::Lang::EN for more information.
- attr_accessor :language
- exportable :language
- # The message hash.
- attr_reader :message
-
- def language=(ll) #:nodoc:
- if ll.kind_of?(String)
- @language = Ruwiki::Lang::const_get(ll.upcase)
- else
- @language = ll
- end
- @message = @language::Message
- end
-
- # Returns the specified template as a string.
- def template(name)
- File.read(File.join(@template_path, @template_set, "#{name.to_s}.tmpl"))
- rescue Errno::ENOENT
- raise ConfigError, message[:no_template_found] % [name.inspect, @template_set]
- end
-
- # Returns the CSS stylesheet content for the Wiki. This previously
- # returned the <link> to the stylesheet, but instead returns a <style>
- # block in the head so that the CSS is kept with the template set, which
- # may be kept outside of the HTML area.
- def css_link
- %Q[<style type="text/css" media="screen,print">#{File.read(File.join(@template_path, @template_set, @css))}</style>]
- end
-
- # Creates a new configuration object.
- def initialize(exportable = {})
- rc = exportable['ruwiki-config'] || {}
- @debug = (rc['debug'] == "false") ? false : true
- @default_project = rc['default-project'] || "Default"
- @default_page = rc['default-page'] || "ProjectIndex"
- @auth_mechanism = rc['auth-mechanism'] || nil
-
- case rc['auth-options']
- when nil, ""
- @auth_options = {}
- else
- @auth_options = Ruwiki::Exportable.load(rc['auth-options'])['default']
- end
-
- case rc['storage-type']
- when nil, ""
- @storage_type = 'flatfiles'
- else
- @storage_type = rc['storage-type']
- end
-
- # in 'type!name:<Tab>value\n' format.
- if rc['storage-options'].nil? or rc['storage-options'].empty?
- @storage_options = Hash.new { |hh, kk| hh[kk] = {} }
- else
- @storage_options = Ruwiki::Exportable.load(rc['storage-options'])
- @storage_options.keys.each do |key|
- @storage_options[key] = @storage_options.delete(key)
- end
- end
- if @storage_options.empty?
- @storage_options[@storage_type]['extension'] = "ruwiki"
- @storage_options[@storage_type]['data-path'] = "./data"
- @storage_options[@storage_type]['format'] = "exportable"
- end
-
- @storage_options.each_value do |vv|
- if vv['extension'].nil? or vv['extension'].empty?
- vv['extension'] = "ruwiki"
- end
- if vv['data-path'].nil? or vv['data-path'].empty?
- vv['data-path'] = "./data"
- end
- end
-
- @template_path = rc['template-path'] || "./templates/"
- @template_set = rc['template-set'] || "default"
- @css = rc['css'] || "ruwiki.css"
- @webmaster = rc['webmaster']
- @title = rc['title'] || "Ruwiki"
- @time_format = rc['time-format'] || "%H:%M:%S"
- @date_format = rc['date-format'] || "%Y.%m.%d"
- @datetime_format = rc['datetime-format'] || "#{@date_format} #{@time_format}"
- case rc['language']
- when nil, ""
- self.language = Ruwiki::Lang::EN
- else
- self.language = Ruwiki::Lang::const_get(rc['language'].upcase)
- end
- end
-
- # Verifies that required configuration options are actually set. Right
- # now, it only checks the values that are defaulted to +nil+.
- def verify
- raise ConfigError, message[:no_webmaster_defined] if @webmaster.nil? or @webmaster.empty?
- raise ConfigError, message[:invalid_template_dir] % [@template_path] unless File.exists?(@template_path) and File.directory?(@template_path)
- tt = File.join(@template_path, @template_set)
- raise ConfigError, message[:no_template_set] % [@template_set] unless File.exists?(tt) and File.directory?(tt)
- end
-
- # Provides the canonical export hash.
- def export
- exportable = super
-
- rc = exportable['ruwiki-config']
-
- rc['auth-options'] = Ruwiki::Exportable.dump({ 'default' => rc['auth-options']})
-
- rc['storage-options'] = Ruwiki::Exportable.dump(rc['storage-options'])
- rc['storage-type'] = rc['storage-type'].to_s
- rc['language'] = "#{rc['language']}".sub(/^.*?::([A-Z]+)$/, '\1').downcase
- exportable
- end
-
- class << self
- def write(file, config)
- if file.respond_to?(:write)
- file.puts(config.dump)
- else
- File.open(file, 'wb') { |ff| ff.puts(config.dump) }
- end
- end
-
- def read(file)
- data = nil
- if file.respond_to?(:read)
- data = file.read
- else
- File.open(file, 'rb') { |ff| data = ff.read }
- end
- hash = Ruwiki::Exportable.load(data)
-
- Ruwiki::Config.new(hash)
- end
- end
-
- class ConfigError < StandardError; end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/exportable.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/exportable.rb
deleted file mode 100644
index c18290f..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/exportable.rb
+++ /dev/null
@@ -1,192 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # == Synopsis
- # Generalises a marshaling format that is easily read and edited by humans
- # and is relatively easy to manage by software. When an attribute is marked
- # #exportable, the name of the attribute is transformed and stored in
- # a two-level hash, e.g.:
- #
- # exportable_group 'group1'
- # exportable :var_1
- # exportable :var_2
- # exportable_group 'group2'
- # exportable :var_3
- # exportable :var_4
- #
- # Results in an exportable hash of:
- #
- # { 'group1' =>
- # { 'var-1' => @var1,
- # 'var-2' => @var2, },
- # 'group2' =>
- # { 'var-3' => @var3,
- # 'var-4' => @var4, }, }
- #
-module Ruwiki::Exportable
- class InvalidFormatError < RuntimeError; end
-
- class << self
- # Adds two methods and an attribute to the class that is including Exportable
- #
- # <tt>__exportables</tt>:: Contains the list of exportable symbols by group.
- # <tt>exportable_group</tt>:: Defines the current group for exportable
- # symbols. Default is 'default'.
- # <tt>exportable</tt>:: Accepts two arguments, the attribute being
- # exported and an option hash, containing the
- # values :name and :group, where :name
- # indicates the name of the attribute (so
- # that the default name transformation is
- # not applied) and :group overrides the
- # current #exportable_group. By default, the
- # name of the attribute is transformed such
- # that underscores are converted to dashes
- # (<tt>var_1</tt> becomes 'var-1').
- def append_features(mod)
- super
-
- class << mod
- attr_reader :__exportables
-
- define_method(:exportable_group) do |name|
- @__exportable_group = name || 'default'
- end
-
- define_method(:exportable) do |*symset|
- symbol = symset.shift
- options = symset.shift || {}
-
- @__exportables ||= {}
-
- options[:name] ||= symbol.to_s.gsub(/_/, '-')
- options[:group] ||= @__exportable_group || 'default'
-
- @__exportables[options[:group]] ||= {}
- @__exportables[options[:group]][options[:name]] = "@#{symbol.to_s}".intern
- end
- end
- end
-
- # Looks for comments. Comments may ONLY be on single lines.
- COMMENT_RE = %r{^#}
- # Looks for newlines
- NL_RE = %r{\n}
- # Looks for a line that indicates an exportable value. See #dump.
- HEADER_RE = %r{^([a-z][-a-z]+)!([a-z][-a-z]+):[ \t](.*)$}
- # Looks for an indented group indicating that the last group is
- # a multiline value.
- FIRST_TAB = %r{^[ \t]}
-
- # Dumps the provided exportable hash in the form:
- #
- # section!name:<Tab>Value
- # section!name:<Space>Value
- #
- # Multiline values are indented either one space or one tab:
- #
- # section!name:<Tab>Value Line 1
- # <Tab>Value Line 2
- # <Tab>Value Line 3
- # <Tab>Value Line 4
- #
- # All values in the exportable hash are converted to string
- # representations, so only values that can meaningfully be reinstantiated
- # from string representations should be stored in the exportable hash. It
- # is the responsibility of the class preparing the exportable hash
- # through Exportable#export to make the necessary transformations.
- def dump(export_hash)
- dumpstr = ""
-
- export_hash.keys.sort.each do |sect|
- export_hash[sect].keys.sort.each do |item|
- val = export_hash[sect][item].to_s.split(NL_RE).join("\n\t")
- dumpstr << "#{sect}!#{item}:\t#{val}\n"
- end
- end
-
- dumpstr
- end
-
- # Loads a buffer in the form provided by #dump into an exportable hash.
- # Skips comment lines.
- def load(buffer)
- hash = {}
- return hash if buffer.nil? or buffer.empty?
-
- # Split the buffer and eliminate comments.
- buffer = buffer.split(NL_RE).delete_if { |line| line =~ COMMENT_RE }
-
- if HEADER_RE.match(buffer[0]).nil?
- raise Ruwiki::Exportable::InvalidFormatError
- end
-
- sect = item = nil
-
- buffer.each do |line|
- line.chomp!
- match = HEADER_RE.match(line)
-
- # If there is no match, add the current line to the previous match.
- # Remove the leading \t, though.
- if match.nil?
- raise Ruwiki::Exportable::InvalidFormatError if FIRST_TAB.match(line).nil?
- hash[sect][item] << "\n#{line.gsub(FIRST_TAB, '')}"
- else
- sect = match.captures[0]
- item = match.captures[1]
- hash[sect] ||= {}
- hash[sect][item] = match.captures[2]
- end
- end
-
- hash
- end
- end
-
- # Converts #exportable attributes to an exportable hash, in the form:
- # { 'group1' =>
- # { 'var-1' => @var1,
- # 'var-2' => @var2, },
- # 'group2' =>
- # { 'var-3' => @var3,
- # 'var-4' => @var4, }, }
- #
- # Classes that #include Exportable are encouraged to override export to
- # ensure safe transformations of values. An example use might be:
- #
- # class TimeClass
- # include Ruwiki::Exportable
- #
- # def export
- # sym = super
- #
- # sym['default']['time'] = sym['default']['time'].to_i
- # sym
- # end
- #
- # In this way, the 'time' value is converted to an integer rather than the
- # default string representation.
- def export
- sym = {}
-
- self.class.__exportables.each do |group, gval|
- gname = group || @__exportable_group || 'default'
- gsym = {}
- gval.each do |name, nval|
- val = self.instance_variable_get(nval)
- gsym[name] = val unless val.nil?
- end
- sym[gname] = gsym
- end
-
- sym
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/handler.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/handler.rb
deleted file mode 100644
index c6a9375..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/handler.rb
+++ /dev/null
@@ -1,342 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Handler
- class << self
- # Generate a new Handler pair from a CGI request.
- def from_cgi(cgi, output_stream = $stdout)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::CGIRequest.new(cgi)
- o.response = Ruwiki::Handler::CGIResponse.new(cgi, output_stream)
- end
- end
-
- # Generate a new Handler pair from a WEBrick request.
- def from_webrick(req, res)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::WEBrickRequest.new(req)
- o.response = Ruwiki::Handler::WEBrickResponse.new(res)
- end
- end
- end
-
- # Returns the handler's request object.
- attr_accessor :request
- # Returns the handler's response object.
- attr_accessor :response
-
- # Creates the handler pair.
- def initialize(&block) #:yields: self
- @request = nil
- @response = nil
- yield self if block_given?
- end
-
- # Essentially a clone of WEBrick::Cookie for use with Ruwiki.
- class Cookie
- attr_reader :name
- attr_accessor :value
- attr_accessor :version
-
- FIELDS = %w(domain path secure comment max_age expires)
-
- FIELDS.each { |field| attr_accessor field.intern }
-
- def initialize(name, value)
- @name = name
- @value = value
- @version = 0 # Netscape Cookie
-
- FIELDS.each { |field| instance_variable_set("@#{field}", nil) }
-
- yield self if block_given?
- end
-
- def expires=(t) #:nodoc:
- @expires = if t.nil? or t.kind_of?(Time)
- t
- else
- Time.parse(t.to_s)
- end
- end
-
- def to_s
- ret = "#{@name}=#{@value}"
- ret << "; Version=#{@version.to_s}" if @version > 0
- ret << "; Domain=#{@domain}" if @domain
- ret << "; Expires=#{CGI::rfc1123_date(@expires)}" if @expires
- ret << "; Max-Age=#{CGI::rfc1123_date(@max_age)}" if @max_age
- ret << "; Comment=#{@comment}" if @comment
- ret << "; Path=#{@path}" if @path
- ret << "; Secure" if @secure
- ret
- end
- end
-
- # Represents an abstract incoming request. This insulates the rest of
- # the code from knowing whether parameters are passed as part of the
- # path, as parameters in the URL, or in some other fashion.
- class AbstractRequest
- def initialize(*args)
- end
- end
-
- # Handles all requests from web applications.
- #
- # Subclasses should provide:
- # @parameters:: Hash-like object that responds to #[] and #hash_key?]
- # @environment:: Hash-like object that responds to #[]
- class AbstractWebRequest < AbstractRequest
- # The parameters provided via the web request.
- attr_reader :parameters
- # The environment provided to the web request.
- attr_reader :environment
- # The request path.
- attr_reader :path
-
- # The list of cookies.
- attr_reader :cookies
-
- def each_parameter #:yields parameter, value:
- @parameters.each { |kk, vv| yield kk, vv }
- end
-
- def each_environment #:yields variable, value
- @environment.each { |kk, vv| yield kk, vv }
- end
-
- def each_cookie #:yields name, value:
- @cookies.each { |kk, vv| yield kk, vv }
- end
-
- # Return the URL of our server.
- def server_url
- res = "http://" # should detect whether we're in secure server mode.
- if @environment['HTTP_HOST']
- res << @environment['HTTP_HOST']
- else
- res << "#{@environment['SERVER_NAME']}:#{@environment['SERVER_PORT']}"
- end
- end
-
- # Return the URL of this script.
- def script_url
- server_url << @environment['SCRIPT_NAME'].to_s
- end
-
- # Return the URL of this request.
- def request_url
- res = script_url
- res << @environment['PATH_INFO'] if @environment['PATH_INFO']
- query = @environment['QUERY_STRING']
- res << "?#{@environment['QUERY_STRING']}" if query && !query.empty?
- res
- end
-
- # Convert a file path into a URL
- def make_url(project, path)
- "#{server_url}/#{project}/#{path}"
- end
-
- def determine_request_path
- @path = ""
- return @path if @environment['PATH_INFO'].nil?
- @path = @environment['PATH_INFO'].dup
- end
- end
-
- # Request for CGI-based activity to ruwiki.
- class CGIRequest < AbstractWebRequest
- def initialize(cgi, output_stream = $stdout)
- @environment = ENV
- @cgi = cgi
- @parameters = {}
- cgi.params.each { |kk, vv| @parameters[kk] = vv[0] }
- @cookies = {}
- cgi.cookies.each do |name, cookie|
- @cookies[name] = Ruwiki::Handler::Cookie.new(name, cookie.value) do |oc|
- oc.version = cookie.version if cookie.respond_to?(:version)
- oc.domain = cookie.domain
- oc.path = cookie.path
- oc.secure = cookie.secure
- oc.comment = cookie.comment if cookie.respond_to?(:comment)
- oc.expires = cookie.expires
- end
- end
- super
- end
- end
-
- # Request for WEBrick based servlet activity to ruwiki.
- class WEBrickRequest < AbstractWebRequest
- def initialize(req)
- @environment = req.meta_vars
- @parameters = req.query
- @cookies = {}
- req.cookies.each do |rqc|
- @cookies[rqc.name] = Ruwiki::Handler::Cookie.new(rqc.name, rqc.value) do |oc|
- oc.version = rqc.version
- oc.domain = rqc.domain
- oc.path = rqc.path
- oc.secure = rqc.secure
- oc.comment = rqc.comment
- oc.expires = rqc.expires
- oc.max_age = rqc.max_age
- end
- end
- super
- end
- end
-
- # Used to write responses in different execution environments such as
- # CGI and Webrick.
- #
- # If you want to create a new response object, you'll need to implement
- # #add_header, #write_headers, #write_cookies, and #<<.
- #
- # The Response object is instantiated with an output stream which must
- # supply +<<+ and +puts+ methods.
- class AbstractResponse
- # Add to the list of headers to be sent back to the client.
- def add_header(key, value)
- raise "Not implemented"
- end
-
- # Write the accumulated headers back to the client.
- def write_headers
- raise "Not implemented"
- end
-
- # Write the string to the client.
- def <<(string)
- raise "Not implemented"
- end
-
- def add_cookies(*cookies)
- cookies.each do |cookie|
- @cookies << cookie
- end
- end
-
- def write_cookies
- raise "Not implemented"
- end
-
- # output_stream must respond to #<< and #puts.
- def initialize(output_stream = $stdout)
- @headers = {}
- @cookies = []
- @written = false
- @status = nil
- @output_stream = output_stream
- end
-
- def written?
- @written
- end
- end
-
- # CGIResponse is the response object for CGI mode.
- class CGIResponse < AbstractResponse
- # output_stream must respond to #<< and #puts.
- def initialize(cgi, output_stream = $stdout)
- @cgi = cgi
- @done = {
- :headers => false,
- :cookies => false,
- :body => false
- }
- super(output_stream)
- end
-
- # Add the header pair for later output as a CGI header.
- def add_header(key, value)
- @headers[key] = value
- end
-
- # Write the headers to the stream. The headers can only be written
- # once.
- def write_headers
- return if @done[:headers]
- @headers.each { |key, value| @output_stream.puts "#{key}: #{value}\r\n" }
- write_cookies
- @output_stream.puts
- @done[:headers] = true
- end
-
- # Write the cookies to the stream. The cookies can only be written
- # once.
- def write_cookies
- return if @done[:cookies]
- @cookies.each do |cookie|
- @output_stream.puts "Set-Cookie: #{cookie.to_s}"
- end
- @done[:cookes] = true
- end
-
- # Output the string to the stream provided.
- def <<(string)
- @output_stream << string
- @written = true
- end
-
- def write_status(status)
- unless status.nil?
- @output_stream << status
- @written = true
- end
- end
- end
-
- # WEBrickResponse is the response object for WEBrick servlet mode.
- class WEBrickResponse < AbstractResponse
- def initialize(webrick_response)
- @response = webrick_response
- @cookies = []
- @done = {
- :headers => false,
- :cookies => false,
- :body => false
- }
- end
-
- def add_header(key, value)
- @response[key] = value
- end
-
- # Copy the cookies into the WEBrick::HTTPResponse cookies array.
- def write_cookies
- return if @done[:cookies]
- @cookies.each do |cookie|
- @response.cookies << cookie.to_s
- end
- @done[:cookes] = true
- end
-
- def write_headers
- write_cookies
- # Webrick will take care of this on its own.
- end
-
- def <<(string)
- @response.body << string.to_s
- @written = true
- end
-
- def write_status(status)
- unless status.nil?
- match = %r{^HTTP/(?:\d|\.)+ (\d+) .*}.match(status)
- @response.status = match.captures[0]
- @response.body << status
- @written = true
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/lang/de.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/lang/de.rb
deleted file mode 100644
index b9db0ef..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/lang/de.rb
+++ /dev/null
@@ -1,339 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Translation by Christian Neukirchen (chneukirchen@yahoo.de) on 22oct2003
-# Updated by Christian Neukirchen (purl.org/net/chneukirchen) on 27aug2004
-# Updated by Christian Neukirchen (purl.org/net/chneukirchen) on 09nov2004
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::DE is the German-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module DE
- Message = Hash.new { |hh, kk| hh[kk] = "Sprachdatei-FEHLER: Unbekannter Nachrichten-Typ #{k.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Unbekanntes Backend %1$s.",
- :cannot_create_project => "Kann %1$s nicht erstellen: %2$s",
- :cannot_destroy_project => "Kann %1$s nicht zerstören: %2$s",
- :cannot_destroy_topic => "Kann %1$s::%2$s nicht zerstören: %3$s",
- :cannot_obtain_lock => "Kann keine Sperre für %1$s::%2$s erhalten. Bitte in Kürze nochmal versuchen.",
- :cannot_release_lock => "Kann die Sperre für %1$s::%2$s nicht lösen. Bitte später nochmal versuchen.",
- :cannot_retrieve_topic => "Kann auf %1$s::%2$s nicht zugreifen: %3$s",
- :cannot_store_topic => "Kann %1$s::%2$s nicht speichern: %3$s",
- :cannot_list_topics => "Kann Themen für Projekt %1$s nicht auflisten: %2$s",
- :error_creating_lock => "Fehler beim Erzeugen der Sperre von %1$s::%2$s: %3$s",
- :error_releasing_lock => "Fehler beim Lösen der Sperre von %1$s::%2$s: %3$s",
- :flatfiles_no_data_directory => "Das Daten-Verzeichnis (%1$s) existiert nicht.",
- :no_access_list_projects => "Keine Berechtigung zum Auflisten der Projekte.",
- :no_access_list_topics => "Keine Berechtigung zum Auflisten der Themen von Projekt %1$s.",
- :no_access_to_create_project => "Keine Berechtigung um Projekt %1$s zu erzeugen.",
- :no_access_to_destroy_project => "Keine Berechtigung um Projekt %1$s zu zerstören.",
- :no_access_to_destroy_topic => "Keine Berechtigung um Thema %1$s::%2$s zu zerstören.",
- :no_access_to_read_topic => "Keine Berechtigung um Thema %1$s::%2$s zu lesen.",
- :no_access_to_store_topic => "Keine Berechtigung um Thema %1$s::%2$s zu speichern.",
- :page_not_in_backend_format => "%1$s::%2$s ist in einem von Backend %3$s nicht unterstütztem Format.",
- :project_already_exists => "Project %1$s existiert bereits.",
- :project_does_not_exist => "Project %1$s existiert nicht.",
- :search_project_fail => "Suche in Projekt %1$s nach Zeichenkette %2$s gescheitert.",
- :yaml_requires_182_or_higher => "YAML-Flatfile-Support existiert nur für Ruby 1.8.2 oder höher.",
- :not_editing_current_version => <<EOM ,
-Sie haben eine alte Version von %1$s::%2$s abgeschickt. Die Unterschiede
-zwischen ihrer und der jetzigen Version wurden kombiniert. Konfliktierende
-Zeilen zeigen beide Zeilen. Bitte gehen sie sicher, dass sie die gesammte
-Seite bearbeitet haben bevor sie nochmals speichern.
-EOM
- :no_empty_search_string => <<EOM ,
-Das Suchfeld darf nicht leer sein. Bitte etwas eingeben bevor der Suchknopf
-gedrückt wird.
-EOM
- :page_is_locked => "Die Seite ist bereits zur Bearbeitung gesperrt. Bitte warte ein paar Minuten und versuche es dann noch ein mal.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Die Konfiguration muss von Typ der Klasse Ruwiki::Config sein.",
- :invalid_template_dir => "Der angegebene Pfad für Schablonen (%1$s) existiert nicht oder ist kein Verzeichnis.",
- :no_template_found => "Keine Schablone %1$s im Schablonen-Set '%2$s' gefunden.",
- :no_template_set => "Es gibt kein Schablonen-Set '%1$s' im Schablonen-Pfad.",
- :no_webmaster_defined => "Konfigurations-Fehler: Kein Webmaster definiert.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fataler Fehler",
- :editing => "Editieren",
- :error => "Fehler",
- :invalid_path_info_value => "Fataler Fehler in der Web-Umgebung. PATH_INFO = %1$s",
- # Should this really get translated? --chris
- :render_arguments => "Ruwiki#render muss mit zwei oder mehr Argumenten aufgerufen werden.",
- :unknown_feature => "Unbekanntes Feature %1$s.",
- :topics_for_project => "Themen for Projekt ::%1$s",
- :project_topics_link => "(Themen)",
- :wiki_projects => "Projekte in %1$s",
- :no_projects => "Keine Projekte bekannt.",
- :no_topics => "Keine Themen in Projekt %1$s.",
- :search_results_for => "= Suchergebnisse für: %1$s",
- :number_of_hits => "%d Treffer",
-
- # Labels
- :label_search_project => "Durchsuche Projekt",
- :label_search_all => "Alles",
- :label_search => "Suche: ",
- :label_project => "Projekt: ",
- :label_topic => "Thema: ",
- :label_edit => "Editieren",
- :label_recent_changes => "Aktuelle Änderungen",
- :label_topics => "Themen",
- :label_projects => "Projekte",
- :label_editing => "Editieren",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Anmerkung: ",
- :label_comment_accelerator => "R",
- :label_save => "Speichern",
- :label_save_accelerator => "S",
- :label_cancel => "Abbrechen",
- :label_cancel_accelerator => "A",
- :label_preview => "Vorschau",
- :label_preview_accelerator => "V",
- :label_original_text => "Ursprüngliche Version",
- :label_raw => "Formatfrei",
- :label_formatted => "Formatiert",
- :label_send_report_by => "Schicken Sie dem Webmaster einen Report via Email.",
- :label_send_report => "Report schicken.",
- :label_saved_page => "Gespeicherte Seite: ",
-
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Benutzung: %1$s [Optionen] <Verzeichnis>+",
- :converter_format_desc => [ "Konvertiert gefundene Dateien (Jetziges",
- "Format egal) in das angegebene Format",
- "Standard ist flatfiles. Erlaubte",
- "Formate sind: yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Erzeugt Backups der aktualisierten",
- "Dateien. Standard ist --backup." ],
- :converter_backupext_desc => [ 'Gibt die Backup-Erweiterung an. Standard',
- 'ist "~", das dem Datendateinamen',
- 'angehängt wird.' ],
- :converter_backupext_error => "Die Backup-Erweiterung darf nicht leer sein.",
- :converter_extension_desc => [ "Gibt die Erweiterung der Ruwiki-",
- "Datendateien an. Standard ist .ruwiki" ],
- :converter_extension_error => "Die Erweiterung darf nicht leer sein.",
- :converter_noextension_desc => [ "Gibt an, dass Ruwiki-Datendateien",
- "keine Dateierweiterung haben." ],
- :converter_quiet_desc => [ "Still sein. Standard sind normale",
- "Mitteilungen." ],
- :converter_language_desc => [ "Sprache auf LANG setzen. Standard ist",
- "en (Englisch). Bekannte Sprachen sind:",
- "en es de" ],
- :converter_verbose_desc => [ "Gesprächig sein. Standard sind normale",
- "Mitteilungen." ],
- :converter_help_desc => [ "Diesen Text zeigen." ],
- :converter_num_arguments => "Fehler: Nicht genug Parameter.",
- :converter_directory => "Verzeichnis",
- :converter_converting_from => "Wandle von %1$s nach %2$s um... ",
- :converter_done => "fertig.",
- :converter_not_ruwiki => "Keine Ruwiki-Datei; übersprungen.",
- :converter_nosave_modified => "Kann veränderte Datei %1$s nicht speichern.",
- :converter_page_format_error => "Fehler: Kann Seitenformat nicht erkennen.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Unbekannter Befehl: %1$s",
- :manager_help_commands => <<EOH ,
-Es gibt diese 'ruwiki'-Befehle:
-
- ruwiki install Standard-Entwicklungspaket installieren.
- ruwiki package Ruwiki-Installation einpacken.
- ruwiki unpackage Ruwiki-Installation auspacken.
- ruwiki service Win32::Service für Ruwiki verwalten.
-
-EOH
- :manager_help_help => <<-EOH ,
-Diese Hilfsnachricht zeigt, wie man mehr Informationen zu diesem
-Kommandozeilenwerkzeug erhalten kann:
-
- ruwiki help commands Alle 'ruwiki' Befehle anzeigen.
- ruwiki help <BEFEHL> Hilfe zu <BEFEHL> zeigen.
- (e.g., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Fehlender Parameter für Option: %1$s",
- :manager_dest_not_directory => "Das Ziel (%1$s) ist kein Verzeichnis.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPTIONEN] [--to ZIEL]
-
-Erzeugt eine neue Ruwiki-Instanz. Standardmäßig installiert dies die Daten,
-Schablonen und eine Standard-Konfigurationsdatei im derzeitigen Verzeichnis.
-Das Ziel kann mit --to geändert werden, und was installiert werden soll mit
-der OPTIONEN-Liste. Die Elemente der OPTIONEN-Liste dürfen durch Leerzeichen,
-Komma oder Semikola getrennt werden. Daher haben
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-alle die gleiche Wirkung. Die Groß-/Kleinschreibung spielt keine Rolle.
-Die OPTIONEN sind:
-
- servlet # Den Ruwiki servlet stub installieren
- service # Den Ruwiki Win32::Service stub installieren
- CGI # Das Ruwiki CGI-Skript installieren
- data # Ruwiki-Daten, Schablonen, und Konfiguration installieren
-
-Optionen können durch voranstellen von '-' oder 'no' abgeschaltet werden:
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-Dies würde das CGI-Skript, nicht aber die Daten installieren.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [QUELL] [--output PAKET] [--replace]
- ruwiki package [QUELL] [-o PAKET] [--replace]
-
-Packt die Ruwiki-Dateien (Daten, Schablonen und Programme) vom angegebenen
-QUELL-Verzeichnis oder dem derzeitigen Verzeichnis in das angegebene Paket
-(oder "./%1$s"). Sollte QUELL eine Ruwuki-Konfigurationsdatei sein (z.B.
-"%2$s"), dann wird sie verwendet, um Ort und Name der Daten- und Schablonen-
-Verzeichnisse zu erfahren.
-
- MERKE: Der Einpack-Prozess normalisiert die Daten- und Schablonen-
- Verzeichnisnamen relativ zum Einpackverzeichnis. Es werden
- niemals absolute Pfade sein.
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [QUELL] [--output VERZEICHNIS]
- ruwiki unpackage [QUELL] [-o VERZEICHNIS]
-
-Entpackt das gegebene Rukwiki-Paket (Standard: "./%1$s") in das angebene
-Verzeichnis (oder ".").
-EOH
- :manager_service_broken => "Kann keinen Win32-Service verwalten, wenn Win32::Service nicht installiert ist.",
- :manager_service_lo_argcount => "Ungenügene Parameteranzahl: %1$s",
- :manager_service_hi_argcount => "Zu viele Parameter: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NAME [BESCHREIBUNG] [Optionen]
- ruwiki service start NAME
- ruwiki service stop NAME
- ruwiki service delete NAME
-
-Verwaltet das Ruwiki WEBrick servlet als Windows-Service. Der Service muss
-benannt (NAME) sein. install unterstützt folgende zusätzliche Optionen:
-
- --rubybin RUBYPFAD Der Pfad zum Ruby-Binärverzeichnis.
- --exec SERVICEPFAD Der Pfad zum Service-Programm.
- --home PFADNACHAHAUSE Der Pfad zum Heimverzeichnis.
-EOH
- :manager_package_exists => "Das Paket %1$s existiert bereits.",
- :manager_service_installed => "Service %1$s installiert.",
- :manager_one_moment => "Moment, %1$s ...",
- :manager_service_started => "Service %1$s gestartet.",
- :manager_service_stopped => "Service %1$s gestoppt.",
- :manager_service_deleted => "Service %1$s gelöscht.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Verwendung: %1$s [Optionen]",
- :runner_general_options => "Allgemeine Optionen:",
- :runner_saveconfig_desc => [ "Sichert die Konfiguration nach FILENAME",
- "und beendet. Falls FILENAME nicht",
- "gegben ist, wird die Standardkonfig-",
- "urationsdatei verwendet. Alle Optionen",
- "werden von der bestehenen Konfiguration",
- "und der Kommandozeile und gesichert.",
- "Das Servlet wird nicht gestartet.",
- "Der Standardname ist:" ],
- :runner_config_desc => [ "Standardkonfiguration von FILENAME",
- "statt der Standardkonfigurationsdatei",
- "lesen. Optionen die bislang gesetzt",
- "wurden werden zu den Werten, die in der",
- "Konfigurationsdatei stehen,",
- " zurückgesetzt." ],
- :runner_webrick_options => "WEBrick-Optionen:",
- :runner_port_desc => [ "Lässt das Ruwiki-Servlet auf dem gegebenen",
- "Port laufen. Standard: 8808." ],
- :runner_address_desc => [ "Schränkt das Ruwiki-Servlet so ein, dass",
- "es nur die (Komma-separierten) Adressen",
- "akzepiert. Kann mehrfach angegeben werden",
- "Standardmäßig wird nicht eingeschränkt." ],
- :runner_local_desc => [ "Lässt das Ruwiki-Servlet nur lokale",
- "Verbindungen akzeptieren (127.0.0.1).",
- "Hebt vorige -A Adressen auf." ],
- :runner_mountpoint_desc => [ "Die relative URI unter der Ruwiki",
- 'zugreifbar wird. Standard: "/".' ],
- :runner_log_desc => [ "Protokolliere WEBrick. Standard ist --log." ],
- :runner_logfile_desc => [ "Die Datei, in die das WEBrick-Protokoll",
- "geschrieben wird. Standard: Standard-",
- "fehlerausgabe." ],
- :runner_threads_desc => [ "Setzt den WEBrick-Threadcount." ],
- :runner_ruwiki_options => "Ruwiki-Optionen:",
- :runner_language_desc => [ 'Wählt die Oberflächensprache für Ruwiki.',
- 'Standard: "en". Kann "en", "de", oder',
- '"es" sein.' ],
- :runner_webmaster_desc => [ 'Die Ruwiki-Wwebmaster Email-Adresse.',
- 'Standard: "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Aktiviert Ruwuki-Debugging. Standard:',
- '--no-debug.' ],
- :runner_title_desc => [ 'Gibt den Ruwiki-Titel an. Standard ist',
- '"Ruwiki".' ],
- :runner_defaultpage_desc => [ 'Eine andere Standardseite. Standard ist',
- '"ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'Eine andere Standardprojektseite.',
- 'Standard ist "Default".' ],
- :runner_templatepath_desc => [ 'Ort, an dem Ruwiki-Schablonen sind.',
- 'Standard ist "./templates".' ],
- :runner_templatename_desc => [ 'Name der Ruwiki-Schablonen. Default',
- 'Standard ist "default".' ],
- :runner_cssname_desc => [ 'Name der CSS-Datei im Schablonenpfad',
- 'Standard ist "ruwiki.css".' ],
- :runner_storage_desc => [ 'Wähle den Speichertyp:' ],
- :runner_datapath_desc => [ 'Ort, an dem Datendateien gespeichert sind.',
- 'Standard ist "./data".' ],
- :runner_extension_desc => [ 'Dateierweiterung für Datendateien.',
- 'Standard ist "ruwiki".' ],
- :runner_central_desc => [ 'Lässt Ruwiki mit den Daten des Standard-',
- 'RubyGem-Orts laufen .' ],
- :runner_general_info => "Allgemeine Information:",
- :runner_help_desc => [ "Zeigt diesen Text an." ],
- :runner_version_desc => [ "Zeigt die Ruwuki-Version." ],
- :runner_rejected_address => "Adresse %1$s abgewiesen. Nur Verbindungen von %2$s werden akzeptiert.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-WEBrick-Optionen:
- Port %2$d
- Erlaubte Adressen %3$s
- Mount Point %4$s
- Protokollieren? %5$s
- Protokollpfad %6$s
- Threads %7$s
-
-Ruwiki-Options:
- Webmaster %8$s
- Debugging? %9$s
- Titel %10$s
- Standardprojekt %11$s
- Standardseite %12$s
- Schablonenpfad %13$s
- Schablone %14$s
- CSS-Datei %15$s
-
- Speichertyp %16$s
- Datenpfad %17$s
- Dateierweiterung %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/lang/en.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/lang/en.rb
deleted file mode 100644
index de0771a..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/lang/en.rb
+++ /dev/null
@@ -1,334 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::EN is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module EN
- Message = Hash.new { |hh, kk| hh[kk] = "Language ERROR: Unknown message key #{kk.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Backend %1$s is unknown.",
- :cannot_create_project => "Cannot create project %1$s: %2$s",
- :cannot_destroy_project => "Cannot destroy project %1$s: %2$s",
- :cannot_destroy_topic => "Cannot destroy %1$s::%2$s: %3$s",
- :cannot_obtain_lock => "Unable to obtain a lock on %1$s::%2$s. Try again shortly.",
- :cannot_release_lock => "Unable to release the lock on %1$s::%2$s. Try again shortly.",
- :cannot_retrieve_topic => "Cannot retrieve %1$s::%2$s: %3$s",
- :cannot_store_topic => "Cannot store %1$s::%2$s: %3$s",
- :cannot_list_topics => "Cannot list topics for project %1$s: %2$s",
- :error_creating_lock => "Error creating lock on %1$s::%2$s: %3$s",
- :error_releasing_lock => "Error releasing lock on %1$s::%2$s: %3$s",
- :flatfiles_no_data_directory => "The data directory (%1$s) does not exist.",
- :no_access_list_projects => "No permission to list projects.",
- :no_access_list_topics => "No permission to list topics in project %1$s.",
- :no_access_to_create_project => "No permission to create project %1$s.",
- :no_access_to_destroy_project => "No permission to destroy project %1$s::%2$s.",
- :no_access_to_destroy_topic => "No permission to destroy topic %1$s::%2$s.",
- :no_access_to_read_topic => "No permission to retrieve the %1$s::%2$s.",
- :no_access_to_store_topic => "No permission to store the %1$s::%2$s.",
- :page_not_in_backend_format => "%1$s::%2$s is not in the format supported by the backend %3$s.",
- :project_already_exists => "Project %1$s already exists.",
- :project_does_not_exist => "Project %1$s does not exist.",
- :search_project_fail => "Failure searching project %1$s with string %2$s.",
- :yaml_requires_182_or_higher => "YAML flatfile support exists only for Ruby version 1.8.2 or higher.",
- :not_editing_current_version => <<EOM ,
-You have submitted an old version of %1$s::%2$s. The differences between
-your version and the current version of this page have been merged.
-Conflicting lines have both lines shown. Please ensure that you have edited
-the entire page before saving again.
-EOM
- :no_empty_search_string => <<EOM ,
-The search field may not be empty. Please enter something in the search box
-before pressing the search button.
-EOM
- :page_is_locked => "The page is locked for editing. Please wait a few minutes and try again.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Configuration must be of class Ruwiki::Config.",
- :invalid_template_dir => "The specified path for templates (%1$s) does not exist or is not a directory.",
- :no_template_found => "No template of %1$s found in template set %2$s.",
- :no_template_set => "There is no template set '%1$s' in the template path.",
- :no_webmaster_defined => "Configuration error: Webmaster is unset.",
- # Miscellaneous messages.
- :complete_utter_failure => "Complete and Utter Failure",
- :editing => "Editing",
- :error => "Error",
- :invalid_path_info_value => "Something has gone seriously wrong with the web environment. PATH_INFO = %1$s",
- :render_arguments => "Ruwiki#render must be called with zero or two arguments.",
- :unknown_feature => "Unknown feature %1$s.",
- :topics_for_project => "Topics for Project ::%1$s",
- :project_topics_link => "(topics)",
- :wiki_projects => "Projects in %1$s",
- :no_projects => "No known projects.",
- :no_topics => "No topics in project %1$s.",
- :search_results_for => "= Search results for: %1$s",
- :number_of_hits => "%1$d Hits",
-
- # Labels
- :label_search_project => "Search Project",
- :label_search_all => "All",
- :label_search => "Search: ",
- :label_project => "Project: ",
- :label_topic => "Topic: ",
- :label_edit => "Edit",
- :label_recent_changes => "Recent Changes",
- :label_topics => "Topics",
- :label_projects => "Projects",
- :label_editing => "Editing",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Edit Comment: ",
- :label_comment_accelerator => "O",
- :label_save => "Save",
- :label_save_accelerator => "S",
- :label_cancel => "Cancel",
- :label_cancel_accelerator => "C",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Original Text",
- :label_raw => "Raw",
- :label_formatted => "Formatted",
- :label_send_report_by => "Send the Wiki maintainer a report by email.",
- :label_send_report => "Send report.",
- :label_saved_page => "Saved page: ",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Usage: %1$s [options] <directory>+",
- :converter_format_desc => [ "Converts encountered files (regardless",
- "of the current format), to the specified",
- "format. Default is flatfiles. Allowed",
- "formats are: yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Create backups of upgraded files.",
- "Default is --backup." ],
- :converter_backupext_desc => [ 'Specify the backup extension. Default',
- 'is "~", which is appended to the data',
- 'filename.' ],
- :converter_backupext_error => "The backup extension must not be empty.",
- :converter_extension_desc => [ "Specifies the extension of Ruwiki data",
- "files. The default is .ruwiki" ],
- :converter_extension_error => "The extension must not be empty.",
- :converter_noextension_desc => [ "Indicates that the Ruwiki data files",
- "have no extension." ],
- :converter_quiet_desc => [ "Runs quietly. Default is to run with",
- "normal messages." ],
- :converter_language_desc => [ "Sets the language to LANG. Defaults",
- "to en (English). Known languages",
- "are: en es de" ],
- :converter_verbose_desc => [ "Runs with full message. Default is to",
- "run with normal messages." ],
- :converter_help_desc => [ "Shows this text." ],
- :converter_num_arguments => "Error: not enough arguments.",
- :converter_directory => "directory",
- :converter_converting_from => "converting from %1$s to %2$s ... ",
- :converter_done => "done.",
- :converter_not_ruwiki => "not a Ruwiki file; skipping.",
- :converter_nosave_modified => "cannot save modified %1$s.",
- :converter_page_format_error => "Error: Cannot detect the page format.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Unknown command: %1$s",
- :manager_help_commands => <<EOH ,
-The commands known to 'ruwiki' are:
-
- ruwiki install Installs the default deployment package.
- ruwiki package Packages a Ruwiki installation.
- ruwiki unpackage Unpackages a Ruwiki installation.
- ruwiki service Manages a Win32::Service for Ruwiki.
-
-EOH
- :manager_help_help => <<-EOH ,
-This is a basic help message containing pointers to more information on how
-to use this command-line tool. Try:
-
- ruwiki help commands list all 'ruwiki' commands
- ruwiki help <COMMAND> show help on <COMMAND>
- (e.g., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Missing parameter for option: %1$s",
- :manager_dest_not_directory => "The destination (%1$s) is not a directory.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPTIONS] [--to DEST]
-
-Creates a new Ruwiki instance. By default this installs the data, templates,
-and a default configuration file to the current directory. The destination
-can be changed with the --to option, and what is installed can be specified
-with the OPTIONS list. The OPTIONS list may be space, comma, or semi-colon
-separated. Thus,
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-are all equivalent. The options may be specified in any case. The
-installation OPTIONS are:
-
- servlet # Installs the Ruwiki servlet stub
- service # Installs the Ruwiki Win32::Service stub
- CGI # Installs the Ruwiki CGI script
- data # Installs the Ruwiki data, templates, and configuration
-
-Options may be disabled with by prepending a dash or 'no':
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-These will install the CGI script but not the data.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [SOURCE] [--output PACKAGE] [--replace]
- ruwiki package [SOURCE] [-o PACKAGE] [--replace]
-
-Packages the Ruwiki files (data, templates, and executables) from the
-specified SOURCE or the current directory into the specified output package
-(or "./%1$s"). If the SOURCE is a ruwiki configuration file (e.g.,
-"%2$s"), then that will be used to determine the location and name of
-the data and template directories.
-
- NOTE: The packaging process will normalize the data and templates
- directory names to be relative to the unpacking directory. They
- will NEVER be absolute paths.
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [SOURCE] [--output DIRECTORY]
- ruwiki unpackage [SOURCE] [-o DIRECTORY]
-
-Unpackages the provided Ruwiki package (default "./%1$s") into the
-specified directory (default ".").
-EOH
- :manager_service_broken => "Cannot manage a Win32 service if Win32::Service is not installed.",
- :manager_service_lo_argcount => "Insufficient arguments: %1$s",
- :manager_service_hi_argcount => "Too many arguments: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NAME [DESCRIPTION] [options]
- ruwiki service start NAME
- ruwiki service stop NAME
- ruwiki service delete NAME
-
-Manages the Ruwiki WEBrick servlet as a Windows service. The service must be
-NAMEd. install supports the following additional options:
-
- --rubybin RUBYPATH The path to the Ruby binary.
- --exec SERVICEPATH The path to the service executable.
- --home PATHTOHOME The path to the home directory.
-EOH
- :manager_package_exists => "Package %1$s already exists.",
- :manager_service_installed => "%1$s service installed.",
- :manager_one_moment => "One moment, %1$s ...",
- :manager_service_started => "%1$s service started.",
- :manager_service_stopped => "%1$s service stopped.",
- :manager_service_deleted => "%1$s service deleted.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Usage: %1$s [options]",
- :runner_general_options => "General options:",
- :runner_saveconfig_desc => [ "Saves the configuration to FILENAME and",
- "exit. If FILENAME is not used, then the",
- "default configuration file will be",
- "used. All options will be read from the",
- "existing configuration file and the",
- "command-line and saved. The servlet",
- "will not start. The default name is:" ],
- :runner_config_desc => [ "Read the default configuration from",
- "FILENAME instead of the default config",
- "file. Options set until this point will",
- "be reset to the values from those read",
- "configuration file." ],
- :runner_webrick_options => "WEBrick options:",
- :runner_port_desc => [ "Runs the Ruwiki servlet on the specified",
- "port. Default 8808." ],
- :runner_address_desc => [ "Restricts the Ruwiki servlet to accepting",
- "connections from the specified address or",
- "(comma-separated) addresses. May be",
- "specified multiple times. Defaults to all",
- "addresses." ],
- :runner_local_desc => [ "Restricts the Ruwiki servlet to accepting",
- "only local connections (127.0.0.1).",
- "Overrides any previous -A addresses." ],
- :runner_mountpoint_desc => [ "The relative URI from which Ruwiki will",
- 'be accessible. Defaults to "/".' ],
- :runner_log_desc => [ "Log WEBrick activity. Default is --log." ],
- :runner_logfile_desc => [ "The file to which WEBrick logs are",
- "written. Default is standard error." ],
- :runner_threads_desc => [ "Sets the WEBrick threadcount." ],
- :runner_ruwiki_options => "Ruwiki options:",
- :runner_language_desc => [ 'The interface language for Ruwiki.',
- 'Defaults to "en". May be "en", "de", or',
- '"es".' ],
- :runner_webmaster_desc => [ 'The Ruwiki webmaster email address.',
- 'Defaults to "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Turns on Ruwiki debugging. Defaults',
- 'to --no-debug.' ],
- :runner_title_desc => [ 'Provides the Ruwiki title. Default is',
- '"Ruwiki".' ],
- :runner_defaultpage_desc => [ 'An alternate default page. Default is',
- '"ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'An alternate default project. Default is',
- '"Default".' ],
- :runner_templatepath_desc => [ 'The location of Ruwiki templates. Default',
- 'is "./templates".' ],
- :runner_templatename_desc => [ 'The name of the Ruwiki templates. Default',
- 'is "default".' ],
- :runner_cssname_desc => [ 'The name of the CSS file in the template',
- 'path. Default is "ruwiki.css".' ],
- :runner_storage_desc => [ 'Select the storage type:' ],
- :runner_datapath_desc => [ 'The path where data files are stored.',
- 'Default is "./data".' ],
- :runner_extension_desc => [ 'The extension for data files.',
- 'Default is "ruwiki".' ],
- :runner_central_desc => [ 'Runs Ruwiki with the data in the default',
- 'RubyGem location.' ],
- :runner_general_info => "General info:",
- :runner_help_desc => [ "Shows this text." ],
- :runner_version_desc => [ "Shows the version of Ruwiki." ],
- :runner_rejected_address => "Rejected peer address %1$s. Connections are only accepted from %2$s.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-WEBrick options:
- Port %2$d
- Accepted Addresses %3$s
- Mount Point %4$s
- Logging? %5$s
- Log Destination %6$s
- Threads %7$s
-
-Ruwiki options:
- Webmaster %8$s
- Debugging? %9$s
- Title %10$s
- Default Project %11$s
- Default Page %12$s
- Template Path %13$s
- Template Set %14$s
- CSS Source %15$s
-
- Storage Type %16$s
- Data Path %17$s
- Extension %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/lang/es.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/lang/es.rb
deleted file mode 100644
index 4a9ee2a..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/lang/es.rb
+++ /dev/null
@@ -1,339 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Mauricio Julio Fernández Pradier (batsman.geo@yahoo.com)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::ES is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module ES
- Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Identificador de mensaje desconocido: #{kk.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Backend %1$s desconocido.",
- :cannot_create_project => "No pudo crearse el proyecto %1$s: %2$s",
- :cannot_destroy_project => "No pudo borrarse el proyecto %1$s: %2$s",
- :cannot_destroy_topic => "No pudo borrarse %1$s::%2$s: %3$s",
- :cannot_obtain_lock => "No pudo obtenerse el cerrojo para %1$s::%2$s. Reinténtelo de nuevo en breve.",
- :cannot_release_lock => "No pudo liberarse el cerrojo para %1$s::%2$s. Reinténtelo de nuevo en breve.",
- :cannot_retrieve_topic => "No pudo obtenerse %1$s::%2$s: %3$s",
- :cannot_store_topic => "No pudo almacenarse %1$s::%2$s: %3$s",
- :cannot_list_topics => "No se pudo listar los temas del proyecto %1$s: %2$s",
- :error_creating_lock => "Error al crear el cerrojo para %1$s::%2$s: %3$s",
- :error_releasing_lock => "Error al liberar el cerrojo para %1s::%2$s: %3$s",
- :flatfiles_no_data_directory => "El directorio de datos (%1$s) no existe.",
- :no_access_list_projects => "Permiso denegado al listar los proyectos.",
- :no_access_list_topics => "Permiso denegado al listar los temas del proyecto %1$s.",
- :no_access_to_create_project => "Permiso denegado al crear el proyecto %1$s.",
- :no_access_to_destroy_project => "Permiso denegado al borrar el proyecto %1$s::%2$s.",
- :no_access_to_destroy_topic => "Permiso denegado al borrar el borrar el tema %1$s::%2$s.",
- :no_access_to_read_topic => "Permiso denegado al acceder a %1$s::%2$s.",
- :no_access_to_store_topic => "Permiso denegado al almacenar %1$s::%2$s.",
- :page_not_in_backend_format => "%1$s::%2$s no está en un formato soportado por el backend %3$s.",
- :project_already_exists => "El proyecto %1$s ya existe.",
- :project_does_not_exist => "El proyecto %1$s no existe.",
- :search_project_fail => "Error al buscar la cadena %2$s en el proyecto %1$s.",
- :yaml_requires_182_or_higher => "El soporte para archivos YAML sólo está disponible en Ruby versión 1.8.2 o superior.",
- :not_editing_current_version => <<EOM ,
-Ha enviado una versión antigua de %1$s::%2$s. Las diferencias entre su versión
-y la actual han sido fusionadas. En caso de conflicto, las líneas de ambas
-versiones serán mostradas. Asegúrese de editar la página en su totalidad
-antes de salvar de nuevo.
-EOM
- :no_empty_search_string => <<EOM ,
-El campo de búsqueda no puede estar vacío. Por favor introduzca el texto
-a buscar antes de pulsar sobre el botón de búsqueda.
-EOM
- :page_is_locked => "La pagina no puede ser editada al estar bloqueada en este momento. Por favor espere unos minutos y vuelva a intentar.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "La configuración debe ser de clase Ruwiki::Config.",
- :invalid_template_dir => "El path para plantillas (%1$s) no existe o no es un directorio.",
- :no_template_found => "No pudo encontrarse la plantilla para %1$s en el conjunto %2$s.",
- :no_template_set => "No pudo encontrarse el conjunto de plantillas '%1$s' en el path.",
- :no_webmaster_defined => "Error de configuración: Webmaster no está definido.",
- # Miscellaneous messages.
- :complete_utter_failure => "Error catastrófico",
- :editing => "Edición",
- :error => "Error",
- :invalid_path_info_value => "Algo huele a podrido en su entorno Web. PATH_INFO = %1$s",
- :render_arguments => "Ruwiki#render debe ser llamado con cero o dos argumentos.",
- :unknown_feature => "Característica desconocida: %1$s.",
- :topics_for_project => "Temas del Proyecto ::%1$s",
- :project_topics_link => "(temas)",
- :wiki_projects => "Proyectos en %1$s",
- :no_projects => "Ningún proyecto.",
- :no_topics => "El proyecto %1$s no tiene nigún tema.",
- :search_results_for => "= Resultados de la búsqueda de: %1$s",
- :number_of_hits => "%1$d Resultados",
-
- # Labels
- :label_search_project => "Buscar en projecto",
- :label_search_all => "Todo",
- :label_search => "Buscar: ",
- :label_project => "Proyecto: ",
- :label_topic => "Tema: ",
- :label_edit => "Editar",
- :label_recent_changes => "Cambios recientes",
- :label_topics => "Temas",
- :label_projects => "Proyectos",
- :label_editing => "Edición",
- :label_text => "Texto:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Editar Comentario: ",
- :label_comment_accelerator => "O",
- :label_save => "Salvar",
- :label_save_accelerator => "S",
- :label_cancel => "Cancelar",
- :label_cancel_accelerator => "C",
- :label_preview => "Previsualizar",
- :label_preview_accelerator => "P",
- :label_original_text => "Text Original",
- :label_raw => "Crudo",
- :label_formatted => "Formateado",
- :label_send_report_by => "Enviar notificación al administrador del Wiki por email.",
- :label_send_report => "Enviar notificación.",
- :label_saved_page => "Página salvada: ",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Modo de empleo: %1$s [opciones] <dir.>",
- :converter_format_desc => [ "Convertir los ficheros encontrados",
- "(independientemente de su formato), al",
- "formato especificado; por defecto ",
- "archivos planos. Formatos permitidos:",
- " yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Crear copias de seguridad de ficheros ",
- "actualizados. La opción por defecto es ",
- "--backup." ],
- :converter_backupext_desc => [ 'Especificar la extensión para las copias',
- 'de seguridad (por defecto "~") que se',
- 'añade al nombre del fichero de datos' ],
- :converter_backupext_error => [ "La extensión para copias de seguridad",
- "no debe estar vacía." ],
- :converter_extension_desc => [ "Especifica la extensión de los ficheros",
- "de datos de Ruwiki (por defecto .ruwiki)" ],
- :converter_extension_error => "La extensión no debe estar vacía.",
- :converter_noextension_desc => [ "Indica que los ficheros de datos de",
- "Ruwiki no tienen ninguna extensión." ],
- :converter_quiet_desc => [ "Ejecución silenciosa. Por defecto se ",
- "ejecuta con mensajes normales." ],
- :converter_language_desc => [ "Especifica el idioma a emplear con LANG.",
- "Por defecto 'en' (inglés).",
- "Idiomas disponibles: en es de" ],
- :converter_verbose_desc => [ "Información detallada de ejecución.",
- "Por defecto se ejecuta con un nivel de ",
- "detalle inferior." ],
- :converter_help_desc => [ "Mostrar este texto." ],
- :converter_num_arguments => "Error: número de argumentos insuficiente.",
- :converter_directory => "directorio",
- :converter_converting_from => "convertiendo de %1$s a %2$s ... ",
- :converter_done => "hecho.",
- :converter_not_ruwiki => "no es un fichero de Ruwiki; ignorando.",
- :converter_nosave_modified => "no pudo salvarse %1$s.",
- :converter_page_format_error => "Error: No pudo detectarse el formato de la página.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Comando desconocido: %1$s",
- :manager_help_commands => <<EOH ,
-Los comandos reconocidos por 'ruwiki' son:
-
- ruwiki install Instala el entorno por defecto.
- ruwiki package Empaqueta una instalación de Ruwiki.
- ruwiki unpackage Desempaqueta una instalación de Ruwiki.
- ruwiki service Gestiona un Win32::Service para Ruwiki.
-
-EOH
- :manager_help_help => <<-EOH ,
-Este es un mensaje de ayuda básico con referencias a información suplementaria
-relativa a esta herramienta de la línea de comandos. Intente:
-
- ruwiki help commands mostrar todos los comandos de ruwiki
- ruwiki help <COMANDO> mostrar ayuda sobre <COMANDO>
- (p.ej., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Falta parámetro para la opción: %1$s",
- :manager_dest_not_directory => "El destino (%1$s) no es un directorio.",
- :manager_service_broken => "No pudo crearse un servicio de Win32 al no estar instalado Win32::Service.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPCIONES] [--to DEST]
-
-Crea una instancia de Ruwiki. Por defecto, se instala los ficheros de datos,
-plantillas y la configuración por defecto en el directorio actual. El destino
-puede ser cambiado con la opción --to, y los elementos a instalar con la lista
-de OPCIONES, que puede ser delimitada por espacios, comas o puntos y comas.
-Así pues,
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-son equivalentes. Las opciones pueden especificarse en mayúsculas/minúsculas.
-Las opciones de instalación son:
-
- servlet # Instala el stub para el servlet Ruwiki
- service # Instala el stub para el Win32::Service Ruwiki
- CGI # Instala el script CGI Ruwiki
- data # Instala los datos, plantillas y configuración de Ruwiki
-
-Las opciones pueden deshabilitarse precediéndolas de un guión o 'no':
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-instalarán el script CGI pero no los datos.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [FUENTE] [--output PAQUETE] [--replace]
- ruwiki package [FUENTE] [-o PAQUETE] [--replace]
-
-Empaqueta los ficheros de Ruwiki (datos, plantillas y ejecutables) de la
-FUENTE especificada o el directorio actual en el archivo de salida
-especificado (o "../%1$s"). Si la FUENTE es un fichero de configuración
-de rukiwi (p.ej. "%2$s"), será empleado para determinar la localización
-y el nombre de los directorios de datos y plantillas.
-
- NOTA: El proceso de empaquetado normaliza los nombres de los
- ficheros de datos y plantillas para que sean relativos al
- directorio de desempaquetado. NUNCA serán paths absolutos.
-
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [FUENTE] [--output DIRECTORIO]
- ruwiki unpackage [FUENTE] [-o DIRECTORIO]
-
-Desempaqueta el paquete de Ruwiki provisto (por defecto "./%1$s")
-en el directorio indicado (por defecto ".").
-EOH
- :manager_service_lo_argcount => "Argumentos insuficientes: %1$s",
- :manager_service_hi_argcount => "Demasiados argumentos: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NOMBRE [DESCRIPCION] [opciones]
- ruwiki service start NOMBRE
- ruwiki service stop NOMBRE
- ruwiki service delete NOMBRE
-
-Gestiona el servlet Ruwiki para WEBrick como un servicio de Windows, bajo el
-NOMBRE indicado. install soporta además las opciones siguientes:
-
- --rubybin RUBYPATH Path del ejecutable Ruby.
- --exec SERVICEPATH Path del ejecutable del servicio.
- --home PATHTOHOME Path del directorio home.
-EOH
- :manager_package_exists => "El paquete %1$s ya existe.",
- :manager_service_installed => "Servicio %1$s instalado.",
- :manager_one_moment => "Un momento, %1$s ...",
- :manager_service_started => "Servicio %1$s iniciado.",
- :manager_service_stopped => "Servicio %1$s parado.",
- :manager_service_deleted => "Servicio %1$s borrado.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Modo de empleo: %1$s [opciones]",
- :runner_general_options => "Opciones generales:",
- :runner_saveconfig_desc => [ "Salvar la configuración en FILENAME y",
- "salir. Si no se emplea FILENAME, la",
- "configuración por defecto será usada.",
- "Todas las opciones serán leídas del",
- "fichero existente y de la línea de",
- "comandos y salvadas. El servlet no se",
- "arrancará. El nombre por defecto es:" ],
- :runner_config_desc => [ "Leer la configuración por defecto de",
- "FILENAME en vez del fichero por defecto",
- "Las opciones especificadas anteriormente",
- "serán sobrescritas" ],
- :runner_webrick_options => "Opciones de WEBrick:",
- :runner_port_desc => [ "Ejecutar el servlet Ruwiki en el puerto",
- "especificado; por defecto 8808." ],
- :runner_address_desc => [ "Aceptar únicamente conexiones desde las",
- "direcciones especificadas (separadas por",
- "comas). Puede usarse repetidamente. Por",
- "defecto todas las direcciones serán",
- "aceptadas" ],
- :runner_local_desc => [ "Aceptar únicamente conexiones locales",
- "(127.0.0.1). Anula las direcciones",
- "indicadas previamente en -A" ],
- :runner_mountpoint_desc => [ "URI relativo en el que Ruwiki estará",
- 'accesible. Por defecto "/".' ],
- :runner_log_desc => [ "Realizar log de la actividad de WEBrick.",
- "Por defecto se usa --log." ],
- :runner_logfile_desc => [ "Fichero en el que escribir los logs de",
- "WEBrick. Por defecto, el standard error." ],
- :runner_threads_desc => [ "Asigna al threadcount de WEBrick." ],
- :runner_ruwiki_options => "Opciones de Ruwiki:",
- :runner_language_desc => [ 'Idioma de la inferfaz de Ruwiki.',
- 'Por defecto "en". Puede ser "en", ',
- '"de", o "es".' ],
- :runner_webmaster_desc => [ 'Email del webmaster de Ruwiki.',
- 'Por defecto "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Activa debugging de Ruwiki. Por defecto',
- 'inhabilitado.' ],
- :runner_title_desc => 'Título del Ruwiki. Por defecto "Ruwiki".',
- :runner_defaultpage_desc => [ 'Página por defecto alternativa; por',
- 'defecto "ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'Proyecto por defecto. Por defecto',
- '"Default".' ],
- :runner_templatepath_desc => [ 'Localización de las plantillas.',
- 'Por defecto "./templates".' ],
- :runner_templatename_desc => [ 'Nombre de las plantillas. Por defecto',
- '"default".' ],
- :runner_cssname_desc => [ 'Nombre del fichero CSS en el directorio',
- 'de plantillas. Por defecto "ruwiki.css".' ],
- :runner_storage_desc => [ 'Tipo de almacenamiento:' ],
- :runner_datapath_desc => [ 'Path donde salvar los ficheros de datos.',
- 'Por defecto; "./data".' ],
- :runner_extension_desc => [ 'Extensión para ficheros de datos.',
- 'Por defecto "ruwiki".' ],
- :runner_central_desc => [ 'Ejecuta Ruwiki con los datos del',
- 'directorio RubyGem.' ],
- :runner_general_info => "Información general:",
- :runner_help_desc => [ "Muestra este texto." ],
- :runner_version_desc => [ "Muestra la versión de Ruwiki." ],
- :runner_rejected_address => "Dirección remota %1$s rechazada. Sólo se admiten conexiones desde %2$s.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-Opciones de WEBrick:
- Puerto %2$d
- Direcciones admitidas %3$s
- Punto de montaje %4$s
- Logging? %5$s
- Destino del log %6$s
- Hebras %7$s
-
-Opciones de Ruwiki:
- Webmaster %8$s
- Debugging? %9$s
- Título %10$s
- Proyecto por defecto %11$s
- Página por defecto %12$s
- Path para plantillas %13$s
- Conjunto de plantillas %14$s
- Fuente CSS %15$s
-
- Tipo de almacenamiento %16$s
- Path de datos %17$s
- Extensión %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/page.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/page.rb
deleted file mode 100644
index e94521f..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/page.rb
+++ /dev/null
@@ -1,262 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # The page class for Ruwiki. The page defines the data and meta-data for a
- # page.
-class Ruwiki::Page
- include Ruwiki::Exportable
-
- exportable_group 'ruwiki'
- # Returns the content version of the page. If the page has a greater
- # content version than this version of Ruwiki does, we should probably
- # throw an exception, because attempting to save such a page will cause
- # a loss of data. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +content-version+
- attr_reader :content_version
- exportable :content_version
- # Returns the version of Ruwiki from which this page was generated.
- # Informational only. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +version+
- attr_reader :ruwiki_version
- exportable :ruwiki_version, :name => 'version'
-
- exportable_group 'properties'
- # Returns or sets the displayed title of the page, which may differ from
- # the topic of the page. As of Ruwiki 0.8.0, this is not currently used
- # and it may disappear.
- #
- # Class:: +properties+
- # ID:: +title+
- attr_accessor :title
- exportable :title
- # Returns or sets the topic of the page, which may differ from the
- # title. This is used to set the topic on a page being saved.
- #
- # Class:: +properties+
- # ID:: +topic+
- attr_accessor :topic
- exportable :topic
- # Returns or sets the project of the page, which may differ from the
- # title. This is used to set the project on a page being saved.
- #
- # Class:: +properties+
- # ID:: +project+
- attr_accessor :project
- exportable :project
- # Returns or sets the creator of the page. Unless we know the user
- # (through the authentication mechanism, only partially implemented for
- # Ruwiki 0.9.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +creator+
- attr_accessor :creator
- exportable :creator
- # Returns or sets the creator's IP address. This should always be set.
- # It will have a value of "UNKNOWN" on the off-chance that something
- # prevents this from working.
- #
- # Class:: +properties+
- # ID:: +creator-ip+
- attr_accessor :creator_ip
- exportable :creator_ip
- # Returns or sets the date of creation.
- #
- # Class:: +properties+
- # ID:: +create-date+
- attr_accessor :create_date
- exportable :create_date
- # Returns or sets the last editor of the page. Unless we know the user
- # (through the authentication mechanism, only partially implemented for
- # Ruwiki 0.9.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +editor+
- attr_accessor :editor
- exportable :editor
- # Returns or sets the last editor's IP address. This should always be
- # set. It will have a value of "UNKNOWN" on the off-chance that
- # something prevents this from working.
- #
- # Class:: +properties+
- # ID:: +editor-ip+
- attr_accessor :editor_ip
- exportable :editor_ip
- # Returns or sets the date of the last edit.
- #
- # Class:: +properties+
- # ID:: +edit-date+
- attr_accessor :edit_date
- exportable :edit_date
- # Indicates whether the page is editable. Non-editable pages are
- # effectively static pages.
- #
- # Class:: +properties+
- # ID:: +editable+
- attr_accessor :editable
- exportable :editable
- # Indicates whether the page is indexable. Non-indexable pages are
- # invisible to compliant web robots, and their links may not be
- # followed.
- #
- # Class:: +properties+
- # ID:: +indexable+
- attr_accessor :indexable
- exportable :indexable
- # The current version of the page. The old version is always (#version
- # - 1).
- #
- # Class:: +properties+
- # ID:: +version+
- attr_accessor :version
- exportable :version
- # An array of complete tags that will appear in the HTML <HEAD> section.
- # Can be used to specify additional CSS, <META> tags, or even JavaScript
- # on a per-page basis. Currently unused.
- #
- # Class:: +properties+
- # ID:: +html-headers+
- attr_accessor :html_headers
- exportable :html_headers
- # The entropy of the page. This is a ratio of the number of lines
- # changed in the file vs. the total number of lines in the file. This
- # value is currently unused. (And, sad to say, I don't remember why
- # I included it. However, it's an interesting value that may be useful
- # in spam fighting techniques. It is currently stored in the meta-data,
- # but that may change moving forward.)
- #
- # Class:: +properties+
- # ID:: +entropy+
- attr_reader :entropy
- exportable :entropy
- # The edit comment for the current revision of the page.
- #
- # Class:: +properties+
- # ID:: +edit-comment+
- attr_accessor :edit_comment
- exportable :edit_comment
-
- exportable_group 'page'
- # The header content of the page. This is static content (in either Wiki
- # or HTML formats) that appears before the editable contents of the
- # page. If both this and Wiki-level header content are specified, this
- # will appear *after* the Wiki-level header content.
- #
- # Class:: +page+
- # ID:: +header+
- attr_accessor :header
- exportable :header
- # The footer content of the page. This is static content (in either Wiki
- # or HTML formats) that appears before the editable contents of the
- # page. If both this and Wiki-level footer content are specified, this
- # will appear *before* the Wiki-level footer content.
- #
- # Class:: +page+
- # ID:: +footer+
- attr_accessor :footer
- exportable :footer
- # The editable unformatted Wiki content of the page.
- #
- # Class:: +page+
- # ID:: +content+
- attr_accessor :content
- exportable :content
-
- # Creates a Ruwiki page. This must be created from the canonical export
- # hash.
- def initialize(exported = {})
- ruwiki = exported['ruwiki']
- @content_version = (ruwiki['content-version'] || Ruwiki::CONTENT_VERSION).to_i
- @ruwiki_version = ruwiki['version'] || Ruwiki::VERSION
-
- props = exported['properties']
- @title = props['title']
- @topic = props['topic'] || "NewTopic"
- @project = props['project'] || "Default"
- @creator = props['creator'] || ""
- @creator_ip = props['creator-ip'] || "UNKNOWN"
- @create_date = Time.at((props['create-date'] || Time.now.utc).to_i)
- @editor = props['editor'] || ""
- @editor_ip = props['editor-ip'] || "UNKNOWN"
- @edit_date = Time.at((props['edit-date'] || Time.now.utc).to_i)
- @edit_comment = props['edit-comment'] || ""
- case props['editable']
- when "false"
- @editable = false
- else
- @editable = true
- end
- case props['indexable']
- when "false"
- @indexable = false
- else
- @indexable = true
- end
- @entropy = (props['entropy'] || 0).to_f
- @html_headers = props['html-headers'] || []
- @version = (props['version'] || 0).to_i
-
- page = exported['page']
- @header = page['header'] || ""
- @content = page['content'] || ""
- @footer = page['footer'] || ""
-
- # Fix the possibility that the content might be an array of chunks.
- @content = @content.join("") if @content.kind_of?(Array)
-
- @content.gsub!(/\r/, "")
- end
-
- # Outputs the HTML version of the page.
- def to_html(markup)
- # Normalise the content, first
- @content.gsub!(/\r/, "")
- markup.parse(@content, @project)
- end
-
- # Provides the canonical export hash.
- def export
- sym = super
-
- sym.each_key do |sect|
- if sect == 'ruwiki'
- sym[sect]['content-version'] = Ruwiki::CONTENT_VERSION
- sym[sect]['version'] = Ruwiki::VERSION
- else
- sym[sect].each_key do |item|
- case [sect, item]
- when ['properties', 'create-date'], ['properties', 'edit-date']
- sym[sect][item] = sym[sect][item].to_i
- when ['properties', 'editable'], ['properties', 'indexable']
- sym[sect][item] = (sym[sect][item] ? 'true' : 'false')
- else
- sym[sect][item] = sym[sect][item].to_s
- end
- end
- end
- end
-
- sym
- end
-
- NULL_PAGE = {
- 'ruwiki' => {
- 'content-version' => Ruwiki::CONTENT_VERSION,
- 'version' => Ruwiki::VERSION
- },
- 'properties' => { },
- 'page' => { },
- }
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/servlet.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/servlet.rb
deleted file mode 100644
index 373482e..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/servlet.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'webrick'
-
-class Ruwiki::Servlet < WEBrick::HTTPServlet::AbstractServlet
- class << self
- attr_accessor :config
- end
-
- def initialize(config)
- @config = config
- end
-
- # Converts a POST into a GET.
- def do_POST(req, res)
- do_GET(req, res)
- end
-
- def do_GET(req, res)
- # Generate the reponse handlers for Ruwiki from the request and response
- # objects provided.
- wiki = Ruwiki.new(Ruwiki::Handler.from_webrick(req, res))
-
- # Configuration defaults to certain values. This overrides the defaults.
- wiki.config = Ruwiki::Servlet.config unless Ruwiki::Servlet.config.nil?
- wiki.config!
- wiki.config.logger = @config.logger
- wiki.run
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/template.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/template.rb
deleted file mode 100644
index af26151..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/template.rb
+++ /dev/null
@@ -1,553 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file is originally from rdoc by Dave Thomas (dave@pragprog.com).
-#
-# $Id$
-#++
-require 'cgi'
-
- # Ruwiki templating, based originally on RDoc's "cheap-n-cheerful" HTML
- # page template system, which is a line-oriented, text-based templating
- # system.
- #
- # Templates can contain:
- #
- # * The directive !INCLUDE!, which will include the next template from the
- # provided list. This is processed before any template substitution, so
- # repeating and optional blocks work on the values within the template
- # substitution.
- # * Substitutable variable values between percent signs (<tt>%key%</tt>).
- # Optional variable values can be preceded by a question mark
- # (<tt>%?key%</tt>).
- # * Label values between hash marks (<tt>#key#</tt>). Optional label
- # values can be preceded by a question mark (<tt>#?key#</tt>).
- # * Links (<tt>HREF:ref:name:</tt>).
- # * Repeating substitution values (<tt>[:key| stuff :]</tt>). The value of
- # +key+ may be an integer value or a range (in which case key will be
- # used as an iterator, providing the current value of key on successive
- # values), an array of scalar values (substituting each value), or an
- # array of hashes (in which case it works like repeating blocks, see
- # below). These must NOT be nested. Note that integer value counting is
- # one-based.
- # * Optional substitution values (<tt>[?key| stuff ?]</tt> or <tt>[!key|
- # stuff ?]</tt>. These must NOT be nested.
- # * Repeating blocks:
- # START:key
- # ... stuff
- # END:key
- # * Optional blocks:
- # IF:key
- # ... stuff
- # ENDIF:key
- # or:
- # IFNOT:key
- # ... stuff
- # ENDIF:key
- #
- # When generating the output, a hash of values is provided and an optional
- # hash of labels is provided. Simple variables are resolved directly from
- # the hash; labels are resolved as Symbols from the label hash or are
- # otherwise treated as variables. Labels are always resolved from a single
- # message hash.
- #
- # The +key+ for repeating blocks (one-line or multi-line) must be an array
- # of hashes. The repeating block will be generated once for each entry.
- # Blocks can be nested arbitrarily deeply.
- #
- # Optional blocks will only be generated if the test is true. IF blocks
- # test for the presence of +key+ or that +key+ is non-+nil+; IFNOT blocks
- # look for the absence or +nil+ value of +key+. IFBLANK blocks test for
- # the absence, +nil+ value, or emptiness of +key+; IFNOTBLANK blocks test
- # for the presence of +key+ and that it is neither +nil+ nor empty.
- #
- # Usage: Given a set of templates <tt>T1</tt>, <tt>T2</tt>, etc.
- #
- # values = { "name" => "Dave", "state" => "TX" }
- # fr = { :name => "Nom", :state => "Etat" }
- # en = { :name => "Name", :state => "State" }
- # tt = TemplatePage.new(T1, T2, T3)
- #
- # res = ""
- # tt.process(res, values, fr)
- # tt.process(res, values, en)
- #
-class Ruwiki::TemplatePage
- BLOCK_RE = %r{^\s*(IF|IFNOT|IFBLANK|IFNOTBLANK|ENDIF|START|END):(\w+)?}
- HREF_RE = %r{HREF:(\w+?):(\w+?):}
- LABEL_RE = %r{#(\??)(-?)(\w+?)#}
- VARIABLE_RE = %r{%(\??)(-?)(\w+?)%}
- IFLINE_RE = %r{\[([?!])(\w+?)\|(.*?)\?\]}
- BLOCKLINE_RE = %r{\[:(\w+?)\|(.*?):\]}
- INCLUDE_RE = %r{!INCLUDE!}
-
- DDLB_RES = [
- [ :check, %r{%check:(\w+?)%} ],
- [ :date, %r{%date:(\w+?)%} ],
- [ :popup, %r{%popup:(\w+?):(\w+?)%} ],
- [ :ddlb, %r{%ddlb:(\w+?):(\w+?)%} ],
- [ :vsortddlb, %r{%vsortddlb:(\w+?):(\w+?)%} ],
- [ :radio, %r{%radio:(\w+?):(\w+?)%} ],
- [ :radioone, %r{%radioone:(\w+?):(\w+?)%} ],
- [ :input, %r{%input:(\w+?):(\d+?):(\d+?)%} ],
- [ :text, %r{%text:(\w+?):(\d+?):(\d+?)%} ],
- [ :pwinput, %r{%pwinput:(\w+?):(\d+?):(\d+?)%} ],
- [ :pair, %r{%pair(\d)?:([^:]+)(\w+?)%} ]
- ]
-
- # Nasty hack to allow folks to insert tags if they really, really want to
- OPEN_TAG = "\001"
- CLOSE_TAG = "\002"
- BR = "#{OPEN_TAG}br#{CLOSE_TAG}"
-
- # A Context holds a stack of key/value pairs (like a symbol table). When
- # asked to resolve a key, it first searches the top of the stack, then the
- # next level, and so on until it finds a match (or runs out of entries).
- class Context
- def initialize
- @stack = []
- end
-
- def push(hash)
- @stack.push(hash)
- end
-
- def pop
- @stack.pop
- end
-
- # Find a scalar value, throwing an exception if not found. This method is
- # used when substituting the %xxx% constructs
- def find_scalar_raw(key)
- @stack.reverse_each do |level|
- if level.has_key?(key)
- val = level[key]
- return val unless val.kind_of?(Array)
- end
- end
- raise "Template error: can't find variable '#{key}'."
- end
-
- def find_scalar(key)
- find_scalar_raw(key) || ''
- end
-
- # Lookup any key in the stack of hashes
- def lookup(key)
- @stack.reverse_each do |level|
- return level[key] if level.has_key?(key)
- end
- nil
- end
- end
-
- # Simple class to read lines out of a string
- class LineReader
- attr_reader :lines
- def initialize(lines)
- @lines = lines
- end
-
- # read the next line
- def read
- @lines.shift
- end
-
- # Return a list of lines up to the line that matches a pattern. That last
- # line is discarded.
- def read_up_to(pattern)
- res = []
- while line = read
- if pattern.match(line)
- return LineReader.new(res)
- else
- res << line
- end
- end
- raise "Missing end tag in template: #{pattern.source}"
- end
-
- # Return a copy of ourselves that can be modified without affecting us
- def dup
- LineReader.new(@lines.dup)
- end
- end
-
- # +templates+ is an array of strings containing the templates. We start at
- # the first, and substitute in subsequent ones where the string
- # <tt>!INCLUDE!</tt> occurs. For example, we could have the overall page
- # template containing
- #
- # <html><body>
- # <h1>Master</h1>
- # !INCLUDE!
- # </body></html>
- #
- # and substitute subpages in to it by passing [master, sub_page]. This
- # gives us a cheap way of framing pages
- def initialize(*templates)
- result = templates.shift.dup
- templates.each { |content| result.sub!(INCLUDE_RE, content) }
- @lines = LineReader.new(result.split(/\r?\n/))
- end
-
- attr_reader :lines
-
- def set_options(opts = {})
- @message = opts[:messages] || {}
- @output = opts[:output] || $stdout
- end
-
- # Render templates as HTML. Compatibility method for Rublog and
- # Rdoc.
- def write_html_on(op, value_hash, message_hash = {})
- to_html(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as HTML
- def to_html(value_hash, options = {})
- set_options(options)
- esc = proc { |str| CGI.escapeHTML(str) }
- @output << process(value_hash, esc)
- end
-
- # Render templates as TeX. Compatibility method for Rublog and
- # Rdoc.
- def write_tex_on(op, value_hash, message_hash = {})
- to_tex(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as TeX
- def to_tex(value_hash, options = {})
- set_options(options)
-
- esc = proc do |str|
- str.
- gsub(/&lt;/, '<').
- gsub(/&gt;/, '>').
- gsub(/&amp;/) { '\\&' }.
- gsub(/([$&%\#{}_])/) { "\\#$1" }.
- gsub(/>/, '$>$').
- gsub(/</, '$<$')
- end
- str = ""
-
- str << process(value_hash, esc)
- @output << str
- end
-
- # Render templates as plain text. Compatibility method for Rublog and
- # Rdoc.
- def write_plain_on(op, value_hash, message_hash = {})
- to_plain(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as plain text.
- def to_plain(value_hash, options = {})
- set_options(options)
- esc = proc {|str| str}
- @output << process(value_hash, esc)
- end
-
- # Render the templates. The The <tt>value_hash</tt> contains key/value
- # pairs used to drive the substitution (as described above). The
- # +escaper+ is a proc which will be used to sanitise the contents of the
- # template.
- def process(value_hash, escaper)
- @context = Context.new
- sub(@lines.dup, value_hash, escaper).
- tr("\000", '\\').
- tr(OPEN_TAG, '<').
- tr(CLOSE_TAG, '>')
- end
-
- # Substitute a set of key/value pairs into the given template. Keys with
- # scalar values have them substituted directly into the page. Those with
- # array values invoke <tt>substitute_array</tt> (below), which examples a
- # block of the template once for each row in the array.
- #
- # This routine also copes with the <tt>IF:</tt>_key_ directive, removing
- # chunks of the template if the corresponding key does not appear in the
- # hash, and the START: directive, which loops its contents for each value
- # in an array
- def sub(lines, values, escaper)
- @context.push(values)
- skip_to = nil
- result = []
-
- while line = lines.read
- mv = line.match(BLOCK_RE)
-
- if mv.nil?
- result << expand(line.dup, escaper)
- next
- else
- cmd = mv.captures[0]
- tag = mv.captures[1]
- end
-
- case cmd
- when "IF", "IFNOT", "IFNOTBLANK", "IFBLANK"
- raise "#{cmd}: must have a key to test." if tag.nil?
-
- val = @context.lookup(tag)
- case cmd # Skip lines if the value is...
- when "IF" # false or +nil+ (not false => true)
- test = (not val)
- when "IFBLANK" # +nil+ or empty
- test = (not (val.nil? or val.empty?))
- when "IFNOT"
- test = val
- when "IFNOTBLANK" #
- test = (val.nil? or val.empty?)
- end
- lines.read_up_to(/^\s*ENDIF:#{tag}/) if test
- when "ENDIF"
- nil
- when "START"
- raise "#{cmd}: must have a key." if tag.nil?
-
- body = lines.read_up_to(/^\s*END:#{tag}/)
- inner = @context.lookup(tag)
- raise "unknown tag: #{tag}" unless inner
- raise "not array: #{tag}" unless inner.kind_of?(Array)
- inner.each { |vals| result << sub(body.dup, vals, escaper) }
- result << "" # Append the missing \n
- else
- result << expand(line.dup, escaper)
- end
- end
-
- @context.pop
-
- result.join("\n")
- end
-
- # Given an individual line, we look for %xxx%, %?xxx%, #xxx#, #?xxx#,
- # [:key| xxx :], [?key| stuff ?], [!key| stuff ?] and HREF:ref:name:
- # constructs, substituting as appropriate.
- def expand(line, escaper)
- # Generate a cross-reference if a reference is given. Otherwise, just
- # fill in the name part.
- line = line.gsub(HREF_RE) do
- ref = @context.lookup($1)
- name = @context.find_scalar($2)
-
- if ref and not ref.kind_of?(Array)
- %Q(<a href="#{ref}">#{name}</a>)
- else
- name
- end
- end
-
- # Look for optional content.
- line = line.gsub(IFLINE_RE) do
- type = $1
- name = $2
- stuff = $3
-
- case type
- when '?'
- test = @context.lookup(name)
- when '!'
- test = (not @context.lookup(name))
- end
-
- if test
- stuff
- else
- ""
- end
- end
-
- # Look for repeating content.
- line = line.gsub(BLOCKLINE_RE) do |match|
- name = $1
- stuff = $2
-
- val = @context.lookup(name)
- ss = ""
- case val
- when nil
- nil
- when Fixnum
- val.times { |ii| ss << stuff.sub(/%#{name}%/, "#{ii + 1}") }
- when Range
- val.each { |ii| ss << stuff.sub(/%#{name}%/, "#{ii}") }
- when Array
- if not val.empty? and val[0].kind_of?(Hash)
- val.each do |vv|
- @context.push(vv)
- ss << expand(stuff, escaper)
- @context.pop
- end
- else
- val.each { |ee| ss << stuff.sub(/%#{name}%/, "#{ee}") }
- end
- end
- ss
- end
-
- # Substitute in values for #xxx# constructs.
- line = line.gsub(LABEL_RE) do
- mandatory = $1.nil?
- escaped = $2.nil?
- key = $3.intern
- val = @message[key]
-
- if val.nil?
- raise "Template error: can't find label '#{key}'." if mandatory
- ""
- else
- val = val.to_s
- val = escaper.call(val) if escaped
- val.tr('\\', "\000")
- end
- end
-
- # Substitute in values for %xxx% constructs. This is made complex
- # because the replacement string may contain characters that are
- # meaningful to the regexp (like \1)
- line = line.gsub(VARIABLE_RE) do
- mandatory = $1.nil?
- escaped = $2.nil?
- key = $3
- val = @context.lookup(key)
-
- if val.nil?
- raise "Template error: can't find variable '#{key}'." if mandatory
- ""
- else
- val = val.to_s
- val = escaper.call(val) if escaped
- val.tr('\\', "\000")
- end
- end
-
- # Substitute DDLB controls:
- DDLB_RES.each do |ddlb|
- line = line.gsub(ddlb[1]) do
- self.send(ddlb[0], Regexp.last_match.captures)
- end
- end
-
- line
- rescue Exception => ex
- raise "Error in template: #{ex}\nOriginal line: #{line}\n#{ex.backtrace[0]}"
- end
-
- def check(*args)
- value = @context.find_scalar_raw(args[0])
- checked = value ? " checked" : ""
- "<input type=\"checkbox\" name=\"#{name}\"#{checked}>"
- end
-
- def vsortddlb(*args)
- ddlb(*(args.dup << true))
- end
-
- def ddlb(*args)
- value = @context.find_scalar(args[0]).to_s
- options = @context.lookup(args[1])
- sort_on = args[2] || 0
-
- unless options and options.kind_of?(Hash)
- raise "Missing options #{args[1]} for ddlb #{args[0]}."
- end
-
- res = %Q(<select name="#{args[0]}">)
-
- sorted = options.to_a.sort do |aa, bb|
- if aa[0] == -1
- -1
- elsif bb[0] == -1
- 1
- else
- aa[sort_on] <=> bb[sort_on]
- end
- end
-
- sorted.each do |key, val|
- selected = (key.to_s == value) ? " selected" : ""
- res << %Q(<option value="#{key}"#{selected}>#{val}</option>)
- end
- res << "</select>"
- end
-
- def date(*args)
- yy = "#{argv[0]}_y"
- mm = "#{argv[0]}_m"
- dd = "#{argv[0]}_d"
- %Q<#{input(yy, 4, 4)}&nbsp;.&nbsp;#{input(mm, 2, 2)}&nbsp;.&nbsp;#{input(dd, 2, 2)}>
- end
-
- def radioone(*args)
- radio(*(args.dup << ""))
- end
-
- def radio(*args)
- value = @context.find_scalar(argv[0]).to_s
- options = @context.lookup(argv[1])
- br = argv[2] || "<br />"
-
- unless options and options.kind_of?(Hash)
- raise "Missing options #{args[1]} for radio #{args[0]}."
- end
-
- res = ""
- options.keys.sort.each do |key|
- val = options[key]
- checked = (key.to_s == value) ? " checked" : ""
- res << %Q(<label>
- <input type="radio" name="#{args[0]}"
- value="#{key}"#{checked}">#{val}</label>#{br})
- end
- res
- end
-
- def text(*args)
- value = @context.find_scalar(args[0]).to_s
- %Q(<textarea name="#{args[0]}" cols="#{args[1]}" rows="#{args[2]}">
-#{CGI.escapeHTML(value)}
-</textarea>)
- end
-
- def pwinput(*args)
- input(*(args.dup << "password"))
- end
-
- def input(*args)
- name = args[0]
- value = @context.find_scalar(name).to_s
- width = args[1]
- max = args[2]
- iptype = args[3] || "text"
- %Q(<input type="#{iptype}" name="#{name}" value="#{value}" size="#{width}" maxsize="#{max}">)
- end
-
- def popup(*args)
- url = CGI.escapeHTML(@context.find_scalar(args[0]).to_s)
- text = @context.find_scalar(args[1]).to_s
- %Q|<a href="#{url}" target="Popup" class="methodtitle" onClick="popup('#{url}'); return false;">#{text}</a>|
- end
-
- def pair(*args)
- label = args[0]
- name = args[1]
- colsp = args[2]
-
- value = @context.find_scalar(name).to_s
- value = case value
- when "true" then "Yes"
- when "false" then "No"
- else value
- end
- td = (colsp.nil? or colsp.empty?) ? "<td>" : %Q{<td colspan="#{colsp}">}
- "#{Html.tag(label)}#{td}#{value}</td>"
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/utils.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/utils.rb
deleted file mode 100644
index c58a9f4..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/utils.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # So that Ruwiki doesn't have to be loaded in full to use the bloody thing.
-unless defined?(Ruwiki)
- class Ruwiki
- VERSION = "0.9.0"
- end
-end
-
-module Ruwiki::Utils
- RUN_PATH = Dir.pwd
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/utils/command.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/utils/command.rb
deleted file mode 100644
index ba7c060..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/utils/command.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # Implements the command pattern. Commands are used by the command-line
-class Ruwiki::Utils::CommandPattern
- class AbstractCommandError < Exception; end
- class UnknownCommandError < RuntimeError; end
- class CommandAlreadyExists < RuntimeError; end
- class MissingParameterError < ArgumentError
- def initialize(argument)
- @argument = argument
- end
-
- attr_reader :argument
- end
-
- class << self
- def add(command)
- command = command.new if command.kind_of?(Class)
-
- @commands ||= {}
- if @commands.has_key?(command.name)
- raise CommandAlreadyExists
- else
- @commands[command.name] = command
- end
-
- if command.respond_to?(:altname)
- unless @commands.has_key?(command.altname)
- @commands[command.altname] = command
- end
- end
- end
-
- def <<(command)
- add(command)
- end
-
- attr_accessor :default
- def default=(command) #:nodoc:
- if command.kind_of?(Ruwiki::Utils::CommandPattern)
- @default = command
- elsif command.kind_of?(Class)
- @default = command.new
- elsif @commands.has_key?(command)
- @default = @commands[command]
- else
- raise UnknownCommandError
- end
- end
-
- def command?(command)
- @commands.has_key?(command)
- end
-
- def command(command)
- if command?(command)
- @commands[command]
- else
- @default
- end
- end
-
- def [](cmd)
- self.command(cmd)
- end
-
- def default_ioe(ioe = {})
- ioe[:input] ||= $stdin
- ioe[:output] ||= $stdout
- ioe[:error] ||= $stderr
- ioe
- end
- end
-
- def [](args, opts = {}, ioe = {})
- call(args, opts, ioe)
- end
-
- def name
- raise AbstractCommandError
- end
-
- def call(args, opts = {}, ioe = {})
- raise AbstractCommandError
- end
-
- def help
- raise AbstractCommandError
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/utils/converter.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/utils/converter.rb
deleted file mode 100644
index 0261af8..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/utils/converter.rb
+++ /dev/null
@@ -1,297 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-
-module Ruwiki::Utils::Converter
- class << self
- TARGETS = %w(flatfiles yaml marshal)
-
- # Create the regular expressions that are used in Ruwiki 0.6.2
- OLD_HEADER_RE = /^\s*([a-z]+)\s*:\s*(.*)$/
- OLD_HEADER_END_RE = /^#EHDR$/
- DATA_HEADER_END_RE = /\A#EHDR\z/
- NL_RE = /\n/
-
- def with(obj)
- yield obj if block_given?
- end
-
- # Only allow this to be run once. Silently fail otherwise.
- def set_defaults
- return unless @options.nil?
- @options = OpenStruct.new
-
- with @options do |oo|
- oo.traverse_directories = true
- oo.backup_old_files = true
- oo.backup_extension = "~"
- oo.quiet = false
- oo.verbose = false
- oo.extension = 'ruwiki'
- oo.target_format = 'flatfiles'
- end
- end
-
- def message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def message(id)
- if @message[id].nil?
- []
- else
- @message[id]
- end
- end
-
- def display_options
- end
-
- def summary
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- set_defaults
-
- @input = input
- @output = output
- @error = error
-
- language = 'en'
- find_lang = argv.grep(%r{^--lang})
- find_lang.each do |ee|
- if ee =~ %r{^--lang=}
- language = ee.sub(%r{^--lang=}, '')
- else
- language = argv[argv.index(ee).succ]
- end
- end
-
- require "ruwiki/lang/#{language.downcase}"
- self.message = Ruwiki::Lang.const_get(language.upcase)
-
- argv.options do |opts|
- opts.banner = message(:converter_usage) % File.basename($0)
- opts.separator ''
- opts.on('--format=FORMAT', *message(:converter_format_desc)) do |ff|
- @options.target_format = ff
- end
- opts.on('--[no-]backup', *message(:converter_backup_desc)) do |bb|
- @options.backup_old_files = bb
- end
- opts.on('--backup-extension=EXTENSION', *message(:converter_backupext_desc)) do |ee|
- if ee.nil? or ee.empty?
- @error << message(:converter_backupext_error) << "\n" if ee.nil? or ee.empty?
- @error << "#{opts}\n"
- return 0
- end
- @options.backup_extension = ee
- end
- opts.on('--extension=EXTENSION', *message(:converter_extension_desc)) do |ee|
- if ee.nil? or ee.empty?
- @error << message(:converter_extension_error) << "\n" if ee.nil? or ee.empty?
- @error << "#{opts}\n"
- return 0
- end
- @options.extension = ee
- end
- opts.on('--no-extension', *message(:converter_noextension_desc)) do
- @options.extension = nil
- end
- opts.on('--lang=LANG', *message(:converter_language_desc)) do |lang|
- self.message = Ruwiki::Lang.const_get(lang.upcase)
- end
- opts.on('--quiet', *message(:converter_quiet_desc)) do |qq|
- @options.quiet = qq
- @options.verbose = (not qq)
- end
- opts.on('--verbose', *message(:converter_verbose_desc)) do |vv|
- @options.quiet = (not vv)
- @options.verbose = vv
- end
- opts.separator ''
- opts.on_tail('--help', *message(:converter_help_desc)) do
- @error << "#{opts}\n"
- return 0
- end
-
- opts.parse!
- end
-
- if argv.empty?
- @error << message(:converter_num_arguments) << "\n#{argv.options}\n" unless @options.quiet
- return 127
- end
-
- display_options if @options.verbose
-
- @options.target_format.capitalize!
- @options.target_format_class = Ruwiki::Backend.const_get(@options.target_format)
-
- argv.each { |file| process_file(file) }
-
- summary if not @options.quiet
- end
-
- # Process a single file.
- def process_file(file)
- if @options.backup_old_files
- return if file =~ /#{@options.backup_extension}/
- end
- @out << "#{file}: " unless @options.quiet
-
- if File.directory?(file) and @options.traverse_directories
- @out << message(:converter_directory) << "\n" unless @options.quiet
- Dir.chdir(file) { Dir['*'].each { |entry| process_file(entry) } }
- else
- begin
- page, page_format = load_page(file)
- @out << message(:converter_converting_from) % [ page_format, @options.target_format ] if @options.verbose
- save_page(file, page)
- @out << message(:converter_done) << "\n" unless @options.quiet
- rescue PageLoadException
- @out << message(:converter_not_ruwiki) << "\n" unless @options.quiet
- rescue PageSaveException
- @out << message(:cannot_nosave_modified) << "\n" % [ file ] unless @options.quiet
- end
- end
- end
-
- def load_page(file)
- data = File.read(file)
- page_format = nil
-
- if data =~ OLD_HEADER_END_RE
- page_format = 'OldFlatfiles'
-
- page = Ruwiki::Page::NULL_PAGE.dup
-
- unless data.empty?
- rawbuf = data.split(NL_RE).map { |ee| ee.chomp }
-
- loop do
- if rawbuf[0] =~ OLD_HEADER_END_RE
- rawbuf.shift
- break
- end
-
- match = OLD_HEADER_RE.match(rawbuf[0])
-
- unless match.nil?
- case match.captures[0]
- when 'topic'
- page['properties']['topic'] = match.captures[1]
- page['properties']['title'] = match.captures[1]
- when 'version'
- page['properties']['version'] = match.captures[1].to_i
- else
- nil
- end
- end
- rawbuf.shift
- end
-
- page['page']['content'] = rawbuf.join("\n")
-
- with page['properties'] do |pp|
- pp['project'] = File.basename(File.dirname(File.expand_path(file)))
- pp['editable'] = true
- pp['indexable'] = true
- pp['entropy'] = 0.0
- end
- end
- end
-
- # Try Marshal
- if page_format.nil?
- begin
- page = ::Marshal.load(data)
- page_format = 'Marshal'
- rescue Exception
- nil
- end
- end
-
- # Try YAML
- if page_format.nil?
- begin
- page = ::YAML.load(data)
- page_format = 'YAML'
- rescue Exception
- nil
- end
- end
-
- # Try the Flatfiles format
- if page_format.nil?
- begin
- page = Ruwiki::Backend::Flatfiles.load(data)
- page_format = 'Exportable'
- rescue Exception => ex
- nil
- end
- end
-
- if page_format.nil? # Cannot detect page type.
- @error << @message[:converter_page_format_error] << "\n"
- raise PageLoadException
- end
- [page, page_format]
- rescue PageLoadException
- raise
- rescue Exception => ex
- @error << %Q|#{ex.message}\n#{ex.backtrace.join("\n")}\n| if @options.verbose
- raise PageLoadException
- end
-
- def save_page(file, page)
- if @options.backup_extension != '~'
- backup = "#{file}.#{@options.backup_extension}"
- else
- backup = "#{file}#{@options.backup_extension}"
- end
-
- # Always backup the file -- we are transactional.
- FileUtils.cp(file, backup)
-
- if @options.target_format == 'Marshal'
- method = :print
- else
- method = :puts
- end
- File.open(file, 'wb') { |ff| ff.__send__(method, @options.target_format_class.dump(page)) }
- rescue Exception => ex
- FileUtils.mv(backup, file) if File.exists?(backup)
- @error << %Q|#{ex.message}\n#{ex.backtrace.join("\n")}\n| if @options.verbose
- raise PageSaveException
- ensure
- # If we aren't *supposed* to back up the file, then get rid of the
- # backup.
- if File.exists?(backup) and (not @options.backup_old_files)
- FileUtils.rm(backup)
- end
- end
-
- class PageLoadException < RuntimeError; end
- class PageSaveException < RuntimeError; end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/utils/manager.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/utils/manager.rb
deleted file mode 100644
index aaf978d..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/utils/manager.rb
+++ /dev/null
@@ -1,648 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-require 'stringio'
-require 'zlib'
-require 'ruwiki/exportable'
-require 'ruwiki/utils/command'
-require 'ruwiki/config'
-
-begin
- if defined?(Gem::Cache)
- require_gem 'archive-tar-minitar', '~> 0.5.1'
- else
- require 'archive/tar/minitar'
- end
-rescue LoadError => ex
- $stderr.puts ex.message
- raise
-end
-
-module Ruwiki::Utils::Manager
- DEFAULT_PACKAGE_NAME = 'ruwiki.pkg'
-
- def self.message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def self.message(id)
- @message[id]
- end
-
- class ManagerError < RuntimeError; end
-
- EXECUTABLES = %w(ruwiki.cgi ruwiki_servlet ruwiki_servlet.bat \
- ruwiki_servlet.cmd ruwiki_service.rb)
-
- class ManagerHelp < Ruwiki::Utils::CommandPattern
- def name
- "help"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- help_on = args.shift
- output = ""
-
- if Ruwiki::Utils::CommandPattern.command?(help_on)
- ioe[:output] << Ruwiki::Utils::CommandPattern[help_on].help
- elsif help_on == "commands"
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_help_commands)
- else
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_unknown_command) % [ help_on ] << "\n" % [ help_on ] unless help_on.nil? or help_on.empty?
- ioe[:output] << self.help
- end
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_help_help)
- end
- end
-
- class ManagerInstall < Ruwiki::Utils::CommandPattern
- def name
- "install"
- end
-
- def call(args, opts = {}, ioe = {})
- argv = []
-
- replace = false
- dest = "."
- name = nil
-
- while (arg = args.shift)
- case arg
- when '--to'
- dir = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if dir.nil?
- if File.exist?(dir)
- if not File.directory?(dir)
- raise ArgumentError, Ruwiki::Utils::Manager.message(:manager_dest_not_directory)
- end
- else
- FileUtils.mkdir_p(dir)
- end
- dest = dir
- when /;/o
- argv.push(*(arg.split(/;/o)))
- when /,/o
- argv.push(*(arg.split(/,/o)))
- else
- argv << arg
- end
- end
-
- options = { 'data' => true }
-
- while (arg = argv.shift)
- case arg
- when /^(?:-|no)(.*$)/
- options.delete($1)
- else
- options[arg] = true
- end
- end
-
- Ruwiki::Utils::Manager.install(dest, options)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_install_help)
- end
- end
-
- class ManagerPackage < Ruwiki::Utils::CommandPattern
- def name
- "package"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- argv = []
- replace = false
- dest = "."
- name = nil
-
- while (arg = args.shift)
- case arg
- when '--replace'
- replace = true
- when '-o', '--output'
- name = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if name.nil?
- dest = File.dirname(name)
- name = File.basename(name)
- else
- argv << arg
- end
- end
-
- if argv.size > 1
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_hi_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 1
- end
- source = argv.shift || "."
-
- Ruwiki::Utils::Manager.package(source, dest, name, replace)
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_package_help) % [ "./#{Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME}",
- Ruwiki::Config::CONFIG_NAME ]
- end
- end
-
- class ManagerUnpackage < Ruwiki::Utils::CommandPattern
- def name
- "unpackage"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- argv = []
- dir = "."
-
- while (arg = args.shift)
- case arg
- when '-o', '--output'
- dir = args.shift
- raise Ruwiki::Utils::CommandPatter::MissingParameterError.new(arg) if dir.nil? or not File.directory?(dir)
- else
- argv << arg
- end
- end
-
- if argv.size > 1
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_hi_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 1
- end
- source = argv.shift || Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME
-
- Ruwiki::Utils::Manager.unpackage(source, dir)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_unpackage_help) % [ "./#{Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME}" ]
- end
- end
-
- if RUBY_PLATFORM =~ /win32/
- class ManagerService < Ruwiki::Utils::CommandPattern
- def name
- "service"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
-
- if args.size < 2
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_lo_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 0
- end
-
- command = args.shift
- service = args.shift
-
- options ||= {}
- options[:service_name] = service
- options[:service_home] = File.expand_path(".")
-
- argv = []
- while (arg = args.shift)
- case arg
- when "--rubybin"
- options[:ruby_bin] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:ruby_bin].nil?
- when "--exec"
- options[:service_bin] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:service_bin].nil?
- when "--home"
- options[:service_home] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:service_home].nil?
- else
- argv << arg
- end
- end
-
- options[:service_desc] = args.join(" ") if args.size > 0
-
- case command
- when "install"
- options[:service_install] = true
- when "start"
- options[:service_start] = true
- when "stop"
- options[:service_stop] = true
- when "delete"
- options[:service_delete] = true
- else
- raise ArgumentError, Ruwiki::Utils::Manager.message(:manager_unknown_command) % [ command ]
- end
-
- Ruwiki::Utils::Manager.manage_windows_service(options, ioe)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_service_help)
- end
- end
- Ruwiki::Utils::CommandPattern << ManagerService
- end
-
- Ruwiki::Utils::CommandPattern << ManagerHelp
- Ruwiki::Utils::CommandPattern << ManagerInstall
- Ruwiki::Utils::CommandPattern << ManagerPackage
- Ruwiki::Utils::CommandPattern << ManagerUnpackage
- Ruwiki::Utils::CommandPattern.default = Ruwiki::Utils::CommandPattern["help"]
-
- class << self
- attr_accessor :shared
- attr_reader :ruwiki_servlet
- attr_reader :ruwiki_servlet_bat
- attr_reader :ruwiki_servlet_cmd
- attr_reader :ruwiki_service
- attr_reader :ruwiki_cgi
- attr_reader :ruwiki_pkg
- def shared=(shared)
- @shared = shared
- @ruwiki_servlet = File.join(@shared, "bin", "ruwiki_servlet")
- @ruwiki_servlet_bat = File.join(@shared, "bin", "ruwiki_servlet.bat")
- @ruwiki_servlet_cmd = File.join(@shared, "bin", "ruwiki_servlet.cmd")
- @ruwiki_service = File.join(@shared, "bin", "ruwiki_service.rb")
- @ruwiki_cgi = File.join(@shared, "bin", "ruwiki.cgi")
- @ruwiki_pkg = File.join(@shared,
- Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME)
- end
-
- def with(obj)
- yield obj if block_given?
- end
-
- def tar_files(list, name)
- ff = StringIO.new
- gz = Zlib::GzipWriter.new(ff)
- to = Archive::Tar::Minitar::Output.new(gz)
- list.each { |item| Archive::Tar::Minitar.pack_file(item, to) }
- data = ff.string
- group = {
- :name => name,
- :data => data,
- :mode => 0644,
- }
- return group
- rescue Exception => ex
- puts ex.message, ex.backtrace.join("\n")
- ensure
- to.close
- group[:size] = group[:data].size
- end
-
- def package(source, dest, name = nil, replace = false)
- # If the package name is nil, use the default name. If replace is
- # false, then append a number on the end if the file already exists.
- # Increment the number until we have a unique filename.
- if name.nil?
- pkg = File.join(dest, DEFAULT_PACKAGE_NAME)
- if File.exists?(pkg) and (not replace)
- pbn = "#{File.basename(DEFAULT_PACKAGE_NAME, '.pkg')}-%02d.pkg"
- ii = 1
- while File.exists?(pkg)
- pkg = File.join(dest, pbn % ii)
- ii += 1
- end
- end
- else
- pkg = File.join(dest, name)
- if File.exists?(pkg) and (not replace)
- raise ManagerError, Ruwiki::Utils::Manager.message(:manager_package_exists)
- end
- end
-
- files = []
-
- if File.directory?(source)
- Dir.chdir(source) do
- if File.exists?(Ruwiki::Config::CONFIG_NAME)
- cs = File.stat(Ruwiki::Config::CONFIG_NAME)
- files << {
- :name => Ruwiki::Config::CONFIG_NAME,
- :data => File.read(Ruwiki::Config::CONFIG_NAME),
- :mtime => cs.mtime,
- :mode => 0644,
- :size => cs.size
- }
- end
-
- EXECUTABLES.each do |ff|
- if File.exists?(ff)
- cs = File.stat(ff)
- files << {
- :name => ff,
- :data => File.read(ff),
- :mtime => cs.mtime,
- :mode => 0755,
- :size => cs.size
- }
- end
- end
-
- f_data = Dir["data/**/**"].select { |dd| dd !~ /CVS\// }
- f_data.unshift("data")
- f_data.map! do |dd|
- res = { :name => dd, :mode => 0644 }
- if File.directory?(dd)
- res[:mode] = 0755
- res[:dir] = true
- end
- res
- end
-
- f_tmpl = Dir["templates/**/**"].select { |tt| tt !~ /CVS\// }
- f_tmpl.unshift("templates")
- f_tmpl.map! do |tt|
- res = { :name => tt, :mode => 0644 }
- if File.directory?(tt)
- res[:mode] = 0755
- res[:dir] = true
- end
- res
- end
-
- files << tar_files(f_data, "data.pkg")
- files << tar_files(f_tmpl, "tmpl.pkg")
- end
- else
- stat = File.stat(source)
- files << {
- :name => File.basename(source),
- :data => File.read(source),
- :mtime => stat.mtime,
- :mode => 0644,
- :size => stat.size
- }
-
- EXECUTABLES.each do |ff|
- ff = File.join(File.dirname(source), ff)
- if File.exists?(ff)
- cs = File.stat(ff)
- files << {
- :name => ff,
- :data => File.read(ff),
- :mtime => cs.mtime,
- :mode => 0755,
- :size => cs.size
- }
- end
- end
-
- cc = Ruwiki::Exportable.load(files[0][:data])
- tp = cc['ruwiki-config']['template-path']
- tp = "./templates" if tp.nil? or tp.empty?
- so = cc['ruwiki-config']['storage-options']
-
- if so.nil? or so.empty?
- dp = "./data"
- else
- so = Ruwiki::Exportable.load(so)
- key = 'flatfiles'
- dp = so[key]['data-path']
- end
-
- dp = "./data" if dp.nil? or dp.empty?
- bndp = File.basename(dp)
- bntp = File.basename(tp)
-
- so[key]['data-path'] = bndp
- cc['ruwiki-config']['storage-options'] = Ruwiki::Exportable.dump(so)
- cc['ruwiki-config']['template-path'] = bntp
- files[0][:data] = Ruwiki::Exportable.dump(cc)
- files[0][:size] = files[0][:data].size
-
- Dir.chdir(File.dirname(dp)) do
- f_data = Dir["#{bndp}/**/**"].select { |dd| dd !~ /CVS\// }
- f_data.map! { |dd| { :name => dd, :mode => 0644 } }
- files << tar_files(f_data, "data.pkg")
- end
-
- Dir.chdir(File.dirname(tp)) do
- f_tmpl = Dir["#{bntp}/**/**"].select { |tt| tt !~ /CVS\// }
- f_tmpl.map! { |tt| { :name => tt, :mode => 0644 } }
- files << tar_files(f_tmpl, "tmpl.pkg")
- end
- end
-
- ff = File.open(pkg, "wb")
- gz = Zlib::GzipWriter.new(ff)
- tw = Archive::Tar::Minitar::Writer.new(gz)
-
- files.each do |entry|
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
- end
-
- nil
- rescue Exception => ex
- puts ex, ex.backtrace.join("\n")
- ensure
- tw.close if tw
- gz.close if gz
- end
-
- def unpackage(source, dest)
- ff = File.open(source, "rb")
- gz = Zlib::GzipReader.new(ff)
- Archive::Tar::Minitar::Input.open(gz) do |it|
- it.each do |entry|
- case entry.full_name
- when "data.pkg", "tmpl.pkg"
- pkg = StringIO.new(entry.read)
- pkgz = Zlib::GzipReader.new(pkg)
- Archive::Tar::Minitar::Input.open(pkgz) do |inner|
- inner.each { |item| inner.extract_entry(dest, item) }
- end
- else
- it.extract_entry(dest, entry)
- end
- end
- end
-
- nil
- end
-
- def install(dest, options = {})
- if options['servlet']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet, dest, :mode => 0755)
- if RUBY_PLATFORM =~ /win32/
- if File.exists?(Ruwiki::Utils::Manager.ruwiki_servlet_bat)
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet_bat, dest, :mode => 0755)
- end
- if File.exists?(Ruwiki::Utils::Manager.ruwiki_servlet_cmd)
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet_cmd, dest, :mode => 0755)
- end
- end
- end
-
- if RUBY_PLATFORM =~ /win32/ and options['service']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_service, dest, :mode => 0755)
- end
-
- if options['cgi']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_cgi, dest, :mode => 0755)
- end
-
- if options['data']
- unpackage(Ruwiki::Utils::Manager.ruwiki_pkg, dest)
- if options['service']
- cfn = File.join(dest, 'ruwiki.conf')
- cfg = nil
- File.open(cfn, "rb") { |f| cfg = f.read }
- cfg.gsub!(%r{\./data}, File.join(File.expand_path(dest), "data"))
- cfg.gsub!(%r{\./templates}, File.join(File.expand_path(dest), "templates"))
- File.open(cfn, "wb") { |f| f.write(cfg) }
- end
- end
- end
-
- if RUBY_PLATFORM =~ /win32/
- begin
- require 'win32/service'
- require 'rbconfig'
- HasWin32Service = true
- rescue LoadError
- HasWin32Service = false
- end
-
- # The work here is based on Daniel Berger's Instiki Service Tutorial.
- # http://rubyforge.org/docman/view.php/85/107/instiki_service_tutorial.txt
- def manage_windows_service(options, ioe)
- raise Ruwiki::Utils::Manager.message(:manager_service_broken) unless HasWin32Service
-
- service_name = options[:service_name] || 'RuwikiSvc'
-
- if options[:service_install]
- service_home = options[:service_home]
-
- program = options[:service_bin]
- if program.nil? or program.empty?
- program = File.join(service_home, "ruwiki_service.rb")
- elsif program !~ %r{[/\\]}
- program = File.join(service_home, program)
- end
- program = %<"#{program}">
-
- ruby = options[:ruby_bin] || %<"#{File.join(Config::CONFIG['bindir'], 'ruby.exe')}">
-
- service_desc = options[:service_desc] || 'Ruwiki'
-
- binpath = "#{ruby} #{program}".tr('/', '\\')
-
- service = Win32::Service.new
- service.create_service do |svc|
- svc.service_name = service_name
- svc.display_name = service_desc
- svc.binary_path_name = binpath
- svc.dependencies = [] # Required because of a bug in Win32::Service
- end
- service.close
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_installed) % [ service_name ] << "\n"
- end
-
- if options[:service_start]
- Win32::Service.start(service_name)
- started = false
- while (not started)
- status = Win32::Service.status(service_name)
- started = (status.current_state == "running")
- break if started
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_one_moment) % [ status.current_state ] << "\n"
- sleep 1
- end
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_started) % [ service_name ] << "\n"
- end
-
- if options[:service_stop]
- Win32::Service.stop(service_name)
- stopped = false
- while (not stopped)
- status = Win32::Service.status(service_name)
- stopped = (status.current_state == "stopped")
- break if stopped
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_one_moment) % [ status.current_state ] << "\n"
- sleep 1
- end
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_stopped) % [ service_name ] << "\n"
- end
-
- if options[:service_delete]
- Win32::Service.stop(service_name) rescue nil
- Win32::Service.delete(service_name)
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_deleted) % [ service_name ] << "\n"
- end
- end
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- ioe = {
- :input => input,
- :output => output,
- :error => error
- }
-
- language = 'en'
- find_lang = argv.grep(%r{^--lang})
- find_lang.each do |ee|
- eepos = argv.index(ee)
- if ee =~ %r{^--lang=}
- language = ee.sub(%r{^--lang=}, '')
- else
- language = argv[eepos.succ]
- argv.delete_at(eepos.succ)
- end
- argv.delete_at(eepos)
- end
-
- require "ruwiki/lang/#{language.downcase}"
- Ruwiki::Utils::Manager.message = Ruwiki::Lang.const_get(language.upcase)
-
- command = Ruwiki::Utils::CommandPattern[(argv.shift or "").downcase]
- return command[argv, {}, ioe]
- rescue Ruwiki::Utils::CommandPattern::MissingParameterError => ee
- ioe[:error] << Ruwiki::Utils::Manager.message(:manager_missing_parameter) % [ ee.argument ] << "\n"
- return 1
- rescue ArgumentError, ManagerError => ee
- ioe[:error] << ee.message << "\n"
- return 1
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/utils/servletrunner.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/utils/servletrunner.rb
deleted file mode 100644
index 91dc916..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/utils/servletrunner.rb
+++ /dev/null
@@ -1,296 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-require 'webrick'
-
-require 'ruwiki/utils'
-require 'ruwiki/exportable'
-require 'ruwiki/servlet'
-require 'ruwiki/lang/en'
-require 'ruwiki/lang/de'
-require 'ruwiki/lang/es'
-
-require 'optparse'
-require 'ostruct'
-
-module Ruwiki::Utils::ServletRunner
- COPYRIGHT = <<-"COPYRIGHT"
-Ruwiki #{Ruwiki::VERSION}
- Copyright © 2002 - 2004, Digikata and HaloStatue
-
- http://rubyforge.org/projects/ruwiki/
-
- Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-
-Licensed under the same terms as Ruby.
-
-$Id$
-COPYRIGHT
-
- class WEBrickConfig
- include Ruwiki::Exportable
-
- exportable_group 'webrick-config'
- attr_accessor :port
- exportable :port
- attr_accessor :addresses
- exportable :addresses
- attr_accessor :mount
- exportable :mount
- attr_accessor :do_log
- exportable :do_log
- attr_accessor :log_dest
- exportable :log_dest
- attr_accessor :threads
- exportable :threads
-
- def export
- hash = super
- sc = hash['webrick-config']
- sc['addresses'] = sc['addresses'].join(";")
- sc['do-log'] = (sc['do-log'] ? 'true' : 'false')
- hash
- end
-
- # Because the servlet can be started from the command-line, provide
- # defaults for all possible configuration options.
- def initialize(exported = {})
- sc = exported['webrick-config'] || {}
- @port = sc['port'] || 8808
- @mount = sc['mount'] || '/'
- @addresses = sc['addresses']
- @do_log = ((sc['do-log'] == 'false') ? false : true)
- @log_dest = sc['log-dest']
- @threads = sc['threads'] || 1
-
- if @addresses.nil? or @addresses.empty?
- @addresses = []
- else
- @addresses = @addresses.split(/;/)
- end
-
- if @log_dest.nil? or @log_dest.empty?
- @log_dest = "<STDERR>"
- end
- end
- end
-
- def self.message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def self.message(id)
- @message[id]
- end
-
- class << self
- # This is for the WEBrick version of Ruwiki. This has been abstracted to
- # accept a Config global variable to reconfigure Ruwiki after initial
- # creation.
- def read_config(filename)
- ch = {}
- if File.exists?(filename)
- File.open(filename, 'rb') { |ff| ch = Ruwiki::Exportable.load(ff.read) }
- end
-
- @sc = WEBrickConfig.new(ch)
- @rc = Ruwiki::Config.new(ch)
-
- if @rc.webmaster.nil? or @rc.webmaster.empty?
- @rc.webmaster = "webmaster@domain.tld"
- end
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- read_config(Ruwiki::Config::CONFIG_NAME)
-
- save_config = nil
-
- language = 'en'
- find_lang = argv.grep(%r{^--language})
- find_lang.each do |ee|
- if ee =~ %r{^--language=}
- language = ee.sub(%r{^--language=}, '')
- else
- language = argv[argv.index(ee).succ]
- end
- end
-
- require "ruwiki/lang/#{language.downcase}"
- @rc.language = Ruwiki::Lang.const_get(language.upcase)
- self.message = @rc.language
-
- argv.options do |oo|
- oo.banner = self.message(:runner_usage) % [ File.basename($0) ]
- oo.separator self.message(:runner_general_options)
- oo.on('--save-config [FILENAME]', *([ self.message(:runner_saveconfig_desc), Ruwiki::Config::CONFIG_NAME ].flatten)) { |fname|
- save_config = fname || Ruwiki::Config::CONFIG_NAME
- }
- oo.on('--config FILENAME', *self.message(:runner_config_desc)) { |fn|
- read_config(fn)
- }
- oo.separator ""
- oo.separator self.message(:runner_webrick_options)
- oo.on('-P', '--port PORT', Numeric, *self.message(:runner_port_desc)) { |port|
- @sc.port = port
- }
- oo.on('-A', '--accept ADDRESS,ADDRESS,ADDRESS', Array, *self.message(:runner_address_desc)) { |address|
- @sc.addresses += address
- }
- oo.on('-L', '--local', *self.message(:runner_local_desc)) {
- @sc.addresses = ["127.0.0.1"]
- }
- oo.on('-M', '--mount MOUNT-POINT', *self.message(:runner_mountpoint_desc)) { |mp|
- @sc.mount = mp
- }
- oo.on('--[no-]log', *self.message(:runner_log_desc)) { |log|
- @sc.do_log = log
- }
- oo.on('--logfile LOGFILE', *self.message(:runner_logfile_desc)) { |lf|
- @sc.log_dest = lf
- }
- oo.on('-T', '--threads THREADS', Integer, *self.message(:runner_threads_desc)) { |tc|
- @sc.threads = tc
- }
- oo.separator ""
- oo.separator self.message(:runner_ruwiki_options)
- oo.on('--language=LANGUAGE', *self.message(:runner_language_desc)) { |lang|
- nil
- }
- oo.on('--webmaster WEBMASTER', *self.message(:runner_webmaster_desc)) { |wm|
- @rc.webmaster = wm
- }
- oo.on('--[no-]debug', *self.message(:runner_debug_desc)) { |dd|
- @rc.debug = dd
- }
- oo.on('--title TITLE', *self.message(:runner_title_desc)) { |tt|
- @rc.title = tt
- }
- oo.on('--default-page PAGENAME', *self.message(:runner_defaultpage_desc)) { |dp|
- @rc.default_page = dp
- }
- oo.on('--default-project PAGENAME', *self.message(:runner_defaultproject_desc)) { |dp|
- @rc.default_project = dp
- }
- oo.on('--template-path TEMPLATE_PATH', *self.message(:runner_templatepath_desc)) { |tp|
- @rc.template_path = tp
- }
- oo.on('--templates TEMPLATES', *self.message(:runner_templatename_desc)) { |tp|
- @rc.template_set = tp
- }
- oo.on('--css CSS_NAME', *self.message(:runner_cssname_desc)) { |css|
- @rc.css = css
- }
- oo.on('--storage-type TYPE', Ruwiki::KNOWN_BACKENDS, *([self.message(:runner_storage_desc), Ruwiki::KNOWN_BACKENDS.join(", ")].flatten)) { |st|
- @rc.storage_type = st
- @rc.storage_options[@rc.storage_type]['data-path'] ||= "./data/"
- @rc.storage_options[@rc.storage_type]['extension'] ||= "ruwiki"
- }
- oo.on('--data-path PATH', *self.message(:runner_datapath_desc)) { |fdp|
- @rc.storage_options['flatfiles']['data-path'] = fdp
- }
- oo.on('--extension EXT', *self.message(:runner_extension_desc)) { |ext|
- @rc.storage_options['flatfiles']['data-path'] = fdp
- }
- if defined?(Gem::Cache)
- oo.separator ""
- oo.on('--central', *self.message(:runner_central_desc)) {
- gempath = Gem::Cache.from_installed_gems.search("ruwiki", "=#{Ruwiki::VERSION}").last.full_gem_path
- @rc.storage_type = 'flatfiles'
- @rc.storage_options['flatfiles']['data-path'] = "#{gempath}/data"
- @rc.storage_options['flatfiles']['extension'] = "ruwiki"
- @rc.storage_options['flatfiles']['format'] = "exportable"
- @rc.template_path = "#{gempath}/templates"
- @rc.template_set = "sidebar"
- }
- end
-
- # TODO: Add options for time, date, and datetime formats.
- oo.separator ""
- oo.separator self.message(:runner_general_info)
- oo.on_tail('--help', *self.message(:runner_help_desc)) {
- error << oo << "\n"
- return 0
- }
- oo.on_tail('--version', *self.message(:runner_version_desc)) {
- error << COPYRIGHT << "\n"
- return 0
- }
- oo.parse!
- end
-
- if save_config
- sc = @sc.export
- rc = @rc.export
- cf = sc.merge(rc)
-
- File.open(save_config, 'wb') { |ff| ff.puts Ruwiki::Exportable.dump(cf) }
- return 0
- end
-
- # If the list of accepted addresses is not empty, provide IP-based
- # restrictions.
- if not @sc.addresses.empty?
- localonly = lambda do |sock|
- if not @sc.addresses.include?(sock.peeraddr[3])
- raise WEBrick::ServerError, self.message(:runner_rejected_address) % [ sock.peeraddr[3], @sc.addresses.join(", ") ]
- end
- end
- else
- localonly = nil
- end
-
- if @sc.do_log
- if "<STDERR>" == @sc.log_dest
- dest = $stderr
- else
- dest = File.open(@sc.log_dest, "wb+")
- end
- logger = WEBrick::Log.new(dest, WEBrick::Log::DEBUG)
- else
- logger = nil
- end
-
- banner = self.message(:runner_banner) %
- [ Ruwiki::Utils::ServletRunner::COPYRIGHT, @sc.port,
- @sc.addresses.join(", "), @sc.mount, @sc.do_log, @sc.log_dest,
- @sc.threads, @rc.webmaster, @rc.debug, @rc.title,
- @rc.default_project, @rc.default_page, @rc.template_path,
- @rc.template_set, @rc.css, @rc.storage_type,
- @rc.storage_options[@rc.storage_type]['data-path'],
- @rc.storage_options[@rc.storage_type]['extension'] ]
-
- banner.each { |bb| logger.info(bb) } unless logger.nil?
-
- server = WEBrick::HTTPServer.new(:Port => @sc.port.to_i,
- :StartThreads => @sc.threads.to_i,
- :AcceptCallback => localonly,
- :Logger => logger)
- @rc.logger = logger
- Ruwiki::Servlet.config = @rc
-
- server.mount(@sc.mount, Ruwiki::Servlet)
- trap("INT") { server.shutdown; return 0 }
- server.start
- return 0
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki.rb
deleted file mode 100644
index ded37ee..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki.rb
+++ /dev/null
@@ -1,164 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
- # Ruwiki's Wiki markup class. This will convert the Wiki markup known by
- # Ruwiki (defined by Token classes). The algorithm is as follows:
- #
- # 1. For each known Token class, match each instance of it in the content
- # stream. Replace each instance in the content stream with a Token
- # marker: TOKEN_x or \TOKEN_x, where x is a digit representing the Token.
- # (\TOKEN_x is a special case of token matching. See
- # Ruwiki::Markup::Token for more information.) Store the Token for later
- # processing.
- # 2. Go back through the content, replacing each instance of \TOKEN_x with
- # the Token's defined restore value (which should be the same value as was
- # originally matched).
- # 3. Go through the content, replacing each instance of TOKEN_x with the
- # Token's defined replacement value.
- # 4. Go through the tokens, in reverse, and execute the post replacement
- # routine defined by the Token. (This may be necessary to collapse
- # consecutive HTML structures.)
- # 5. Return the parsed content and the collected metadata.
- #
- # == Tokens
- # Look at Ruwiki::Markup::Token describes how to create Token objects.
-class Ruwiki::Wiki
- def parse(content, project)
- content = clean(content)
- tokens = []
- project ||= @default_project
-
- Token.tokenlist.each do |token|
- content.gsub!(token.regexp) do |mm|
- match = Regexp.last_match
- tc = token.new(match, project, @backend, @script, @message, @title)
- tokens << tc
- if mm[0, 1] == '\\'
- "\\TOKEN_#{tokens.size - 1}"
- else
- "TOKEN_#{tokens.size - 1}"
- end
- end
- end
-
- replaced = []
- ss = true
- loop do
- break if replaced.size >= tokens.size
- break if ss.nil?
- ss = content.gsub!(/\\TOKEN_(\d+)/) { |mm|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].restore
- }
-
- ss = content.gsub!(/TOKEN_(\d+)/) { |mm|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].replace
- }
- end
-
- token_classes = tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
-
- content
- end
-
- attr_accessor :default_project
- attr_accessor :script
- attr_accessor :backend
- attr_accessor :message
-
- # Creates the markup class.
- def initialize(default_project, script, title)
- @default_project = default_project
- @script = script
- @title = title
- end
-
- # A regular expression that will prevent redirection.
- class << self
- attr_accessor :no_redirect
-
- def redirect(uri)
- if uri =~ %r{^https?://}
- if self.no_redirect and uri =~ self.no_redirect
- uri
- else
- "http://www.google.com/url?sa=D&amp;q=#{CGI.escape(uri)}"
- end
- else
- uri
- end
- end
- end
-
-private
- # Find HTML tags
- SIMPLE_TAG_RE = %r{<[^<>]+?>} # Ensure that only the tag is grabbed.
- HTML_TAG_RE = %r{\A< # Tag must be at start of match.
- (/)? # Closing tag?
- ([\w:]+) # Tag name
- (?:\s+ # Space
- ([^>]+) # Attributes
- (/)? # Singleton tag?
- )? # The above three are optional
- >}x
- ATTRIBUTES_RE = %r{([\w:]+)(=(?:\w+|"[^"]+?"|'[^']+?'))?}x
- STYLE_NOVD_RE = %r{(?:\s?(visibility|display):[^'";]+;?)}x
- ALLOWED_ATTR = %w(style title type lang dir class id cite datetime abbr) +
- %w(colspan rowspan compact start media)
- ALLOWED_HTML = %w(abbr acronym address b big blockquote br caption cite) +
- %w(code col colgroup dd del dfn dir div dl dt em h1 h2 h3) +
- %w(h4 h5 h6 hr i ins kbd li menu ol p pre q s samp small) +
- %w(span strike strong style sub sup table tbody td tfoot) +
- %w(th thead tr tt u ul var)
-
- # Clean the content of unsupported HTML and attributes. This includes
- # XML namespaced HTML. Sorry, but there's too much possibility for
- # abuse.
- def clean(content)
- content = content.gsub(SIMPLE_TAG_RE) do |tag|
- tagset = HTML_TAG_RE.match(tag)
-
- if tagset.nil?
- tag = Ruwiki.clean_entities(tag)
- else
- closer, name, attributes, single = tagset.captures
-
- if ALLOWED_HTML.include?(name.downcase)
- unless closer or attributes.nil?
- attributes = attributes.scan(ATTRIBUTES_RE).map do |set|
- if ALLOWED_ATTR.include?(set[0].downcase)
- if set[0] == 'style'
- set[1].gsub!(STYLE_NOVD_RE, '')
- end
- set.join
- else
- nil
- end
- end.compact.join(" ")
- tag = "<#{closer}#{name} #{attributes}#{single}>"
- else
- tag = "<#{closer}#{name}>"
- end
- else
- tag = Ruwiki.clean_entities(tag)
- end
- end
- tag.gsub(%r{((?:href|src)=["'])(#{Ruwiki::Wiki::RE_URI_SCHEME})}) { "#{$1}\\#{$2}" }
- end
- end
-end
-
-require 'ruwiki/wiki/tokens'
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens.rb
deleted file mode 100644
index 0ef744d..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
- # The base Token class. All Token classes must inherit from Token and
- # *must* implement the following methods:
- #
- # [self.regexp] The regular expression that the Token will be replacing.
- # [replace] The mechanism for replacing the Token with the desired
- # results.
- #
- # Token classes <i>should</i> implement the following method:
- # [self.rank] Default: <tt>5000</tt>. Affects the sort order.
- # Must return an integer.
- #
- # Token classes <i>may</i> implement the following methods:
- # [restore] Restores the token without replacement. Implements
- # the results of the escape character. NOTE: each
- # Token class is responsible for its own restore.
- # Tokens that are anchored to the beginning of a line
- # are the most likely to need to reimplement this.
- # [self.post_replace] Performs any necessary massaging of the data. See
- # the implementation of Ruwiki::Wiki::Lists for more
- # information.
-class Ruwiki::Wiki::Token
- @tokenlist = []
- @sorted = false
-
- class << self
- # Tokens should define rank if they must be first or last in
- # processing. Otherwise, they are sorted in the order defined.
- def rank
- 5000
- end
-
- # The Wiki parsing routine uses Token.tokenlist to determine the
- # tokens that are processed, and the order in which they are
- # processed. See Token.rank for more information.
- def tokenlist(sort = true)
- if sort and not @sorted
- @tokenlist.sort! { |aa, bb| aa.rank <=> bb.rank }
- @sorted = true
- end
- @tokenlist
- end
-
- def inherited(child_class) #:nodoc:
- # Make the child class post_replace a blank function because we
- # don't want to propogate the currently defined post_replace. The
- # current post_replace is specific to Token_Base only.
- class << child_class
- def self.post_replace(content)
- content
- end
- end
-
- @tokenlist << child_class
- @sorted = false
- end
-
- # The replacement regular expression.
- def regexp
- /TOKEN_(\d*)/o
- end
- end
-
- # All Token classes must match this header signature if they define
- # #initialize.
- #
- # [match] The MatchData object for this Token.
- # [project] The project being processed.
- # [backend] The backend for the wiki. This is used to determine if
- # the page or project exists. The object passed must
- # respond to #project_exists?(project) and
- # #page_exists?(page, project).
- # [script] The URI to the script.
- # [message] The message hash for localized messages.
- # [title] The title of the Wiki.
- def initialize(match, project, backend, script, message, title)
- @match = match
- @project = project
- @backend = backend
- @script = script
- @message = message
- @title = title
- end
-
- # The replacement method. Uses @match to replace the token with the
- # appropriate values.
- def replace
- "TOKEN_#{@match[1]}"
- end
-
- # Restores the token without replacement. By default, replaces
- # "dangerous" HTML characters.
- def restore
- Ruwiki.clean_entities(@match[0])
- end
-
- # The content may need massaging after processing.
- def self.post_replace(content)
- content
- end
-end
-
- # Load the tokens from the ruwiki/wiki/tokens directory.
-tokens_dir = 'ruwiki/wiki/tokens'
-
-$LOAD_PATH.each do |path|
- target = "#{path}/#{tokens_dir}"
- if File.exists?(target) and File.directory?(target)
- Dir::glob("#{target}/*.rb") do |token|
- begin
- require token
- rescue LoadError, TypeError
- nil
- end
- end
- end
- Ruwiki::Wiki::Token.tokenlist.each { |tk| tk.freeze }
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/00default.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/00default.rb
deleted file mode 100644
index 996e376..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/00default.rb
+++ /dev/null
@@ -1,209 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-# $debug = File.open("output.txt", "wb")
-
-class Ruwiki::Wiki
- # The Paragraph Token class changes blank lines to <p> tags. This class,
- # under the current implementation, should be *first* in the Token list
- # after Token.
- class Paragraph < Ruwiki::Wiki::Token
- # This Token is #rank 0, because it should be first in the Token list.
- def self.rank
- 0
- end
-
- # Matches blank lines. %r{^$}
- def self.regexp
- %r{(^$)}
- end
-
- def replace
- %Q(</p><p class="rwtk_Paragraph">)
- end
-
- # Ensures that <p> won't be surrounded by <br> tags.
- def self.post_replace(content)
- content.gsub!(%r{\A}, '<p class="rwtk_Paragraph">')
- content.gsub!(%r{\z}, '</p>')
- content.gsub!(%r{\n(</p>)}, '\1')
- content.gsub!(%r{(<p[^>]*>)\n}, '\1')
- content.gsub!(%r{(</p>)(<p[^>]*>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{<p[^>]*></p>}, '')
- content.gsub!(%r{^\n(<p[^>]*>)}, '\1')
- content
- end
- end
-
- # The Code Token class converts indented text to "unformatted" (<pre>)
- # text. This class should be *second* in the Token list.
- class Code < Ruwiki::Wiki::Token
- # This Token is #rank 1, because it should be second in the Token list.
- def self.rank
- 1
- end
-
- # Matches indented text. %r{^(\s+\S?.*)$}
- def self.regexp
-# %r{^(\s+.*)$}
- %r{^([ \t]+[^\n]*)\n?}
- end
-
- # Replaces the text to <pre>content</pre>.
- def replace
- content = Ruwiki.clean_entities(@match.captures[0])
-
- %Q{</p><pre class="rwtk_Code">#{content}</pre>\n}
- end
-
- # Converts cases of %r{</pre>(\n|<br ?/?>)<pre>} to \1.
- def self.post_replace(content)
- content.gsub!(%r{</pre>((\n)*</p>(\n)*)?<pre[^>]*>}, "\n")
- content.gsub!(%r{</pre>(\n|<br ?/?>)?<pre[^>]*>}, '\1')
- content.gsub!(%r{<p[^>]*>(<pre[^>]*>)}, '\1')
- content.gsub!(%r{</pre></p>}, '</pre>')
-# content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content
- end
- end
-
- RE_URI_SCHEME = %r{[-a-z0-9+.]{3,}?:}
- RE_URI_PATH = %r{[^\s<>\]]}
- RE_URI_TEXT = %r{[^\]]*}
-
- class << self
- def increment_numbered_links
- @numbered_links_count ||= 0
- @numbered_links_count += 1
- end
-
- def reset_numbered_links
- @numbered_links_count = 0
- end
- end
-
- # Converts URLs in the form of [url] to numbered links.
- class NumberedLinks < Ruwiki::Wiki::Token
-
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\]}
- end
-
- def replace
- extlink = @match.captures[0]
-
- name = "[#{Ruwiki::Wiki.increment_numbered_links}]"
-
- %Q{<a class="rwtk_NumberedLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{name}</a>}
- end
- end
-
- class Image < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- RE_IMAGE_OPTIONS=%r{([^=]+)=("[^"]+"|[^ ]+)}
-
- def self.regexp
- %r{\[image\s*:\s*(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)(\s+[^\]]+)?\]}
- end
-
- def replace
- options = { 'src' => %Q("#{@match.captures[0]}") }
- groups = @match.captures[1]
- unless groups.nil?
- groups.scan(RE_IMAGE_OPTIONS).each { |gg| options[gg[0].strip] = gg[1].strip }
- end
-
- unless options['numbered'].nil? or options['numbered'] == "false"
- options['title'] = %Q("[#{Ruwiki::Wiki.increment_numbered_links}]")
- options.delete('numbered')
- end
-
- options['title'] ||= options['alt']
- options['title'] ||= options['src']
- options['alt'] ||= options['title']
-
- ss = ""
- options.keys.sort.map { |kk| ss << %Q( #{kk}=#{options[kk]}) }
-
- %Q{<img class="rwtk_Image"#{ss} />}
- end
- end
-
- # Converts URLs in the form of [url name] to named links.
- class NamedLinks < Ruwiki::Wiki::Token
- def self.rank
- 3
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\s+(#{RE_URI_TEXT})\]}
- end
-
- def replace
- extlink = @match.captures[0]
- name = @match.captures[1]
-
- %Q{<a class="rwtk_NamedLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{name}</a>}
- end
- end
-
- # Converts URLs to links where the "name" of the link is the URL itself.
- class ExternalLinks < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{\b(#{RE_URI_SCHEME}#{RE_URI_PATH}+)}
- end
-
- def restore
- @match[0]
- end
-
- def replace
- extlink = @match.captures[0]
-
- %Q{<a class="rwtk_ExternalLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{extlink}</a>}
- end
- end
-
- # Creates a horizontal rule.
- class HRule < Ruwiki::Wiki::Token
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def replace
- %Q(<hr class="rwtk_HRule" />)
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(<p[^>]*>)*(<hr[^ />]* ?/?>)(</p>)*}, '\1')
- content.gsub!(%r{\n<hr />}, "</p>\n<hr />")
- content.gsub!(%r{<hr ?/?>\n<br ?/?>}, "<hr />")
- content.gsub!(%r{(\n|<br ?/?>)?<hr>(\n|<br ?/?>)?}, "<hr />")
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/01wikilinks.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/01wikilinks.rb
deleted file mode 100644
index 442a201..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/01wikilinks.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # This provides the basic WikiWord match. This supports WikiWord,
- # CPlusPlus, ThisIsALink, and C_Plus_Plus.
- RE_WIKI_WORDS = %r{[[:upper:]][\w_]*(?:[[:lower:]]+[[:upper:]_]|[[:upper:]_]+[[:lower:]])[\w_]*}
- # This provides wikipedia format matches, e.g., [[wikipedia links]]. The
- # only restriction on words in this format is that they must NOT begin
- # with an underscore ('_').
- RE_WIKIPEDIA_WORDS = %r{\[\[([^_].*?)\]\]}
- # This provides the basic Wiki Project match.
- RE_PROJECT_WORD = %r{[[:upper:]][[:lower:]]+}
-
- # This provides the Wiki view link format:
- VIEW_LINK = %Q[<a class="rwtk_WikiLink" href="%s">%s</a>]
- EDIT_LINK = %Q[<span class="rwtk_EditWikiLink">%s</span><a class="rwtk_WikiLink" href="%s">?</a>]
-
- # Creates a crosslink for a Project::WikiPage.
- class ProjectCrossLink < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::(#{RE_WIKI_WORDS})}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic.gsub(/_/, ' ')}"]
- else
- EDIT_LINK % ["#{project}::#{topic.gsub(/_/, ' ')}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a crosslink for a Project::WikiPage using a Wikipedia link
- # format.
- class ProjectCrossLinkWikipedia < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::#{RE_WIKIPEDIA_WORDS}}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic}"]
- else
- EDIT_LINK % ["#{project}::#{topic}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to the project index from ::Project.
- class ProjectIndex < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{(\B|\\)::(#{RE_PROJECT_WORD})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- project = @match.captures[1]
-
- if @backend.page_exists?('ProjectIndex', project)
- VIEW_LINK % ["#{@script}/#{project}/ProjectIndex", project]
- else
- if @backend.project_exists?(project)
- EDIT_LINK % [project, "#{@script}/#{project}/ProjectIndex/_edit"]
- else
- EDIT_LINK % [project, "#{@script}/#{project}/_create"]
- end
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project.
- class WikiLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\b|\\)(#{RE_WIKI_WORDS})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic.gsub(/_/, ' ')]
- else
- EDIT_LINK % [topic.gsub(/_/, ' '), "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project using a Wikipedia
- # link format.
- class WikipediaLinks < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(\B|\\)#{RE_WIKIPEDIA_WORDS}\B}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- ALT_TEXT = %r{(.+)\|(.+)}o
-
- def replace
- captures = @match.captures
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- at = ALT_TEXT.match(topic)
-
- if not at.nil?
- topic = at.captures[1]
- link = CGI.escape(at.captures[0])
- end
-
- if @backend.page_exists?(link, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic]
- else
- EDIT_LINK % [topic, "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/02actions.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/02actions.rb
deleted file mode 100644
index 8ad0950..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/02actions.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # Produces a list of topics.
- class TopicList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%topics\((#{Ruwiki::Wiki::RE_PROJECT_WORD})?\)$}
- end
-
- def replace
- project = @match.captures[0] || @project
-
- if @backend.project_exists?(project)
- topic_list = @backend.list_topics(project)
- else
- topic_list = []
- end
-
- if topic_list.empty?
- ss = @message[:no_topics] % [project]
- else
- ss = %Q(<h4 class="rwtk_Headings">#{@message[:topics_for_project] % [project]}</h4>\n<ul class="rwtk_Lists">\n)
- topic_list.each do |tt|
- ss << %Q(<li class="rwtk_Lists">)
- ss << VIEW_LINK % ["#{@script}/#{project}/#{tt}", "#{CGI::unescape(tt.gsub(/_/, ' '))}"]
- ss << "</li>\n"
- end
- ss << "</ul>\n"
- end
-
- ss
- end
- end
-
- class ProjectList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%projects\(\)$}
- end
-
- def replace
- proj_list = @backend.list_projects
-
- ss = %Q(<h4 class="rwtk_Headings">#{@message[:wiki_projects] % [@title]}</h4>\n<ul class="rwtk_Lists">\n)
- proj_list.each do |pp|
- ss << %Q(<li class="rwtk_Lists">)
- ss << VIEW_LINK % ["#{@script}/#{pp}/ProjectIndex", pp]
- ss << %Q! <a href='#{@script}/#{pp}/_topics' class='rw_minilink'>#{@message[:project_topics_link]}</a>!
- ss << "</li>\n"
- end
- ss << "</ul>\n"
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/abbreviations.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/abbreviations.rb
deleted file mode 100644
index b928085..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/abbreviations.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Converts abbreviations.
- class Abbreviations < Ruwiki::Wiki::Token
- ABBREVIATIONS = {
- "matz" => "Yukihiro Matsumoto",
- }
-
- def self.regexp
- %r!@\{([^\}]*)\}!
- end
-
- def replace
- kk = @match.captures[0]
- if kk.nil? or kk.empty?
- data = %Q(<dl class="rwtk_Abbreviations">)
- ABBREVIATIONS.each do |kk, vv|
- data << %Q(<dt class="rwtk_Abbreviations">#{kk}</dt><dd class="rwtk_Abbreviations">#{vv}</dd>)
- end
- data << %Q(</dl>)
- else
- if ABBREVIATIONS.has_key?(kk)
- data = ABBREVIATIONS[kk]
- else
- data = @match[0]
- end
- end
- data
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/calendar.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/calendar.rb
deleted file mode 100644
index c78dc45..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/calendar.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces a mini-calendar with dates as WikiWords.
- class Calendar < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?%calendar\((?:(today)|(\d+),\s*(\d+))(?:,\s*(#{RE_PROJECT_WORD}))?\)}
- end
-
- def self.make(year, month)
- result = []
- tt = Time.local(year, month, 1)
- rr = Array.new(tt.wday, nil)
- rr << 1
-
- 2.upto(31) do |ii|
- break if Time.local(year, month, ii).month != month
- rr << ii
- end
-
- rr += Array.new((- rr.size) % 7, nil)
-
- 0.step(rr.size - 1, 7) do |ii|
- result << rr[ii, 7]
- end
- result
- end
-
- def make_month_link(project, year, month, state = nil)
- ym = "%04d%02d" % [year, month]
- case state
- when :prev
- title = "&laquo; #{year}.#{month}"
- when :next
- title = "#{year}.#{month} &raquo;"
- else
- title = "#{project}::#{year}.#{month}"
- end
- url = "#{@script}/#{project}/#{ym}"
-
- if @backend.page_exists?(ym, project)
- VIEW_LINK % [url, title]
- else
- EDIT_LINK % [title, "#{url}/_edit"]
- end
- end
-
- def replace
- today = @match.captures[0]
- project = @match.captures[3] || @project
- now = Time.now
-
- if today.nil?
- year = @match.captures[1].to_i
- month = @match.captures[2].to_i
- else
- year = now.year
- month = now.month
- end
-
- if (year == now.year) and (month == now.month)
- show_today = now.day
- else
- show_today = nil
- end
-
- result = <<-"CALENDAR_HEAD"
-</p>
-<div class="rwtk_Calendar">
-<table class="rwtk_Calendar" summary="calendar for ::#{project}: #{year}.#{month}">
-<thead>
- CALENDAR_HEAD
-
- result << %Q{ <tr>\n<th colspan="7" class="rwtk_Calendar_current_month">}
- result << make_month_link(project, year, month)
- result << %Q{</th>\n </tr>\n <tr>\n<th colspan="2" class="rwtk_Calendar_prev_month">}
- result << make_month_link(project, year, month - 1, :prev)
- result << %Q{</th>\n<th colspan="3"></th>\n<th colspan="2" class="rwtk_Calendar_next_month">}
- result << make_month_link(project, year, month + 1, :next)
- result << "</th>\n"
-
- result << <<-"CALENDAR_HEAD2"
- </tr>
- <tr>
- <th class="rwtk_Calendar_weekend">Su</th>
- <th class="rwtk_Calendar_weekday">Mo</th>
- <th class="rwtk_Calendar_weekday">Tu</th>
- <th class="rwtk_Calendar_weekday">We</th>
- <th class="rwtk_Calendar_weekday">Th</th>
- <th class="rwtk_Calendar_weekday">Fr</th>
- <th class="rwtk_Calendar_weekend">Sa</th>
- </tr>
-</thead>
-<tbody>
- CALENDAR_HEAD2
-
- Calendar.make(year, month).each do |week|
- result << " <tr>\n"
- week.each do |day|
- if day.nil?
- result << %Q{ <td class="rwtk_Calendar_day"></td>\n}
- else
- date = "%04d%02d%02d" % [year, month, day]
- # Add the ability to create pages based on date here.
- if show_today == day
- result << %Q{ <td class="rwtk_Calendar_today">}
- else
- result << %Q{ <td class="rwtk_Calendar_day">}
- end
- if @backend.page_exists?(date, project)
- result << VIEW_LINK % ["#{@script}/#{project}/#{date}", day]
- else
- result << EDIT_LINK % [day, "#{@script}/#{project}/#{date}/_edit"]
- end
- result << %Q{</td>\n}
- end
- end
- result << " </tr>\n"
- end
-
- result << %Q(</tbody>\n</table>\n</div>\n<p class="rwtk_Paragraph">)
- result
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*>(\s*</?div(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?table(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?t(?:head|body|r)(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*<t[hd].+?</t[hd]>\s*)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/headings.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/headings.rb
deleted file mode 100644
index cfc3001..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/headings.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts headings.
- class Headings < Ruwiki::Wiki::Token
-# def self.rank
-# 5
-# end
-
- def self.regexp
- %r{^\\?(=+)\s+(.*)}
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def replace
- level = @match.captures[0].count("=")
- content = @match.captures[1]
- level = 6 if level > 6
- %Q(<h#{level} class="rwtk_Headings">#{content}</h#{level}>)
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(</h\d>)\n}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{(</h\d>)</p>\n<p>}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{<p[^>]*>(<h\d[^>]*>)}, '\1')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/lists.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/lists.rb
deleted file mode 100644
index 1615c2c..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/lists.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Produces Lists
- class Lists < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?([*#]+)\s+(.*)$}
- end
-
- def replace
- indent = @match.captures[0].scan(/./).map { |ee| ee == "*" ? 'ul' : 'ol' }
- content = @match.captures[1]
-
- pre = ''
- post = ''
- indent.each { |elem| pre << %Q(<#{elem} class="rwtk_Lists">) }
- indent.reverse_each { |elem| post << %Q(</#{elem}>) }
- %Q(#{pre}<li class="rwtk_Lists">#{content}</li>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- RE_NESTED_LISTS = %r{</[uo]l>\s*<[uo]l[^>]*>}
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*><([uo]l[^>]*)>}, '<\1>')
- content.gsub!(%r{</([uo]l)></p>}, '</\1>')
- content.gsub!(RE_NESTED_LISTS, '') while content =~ RE_NESTED_LISTS
- content
- end
- end
-
- # Produces block quotes.
- class Blockquotes < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((:+)|(>+))(\s+.*)$}
- end
-
- def replace
- content = @match.captures[3]
-
- if @match.captures[2].nil?
- char = ':'
- cite = ''
- else
- char = '>'
- cite = ' type="cite"'
- end
- indent = @match.captures[0].count(char)
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<blockquote#{cite} class="rwtk_Blockquotes">)
- post << %Q(</blockquote>)
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1].gsub(/^>/, '&gt;')
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</blockquote>(\n|<br ?/?>)?<blockquote[^>]*>}, '')
- content.gsub!(%r{(</?blockquote[^>]*>\n?)\s*}, '\1')
- content.gsub!(%r{</blockquote>(<blockquote[^>]*>)+}, '\1')
- content
- end
- end
-
- # Produces definition lists. Does not completely work correctly.
- class Definitions < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(;+)\s+(.+?)\s+:\s+(.*)}
- end
-
- def replace
- definition = @match.captures[2]
- term = @match.captures[1]
- indent = @match.captures[0].count(';')
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<dl class="rwtk_Definitions">)
- post << %Q(</dl>)
- end
- %Q(#{pre}<dt class="rwtk_Definitions">#{term}</dt><dd class="rwtk_Definitions">#{definition}</dd>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</dl>(\n|<br ?/?>)?<dl[^>]*>}, '')
- content.gsub!(%r{</dl>(<dl[^>]*>)+}, '\1')
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/rubylists.rb b/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/rubylists.rb
deleted file mode 100644
index b765ad1..0000000
--- a/ruwiki/tags/release-0.9.3/lib/ruwiki/wiki/tokens/rubylists.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Convert ruby-talk mailing list references (e.g., [ruby-talk:12345])
- # into named links.
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
-# %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/#{lm}">#{@match[0]}</a>)
- end
- end
-
- # Convert ruby-core/ext/dev/list/math mailing list references (e.g.,
- # [ruby-core:12345]) into named links.
- class OtherRubyLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-(list|doc|core|dev|ext|math):(\d+)\]}
- end
-
- def replace
- ln, lm = @match.captures[0..1]
- %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-#{ln}/#{lm}">#{@match[0]}</a>)
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/ruwiki b/ruwiki/tags/release-0.9.3/ruwiki
deleted file mode 100644
index 251a140..0000000
--- a/ruwiki/tags/release-0.9.3/ruwiki
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'ruwiki/utils'
-require 'ruwiki/utils/manager'
-
- # RPA Maintainers: Change this to the appropriate location on installation.
- # This is the right place for RubyGems, basically.
-ss = "#{File.dirname(File.expand_path(__FILE__))}/.."
-
-Ruwiki::Utils::Manager.shared = ss
-
-exit Ruwiki::Utils::Manager.run(ARGV)
diff --git a/ruwiki/tags/release-0.9.3/ruwiki.cgi b/ruwiki/tags/release-0.9.3/ruwiki.cgi
deleted file mode 100644
index 2e1ebee..0000000
--- a/ruwiki/tags/release-0.9.3/ruwiki.cgi
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
-config_file = File.join(Dir.pwd, Ruwiki::Config::CONFIG_NAME)
-
-if File.exists?(config_file)
- wiki.load_config(config_file)
- config = Ruwiki::Config.read(config_file)
- if config.webmaster.nil? or config.webmaster.empty?
- config.webmaster = "webmaster@domain.tld"
- end
-else
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
- wiki.config.webmaster = "webmaster@domain.tld"
-
-# wiki.config.debug = false
-# wiki.config.title = "Ruwiki"
-# wiki.config.default_page = "ProjectIndex"
-# wiki.config.default_project = "Default"
- # This next defaults to 'flatfiles'. Conversion of the default data will
- # be necessary to use other formats.
-# wiki.config.storage_type = 'flatfiles'
-# wiki.config.storage_options[wiki.config.storage_type][:data_path] = "./data/"
- wiki.config.storage_options[wiki.config.storage_type][:extension] = "ruwiki"
-# wiki.config.template_path = "./templates/"
-# wiki.config.template_set = "default"
-# wiki.config.css = "ruwiki.css"
-# wiki.config.time_format = "%H:%M:%S"
-# wiki.config.date_format = "%Y.%m.%d"
-# wiki.config.datetime_format = "%Y.%m.%d %H:%M:%S"
-end
-
-wiki.config!
-wiki.run
diff --git a/ruwiki/tags/release-0.9.3/ruwiki.conf b/ruwiki/tags/release-0.9.3/ruwiki.conf
deleted file mode 100644
index 72e4cc6..0000000
--- a/ruwiki/tags/release-0.9.3/ruwiki.conf
+++ /dev/null
@@ -1,22 +0,0 @@
-ruwiki-config!auth-options:
-ruwiki-config!css: ruwiki.css
-ruwiki-config!date-format: %Y.%m.%d
-ruwiki-config!datetime-format: %Y.%m.%d %H:%M:%S
-ruwiki-config!debug: true
-ruwiki-config!default-page: ProjectIndex
-ruwiki-config!default-project: Default
-ruwiki-config!language: en
-ruwiki-config!storage-options: flatfiles!data-path: ./data
- flatfiles!extension: ruwiki
-ruwiki-config!storage-type: flatfiles
-ruwiki-config!template-path: ./templates/
-ruwiki-config!template-set: default
-ruwiki-config!time-format: %H:%M:%S
-ruwiki-config!title: Ruwiki
-ruwiki-config!webmaster: webmaster@domain.tld
-webrick-config!addresses:
-webrick-config!do-log: true
-webrick-config!log-dest: <STDERR>
-webrick-config!mount: /
-webrick-config!port: 8808
-webrick-config!threads: 1
diff --git a/ruwiki/tags/release-0.9.3/ruwiki_convert b/ruwiki/tags/release-0.9.3/ruwiki_convert
deleted file mode 100644
index c290041..0000000
--- a/ruwiki/tags/release-0.9.3/ruwiki_convert
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
- # Load all of the known backends.
-require 'ruwiki/utils'
-require 'ruwiki/backend/flatfiles'
-require 'ruwiki/utils/converter'
-
-exit Ruwiki::Utils::Converter.run(ARGV)
diff --git a/ruwiki/tags/release-0.9.3/ruwiki_service.rb b/ruwiki/tags/release-0.9.3/ruwiki_service.rb
deleted file mode 100644
index bd66d49..0000000
--- a/ruwiki/tags/release-0.9.3/ruwiki_service.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'win32/service'
-require 'ruwiki/utils/servletrunner'
-
-class Ruwiki::Utils::Daemon < Win32::Daemon
- LOCATION = File.dirname(File.expand_path(__FILE__))
-
- def initialize
- @logfile = File.open(File.join(LOCATION, "ruwiki_service.log"), "ab+")
- rescue Exception => e
- File.open(File.join(LOCATION, "temp.log"), "a+") do |f|
- f.puts "Logfile error: #{e}"
- f.puts "Backtrace:\n#{e.backtrace.join(', ')}"
- end
- exit
- end
-
- def service_main
- ARGV.replace(["--config", File.join(LOCATION, Ruwiki::Config::CONFIG_NAME),
- "--logfile", File.join(LOCATION, "ruwiki_servlet.log")])
- Ruwiki::Utils::ServletRunner.run(ARGV, @logfile, @logfile, @logfile)
- rescue Exception => e
- file = LOCATION + '/temp.log'
- File.open(file, "a+") do |f|
- f.puts "Error: #{e}"
- f.puts "Backtrace: #{e.backtrace.join(', ')}"
- end
- exit
- end
-end
-
-daemon = Ruwiki::Utils::Daemon.new
-daemon.mainloop
diff --git a/ruwiki/tags/release-0.9.3/ruwiki_servlet b/ruwiki/tags/release-0.9.3/ruwiki_servlet
deleted file mode 100644
index 224ab3f..0000000
--- a/ruwiki/tags/release-0.9.3/ruwiki_servlet
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'ruwiki/utils/servletrunner'
-
-exit Ruwiki::Utils::ServletRunner.run(ARGV)
diff --git a/ruwiki/tags/release-0.9.3/templates/default/body.tmpl b/ruwiki/tags/release-0.9.3/templates/default/body.tmpl
deleted file mode 100644
index baaa259..0000000
--- a/ruwiki/tags/release-0.9.3/templates/default/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow,noarchive" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.9.3/templates/default/content.tmpl b/ruwiki/tags/release-0.9.3/templates/default/content.tmpl
deleted file mode 100644
index 7f662b2..0000000
--- a/ruwiki/tags/release-0.9.3/templates/default/content.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.3/templates/default/controls.tmpl b/ruwiki/tags/release-0.9.3/templates/default/controls.tmpl
deleted file mode 100644
index 8f855c2..0000000
--- a/ruwiki/tags/release-0.9.3/templates/default/controls.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_header">
- <form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- <!-- Right-hand tabs must go in reverse order! -->
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.9.3/templates/default/edit.tmpl b/ruwiki/tags/release-0.9.3/templates/default/edit.tmpl
deleted file mode 100644
index 9e5dbb5..0000000
--- a/ruwiki/tags/release-0.9.3/templates/default/edit.tmpl
+++ /dev/null
@@ -1,27 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_navbar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_navbar_righttab" id="rw_editing_tab"><strong><em>#label_editing#</em> #%page_version%</strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <div class="rw_content">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.3/templates/default/error.tmpl b/ruwiki/tags/release-0.9.3/templates/default/error.tmpl
deleted file mode 100644
index a3887b2..0000000
--- a/ruwiki/tags/release-0.9.3/templates/default/error.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.3/templates/default/footer.tmpl b/ruwiki/tags/release-0.9.3/templates/default/footer.tmpl
deleted file mode 100644
index 48146ea..0000000
--- a/ruwiki/tags/release-0.9.3/templates/default/footer.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_footer">
-<!--<form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- {!-- Right-hand tabs must go in reverse order! --}
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>-->
-</div>
diff --git a/ruwiki/tags/release-0.9.3/templates/default/ruwiki.css b/ruwiki/tags/release-0.9.3/templates/default/ruwiki.css
deleted file mode 100644
index cfe7bf6..0000000
--- a/ruwiki/tags/release-0.9.3/templates/default/ruwiki.css
+++ /dev/null
@@ -1,297 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_footer
-{
-/*position: absolute;
- width: 100%;
- bottom: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;*/
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_footer { position: fixed; }
-
-body > div#rw_footer > .rw_navbar { position: fixed; bottom: 0; }
-body > div#rw_footer > .rw_navbar > div { position: relative; top: -2em; }
-
-body
-{
- margin: 0.5em;
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_navbar
-{
- width: 100%;
- margin: 0;
- padding: 0.1em;
- font-size: 0.7em;
- border: 1px solid black;
- color: white;
- background-color: #27C;
- height: 0.5em;
- z-index: 2;
-}
-
-.rw_navbar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_navbar a:visited
-{
- color: #2E7;
- font-weight: normal;
- border-bottom: 1px dashed #2E7;
-}
-
-.rw_navbar a:hover
-{
- text-decoration: none;
-}
-
-.rw_navbar_tab
-{
- float: left;
- background-color: #27C;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_navbar_tab:hover
-{
- background-color: #49E;
-}
-
-.rw_navbar_righttab
-{
- float: right;
- padding-left: 0.8em;
- padding-top: 0.3em;
- padding-right: 0.8em;
- border: 1px solid #059;
- background-color: #27C;
- margin: 0 0.3em;
- height: 2em;
-}
-
-.rw_navbar_righttab:hover
-{
- background-color: #49E;
-}
-
-.rw_content
-{
- clear: both;
- margin-top: 2em;
- margin-left: 3em;
- margin-right: 3em;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- font-weight: bolder;
- clear: both;
- font-size: 90%;
- padding: 1em;
- margin-top: 3em;
- margin-left: 5em;
- margin-right: 5em;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #27C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #27C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab { background-color: #C72; }
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
-
diff --git a/ruwiki/tags/release-0.9.3/templates/default/save.tmpl b/ruwiki/tags/release-0.9.3/templates/default/save.tmpl
deleted file mode 100644
index 04069b1..0000000
--- a/ruwiki/tags/release-0.9.3/templates/default/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.3/templates/sidebar/body.tmpl b/ruwiki/tags/release-0.9.3/templates/sidebar/body.tmpl
deleted file mode 100644
index 2f3c10f..0000000
--- a/ruwiki/tags/release-0.9.3/templates/sidebar/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.9.3/templates/sidebar/content.tmpl b/ruwiki/tags/release-0.9.3/templates/sidebar/content.tmpl
deleted file mode 100644
index fa2d67e..0000000
--- a/ruwiki/tags/release-0.9.3/templates/sidebar/content.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.9.3/templates/sidebar/controls.tmpl b/ruwiki/tags/release-0.9.3/templates/sidebar/controls.tmpl
deleted file mode 100644
index 6e12b22..0000000
--- a/ruwiki/tags/release-0.9.3/templates/sidebar/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_titlebar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_titlebar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.3/templates/sidebar/edit.tmpl b/ruwiki/tags/release-0.9.3/templates/sidebar/edit.tmpl
deleted file mode 100644
index eb04395..0000000
--- a/ruwiki/tags/release-0.9.3/templates/sidebar/edit.tmpl
+++ /dev/null
@@ -1,27 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_titlebar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_titlebar_tab" id="rw_editing_tab"><strong><em>#label_editing#</em> #%page_version%</strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <div class="rw_content_edit">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.3/templates/sidebar/error.tmpl b/ruwiki/tags/release-0.9.3/templates/sidebar/error.tmpl
deleted file mode 100644
index 5a2882e..0000000
--- a/ruwiki/tags/release-0.9.3/templates/sidebar/error.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.9.3/templates/sidebar/footer.tmpl b/ruwiki/tags/release-0.9.3/templates/sidebar/footer.tmpl
deleted file mode 100644
index 6dfc390..0000000
--- a/ruwiki/tags/release-0.9.3/templates/sidebar/footer.tmpl
+++ /dev/null
@@ -1,22 +0,0 @@
-<div class="rw_footer">
- <form class="rw_footer_tab" action="_search">
- <div>
- <input class="rw_search_box" type="text" name="q" size="10" />
- </div>
- <div>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- </div>
- </form>
- <div class="rw_footer_tab">
- <dl>
- <dt>%page_project%::</dt>
- <dd><a href="%cgi_url%/%page_project%/_topics">#label_topics#</a><br />
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </dd>
- </div>
- <div class="rw_footer_tab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.9.3/templates/sidebar/ruwiki.css b/ruwiki/tags/release-0.9.3/templates/sidebar/ruwiki.css
deleted file mode 100644
index 0f2b4cc..0000000
--- a/ruwiki/tags/release-0.9.3/templates/sidebar/ruwiki.css
+++ /dev/null
@@ -1,347 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
-.rw_titlebar
-{
- margin: 0 auto;
- height: 0.5em;
-}
-
- /* Normal styling from here on out. */
-body
-{
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_titlebar
-{
- font-size: 0.7em;
- border: 1px solid #059;
- color: white;
- background-color: #5C9;
- height: 0.5em;
- width: 100%;
-}
-
-.rw_titlebar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_titlebar a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_titlebar a:hover
-{
- text-decoration: none;
-}
-
-.rw_titlebar_tab
-{
- float: left;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_titlebar_tab:hover
-{
- background-color: #4E9;
-}
-
-div.rw_footer
-{
- position: fixed;
- left: 72%;
- width: 20%;
- height: 100%;
- padding: 0.2em;
- padding-top: 0.5em;
-//background-color: #95C;
- font-size: 0.9em;
-}
-
-.rw_footer
-{
-}
-
-.rw_footer a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_footer a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_footer a:hover
-{
- text-decoration: none;
-}
-
-.rw_footer_tab
-{
- color: yellow;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0.3em;
- min-height: 2em;
- clear: both;
-}
-
-.rw_footer_tab div
-{
- text-align: right;
-}
-
-div#rw_content
-{
- padding: 50px 0 0 0;
- margin-left: 0;
- voice-family: "\"}\""; /* fake out IE5/Win */
- voice-family: inherit;
- margin-left: 16px;
-}
-
-body > div#rw_content
-{
- margin-left: 0;
-}
-
-.rw_content
-{
- padding-top: 0;
- margin-left: 3em;
- width: 65%;
- float: left;
-}
-
-.rw_content_edit
-{
- width: 90%;
- margin: 0 auto;
- padding: 2em;
- padding-top: 0;
- float: left;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- float: left;
- font-weight: bolder;
- font-size: 90%;
- padding: 0.5em;
- width: 65%;
- margin-top: 3em;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #59C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #59C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #59C;
- margin: 0.1em;
-}
-
-.rw_search_box
-{
- border: 1px dotted #59C;
- width: 100%;
- margin: 0.1em;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab
-{
- background-color: #C72;
- text-align: right;
- margin-right: 2em;
- float: right;
-}
-
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.9.3/templates/sidebar/save.tmpl b/ruwiki/tags/release-0.9.3/templates/sidebar/save.tmpl
deleted file mode 100644
index 7c4c31c..0000000
--- a/ruwiki/tags/release-0.9.3/templates/sidebar/save.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-<div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.9.3/templates/simple/body.tmpl b/ruwiki/tags/release-0.9.3/templates/simple/body.tmpl
deleted file mode 100644
index b3281d0..0000000
--- a/ruwiki/tags/release-0.9.3/templates/simple/body.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.9.3/templates/simple/content.tmpl b/ruwiki/tags/release-0.9.3/templates/simple/content.tmpl
deleted file mode 100644
index 2da5e62..0000000
--- a/ruwiki/tags/release-0.9.3/templates/simple/content.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content -->
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.3/templates/simple/controls.tmpl b/ruwiki/tags/release-0.9.3/templates/simple/controls.tmpl
deleted file mode 100644
index 29cdf3a..0000000
--- a/ruwiki/tags/release-0.9.3/templates/simple/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <a href="%cgi_url%/%page_project%/">%page_project%</a>
- &raquo;
- %page_topic%
- [?editable|<a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">[#label_edit#]</a>?]
-</div>
diff --git a/ruwiki/tags/release-0.9.3/templates/simple/edit.tmpl b/ruwiki/tags/release-0.9.3/templates/simple/edit.tmpl
deleted file mode 100644
index b42759d..0000000
--- a/ruwiki/tags/release-0.9.3/templates/simple/edit.tmpl
+++ /dev/null
@@ -1,25 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <strong>%page_topic%</strong>
- &raquo;
- <strong>%page_project%</strong>
- [<strong><em>#label_editing#</em> #%page_version%</strong>]
-</div>
-
-<div class="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
-</div>
diff --git a/ruwiki/tags/release-0.9.3/templates/simple/error.tmpl b/ruwiki/tags/release-0.9.3/templates/simple/error.tmpl
deleted file mode 100644
index ac898ea..0000000
--- a/ruwiki/tags/release-0.9.3/templates/simple/error.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- |
- <strong><em>%name%</em></strong>
-</div>
-<div class="rw_content">
-<h1>%name%</h1>
-<p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
-<p>%backtrace%</p>
-</div>
diff --git a/ruwiki/tags/release-0.9.3/templates/simple/footer.tmpl b/ruwiki/tags/release-0.9.3/templates/simple/footer.tmpl
deleted file mode 100644
index 2e7893b..0000000
--- a/ruwiki/tags/release-0.9.3/templates/simple/footer.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<form class="rw_navbar" action="_search">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- |
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>,
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- |
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
-</form>
diff --git a/ruwiki/tags/release-0.9.3/templates/simple/ruwiki.css b/ruwiki/tags/release-0.9.3/templates/simple/ruwiki.css
deleted file mode 100644
index 57d1a09..0000000
--- a/ruwiki/tags/release-0.9.3/templates/simple/ruwiki.css
+++ /dev/null
@@ -1,192 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #fafafa;
-}
-
-.rw_navbar
-{
- font-weight: bold;
- font-size: 1.1em;
- padding: 0.3em;
-}
-
-.rw_navbar a
-{
- border-bottom: 1px dashed black;
- font-weight: bold;
-}
-.rw_navbar a:visited
-{
- color: maroon;
- border-bottom: 1px dashed maroon;
-}
-.rw_navbar a:hover { background-color: #afafaf; }
-
-.rw_content
-{
- background-color: white;
- border: 1px dashed grey;
- padding: 0.5em;
- margin-left: 1em;
- margin-right: 1em;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- font-weight: bolder;
- font-size: 90%;
- padding: 0.5em;
- margin-left: 3em;
- margin-right: 3em;
-}
-
-
-.rw_edit_content
-{
- border: 1px solid black;
- padding: 0.3em;
- width: 95%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px solid black;
- padding: 0.3em;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px solid black;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form { }
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px solid black;
-}
-
-.rw_pagelink { text-decoration: none; }
-.rw_projectxlink { }
-.rw_projectindex { }
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title { }
-
-.rw_edit_format div
-{
-}
-
-.rw_search_button
-{
- border: 1px solid black;
-}
-
-.rw_search_box
-{
- border: 1px solid black;
-}
-
-.rw_search_box:hover { }
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_saved_page_announcement { }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { border: none; }
-.rwtk_NumberedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_NamedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_ExternalLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_RubyTalkLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_OtherRubyLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dashed grey; }
-.rwtk_WikiLink { text-decoration: none; }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.9.3/templates/simple/save.tmpl b/ruwiki/tags/release-0.9.3/templates/simple/save.tmpl
deleted file mode 100644
index 51de9f4..0000000
--- a/ruwiki/tags/release-0.9.3/templates/simple/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.9.3/tests/harness.rb b/ruwiki/tags/release-0.9.3/tests/harness.rb
deleted file mode 100644
index 80e7eeb..0000000
--- a/ruwiki/tags/release-0.9.3/tests/harness.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-ENV["REQUEST_METHOD"] = "HEAD"
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_type = 'flatfiles'
-
-dp = nil
-dp = "../data" if File.exists?("../data")
-dp = "./data" if File.exists?("./data")
-raise "Cannot find either ./data or ../data for tests. Aborting." if dp.nil?
-
-$wiki.config.storage_options['flatfiles']['data-path'] = dp
-$wiki.config.storage_options['flatfiles']['format'] = "exportable"
-$wiki.config.storage_options['flatfiles']['extension'] = "ruwiki"
-
-tp = nil
-tp = "../templates" if File.exists?("../templates")
-tp = "./templates" if File.exists?("./templates")
-raise "Cannot find either ./templates or ../templates for tests. Aborting." if tp.nil?
-
-$wiki.config.template_path = tp
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.9.3/tests/tc_backend_flatfile.rb b/ruwiki/tags/release-0.9.3/tests/tc_backend_flatfile.rb
deleted file mode 100644
index c3c815c..0000000
--- a/ruwiki/tags/release-0.9.3/tests/tc_backend_flatfile.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-require 'fileutils'
-
-class TestBackendFlatfiles < Test::Unit::TestCase
- def setup
- @ffopts = { 'data-path' => "./test/data", 'extension' => nil }
-
- # generate a database
- raise "Setup Error: #{@ffopts['data-path']} exists" if File.exists?(@ffopts['data-path'])
-
- @flatbase = {
- 'Proj1' => ['ProjectIndex:all projects must have this',
- 'P1TopicOne:this is the content',
- 'P1TopicTwo:more content'],
- 'Proj2' => ['ProjectIndex:all projects must have this',
- 'P2TopicOne:this is the content',
- 'P2TopicTwo:more content',
- 'P2TopicThree:even more more content']
- }
-
- @flatbase.each do |key, val|
- prjdir = "#{@ffopts['data-path']}/#{key}"
- FileUtils.mkdir_p(prjdir) rescue nil
- val.each do |topcon|
- topic, content = topcon.split(":")
- File.open("#{prjdir}/#{topic}", "w") do |fh|
- fh.puts "page!content:\x09#{content}"
- end
- end
- end
-
- @backend = nil
- @pg = nil
- end
-
- def teardown
- # remove testing flatabase
- FileUtils.rm_rf(@ffopts['data-path'])
- Dir.rmdir("./test") # ugly but it works
- end
-
- def test_list_projects
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- # should be ['Proj1', 'Proj2']
- assert_equal(@flatbase.keys, @backend.list_projects)
- end
-
- def test_list_topics
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- @flatbase.keys.sort.each do |proj|
- got_topics = @backend.list_topics(proj)
- exp_topics = @flatbase[proj].map { |ent| ent.split(':')[0] }
- assert_equal(exp_topics.sort, got_topics.sort)
- end
- end
-
- # test simple one word lookups
- # need to add more complex search strings
- def test_search_project
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- assert_equal({'ProjectIndex' => 1,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 0 }.to_a.sort,
- @backend.search_project('Proj1', 'this').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 0,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'more').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'topic').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'content').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P2TopicOne' => 0,
- 'P2TopicTwo' => 1,
- 'P2TopicThree' => 2 }.to_a.sort,
- @backend.search_project('Proj2', 'more').to_a.sort)
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/tests/tc_bugs.rb b/ruwiki/tags/release-0.9.3/tests/tc_bugs.rb
deleted file mode 100644
index 477cbeb..0000000
--- a/ruwiki/tags/release-0.9.3/tests/tc_bugs.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-
-# see if we can reproduce the LicenseandAuthor hang
-# described in bug id 147 on rubyforge
-class TC_LicenseAndAuthorHang < Test::Unit::TestCase
- def setup
- @ffopts = { }
- dp = nil
- dp = "../data" if File.exists?("../data")
- dp = "./data" if File.exists?("./data")
- raise "Cannot find either ./data or ../data for tests. Aborting." if dp.nil?
-
- @ffopts['data-path'] = dp
- @ffopts['format'] = 'exportable'
-
- @backend = nil
- @pg = nil
- end
-
- # load "to the metal"
- def test_ffload
- assert_nothing_raised do
- @backend = ::Ruwiki::Backend::Flatfiles.new(@ffopts)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.load('LicenseAndAuthorInfo.ruwiki', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-
- # abstract backend retreive
- def test_beload
- @backend = nil
- assert_nothing_raised do
- mock_ruwiki = OpenStruct.new
- mock_ruwiki.config = OpenStruct.new
- mock_ruwiki.config.message = {}
- mock_ruwiki.config.storage_options = { 'flatfiles' => @ffopts }
-
- @backend = ::Ruwiki::BackendDelegator.new(mock_ruwiki, 'flatfiles')
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.retrieve('LicenseAndAuthorInfo', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-end
-
-# if __FILE__ == $0
-# ObjectSpace.each_object { |o| tests << o if o.kind_of?(Class) }
-# tests.delete_if { |o| !o.ancestors.include?(Test::Unit::TestCase) }
-# tests.delete_if { |o| o == Test::Unit::TestCase }
-
-# tests.each { |test| Test::Unit::UI::Console::TestRunner.run(test) }
-# end
diff --git a/ruwiki/tags/release-0.9.3/tests/tc_exportable.rb b/ruwiki/tags/release-0.9.3/tests/tc_exportable.rb
deleted file mode 100644
index b067240..0000000
--- a/ruwiki/tags/release-0.9.3/tests/tc_exportable.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-class Ruwiki; end if __FILE__ == $0
-
-require 'ruwiki/exportable'
-require 'test/unit'
-
- class TCExportable < Test::Unit::TestCase
- class Exportable
- include Ruwiki::Exportable
-
- attr_accessor :a, :b, :long_name, :altname, :xform, :group2
- exportable :a
- exportable :long_name
- exportable :altname, :name => 'alt-name'
- exportable :group2, :group => 'group2'
- end
-
- def test_exportable
- __exportables = {
- 'default' => {
- 'a' => '@a'.intern,
- 'long-name' => '@long_name'.intern,
- 'alt-name' => '@altname'.intern,
- },
- 'group2' => {
- 'group2' => '@group2'.intern
- }
- }
- __values = {
- 'default' => {
- 'a' => 'a',
- 'long-name' => 'c',
- 'alt-name' => 'd',
- },
- 'group2' => { 'group2' => 'e' }
- }
- xx = nil
- ss = nil
- assert_nothing_raised do
- xx = Exportable.new
- xx.a = "a"
- xx.b = "b"
- xx.long_name = "c"
- xx.altname = "d"
- xx.xform = 22/7
- xx.group2 = "e"
- ss = xx.export
- end
- assert_equal(__exportables, xx.class.__exportables)
- assert_equal(__values, ss)
- end
- end
diff --git a/ruwiki/tags/release-0.9.3/tests/tc_template.rb b/ruwiki/tags/release-0.9.3/tests/tc_template.rb
deleted file mode 100644
index c4da672..0000000
--- a/ruwiki/tags/release-0.9.3/tests/tc_template.rb
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'test/unit'
-require 'harness'
-
-class TestTemplates < Test::Unit::TestCase
- def test_include
- a = "a!INCLUDE!c"
- b = "b"
- t = Ruwiki::TemplatePage.new(a, b)
- assert_equal(["abc"], t.lines.lines)
- end
-
- def test_variables
- a = "a%b%c"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.write_plain_on("", v))
- end
-
- def test_optional_variables
- a = "a%b%%?c%d"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.write_plain_on("", v))
-
- v["c"] = "c"
- assert_equal("abcd", t.write_plain_on("", v))
- end
-
- def test_labels
- a = "a#b#c"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.write_plain_on("", v, m))
- end
-
- def test_optional_labels
- a = "a#b##?c#d"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.write_plain_on("", v, m))
-
- m[:c] = "c"
- assert_equal("abcd", t.write_plain_on("", v, m))
- end
-
- def test_hrefs
- a = "HREF:a:b:"
- t = Ruwiki::TemplatePage.new(a)
- v = { "b" => "b" }
-
- assert_equal("b", t.write_plain_on("", v))
-
- s = ""
- v["a"] = "link"
- assert_equal(%Q(<a href="link">b</a>), t.write_plain_on("", v))
- end
-
- def test_repeat_subst
- v1 = { "a" => 3 }
- v2 = { "a" => 2...4 }
- v3 = { "a" => -4...-2 }
- v4 = { "a" => [3, 1, 4, 1, 5, 9] }
- v5 = { "a" => [{ "a" => 3 }, { "a" => 1 }, { "a" => 4 }, { "a" => 1 }, { "a" => 5 }, { "a" => 9 }] }
-
- a = "[:a|xy:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("xyxyxy", t.write_plain_on("", v1))
- assert_equal("xyxy", t.write_plain_on("", v2))
- assert_equal("xyxy", t.write_plain_on("", v3))
- assert_equal("xyxyxyxyxyxy", t.write_plain_on("", v4))
- assert_equal("xyxyxyxyxyxy", t.write_plain_on("", v5))
-
- a = "[:a|%a%:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("123", t.write_plain_on("", v1))
- assert_equal("23", t.write_plain_on("", v2))
- assert_equal("-4-3", t.write_plain_on("", v3))
- assert_equal("314159", t.write_plain_on("", v4))
- assert_equal("314159", t.write_plain_on("", v5))
- end
-
- def test_optional_subst
- v1 = { "a" => "a" }
- v2 = { "a" => nil }
- a1 = "[?a|xy?]"
- a2 = "[!a|xy?]"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
-
- assert_equal("xy", t1.write_plain_on("", v1))
- assert_equal("", t1.write_plain_on("", v2))
- assert_equal("", t2.write_plain_on("", v1))
- assert_equal("xy", t2.write_plain_on("", v2))
- end
-
- def test_repeat_block
- a1 = "START:a\nxy\nEND:a"
- a2 = "START:a\nx%b%y\nEND:a"
- a3 = "START:\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- v = { "a" => [{ "b" => 3 }, { "b" => 1 }, { "b" => 4 }, { "b" => 1 }, { "b" => 5 }, { "b" => 9 }] }
-
- assert_equal("xy\nxy\nxy\nxy\nxy\nxy\n", t1.write_plain_on("", v))
- assert_equal("x3y\nx1y\nx4y\nx1y\nx5y\nx9y\n", t2.write_plain_on("", v))
- assert_raises(RuntimeError) { t3.write_plain_on("", v) }
- end
-
- def test_optional_block
- a1 = "IF:a\nxy\nENDIF:a"
- a2 = "IF:\nxy\nEND:"
- a3 = "IFNOT:a\nxy\nENDIF:a"
- a4 = "IFNOT:\nxy\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- t4 = Ruwiki::TemplatePage.new(a4)
- v1 = { "a" => true }
- v2 = { "a" => nil }
-
- assert_equal("xy", t1.write_plain_on("", v1))
- assert_equal("", t1.write_plain_on("", v2))
- assert_raises(RuntimeError) { t2.write_plain_on("", v1) }
- assert_equal("", t3.write_plain_on("", v1))
- assert_equal("xy", t3.write_plain_on("", v2))
- assert_raises(RuntimeError) { t4.write_plain_on("", v1) }
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/tests/tc_tokens.rb b/ruwiki/tags/release-0.9.3/tests/tc_tokens.rb
deleted file mode 100644
index 929701a..0000000
--- a/ruwiki/tags/release-0.9.3/tests/tc_tokens.rb
+++ /dev/null
@@ -1,335 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'test/unit'
-require 'harness'
-
-class TokenTestCases < Test::Unit::TestCase
- def setup
- @mrw = MockRuwiki.new
- end
-
- class MockRuwiki
- def initialize
- @project = "Default"
- @tokens = []
- @script = "<uri>"
- @message = Hash.new { |h, k| h[k] = "#{k.inspect}" }
- @title = "Ruwiki"
- end
-
- def __tokenize(content, token)
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, @project, $wiki.backend, @script, @message, @title)
- @tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{@tokens.size - 1}"
- else
- "TOKEN_#{@tokens.size - 1}"
- end
- end
- content
- end
-
- def __replace(content)
- replaced = []
- s = true
- loop do
- break if replaced.size >= @tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].restore
- end
-
- s = content.gsub!(/TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].replace
- end
- end
- content
- end
-
- def __post_replace(content)
- token_classes = @tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
- content
- end
-
- end
-
- def __process(token, content, tokenized, replaced, result)
- assert_equal(tokenized, content = @mrw.__tokenize(content, token), "Tokenization failure.")
- assert_equal(replaced, content = @mrw.__replace(content), "Replacement failure.")
- assert_equal(result, content = @mrw.__post_replace(content), "Post-replace failure.")
- end
-
- def __display(token, content)
- p tokenized = @mrw.__tokenize(content.dup, token)
- p replaced = @mrw.__replace(tokenized.dup)
- p result = @mrw.__post_replace(replaced.dup)
- end
-
- def test_Paragraph
- token = Ruwiki::Wiki::Paragraph
- content = "\nABC\n\nabc\n"
- tkv = "TOKEN_0\nABC\nTOKEN_1\nabc\n"
- rpv = %Q(</p><p class="rwtk_Paragraph">\nABC\n</p><p class="rwtk_Paragraph">\nabc\n)
- res = %Q(<p class="rwtk_Paragraph">ABC</p>\n<p class="rwtk_Paragraph">abc</p>)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Image
- token = Ruwiki::Wiki::Image
- content = "[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_0"
- rpv = %Q(<img class="rwtk_Image" alt="http://www.halostatue.ca/graphics/maple_leaf.gif" src="http://www.halostatue.ca/graphics/maple_leaf.gif" title="http://www.halostatue.ca/graphics/maple_leaf.gif" />)
- res = rpv
-
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_1"
- content = %Q([image : http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" title="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="Maple Leaf" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_2"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true])
- rpv = %Q(<img class="rwtk_Image" alt="[1]" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[1]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_3"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true alt="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[2]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- content = "\[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_4"
- rpv = content
- res = content
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Code
- content = " line 1\n line 2\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_0TOKEN_1line 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2</pre>\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
-
- content = " line 1\n line 2\n \n\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_2TOKEN_3TOKEN_4\nline 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\n</p><pre class="rwtk_Code"> </pre>\n\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2\n </pre>\n\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NumberedLinks
- token = Ruwiki::Wiki::NumberedLinks
- Ruwiki::Wiki.reset_numbered_links
- content = "[http://www.yahoo.com] [http://www.ruby-lang.org] \\[http://www.rubyforge.org]"
- tkv = "TOKEN_0 TOKEN_1 \\TOKEN_2"
- uri = CGI.escape("http://www.yahoo.com")
- rpv = %Q{<a class="rwtk_NumberedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">[1]</a> <a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[2]</a> [http://www.rubyforge.org]}
- res = %Q{<a class="rwtk_NumberedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">[1]</a> <a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[2]</a> [http://www.rubyforge.org]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NamedLinks
- token = Ruwiki::Wiki::NamedLinks
- content = "[http://www.yahoo.com Yahoo!] [http://www.ruby-lang.org Ruby] \\[http://www.rubyforge.org RubyForge]"
- tkv = "TOKEN_0 TOKEN_1 \\TOKEN_2"
- uri = CGI.escape("http://www.yahoo.com")
- rpv = %Q{<a class="rwtk_NamedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">Yahoo!</a> <a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
- res = %Q{<a class="rwtk_NamedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">Yahoo!</a> <a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ExternalLinks
- token = Ruwiki::Wiki::ExternalLinks
- content = "http://www.yahoo.com http://www.ruby-lang.org \\http://www.rubyforge.org"
- tkv = "TOKEN_0 TOKEN_1 \\TOKEN_2"
- uri = CGI.escape("http://www.yahoo.com")
- rpv = %Q{<a class="rwtk_ExternalLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">http://www.yahoo.com</a> <a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
- res = %Q{<a class="rwtk_ExternalLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">http://www.yahoo.com</a> <a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_HRule
- token = Ruwiki::Wiki::HRule
- content = "----\n\\----"
- tkv = "TOKEN_0\n\\TOKEN_1"
- rpv = %Q(<hr class="rwtk_HRule" />\n----)
- res = %Q(<hr class="rwtk_HRule" />\n----)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLink
- token = Ruwiki::Wiki::ProjectCrossLink
- content = "Ruwiki::ChangeLog \\Ruwiki::To_Do Ruwiki::NotExist \\Ruwiki::NotExist"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLinkWikipedia
- token = Ruwiki::Wiki::ProjectCrossLinkWikipedia
- content = "Ruwiki::[[ChangeLog]] \\Ruwiki::[[To_Do]] Ruwiki::[[Does Not Exist]] \\Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 Ruwiki::[[_invalid]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectIndex
- token = Ruwiki::Wiki::ProjectIndex
- content = "::Ruwiki \\::Ruwiki ::Newproject \\::Newproject"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikiLinks
- token = Ruwiki::Wiki::WikiLinks
- content = "ProjectIndex \\ProjectIndex AustinZiegler \\AustinZiegler Alan_Chen \\Alan_Chen"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikipediaLinks
- token = Ruwiki::Wiki::WikipediaLinks
- content = "[[ProjectIndex]] \\[[ProjectIndex]] [[Austin Ziegler]] \\[[Austin Ziegler]] [[_Alan Chen]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 [[_Alan Chen]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Abbreviations
- token = Ruwiki::Wiki::Abbreviations
- content = "@{matz}\n@{}\n\\@{matz}"
- tkv = "TOKEN_0\nTOKEN_1\n\\TOKEN_2"
- rpv = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
- res = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Headings
- token = Ruwiki::Wiki::Headings
- content = "= header 1\n== header 2\n=== header 3\n==== header 4\n===== header 5\n====== header 6\n======= header 7->6\n\\== noheader 2\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\nTOKEN_6\n\\TOKEN_7\n"
- rpv = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n== noheader 2\n)
- res = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n<p class="rwtk_Paragraph">== noheader 2\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Blockquotes
- token = Ruwiki::Wiki::Blockquotes
- content = ": level 1\n:: level 2\n::: level 3\n: level 1, para 2\n\\: not a blockquote\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<blockquote class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n: not a blockquote\n)
- res = %Q(<blockquote class="rwtk_Blockquotes">level 1<blockquote class="rwtk_Blockquotes">level 2<blockquote class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n: not a blockquote\n)
- __process(token, content, tkv, rpv, res)
-
- content = "> level 1\n>> level 2\n>>> level 3\n> level 1, para 2\n\\> not a blockquote\n"
- tkv = "TOKEN_5\nTOKEN_6\nTOKEN_7\nTOKEN_8\n\\TOKEN_9\n"
- rpv = %Q(<blockquote type="cite" class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- res = %Q(<blockquote type="cite" class="rwtk_Blockquotes">level 1<blockquote type="cite" class="rwtk_Blockquotes">level 2<blockquote type="cite" class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Definitions
- token = Ruwiki::Wiki::Definitions
- content = "; word1 : val1\n;; word2 : val2\n;;; word3 : val3\n; word1/2 : val1/2\n\\; not-a-word : not-a-val\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd></dl></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl></dl>\n<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
- res = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
-
-# __display(token, content)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Lists
- content = "* level 1\n** level 2\n*** level 3\n*** level 3, item 2\n** level 2, item 2\n* level 1, item 2\n\\* not an item\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\n\\TOKEN_6\n"
- rpv = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ul></ul>\n<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- res = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ul><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n## level 2\n### level 3\n### level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_7\nTOKEN_8\nTOKEN_9\nTOKEN_10\nTOKEN_11\nTOKEN_12\n\\TOKEN_13\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ol><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n*# level 2\n*** level 3\n*#* level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_14\nTOKEN_15\nTOKEN_16\nTOKEN_17\nTOKEN_18\nTOKEN_19\n\\TOKEN_20\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ol></ul>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
- end
-
-
- def test_RubyTalkLinks
- token = Ruwiki::Wiki::RubyTalkLinks
- content = "[ruby-talk:12345] \\[ruby-talk:12345]"
- tkv = "TOKEN_0 \\TOKEN_1"
-# rpv = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
- rpv = %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
-# res = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
- res = %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_OtherRubyLinks
- token = Ruwiki::Wiki::OtherRubyLinks
- content = "[ruby-list:123] \\[ruby-list:123] [ruby-doc:123] \\[ruby-doc:123] [ruby-core:123] \\[ruby-core:123] [ruby-dev:123] \\[ruby-dev:123] [ruby-ext:123] \\[ruby-ext:123] [ruby-math:123] \\[ruby-math:123]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5 TOKEN_6 \\TOKEN_7 TOKEN_8 \\TOKEN_9 TOKEN_10 \\TOKEN_11"
- rpv = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
- res = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
-
- __process(token, content, tkv, rpv, res)
- end
-end
diff --git a/ruwiki/tags/release-0.9.3/tests/testall.rb b/ruwiki/tags/release-0.9.3/tests/testall.rb
deleted file mode 100755
index f2e9100..0000000
--- a/ruwiki/tags/release-0.9.3/tests/testall.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-$stderr.puts "Checking for test cases:"
-Dir['tc_*.rb'].each do |testcase|
- $stderr.puts "\t#{testcase}"
- load testcase
-end
-$stderr.puts " "
diff --git a/ruwiki/trunk/Rakefile b/ruwiki/trunk/Rakefile
deleted file mode 100644
index e1739e4..0000000
--- a/ruwiki/trunk/Rakefile
+++ /dev/null
@@ -1,207 +0,0 @@
-#! /usr/bin/env rake
-$LOAD_PATH.unshift('lib')
-
-require 'rubygems'
-require 'rake/gempackagetask'
-require 'ruwiki'
-require 'ruwiki/utils'
-require 'ruwiki/utils/manager'
-require 'zlib'
-
-DISTDIR = "ruwiki-#{Ruwiki::VERSION}"
-TARDIST = "../#{DISTDIR}.tar.gz"
-
-DATE_RE = %r<(\d{4})[./-]?(\d{2})[./-]?(\d{2})(?:[\sT]?(\d{2})[:.]?(\d{2})[:.]?(\d{2})?)?>
-
-if ENV['RELEASE_DATE']
- year, month, day, hour, minute, second = DATE_RE.match(ENV['RELEASE_DATE']).captures
- year ||= 0
- month ||= 0
- day ||= 0
- hour ||= 0
- minute ||= 0
- second ||= 0
- ReleaseDate = Time.mktime(year, month, day, hour, minute, second)
-else
- ReleaseDate = nil
-end
-
-desc "Run Ruwiki unit tests."
-task :test do |t|
- require 'test/unit/testsuite'
- require 'test/unit/ui/console/testrunner'
-
- runner = Test::Unit::UI::Console::TestRunner
-
- $LOAD_PATH.unshift('tests')
- $stderr.puts "Checking for test cases:" if t.verbose
- Dir['tests/tc_*.rb'].each do |testcase|
- $stderr.puts "\t#{testcase}" if t.verbose
- load testcase
- end
-
- suite = Test::Unit::TestSuite.new("Ruwiki Tests")
-
- ObjectSpace.each_object(Class) do |testcase|
- suite << testcase.suite if testcase < Test::Unit::TestCase
- end
-
- runner.run(suite)
-end
-
-task :clean_data do
- Dir["data/**/*"].each do |file|
- FileUtils.rm_f(file) if file =~ /(?:rdiff|lock|~)$/
- end
-end
-
-desc "Build the default Ruwiki deployment package."
-task :package_data => [ :clean_data ] do
- Ruwiki::Utils::Manager.package(".", ".", nil, false)
-end
-
-task :make_readonly do
- data = nil
- Dir["data/**/*.ruwiki"].each do |file|
- File.open(file, "rb") { |f| data = f.read }
- FileUtils.cp(file, "#{file}.orig")
- if data =~ %r{properties!editable:}o
- data.gsub!(%r{^properties!editable:[ \t].*?$}, "properties!editable:\tfalse")
- else
- data << "properties!editable:\tfalse\n"
- end
- File.open(file, "wb") { |out| out.write(data) }
- end
-end
-
-task :clean_readonly do
- Dir["data/**/*.ruwiki"].each do |file|
- orig = "#{file}.orig"
- FileUtils.mv(orig, file) if File.exists?(orig)
- end
-end
-
-spec = Gem::Specification.new do |s|
- s.name = %q(ruwiki)
- s.version = Ruwiki::VERSION
- s.summary = %q{A simple, extensible, and fast Wiki-clone.}
-
- s.add_dependency('diff-lcs', '~> 1.1.2')
- s.add_dependency('archive-tar-minitar', '~> 0.5.1')
-
- s.has_rdoc = true
- s.rdoc_options = ["--title", "Ruwiki - An Extensible Wiki", "--main", "Readme.tarfile", "--line-numbers"]
- s.extra_rdoc_files = %w(Readme.tarfile Readme.rubygems)
-
- s.bindir = 'bin'
- s.executables = Dir['bin/**/*'].delete_if do |item|
- item =~ %r{(?:\bCVS\b|\.svn\b|[Rr]akefile|install.rb$|~$|gem(?:spec)?$)}
- end.map { |item| item.gsub(%r{^bin/}, "") }
- s.autorequire = %q{ruwiki}
- s.require_paths = %w{lib}
-
- s.test_files = %w{tests/testall.rb}
-
- files = Dir["**/*"].delete_if do |item|
- item =~ %r{\bCVS\b |
- \.svn\b |
- \.bak$ |
- [Rr]akefile |
- install\.rb$ |
- ~$ |
- gem(spec)?$ |
- lib/archive |
- lib/diff |
- \.ruwiki\.orig$}x
- end
- files << "ruwiki.pkg"
- s.files = files
-
- s.author = %q{Austin Ziegler and Alan Chen}
- s.email = %q{ruwiki-discuss@rubyforge.org}
- s.rubyforge_project = %q(ruwiki)
- s.homepage = %q{http://ruwiki.rubyforge.org/}
-
- description = []
- File.open("Readme.rubygems") do |file|
- file.each do |line|
- line.chomp!
- break if line.empty?
- description << "#{line.gsub(/\[\d\]/, '')}"
- end
- end
- s.description = description[2..-1].join(" ")
-end
-desc "Build the RubyGem for Ruwiki."
-task :gem => [ :test ]
-task :gem => [ :update_version ]
-task :gem => [ :package_data ]
-task :gem => [ :make_readonly ]
-Rake::GemPackageTask.new(spec) do |g|
- g.need_tar = false
- g.need_zip = false
- g.package_dir = ".."
-end
-
-VERSION_STRING_RE = %r{\\?%RV#%}
-
-desc "Update the version of Ruwiki to #{Ruwiki::VERSION} in documentation files."
-task :update_version do
- FileList["data/**/*.ruwiki", "Readme*"].to_a.each do |file|
- data = File.read(file)
- data.gsub!(VERSION_STRING_RE) do |match|
- if match[0] == '\\'
- match
- else
- Ruwiki::VERSION
- end
- end
- File.open(file, "wb") { |f| f.write(data) }
- end
-end
-
-desc "Build a Ruwiki .tar.gz distribution."
-task :tar => [ TARDIST ]
-file TARDIST => [ :test, :update_version ] do |t|
- current = File.basename(Dir.pwd)
- Dir.chdir("..") do
- begin
- files = Dir["#{current}/**/*"].select { |dd| dd !~ %r{(?:/CVS/?|~$)} }
- files.delete_if { |dd| dd =~ %r{Rakefile} }
- files.map! do |dd|
- mtime = ReleaseDate || File.stat(dd).mtime
- ddnew = dd.gsub(/^#{current}/, DISTDIR)
- if File.directory?(dd)
- { :name => ddnew, :mode => 0755, :dir => true, :mtime => mtime }
- else
- if dd =~ %r{bin/}
- mode = 0755
- else
- mode = 0644
- end
- data = File.read(dd)
- { :name => ddnew, :mode => mode, :data => data, :size => data.size,
- :mtime => mtime }
- end
- end
-
- ff = File.open(t.name.gsub(%r{^\.\./}o, ''), "wb")
- gz = Zlib::GzipWriter.new(ff)
- tw = Archive::Tar::Minitar::Writer.new(gz)
-
- files.each do |entry|
- if entry[:dir]
- tw.mkdir(entry[:name], entry)
- else
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
- end
- end
- ensure
- tw.close if tw
- gz.close if gz
- end
- end
-end
-
-desc "Build everything."
-task :default => [ :tar, :gem, :clean_readonly ]
diff --git a/ruwiki/trunk/Readme.rubygems b/ruwiki/trunk/Readme.rubygems
deleted file mode 100644
index 240fe57..0000000
--- a/ruwiki/trunk/Readme.rubygems
+++ /dev/null
@@ -1,86 +0,0 @@
-Ruwiki %RV#%
-------------
-Ruwiki is a simple, extensible Wiki-clone written in Ruby. It supports both
-CGI and WEBrick interfaces, templates, and CSS formatting. This Wiki differs
-from most other Wikis in that it supports project namespaces, so that two
-topics may be named the same for differing projects without colliding or
-having to resort to odd naming conventions. Please see the ::Ruwiki project in
-the running Wiki for more information. Ruwiki %RV#% has German and Spanish
-translations available.
-
-Upgrading
----------
-Ruwiki %RV#% has a flatfile format that is incompatible with older versions of
-Ruwiki. If you are upgrading from one of these versions, you must use the
-bin/convert. The simple case will be (assuming that your data files are in
-./data):
-
- % convert ./data
-
-The convert utility is automatically installed by RubyGems.
-
-Requirements
-------------
-Ruwiki currently requires:
- * Ruby 1.8
- * Diff::LCS 1.2.0
- * Archive::Tar::Minitar 0.5.1
-
-The YAML backend requires Ruby 1.8.2 after preview2. You should have been
-prompted to load these dependencies on installation.
-
-Quick Start (WEBrick Readonly)
-------------------------------
-1. Type:
-
- % ruwiki_servlet --gem-data
-
-2. Point your web browser to <http://localhost:8808/>.
-
-Quick Start (CGI)
------------------
-1. Create a directory in a place that your webserver can execute CGI programs
- and type:
-
- % ruwiki install cgi,data --to <directory>
-
-2. Ensure that ruwiki.cgi is executable on your webserver.
-3. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Create a directory to store your data and templates and type:
-
- % ruwiki install data --to <directory>
-
-2. Type:
-
- % ruwiki_servlet
-
-3. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of Ruwiki
-without editing the servlet; use ruwiki_servlet --help for more information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-Credits
--------
-* This software includes portions of Diff::LCS by Austin Ziegler, available
- for download from the Ruwiki RubyForge project:
- [http://rubyforge.org/projects/ruwiki/]
-* Portions of this software are derived from Dave Thomas's RDoc system, now
- part of the Ruby distribution.
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen].
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández].
-
-$Id$
diff --git a/ruwiki/trunk/Readme.tarfile b/ruwiki/trunk/Readme.tarfile
deleted file mode 100644
index a3f4ea6..0000000
--- a/ruwiki/trunk/Readme.tarfile
+++ /dev/null
@@ -1,65 +0,0 @@
-Ruwiki %RV#%
-------------
-Ruwiki is a simple, extensible Wiki-clone written in Ruby. It supports both
-CGI and WEBrick interfaces, templates, and CSS formatting. This Wiki differs
-from most other Wikis in that it supports project namespaces, so that two
-topics may be named the same for differing projects without colliding or
-having to resort to odd naming conventions. Please see the ::Ruwiki project in
-the running Wiki for more information. Ruwiki %RV#% has German and Spanish
-translations available.
-
-Upgrading
----------
-Ruwiki %RV#% has a flatfile format that is incompatible with versions of
-Ruwiki older than 0.8.0. If you are upgrading from one of these versions, you
-must use the bin/convert. The simplest case will be (assuming that your data
-files are in ./data):
-
- % bin/convert ./data
-
-Requirements
-------------
-Ruwiki currently requires:
- * Ruby 1.8
- * Diff::LCS 1.2.0
- * Archive::Tar::Minitar 0.5.1
-
-The YAML backend requires Ruby 1.8.2 after preview2. Portions of Diff::LCS and
-Archive::Tar::Minitar have been included in this version of Ruwiki.
-
-Quick Start (CGI)
------------------
-1. Place the Ruwiki directory in a place that your webserver can execute CGI
- programs and ensure that ruwiki.cgi is executable on your webserver.
-2. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Run bin/ruwiki_servlet (ruby bin/ruwiki_servlet under Windows).
-2. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of Ruwiki
-without editing the servlet; use ruwiki_servlet --help for more information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-Credits
--------
-* This software includes portions of Diff::LCS and Archive::Tar::Minitar by
- Austin Ziegler, available for download from the Ruwiki RubyForge project:
- [http://rubyforge.org/projects/ruwiki/]
-* Portions of this software are derived from Dave Thomas's RDoc system, now
- part of the Ruby distribution.
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen].
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández].
-
-$Id$
diff --git a/ruwiki/trunk/bin/ruwiki b/ruwiki/trunk/bin/ruwiki
deleted file mode 100644
index 251a140..0000000
--- a/ruwiki/trunk/bin/ruwiki
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'ruwiki/utils'
-require 'ruwiki/utils/manager'
-
- # RPA Maintainers: Change this to the appropriate location on installation.
- # This is the right place for RubyGems, basically.
-ss = "#{File.dirname(File.expand_path(__FILE__))}/.."
-
-Ruwiki::Utils::Manager.shared = ss
-
-exit Ruwiki::Utils::Manager.run(ARGV)
diff --git a/ruwiki/trunk/bin/ruwiki.cgi b/ruwiki/trunk/bin/ruwiki.cgi
deleted file mode 100644
index 2e1ebee..0000000
--- a/ruwiki/trunk/bin/ruwiki.cgi
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
-config_file = File.join(Dir.pwd, Ruwiki::Config::CONFIG_NAME)
-
-if File.exists?(config_file)
- wiki.load_config(config_file)
- config = Ruwiki::Config.read(config_file)
- if config.webmaster.nil? or config.webmaster.empty?
- config.webmaster = "webmaster@domain.tld"
- end
-else
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
- wiki.config.webmaster = "webmaster@domain.tld"
-
-# wiki.config.debug = false
-# wiki.config.title = "Ruwiki"
-# wiki.config.default_page = "ProjectIndex"
-# wiki.config.default_project = "Default"
- # This next defaults to 'flatfiles'. Conversion of the default data will
- # be necessary to use other formats.
-# wiki.config.storage_type = 'flatfiles'
-# wiki.config.storage_options[wiki.config.storage_type][:data_path] = "./data/"
- wiki.config.storage_options[wiki.config.storage_type][:extension] = "ruwiki"
-# wiki.config.template_path = "./templates/"
-# wiki.config.template_set = "default"
-# wiki.config.css = "ruwiki.css"
-# wiki.config.time_format = "%H:%M:%S"
-# wiki.config.date_format = "%Y.%m.%d"
-# wiki.config.datetime_format = "%Y.%m.%d %H:%M:%S"
-end
-
-wiki.config!
-wiki.run
diff --git a/ruwiki/trunk/bin/ruwiki_convert b/ruwiki/trunk/bin/ruwiki_convert
deleted file mode 100644
index c290041..0000000
--- a/ruwiki/trunk/bin/ruwiki_convert
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
- # Load all of the known backends.
-require 'ruwiki/utils'
-require 'ruwiki/backend/flatfiles'
-require 'ruwiki/utils/converter'
-
-exit Ruwiki::Utils::Converter.run(ARGV)
diff --git a/ruwiki/trunk/bin/ruwiki_service.rb b/ruwiki/trunk/bin/ruwiki_service.rb
deleted file mode 100644
index bd66d49..0000000
--- a/ruwiki/trunk/bin/ruwiki_service.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'win32/service'
-require 'ruwiki/utils/servletrunner'
-
-class Ruwiki::Utils::Daemon < Win32::Daemon
- LOCATION = File.dirname(File.expand_path(__FILE__))
-
- def initialize
- @logfile = File.open(File.join(LOCATION, "ruwiki_service.log"), "ab+")
- rescue Exception => e
- File.open(File.join(LOCATION, "temp.log"), "a+") do |f|
- f.puts "Logfile error: #{e}"
- f.puts "Backtrace:\n#{e.backtrace.join(', ')}"
- end
- exit
- end
-
- def service_main
- ARGV.replace(["--config", File.join(LOCATION, Ruwiki::Config::CONFIG_NAME),
- "--logfile", File.join(LOCATION, "ruwiki_servlet.log")])
- Ruwiki::Utils::ServletRunner.run(ARGV, @logfile, @logfile, @logfile)
- rescue Exception => e
- file = LOCATION + '/temp.log'
- File.open(file, "a+") do |f|
- f.puts "Error: #{e}"
- f.puts "Backtrace: #{e.backtrace.join(', ')}"
- end
- exit
- end
-end
-
-daemon = Ruwiki::Utils::Daemon.new
-daemon.mainloop
diff --git a/ruwiki/trunk/bin/ruwiki_servlet b/ruwiki/trunk/bin/ruwiki_servlet
deleted file mode 100644
index 224ab3f..0000000
--- a/ruwiki/trunk/bin/ruwiki_servlet
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # 1) Try to load Ruwiki from the local directory structure (e.g., ./lib/
- # and ../lib/).
- # 2) Try to load Ruwiki from the directory structure of the running script
- # (e.g., File.dirname($0)/lib and File.dirname($0)/../lib).
- # 3) Try to load Ruwiki from the directory structure of the current file
- # (e.g., File.dirname(__FILE__)/lib and File.dirname(__FILE__)/../lib).
- # 4) Try to load Ruwiki from an unmodified $LOAD_PATH, e.g., site_ruby.
- # 5) Try to load Ruwiki from Rubygems.
- # 6) Fail hard.
-load_state = 1
-
-$LOAD_PATH.unshift "#{Dir.pwd}/lib", "#{Dir.pwd}/../lib"
-
-begin
- require 'ruwiki'
-rescue LoadError
- if (1..3).include?(load_state)
- $LOAD_PATH.shift # Oh, what I'd give for $LOAD_PATH.shift(2)
- $LOAD_PATH.shift
- end
-
- load_state += 1
-
- case load_state
- when 2
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib", "#{File.dirname($0)}/../lib"
- when 3
- $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib", "#{File.dirname(__FILE__)}/../lib"
- when 5
- require 'rubygems'
- when 6
- raise
- end
- retry
-end
-
-require 'ruwiki/utils/servletrunner'
-
-exit Ruwiki::Utils::ServletRunner.run(ARGV)
diff --git a/ruwiki/trunk/contrib/enscript-token.rb b/ruwiki/trunk/contrib/enscript-token.rb
deleted file mode 100644
index 08c2018..0000000
--- a/ruwiki/trunk/contrib/enscript-token.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# This token by Javier Fontan <jfontan@pc3d.cesga.es>.
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-require "open3"
-
-class Ruwiki::Wiki::CodeColor < Ruwiki::Wiki::Token
- def self.rank
- 0
- end
-
- def self.regexp
- %r<\{\{\{(?::(\w+)\b)?(.*?)\}\}\}>m
- end
-
- def replace
- cap = @match.captures
-
- if cap[0].nil?
- language = "ruby"
- else
- language = cap[0]
- end
-
- text = cap[1]
-
- i, o, e = Open3.popen3("enscript -B --color=emacs -Whtml -E#{language} -o -")
- i.print text
- i.close
-
- re_script = %r{(<pre>.*?</pre>)}mio
- c = o.readlines[1..-1].join("\n")
- re_script.match(c).captures[0]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<pre>\n}im, '<pre class="rwtk_CodeColor>')
- content.gsub!(%r{\n</pre>}im, '</pre>')
- content.gsub!(%r{<font color="(.+?)">}im, '<span style="color: \1">')
- content.gsub!(%r{</font>}im, '</span>')
- content.gsub!(%r{<B>}i, '<b>')
- content.gsub!(%r{</B}i, '</b>')
- content
- end
-end
diff --git a/ruwiki/trunk/contrib/rublog_integrator.rb b/ruwiki/trunk/contrib/rublog_integrator.rb
deleted file mode 100644
index 504d9d6..0000000
--- a/ruwiki/trunk/contrib/rublog_integrator.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This integrator based on work by Chad Fowler.
-#
-# $Id$
-#++
-
-# NOTE: This is not currently compatible with Ruwiki 0.8.0
-#
-# require 'ruwiki/wiki/handler'
-
-class Ruwiki::RubLogHandler < Ruwiki::Wiki::Handler
- def initialize(entries)
- @entries = entries
- end
-
- def page_exists?(page, project)
-# puts "pP: #{page}, #{project}"
- matches = @entries.find_entries_with_root_name(page)
- matches.each { |entry| return true if(entry.dir_name =~ /#{project}/) }
- false
- end
-
- def project_exists?(project)
- true
- end
-
- def script_url
-# request.environment['SCRIPT_NAME']
-# !!SMELL!!
- ENV['SCRIPT_NAME']
- end
-end
-
- # An experimental convertor for Ruwiki
-class RuwikiConvertor < BaseConvertor
- handles "wiki"
-
- def get_title(f)
- title = "---Untitled---"
- loop do
- line = f.gets
- if(line =~ /^topic: (\S+)/) then
- title = $1
- elsif(line =~ /^\#EHDR/) then
- return title
- end
- end
- end
-
- def convert_html(file_entry, f, all_entries)
- title = get_title(f)
- markup = Ruwiki::Wiki.new('Default', Ruwiki::RubLogHandler.new(all_entries))
- body = markup.parse(f.readlines.join("\n"), file_entry.dir_name)
- HTMLEntry.new(title, body, self)
- end
-
- # FIXME: Need to check this one
- def convert_plain(file_name, f, all_entries)
- f.read
- end
-end
diff --git a/ruwiki/trunk/data/Default/ProjectIndex.ruwiki b/ruwiki/trunk/data/Default/ProjectIndex.ruwiki
deleted file mode 100644
index 28807a7..0000000
--- a/ruwiki/trunk/data/Default/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,48 +0,0 @@
-page!content: = Ruwiki
- Ruwiki is a simple, extensible Wiki written in Ruby. It supports both
- CGI and \WEBrick interfaces, templates, and CSS formatting.
- Additionally, it supports project namespaces, so that two pages can be
- named the same for differing projects without colliding or odd naming
- conventions. Please see the ::Ruwiki project for more information.
-
- Ruwiki is also an internationalised Wiki, although more testing,
- especially testing with multibyte character encodings and Unicode
- (UTF-8) is required. There are German and Spanish localisations of the
- messages included with the Ruwiki distribution.
-
- The current version is %RV#%. Enhancements and changes include:
- * a deployment system, whereby Ruwiki deployments can be installed from a package manager like that used for RPA (rpa-base) or \RubyGems (see Ruwiki::RuwikiUtilities);
- * support for Ruwiki as a Windows service on NT, 2000, XP, and 2003 systems;
- * demotion of YAML and Marshal storage types to formats of the Flatfiles storage type;
- * external user authentication (currently to \RubyForge only);
- * antispam efforts including robot and IP exclusion and URL redirection (see Ruwiki::[[Antispam]]); and
- * protection against cross-site scripting (XSS) attacks with HTML and CSS cleaning.
- The full list of changes can be found in Ruwiki::ChangeLog, with
- discussions of various features in Ruwiki::WikiMarkup,
- Ruwiki::Configuring_Ruwiki, and Ruwiki::Extending_Ruwiki.
-
- If you are upgrading from a version of Ruwiki older than 0.8.0, please
- read Ruwiki::RuwikiUtilities.
-
- Certain Ruwiki \APIs are considered stable at this point, others will
- be changing leading up to 1.0. Some of this is discussed in
- Ruwiki::To_Do, with further architectural discussions in
- Ruwiki::[[Roadmap]].
-
- %projects()
-
- Please review ::Tutorial and ::Ruwiki if you are unfamiliar with the
- concept of Wikis in general. If you want to play with \WikiFormatting
- for Ruwiki, use the Ruwiki::SandBox.
-
- [http://rubyforge.org/projects/ruwiki Ruwiki development] is hosted at
- [http://rubyforge.org RubyForge]. The current release of Ruwiki can
- always be [http://rubyforge.org/frs/?group_id=84 downloaded] from
- \RubyForge or the development (unstable) version can be obtained from
- CVS.
-properties!project: Default
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/Antispam.ruwiki b/ruwiki/trunk/data/Ruwiki/Antispam.ruwiki
deleted file mode 100644
index d84ca5a..0000000
--- a/ruwiki/trunk/data/Ruwiki/Antispam.ruwiki
+++ /dev/null
@@ -1,83 +0,0 @@
-page!content: = Ruwiki %RV#% Antispam
- Wiki-spam, like email spam, is a major problem. Ruwiki is going to have
- extensive configurable tools for fighting spam. As it is, there are
- several tools built into Ruwiki to assist in the fight against these
- pond scum, but the tool development is certainly not complete.
-
- == External URI Redirection
- Although this will not greatly assist in the reduction of wiki spam,
- all external \URIs are redirected through an URI on Google that is
- designed specifically to remove \PageRank from links. The mechanism
- currently works on all manually-specified external \URIs and is not
- configurable without changing the URI tokenisation code. Thus, links
- that are generated by \[ruby-talk:12345] will not be redirected through
- Google, but direct links will be.
-
- New to Ruwiki 0.9.1, \URIs may be whitelisted with
- <tt>./data/clean.uri</tt>. The list of \URIs in <tt>clean.uri</tt> are
- &#8220;extended&#8221; Ruby regular expressions, one optional
- expression to a line. Spaces are not significant and comments are
- allowed. If you want to recognise a space in your regular expression,
- do so either with a character class ([ ]) or the whitespace
- meta-character (\s). Hash marks must be escaped (\#) or they will be
- treated as comment markers. Blank or comment-only lines are ignored.
- All other lines will be joined together.
-
- As noted, this will not necessarily reduce wiki spam, but it will deny
- spammers the entire benefit of spamming a wiki implemented with Ruwiki.
-
- == Reacting to Spammers and Robots
- Ruwiki %RV#% includes the ability to present alternative versions of
- itself to certain user agents and/or IP addresses based on a list. In
- the future, both the lists and the faces presented will be configurable
- (highly configurable, at that -- watch this space), but in this version
- of Ruwiki, there are three possible versions to be displayed:
- # Normal Ruwiki. This is a normally displayable and editable wiki.
- # Read-only Ruwiki. This is displayed to benign robots and users who have demonstrated that they cannot be trusted with edit access. The primary effect is to make command pages neither indexable, archivable, nor link-followable, and to remove certain links from visibility for these user agents.
- # Forbidden Ruwiki. The user gets an HTTP response of 403 Forbidden. This is displayed to malign (email-collecting) robots and users who have demonstrated that they are malicious and bent upon defacing the wiki.
-
- While Ruwiki provides these lists, and provides an extensive list of
- both malign and benign robots, it is up to the administrators of the
- wiki to ensure that they are kept up to date.
-
- The lists themselves are &#8220;extended&#8221; Ruby regular
- expressions, one optional expression to a line. Spaces are not
- significant and comments are allowed. If you want to recognise a space
- in your regular expression, do so either with a character class ([ ]) or
- the whitespace meta-character (\s). Hash marks must be escaped (\#) or
- they will be treated as comment markers. Blank or comment-only lines are
- ignored. All other lines will be joined together.
-
- foo
- bar
-
- becomes:
-
- %r{foo|bar}x
-
- The file are stored in the data directory for the running instance of
- Ruwiki (e.g., <tt>./data</tt>):
-
- ./data/agents.banned
- ./data/agents.readonly
- ./data/hostip.banned
- ./data/hostip.readonly
-page!footer:
-page!header:
-properties!create-date: 1103593880
-properties!creator:
-properties!creator-ip: UNKNOWN
-properties!edit-comment:
-properties!edit-date: 1103593880
-properties!editable: true
-properties!editor:
-properties!editor-ip: 127.0.0.1
-properties!entropy: 0.0
-properties!html-headers:
-properties!indexable: false
-properties!project: Ruwiki
-properties!title: Antispam
-properties!topic: Antispam
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/BugTracking.ruwiki b/ruwiki/trunk/data/Ruwiki/BugTracking.ruwiki
deleted file mode 100644
index 5f24cc7..0000000
--- a/ruwiki/trunk/data/Ruwiki/BugTracking.ruwiki
+++ /dev/null
@@ -1,32 +0,0 @@
-page!content: = Ruwiki %RV#% Bug Tracking
- This page is for tracking bugs in Ruwiki. Only bugs from recent
- distributions are tracked. In addition to this source-based bug
- tracking, there is the [http://rubyforge.org RubyForge]
- [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug
- tracker] for Ruwiki.
-
- Those interested in Ruwiki development may also find the Ruwiki::To_Do
- list and the Ruwiki::[[Roadmap]] useful. The format of the bug list is
- &ldquo;version: description&rdquo;.
-
- == Open Bugs
- The version number is the version in which the bug was first reported.
- * 0.6.2: Not all formatting is applied consistently. The token rankings may need adjusting. Eivind Eklund has suggested a scheme that may help with this, but it will require architectural adjustment and will probably slow things down.
-
- ----
- == Closed Bugs
- The version number is the version in which the bug was fixed.
- * 0.9.0: Fixed a problem with old page edits being applied inappropriately.
- * 0.8.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=707&group_id=84&atid=407 Sub-Numbered bullets don&rsquo;t increment]. Fixed a list numbering problem. I think that lists are a bit slower now, but they are completely accurate.
- * 0.7.0: Fixed a link detection problem in \[wikiword] format. Thanks to [mailto:eivind@FreeBSD.org Eivind Eklund] for the patch.
- * 0.7.0: Fixed a problem with &lt;pre&gt; paragraph detection and generation.
- * 0.7.0: Fixed a problem with &lt;p&gt; generation.
- * 0.7.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=197&group_id=84&atid=407 Run-away ruby on some links in default distribution]. This may be related to a runaway header problem that was reported to me on IRC some time back that I believe has been fixed. Please advise.
- * 0.6.1: Projects aren&rsquo;t created appropriately.
- * 0.6.1: Saving without editing (or repost) appears to cause problems. A fix has been applied to attempt to address this. Pages that have not been changed will not be saved.
-properties!project: Ruwiki
-properties!title: BugTracking
-properties!topic: BugTracking
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/ChangeLog.ruwiki b/ruwiki/trunk/data/Ruwiki/ChangeLog.ruwiki
deleted file mode 100644
index da77bec..0000000
--- a/ruwiki/trunk/data/Ruwiki/ChangeLog.ruwiki
+++ /dev/null
@@ -1,120 +0,0 @@
-page!content: = Ruwiki %RV#% ChangeLog
- Uncompleted to-do items can be found in To_Do. Bugs in Ruwiki are
- tracked in BugTracking.
-
- == 0.9.4
- * Fixed a \<pre> rendering problem.
- * Added the ability to escape HTML tags. The opening and closing tags must be escaped independently, e.g., \\<pre> and \\</pre>.
-
- == 0.9.3
- * Fixed a deployment problem because a RPA-modified file was checked in, preventing it from working on RubyGems.
-
- == 0.9.2
- * Fixed a problem with token handling where the first token was nil.
-
- == 0.9.1
- * Fixed a couple of problems with the Ruwiki deployment system surrounding Win32::Service management.
- * Added a Google redirect exclusion list to the configuration.
- * Fixed a problem where last lines of code blocks may not be properly marked.
- * Changed relevant timestamps to UTC.
- * Fixed a problem with Google redirection not working.
- * Fixed a problem with some pages not being displayed as links in the topic listing; only affected some pages created with the Wikipedia form of naming.
- * Fixed a problem with tokens being redefined. Once a token is defined, its class is frozen; the token reader will silently ignore TypeError exceptions.
-
- == 0.9.0
- * Created a Ruwiki deployment system. Various steps were required to accomplish this:
- ** Moved executable files to bin/ for better packaging; moved core servlet code and other utilities to Ruwiki::Utils namespace.
- ** Renamed bin/convert to bin/ruwiki_convert. This will ultimately be moved into the ruwiki command.
- ** Refactored Flatfile format (section!\item:<Tab>value) to Ruwiki::Exportable, loosened the format restrictions to allow for either section!\item:<Tab>value or section!\item:<Space>value.
- ** Incorporated Ruwiki::Exportable into Ruwiki::Config to allow for the saving of configuration files.
- ** Incorporated Ruwiki::Exportable into Ruwiki::\Utils::ServletRunner to allow for the saving of configuration files.
- ** Added Ruwiki manager code for installation and management of Ruwiki deployments.
- ** Added code for running the Ruwiki servlet as a Windows service on Win32. (Currently minimally tested and unworking.)
- ** Added --central to bin/ruwiki_servlet, to run a read-only instance of Ruwiki using the centralised data from RPA or \RubyGems.
- * Removed YAML and Marshal storage types as separate classes and incorporated them as formats of the Flatfiles storage type. Added the 'format' option to the Flatfiles storage_options hash.
- * Added draft \APIs for authentication, robot exclusion, IP exclusion, and HTML cleaning.
- ** Implemented initial authentication for \RubyForge. It verifies a user against their current \RubyForge cookie.
- ** Implemented known robot list. It may require further refinement. It contains two classes of robots:
- *** Read-only: known to be good (like the Googlebot) or neutral (most other crawlers). They are permitted to read, index, and follow links on all non-command pages.
- *** Banned: known to be bad, essentially spam-crawlers. These robots will uniformly get a 403 Forbidden result.
- ** Implemented IP exclusion list. It may require further refinement. It contains two classes of IPs:
- *** Read-only: IP addresses that are not permitted to edit the wiki. They will be treated as read-only robot exclusion.
- *** Banned: known to be bad, essentially spam-crawlers. These IPs will uniformly get a 403 Forbidden result.
- ** HTML cleaning has been implemented.
- *** HTML entities &amp;, &lt;, and &gt; will be escaped.
- *** Only HTML tags and attributes from a &ldquo;known good&rdquo; list will be passed through unchanged.
- *** CSS properties display and visibility will be silently eliminated from embedded HTML.
- *** Although (mostly) valid XHTML is generated, Ruwiki does not currently support tags or attributes in namespaces. If and when this is enabled, it will be enabled on a namespace-by-namespace basis.
- * External URLs are redirected through a single point through the Google PageRank remover URI \http://www.google.com/url?sa=D&q=<em>uri</em>. There is no whitelisting for URIs at this point.
- * Added a Rakefile for packaging. Currently incomplete.
- * Modified the default template style to remove the bottom control bar, as it was blocking the last bit of text on some pages in lesser browsers.
- * Updated more documentation.
- * Added a message facility so that non-error messages can be communicated to the user.
- * Fixed a bug with submitting an old version of the code with an expired lock reverting changes. The changed versions are now merged automatically and re-presented to the user. It's a simplistic merge, to be improved in a later version of Ruwiki. A message is displayed to the user.
- * Modified searching for empty strings so that instead of throwing an error, a message is displayed to the user.
-
- == 0.8.0
- * AC: Added topic list (_topics) and project list (_projects) controls on templates and backend.
- * AZ: Added %topics() and %projects() tokens. See WikiMarkup for details.
- * AC: Added simple search on back-end (both project and global); search strings must be validated and cleansed before being sent to the back-end (the back-end must prepare the string for its own search mechanism). The back-end is wholly responsible for the searching of the pages.
- * AC: Added \RecentChanges list to backend and controls.
- * AZ: Changed default for Ruwiki::Config#storage_options[:flatfiles][:extension] to <tt>ruwiki</tt>.
- * AZ: Topic backlink search: searches for mentions of the topic in the other topics of the project.
- * AZ: New templating engine: The Rdoc templating engine has been greatly enhanced in preparation for some changes that will happen surrounding antispam capabilities.
- * AZ: Multiple flatfile-based backend support: tagged file (&ldquo;flatfiles&rdquo;), YAML (&ldquo;yaml&rdquo;), and Marshal (&ldquo;marshal&rdquo;).
- * AZ: A converter utility between backends.
- * AZ: Defined a canonical, extensible page transport format.
- * AZ: Defined a canonical, format-independent diff format.
- * AZ: Fixed list numbering problem. Modified lists to allow for mixed lists. See WikiMarkup for restrictions.
- * AZ: Removed automatic image conversion for \URIs that look like images. Now, images must be specified with the \[image:uri] format. See WikiMarkup for more details.
- * AZ: Fixed minor bugs in several tokens.
- * AZ: New look! Ruwiki now sports a new default look with CSS and template changes.
- * AZ: New look! Ruwiki has a &ldquo;simple&rdquo; template set.
- * AZ: New look! Ruwiki has a &ldquo;sidebar&rdquo; template set.
- * AZ: Fixed a long-standing bug with code tokens.
-
- == 0.7.0
- * Changed the tokenization API so that the #post_replace call is made at the Token class level instead of the instance level.
- * Improved HTML code generation.
- * Added servlet runner batch files for Windows. They <strong>will</strong> require modification to run properly.
- * Added %calendar(...) support. See WikiMarkup for more information.
-
- == 0.6.2
- * Removed dependencies on Ruwiki from a number of classes (Ruwiki::Backend, Ruwiki::Backend::Flatfiles, Ruwiki::Page, Ruwiki::Wiki, Ruwiki::Wiki::Tokens, and various tokens).
- * Ruwiki now initializes a \Ruwiki::BackendDelegator, which creates the requisite Ruwiki::Backend instance with Ruwiki::Config#storage_options.
- * Added German (Christian Neukirchen &lt;cneukirchin@yahoo.de&gt;) and Spanish translations (Mauricio Fernández &lt;batsman.geo@yahoo.com&gt;).
-
- == 0.6.1
- * Changed Ruwiki::Config#data_path to Ruwiki::Config#storage_options[:flatfiles][:data_path]. This represents a generalisation of storage type options so that the Ruwiki::Config object is not polluted with storage type options. Ruwiki::Config#storage_options keys should be the same Ruby Symbol as is used in Ruwiki::Config#storage_type.
- * Added Ruwiki::Config#storage_options[:flatfiles][:extension], based on a request by Chad Fowler. This allows you to have Project/\TopicFile actually stored as Project/\TopicFile.wiki if Ruwiki::Config#storage_options[:flatfiles][:extension] is set to <tt>wiki</tt>. The default for Ruwiki::Config#storage_options[:flatfiles][:extension] is <tt>nil</tt>.
- * Fixed incorrect references. I had been incorrectly attributing [http://sourceforge.net/projects/rdoc-wiki RDoc Wiki] to Dave Thomas. \RDoc Wiki is by Michael Neumann. However, the project I pulled from <strong>is</strong> by Dave Thomas, but it&rsquo;s [http://sourceforge.net/projects/rublog RubLog]. Apologies to both developers.
- * Added RuwikiTemplatingLibrary documentation.
- * Internationalized messages, except for the templating library.
- * Added configuration API for future work surrounding features. The existing wiki is mostly feature complete. Additional features (such as access controls) will be added through the feature interface.
- * Fixed project creation.
- * Fixed problems with \WikiWord links.
- * Added Wikipedia-style Wiki links (\[[list of words]]).
- * Fixed a potential problem with re-posted data or saving without editing.
- * Added the ability to put commands in the URL.
-
- == 0.6.0
- * Added Ruby mailing list reference support (e.g., \[ruby-talk:12345]).
- * Reorganised the code (again) to better support alternative frontends. Based, in part, on [http://sourceforge.net/projects/rublog RubLog] by Dave Thomas. (Reference corrected in 0.6.1.)
- * Added a [http://www.webrick.org WEBrick] servlet interface. Based, in part, on the \WEBrick servlet interface provided with \RubLog by Chad Fowler.
- * Added templates, using the [http://rdoc.sourceforge.net RDoc] template.rb library.
- * Changed the default topic to be \ProjectIndex instead of \DefaultProject.
- * Added a new \WikiWord format, \Wiki_Word_with_Spaces.
- * Completed lots of Ruwiki documentation.
- * Updated the save page.
- * Fixed a problem with the linking of project specific pages.
-
- == 0.5.0
- * Reorganized the code significantly to be easier to edit and extend.
- * Added abbreviation capabilities.
- * Cleaned up a lot of tokenizing code.
-properties!project: Ruwiki
-properties!title: ChangeLog
-properties!topic: ChangeLog
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/Configuring_Ruwiki.ruwiki b/ruwiki/trunk/data/Ruwiki/Configuring_Ruwiki.ruwiki
deleted file mode 100644
index bfb3c3b..0000000
--- a/ruwiki/trunk/data/Ruwiki/Configuring_Ruwiki.ruwiki
+++ /dev/null
@@ -1,150 +0,0 @@
-page!content: = Configuring Ruwiki %RV#%
- Ruwiki is configured similarly as both a CGI and a \WEBrick servlet.
- The biggest distinction is that because the Wiki servlet is created
- after the \WEBrick server is created (during the dispatch to the
- servlet), it is necessary to configure the wiki with a global
- Ruwiki::Config object stored in Ruwiki::Servlet.config. This must be a
- valid Ruwiki::Config object. In the examples below,
- <em>wiki.config</em> may be simply considered a random Ruwiki::Config
- object.
-
- > This has changed in Ruwiki 0.9.0 from a global configuration object
- > named $config.
-
- : Additional configuration options will be added from time to time. The
- : form for specifying configuration may be changed prior to 1.0.
-
- If you are looking for discussion on templates, this has been moved to
- Extending_Ruwiki.
-
- == Ruwiki Configuration Options
- === wiki.config.title
- This configuration option names the Wiki; by default this is
- <tt>Ruwiki</tt>. This affects the display of the home link and the
- &lt;title&gt; element of pages.
-
- === wiki.config.webmaster
- The email address for the webmaster. This is used in generating error
- reports that can be emailed to the wiki&rsquo;s webmaster.
-
- === wiki.config.language
- This sets the internationalisation mechanism. It must be one of the
- known two-letter ISO language codes or a module under Ruwiki::Lang
- matching that description. See Extending_Ruwiki for more information.
- Ruwiki's default language is English ('en'), but there are translations
- for Spanish ('es') and German ('de') included. Localization is
- currently per wiki instance. In a servlet environment, this may mean
- that only a single language is recognised.
-
- === wiki.config.default_page, wiki.config.default_project
- These options indicate what will happen when the wiki&rsquo;s URL is
- specified without any parameters (the default page in the default
- project is opened), when a topic is specified without a project (the
- topic is opened in the default project), and when a project is
- specified without a topic (the default page is opened in the project).
-
- === wiki.config.storage_type, wiki.config.storage_options
- <tt>wiki.config.storage_type</tt> specifies the back-end storage
- mechanism as a Ruby Symbol. Currently, <tt>'flatfiles'</tt>,
- is supported. See Extending_Ruwiki for more information.
-
- <tt>wiki.config.storage_options</tt> is a hash of option hashes for
- each known storage type known to the Wiki. This must use the same
- Symbol as <tt>wiki.config.storage_type</tt> as the top-level hash key.
-
- ==== ...storage_options['flatfiles']['data-path']
- The directory in which the wiki files will be found. By default, this
- is &ldquo;<tt>./data/</tt>&rdquo;.
-
- ==== ...storage_options['flatfiles']['format']
- Specifies the storage format for the flatfiles backend. The default
- format is 'exportable', but may be set to 'yaml' or 'marshal' as well.
- The 'yaml' format will not work reliably with versions of Ruby before
- 1.8.2 preview 3.
-
- ==== ...storage_options['flatfiles']['extension']
- The extension of the wiki files. By default, this is
- &ldquo;ruwiki&rdquo;. For those upgrading from a version of Ruwiki
- before 0.8.0, note that you must explicitly set this value to
- <tt>nil</tt> if you wish to have no extension.
-
- === wiki.config.template_path
- This specifies the paths where the Wiki templates will be found. The
- process running the Wiki must have read access to the template_path.
-
- === wiki.config.template_set, wiki.config.css
- These two options indicate which template set will be used. Three
- template sets are provided in the release package:
- &ldquo;default&rdquo;, &ldquo;simple&rdquo;, and &ldquo;sidebar&rdquo;.
- The only CSS file used initially is &ldquo;ruwiki.css&rdquo;. Templates
- work such that they will be found in
- <em>template_path</em>/<em>template_set</em>. All CSS files are loaded
- from the template set directory and emitted as part of the output
- stream.
-
- : The bad side of this is that the CSS never caches on the client side
- : as it would if it were a separate file. However, as templates may not
- : be in a web-accessible directory, this is necessary.
-
- === wiki.config.time_format, wiki.config.date_format, wiki.config.datetime_format
- When the wiki displays date or time values, these formats are used.
- They are not currently accessible by tokens.
-
- === wiki.config.debug
- Adds additional information to the (rare) error reports. Defaults to
- <tt>false</tt>.
-
- === wiki.config.logger
- Sets or returns the logger. The logger, if set, must respond to the
- same methods as WEBrick::Logger.
-
- === wiki.config.auth_mechanism
- The authentication mechanism name as a String. Corresponds to a
- filename that will be found in ruwiki/auth. The authenticator must have
- a single class method, +authenticate+, which accepts the +request+, the
- +response+, and the +auth_options+. This API is a draft API and is
- likely to change in future versions of Ruwiki. In this version of
- Ruwiki, only one authentication mechanism will be found -- for dealing
- with authenticating users already logged into RubyForge.
-
- === wiki.config.auth_options
- Options for the authentication mechanism as a Hash. This will be passed
- to the authenticator defined in wiki.config.auth_mechanism. The
- <tt>auth_options</tt> are a single-level hash. They may be stored in
- the Ruwiki configuration file as:
-
- ruwiki-config!auth-options: default!user: pgsqluser
- default!pass: pgsqlpass
-
- == Ruwiki Servlet Options
- Most, if not all, of the configuration above can be achieved through
- command-line options of the ruwiki servlet.
-
- === Servlet Command-Line Options
- ; -P, --port <em>PORT</em> : Runs the Ruwiki servlet on the specified port. Default 8808.
- ; -A, --accept <em>ADDRESSES</em> : Restricts the Ruwiki servlet to accepting connections from the specified address or (comma-separated) addresses. May be specified multiple times. Defaults to all addresses.
- ; -L, --local : Restricts the Ruwiki servlet to accepting only local connections (127.0.0.1). Overrides any previous --accept addresses.
- ; -M, --mount <em>MOUNT_POINT</em> : The relative URI from which Ruwiki will be accessible. Defaults to &ldquo;/&rdquo;.
- ; --[no-]log : Log \WEBrick activity. Default is --log.
- ; --logfile <em>LOGFILE</em> : The file to which \WEBrick logs are written. Default is standard error.
- ; -T, --threads <em>THREADS</em> : Sets the \WEBrick threadcount.
-
- === Ruwiki Command-Line Options
- ; --language <em>LANGUAGE</em> : The interface language for Ruwiki. Defaults to &ldquo;en&rdquo;. May be &ldquo;en&rdquo;, &ldquo;de&rdquo;, or &ldquo;es&rdquo;.
- ; --webmaster <em>WEBMASTER</em> : The Ruwiki webmaster email address. Defaults to &ldquo;webmaster@domain.com&rdquo;.
- ; --[no-]debug : Turns on Ruwiki debugging. Defaults to --no-debug.
- ; --title <em>TITLE</em> : Provides the Ruwiki title. Default is &ldquo;Ruwiki&rdquo;.
- ; --default-page <em>PAGENAME</em> : An alternate default page. Default is &ldquo;\ProjectIndex&rdquo;.
- ; --default-project <em>PAGENAME</em> : An alternate default project. Default is &ldquo;Default&rdquo;.
- ; --template-path <em>TEMPLATE_PATH</em> : The location of Ruwiki templates. Default is &ldquo;./templates&rdquo;.
- ; --templates <em>TEMPLATES</em> : The name of the Ruwiki templates. Default is &ldquo;default&rdquo;.
- ; --css <em>CSS_NAME</em> : The name of the <acronym title="Cascading Style Sheets">CSS</acronym> file in the template path. Default is &ldquo;ruwiki.css&rdquo;.
- ; --storage-type <em>TYPE</em> : Select the storage type: flatfiles, yaml, marshal
- ; --flatfiles-data-path <em>PATH</em> : The path where data files are stored. Default is &ldquo;./data&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
- ; --flatfiles-extension <em>EXT</em> : The extension for data files. Default is &ldquo;ruwiki&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
-properties!project: Ruwiki
-properties!title: Configuring_Ruwiki
-properties!topic: Configuring_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/Extending_Ruwiki.ruwiki b/ruwiki/trunk/data/Ruwiki/Extending_Ruwiki.ruwiki
deleted file mode 100644
index fbc89b8..0000000
--- a/ruwiki/trunk/data/Ruwiki/Extending_Ruwiki.ruwiki
+++ /dev/null
@@ -1,316 +0,0 @@
-page!content: = Extending Ruwiki %RV#%
- Ruwiki is relatively easily extended to support new features. There are
- four primary ways in which Ruwiki can be extended or modified by the
- end user: templates, translating Ruwiki messages and labels, markup
- tokens, and creating new backends.
-
- == Templates
- Templating is done with a heavily modified version of the \RDoc
- template.rb library included in the distribution of Ruwiki. The
- templating library allows for nested templates, and this is used
- extensively in Ruwiki. This library is documented in
- RuwikiTemplatingLibrary.
-
- There are four major templates: content, edit, save, and error. Each of
- these has a slightly different combination of template files used, and
- this means that there are different sets of variables available.
-
- The major templates are &ldquo;composite templates&rdquo; that are
- defined as follows:
- ; content or search : body.tmpl, content.tmpl, controls.tmpl, footer.tmpl
- ; edit or preview : body.tmpl, edit.tmpl
- ; save : body.tmpl, save.tmpl, controls.tmpl, footer.tmpl
- ; error : body.tmpl, error.tmpl
-
- === Common Variables
- The following template variables are presented for all composite
- templates.
- ; <tt>%css_link%</tt> : The contents of the CSS file for the template set.
- ; <tt>%home_link%</tt> : A link to the root page of the Wiki.
- ; <tt>%editable%</tt> : A boolean value to mark the page as editable or not. Used in a conditional block in the templates.
- ; <tt>%cgi_url%</tt> : The URL for the Wiki.
- ; <tt>%content%</tt> : The formatted content of the current page.
- ; <tt>%page_project%</tt> : The project for the current page.
- ; <tt>%page_raw_topic%</tt> : The topic for the current page, escaped for safe transmission over the web.
- ; <tt>%page_topic%</tt> : The printable topic for the current page.
- ; <tt>%url_project%</tt> : The URL to the current page&rsquo;s project.
- ; <tt>%url_topic_search%</tt> : The URL to search for the current topic in the current project.
- ; <tt>%link_topic_search%</tt> : A link to the current topic search.
-
- === Variables for :content, :save, :search, :edit, :preview
- ; <tt>%message%</tt> : A message presented at the top of the Wiki when Ruwiki needs to inform the user of something that is not an error.
-
- === Variables for :content, :save, :search
- ; <tt>%wiki_title%</tt> : The title of the Wiki.
- ; <tt>%label_topic_or_search%</tt> : Either <tt>#topic#</tt> or <tt>#search#</tt>.
- ; <tt>%page_topic_name%</tt> : The same as <tt>%page_topic%</tt>.
-
- === Variables for :edit, :preview
- ; <tt>%wiki_title%</tt> : The title of the Wiki with a tag to indicate that the page is being edited.
- ; <tt>%page_content%</tt> : The content of the page.
- ; <tt>%page_version%</tt> : The current version number of the page.
- ; <tt>%unedited_page_content%</tt> : The formatted, unedited content of the page.
- ; <tt>%pre_page_content%</tt> : A Web-escaped form of the page content.
- ; <tt>%edit_comment%</tt> : The current edit comment.
-
- === Variables for :error
- ; <tt>%wiki_title%</tt> : The title of the Wiki with an error message.
- ; <tt>%name%</tt> : The name of the error.
- ; <tt>%backtrace%</tt> : The backtrace of the error.
- ; <tt>%backtrace_email%</tt> : The backtrace of the error formatted for sending by email.
- ; <tt>%webmaster%</tt> : The email address of the webmaster.
-
- == Translating Ruwiki Messages
- : NOTE: The mechanism for specifying language may be changed in a
- : future version of Ruwiki, although the internationalisation mechanism
- : will not be changing.
-
- Ruwiki is internationalized. This method sets the Ruwiki error messages
- (and a few other messages) to the specified language Module. The
- language Module must have a constant Hash called <tt>Message</tt>
- containing a set of symbols and localized versions of the messages
- associated with them.
-
- If the file <em>ruwiki/lang/es.rb</em> contains the module
- <tt>Ruwiki::Lang::ES</tt>, the messages for RSS could be localized to
- Spanish thus:
-
- require 'ruwiki/lang/es'
- ...
- wiki.config.language = Ruwiki::Lang::ES
-
- Localization is currently per wiki instance. In a servlet environment,
- this may mean that only a single language is recognised.
-
- It is recommended that the hash be created with a default proc that
- reports unknown message keys.
-
- Message = Hash.new { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
-
- == Extending Ruwiki Markup
-
- : <strong>WARNING:</strong> These \APIs will change in Ruwiki 0.9.0,
- : replacing the instance variables @project, @backend, and @script with
- : a Handler object. There may be other changes as well.
-
- Ruwiki&rsquo;s WikiMarkup can be extended by creating a new
- Ruwiki::Wiki::Token. Tokens will be automatically loaded if they are
- placed in <em>ruwiki/wiki/tokens</em>.
-
- It is recommended that new tokens be added to the test cases in
- <tt>tests/tc_tokens.rb</tt>.
-
- The following Ruwiki::Wiki::Token class will convert strings in the
- forms of \[ruby-talk:12345] to links.
-
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- === Known Instance Variables
- ==== @match
- The match data for this token instance is is kept in @match. This is
- what will be used in #replace and #restore.
-
- ==== @project
- The project being processed.
-
- ==== @backend
- The Backend for the wiki. If you are using Ruwiki tokenizers outside of
- Ruwiki, this does not need to be a \BackendDelegator, but can be the
- direct Backend (which expects less information).
-
- ==== @script
- The URI to the script.
-
- ==== @message
- The message hash for displaying localised messages.
-
- ==== @title
- The title of the wiki instance.
-
- === Required Methods
- ==== ::regexp
- Ruwiki tokens are matched only through regular expression matches. As
- shown in the example above, the regular expression for ruby-talk
- mailing list posts is <tt>%r{\[ruby-\talk:(\d+)\]}</tt>. The purpose of
- the ::regexp method is to return the regexp for matching.
-
- For most inline matches, Ruwiki will ensure that the escape character
- (\) works automatically. For whole-line matches, it is necessary to
- match the escape character manually and provide a #restore method.
-
- As an example, the \HRule class implements these methods.
-
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- It may also be necessary to match escapes manually on inline matches
- that must be along word boundaries where the regular expression
- includes characters that normally match word boundaries. The project
- index match (e.g., \::Ruwiki) regular expression does this
- <tt>%r{(\B|\\)::([A-Z][a-z]+)}</tt>.
-
- ==== #replace
- This returns the formatted token. In the \RubyTalkLinks class above,
- the matched regular expression will be replaced with a hyperlink. The
- text of the hyperlink will be the matched text; the target of the
- hyperlink will include the first captured value.
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
-
- === Optional Methods
- ==== ::rank
- By default, a token will be processed in the order created. Tokens may
- be given a specific rank to ensure that they are processed in a
- particular order. The default rank is <tt>9999</tt>.
-
- ==== #restore
- Restores the token without replacement. Implements the results of the
- escape character. Each Token class is responsible for its own
- restoration. As noted in #regexp, whole-line tokens are most likely to
- need a #restore implementation.
-
- ==== ::post_replace
- Performs any necessary massaging of the data. The Lists token uses this
- to ensure that lists are collapsed together; the Paragraph token uses
- this to ensure that there are no empty paragraph tag pairs
- (&lt;p&gt;&lt;/p&gt;).
-
- : <strong>Note:</strong> This has been changed from Ruwiki 0.6.x.
- : Plugins written for the Ruwiki 0.6.x Token API will need to be
- : modified so that this is defined as:
-
- def self.post_replace
- ...
- end
-
- : as opposed to:
-
- def post_replace
- ...
- end
-
- == Extending Ruwiki Backends
- Ruwiki can support varying backends, as the backend interface has been
- abstracted completely from the data store. The backend
- <strong>must</strong>:
-
- # reside in <em>ruwiki/backends/</em> as <em>backend_name</em>.rb.
- # be registered by adding the <em>backend_name</em> as a symbol (e.g., :<em>backend_name</em>) to Ruwiki::KNOWN_BACKENDS.
- # inherit from Ruwiki::Backend.
- # exist as Ruwiki::Backend::<em>\Backend_name</em>.
-
- === Required Methods
- ==== #initialize(storage_options)
- The backend may only obtain its configuration information from an
- option hash provided by the \BackendDelegate. This is obtained from
- <tt>wiki.config.options[backend]</tt>. If a configuration error is
- detected during initialization, the backend should raise the
- \Ruwiki::Backend exception class \BackendError. This would be done
- with:
-
- raise Ruwiki::Backend::BackendError.new([:message_symbol, [message_parameters]])
-
- Backend writers should add appropriate messages to the
- <em>lang/en.rb</em> at a minimum. The \BackendDelegator will detect
- this and report the results appropriately.
-
- ==== #load(topic, project)
- The backend will be provided the name of the topic and project. It must
- return the selected page as a hash of hashes. The hash must match that
- of \Ruwiki::Page#export. It will be passed as the parameter to
- \Ruwiki:::Page.new.
-
- ==== #store(page)
- This method must store the provided Ruwiki::Page object. Current Ruwiki
- backend implementations store the Ruwiki::Page#export hash. This method
- is responsible for calling the private method Backend#make_diff and
- adding the result to the list of diffs for the page.
-
- ===== Backend#make_diff(oldpage, newpage)
- This method expects two page objects, or their Ruwiki::Page#export
- representation. It will return a hash representing the difference set
- between the two pages.
-
- ==== #obtain_lock(page, time, expire, address = 'UKNOWN')
- Obtains an exclusive lock on the page. The \BackendDelegator is called
- with the page, the address, and a timeout which is provided. The time
- is provided by the call to the BackendDelegate, and the expire is also
- provided by the call to the BackendDelegate which is given a timeout
- value (by default 600 seconds). If the lock is still in effect, a
- second call to #obtain_lock should renew the timeout on the lock.
-
- ==== #release_lock(page, address = 'UNKNOWN')
- Releases the exclusive lock on the page. The lock should not be released
- unless the IP address on the lock is the same or the lock has expired.
-
- ==== #project_exists?(project)
- Returns <tt>true</tt> if the project exists.
-
- ==== #page_exists?(topic, project = 'Default')
- Returns <tt>true</tt> if the page exists within the specified project.
-
- ==== #create_project(project)
- Attempts to create the project.
-
- ==== #search_project(project, search_string)
- String search all topic names and content in a project and return a
- hash of topic hits:
-
- topicname => hits
-
- ==== #list_projects
- Return an array of all projects.
-
- ==== #list_topics(project)
- Return an array of all topics within the project.
-
- === Future Methods
- Note that these methods are currently optional (they are not yet called
- from Ruwiki), but will become required moving forward as the functions
- are implemented in Ruwiki.
-
- ==== #destroy(page)
- Removes the page from the wiki. This should <strong>not</strong> remove
- the change history of the topic (in the event that the page has been
- removed maliciously). There will be a separate method to remove the
- page history.
-
- ==== #destroy_project(project)
- Attempts to destroy the project.
-
- === Optional Methods
- These methods are completely optional. They are guarded in the
- \BackendDelegate by a call to #respond_to?().
-
- ==== #global_search(search_string)
- The global search in the backend delegate is by default implemented as
- a looping search through all projects. A backend may have a more
- efficient backend global search mechanism. If the backend responds to
- #global_search, then the \BackendDelegate will use this method.
-properties!project: Ruwiki
-properties!title: Extending_Ruwiki
-properties!topic: Extending_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/LicenseAndAuthorInfo.ruwiki b/ruwiki/trunk/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
deleted file mode 100644
index 5d1c20e..0000000
--- a/ruwiki/trunk/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
+++ /dev/null
@@ -1,29 +0,0 @@
-page!content: = Ruwiki Licence
- Ruwiki is copyright &copy; 2002 - 2004 [mailto:alan@digikata.com Alan
- Chen] and [mailto:ruwiki@halostatue.ca Austin Ziegler].
-
- Ruwiki is provided free of use and without any warranty express or
- implied. You may use, distribute, or modify Ruwiki under the conditions
- of Ruby&rsquo;s licence or the [http://www.gnu.org/copyleft/gpl.html
- GNU General Public Licence].
-
- * Ruwiki includes a modified version of rdoc/template.rb originally by Dave Thomas for use in \RDoc.
-
- == Translations
- * Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen] on 2003.10.22, with corrections by Mauricio Fern&aacute;ez. Note that the initial template translations (./templates/de/) were done via \AltaVista Babelfish and should not be blamed on Christian.
- * Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fern&aacute;ndez] on 2003.10.22. Note that the initial template translations (./templates/es/) were done via \AltaVista Babelfish and should not be blamed on Mauricio.
-
- == Austin&rsquo;s Other Projects
- Austin has also released several other projects available on the RAA that you may be interested in:
- * [http://raa.ruby-lang.org/list.rhtml?name=mime-types MIME::Types], \RubyForge [http://rubyforge.org/projects/mime-types project].
- * [http://raa.ruby-lang.org/list.rhtml?name=pdf-writer PDF::Writer], \RubyForge [http://rubyforge.org/projects/ruby-pdf project].
- * [http://raa.ruby-lang.org/list.rhtml?name=text-format Text::Format], \RubyForge [http://rubyforge.org/projects/text-format project].
- * [http://raa.ruby-lang.org/list.rhtml?name=trans-simple Transaction::Simple], \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=uninheritable Uninheritable], Transaction::Simple&rsquo;s \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=diff-lcs Diff::LCS], Ruwiki&rsquo;s \RubyForge [http://rubyforge.org/projects/ruwiki project].
-properties!project: Ruwiki
-properties!title: LicenseAndAuthorInfo
-properties!topic: LicenseAndAuthorInfo
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/ProjectIndex.ruwiki b/ruwiki/trunk/data/Ruwiki/ProjectIndex.ruwiki
deleted file mode 100644
index e370528..0000000
--- a/ruwiki/trunk/data/Ruwiki/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,83 +0,0 @@
-page!content: = Ruwiki %RV#%
- This is the \ProjectIndex page for Ruwiki. For any given project, the
- \ProjectIndex topic will be the default topic for plain project links.
-
- == Features and Information
- * This wiki supports a variety of WikiFeatures that you may be interested in. The rules for WikiMarkup are similar to some other wikis, but there are a few unique markup capabilities in Ruwiki.
- * Configuring_Ruwiki is simple.
- * Extending_Ruwiki is almost as simple.
- * What you need to know for using Ruwiki's [[Antispam]] capabilities.
- * Who wrote Ruwiki? Read the LicenseAndAuthorInfo.
-
- == Requirements
- Ruwiki currently requires Ruby 1.8, Diff::LCS 1.1.2 and
- Archive::Tar::Minitar 0.5.1. These packages are included in the
- <em>packages/</em> directory in the
- <code>ruwiki-0.9.0-full.tar.gz</code> form of the distribution.
-
- The YAML backend requires Ruby 1.8.2 preview 3 or later.
-
- == Upgrading
- Ruwiki %RV#% has a flatfile format that is incompatible with versions
- of Ruwiki older than Ruwiki 0.8.0. If you are upgrading from one of
- these versions, you must use the bin/ruwiki_convert. The simple case
- will be (assuming that your data files are in ./data):
-
- % ruwiki_convert ./data
-
- The ruwiki_convert utility is automatically installed by \RubyGems and
- RPA. See RuwikiUtilities for more information. Note that this utility
- will probably be incorporated into the main Ruwiki utility in a future
- version.
-
- == Getting Started
- There are some differences between the startup of <tt>.tar.gz</tt>,
- \RubyGems, and RPA installations of Ruwiki.
-
- === \QuickStart (Read-only: \RubyGem and RPA Installation Only)
- Run:
- % ruwiki_servlet --central
-
- Point your web browser to \http://localhost:8808/.
-
- === \QuickStart (CGI)
- # Install the Ruwiki CGI (<tt>ruwiki.cgi</tt>) program in a place where your webserver can execute it.
- #* <strong>\RubyGem:</strong> <tt>ruwiki install cgi,data --to <em>directory</em></tt>
- #* <strong><tt>.tar.gz</tt>:</strong> Extract the Ruwiki directory to that directory. <tt>cp bin/ruwiki.cgi .</tt> <em>or</em> <tt>copy bin\ruwiki.cgi .</tt>
- # Point your web browser to the appropriate URL.
-
- === \QuickStart (\WEBrick)
- # Install the Ruwiki servlet or data.
- #* <strong>\RubyGem:</strong> <tt>ruwiki install data --to <em>directory</em></tt> <em>or</em> <tt>ruwiki install servlet,data --to <em>directory</em></tt>
- #* <strong><tt>.tar.gz</tt>:</strong> Extract the Ruwiki directory.
- # Run <tt>ruwiki_servlet</tt>. Under the <tt>.tar.gz</tt>, this would be <tt>bin/ruwiki_servlet</tt> <em>or</em> <tt>ruby bin\ruwiki_servlet</tt>
- # Point your web browser to \http://localhost:8808/.
-
- == Support
- * Troubles with Ruwiki? See TroubleShooting for some suggestions. Have a new problem? Add it to the main [http://ruwiki.rubyforge.org/ruwiki.cgi/Ruwiki/TroubleShooting TroubleShooting] page.
- * Subscribe to [http://rubyforge.org/mailman/listinfo/ruwiki-discuss ruwiki-discuss] ([http://rubyforge.org/pipermail/ruwiki-discuss/ archives]).
- * You can also use the [http://rubyforge.org/forum/?group_id=84 Ruwiki Public Forum] or the on \RubyForge.
-
- == Tracking Ruwiki Development
- The development progress of Ruwiki is kept primarily in the wiki
- itself, but the services of [http://rubyforge.org RubyForge] are used
- as well.
- * The BugTracking page in Ruwiki keeps track of open and closed bugs in Ruwiki. Bugs can also be found in the \RubyForge [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug tracker] and [http://rubyforge.org/tracker/?atid=408&group_id=84&func=browse Support Requests].
- * The To_Do list keeps track of major development goals for Ruwiki. Items for this list can be found on \RubyForge in [http://rubyforge.org/tracker/?atid=410&group_id=84&func=browse Feature Requests] and [http://rubyforge.org/tracker/?atid=409&group_id=84&func=browse Patches].
- * There is a mailing list to track CVS changes: [http://rubyforge.org/mailman/listinfo/ruwiki-checkin ruwiki-checkin] ([http://rubyforge.org/pipermail/ruwiki-checkin/ archives]).
-
- == Different Features?
- If this wiki doesn&rsquo;t have the right combination of features, (or if it
- just doesn&rsquo;t feel right) try these other Ruby-based Wikis:
-
- * [http://pimwiki.rubyforge.org/ PIMWiki]
- * [http://instiki.rubyforge.org/ Instiki]
- * [http://www.walrus-ruby.org/amrita/cgi-bin/aswiki/aswiki.cgi Amrita Wiki]
- * [http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=top RWiki]
- * [http://www.xpsd.com/MiniRubyWiki MiniRubyWiki]
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/Roadmap.ruwiki b/ruwiki/trunk/data/Ruwiki/Roadmap.ruwiki
deleted file mode 100644
index 50e311b..0000000
--- a/ruwiki/trunk/data/Ruwiki/Roadmap.ruwiki
+++ /dev/null
@@ -1,224 +0,0 @@
-page!content: = Ruwiki %RV#%: The Road Ahead
- This roadmap is accurate as of the release of 0.9.0.
-
- What lies ahead for Ruwiki? The To_Do list will give a detailed list
- of what is to follow, but this list is not the roadmap. There is no
- clear indication of the reason for &mdash; and in some cases, the
- meaning of &mdash; the items on the list. The intention of this
- document is to expand on that list. As items are completed, they will
- be removed from this document.
-
- == A Note About Targets
- Ruwiki development is not proceeding as quickly as I would prefer, but
- it is continuing steadily. I am at times choosing to delay releases
- and bypass some versions because there are other pressing concerns; I
- am definitely aiming for quality here, not for timeliness.
-
- == Development Inputs
- The primary driver of development on Ruwiki is the needs of a few
- groups of people. First, both Alan and Austin use or will use Ruwiki
- at work. There are particular needs that both have. Austin will be
- replacing an installation of \PhpWiki with an installation of Ruwiki
- sometime in early 2005.
-
- Second, [http://www.rubygarden.org/ruby RubyGarden], and
- [http://www.rubyforge.org RubyForge], and the
- [http://rpa.rubygarden.org <acronym title="Ruby Production Archive">RPA</acronym>]
- have expressed an intention to replace the Perl-based \UseMod wiki
- with a Ruby-based wiki. The popular and easy-to-use Instiki
- (&ldquo;there is no step 3&rdquo;) is not an ideal choice for either
- because they either require or prefer a CGI-based wiki. Ruwiki has the
- desired level of performance and implemenation simplicity that
- impresses both groups, and it is the current preferred choice. Thus,
- the needs of both websites factor highly into the goals for Ruwiki.
-
- Third, Austin gave a talk on Ruwiki at \RubyConf 2004. Many of the
- features in the current release come from a development effort leading
- up to the talk and in the weeks following.
-
- Last, and certainly not least, feature requests and bug reports are a
- factor. One of the things that changed in Ruwiki 0.8.0 was the look
- and feel; admittedly, the look and feel in earlier versions was a bit
- garish, designed to fit in with a particular website more than be a
- general wiki theme. Users complained, and we changed this. The
- continual spam defacement of the \RubyGarden wiki suggested several
- possible improvements that could be made in Ruwiki to fight wiki spam;
- initial work has been implemented in Ruwiki 0.9.0 and more work
- remains. Additionally, Ruwiki is the first wiki with built-in
- deployment support for package management systems (such as \RubyGems
- and rpa-base), although Instiki has been modified for RPA by the RPA
- team to support limited installation in RPA locations.
-
- == Ruwiki 0.10.0: &ldquo;Are You Being Served?&rdquo;
- Ruwiki 0.8.0 introduced an incompatible change in the way that page
- diffs were stored, so users were advised to remove any existing .rdiff
- files. This isn&rsquo;t as problematic as it may sound, as until
- 0.10.0, there is no way to actually view the page diffs from Ruwiki
- itself.
-
- In Ruwiki 0.7.0, a new token was introduced: %calendar(). The concept
- here is a sound one that can be extended to make token addition
- easier. Currently, it is necessary for token writers to create their
- own regular expressions. The &ldquo;function token&rdquo; will be
- added &mdash; although the form may not be
- &ldquo;%<em>function-name</em>&rdquo; &mdash; that will work with
- either a line replacement or a word replacement so that the regular
- expression does not need to be written. Tests for the replacement will
- still need to be written, but standardizing new custom tokens will be
- a good thing.
-
- Chad Fowler&rsquo;s port of \RubLog&rsquo;s vector search will
- probably be added to this version.
-
- The presence of static HTML content (headers and footers) per page has
- been accounted for in Ruwiki 0.8.0, but it will not be displayed.
- Further, there is currently no way to specify or display static
- content for the wiki or the project. (A related problem here is that
- projects do not have any properties. This will become important as
- projects should be able to be marked private within a wiki in the
- future.)
-
- The purpose of the \WikiWikiWeb is to provide a collaborative,
- community knowledge editing environment. Unfortunately, the pondscum
- known as spammers have figured out that the \WikiWikiWeb provides a
- positive Google \PageRank, and having their links on our Wikis is
- benefits them. Just as they don&rsquo;t care about filling our
- mailboxes with junk, they don&rsquo;t care about defacing our
- community knowledge. Ruwiki 0.10.0 provides additional antispam
- defences.
-
- The \RecentChanges mechanism will be updated to make it possible to
- see the \GlobalRecentChanges list.
-
- The most significant change in Ruwiki 0.10.0 will be the modification
- of the request pipeline. This will not be visible to the end user, but
- it will be significant to users who wish to extend Ruwiki. Currently,
- Ruwiki processes all commands in ruwiki.rb. In Ruwiki 0.10.0, this
- will be changed to a dispatch mechanism, where Action objects are
- introduced, and ruwiki.rb dispatches requests to Action objects.
-
- <table summary="Pipeline" style="border: 1px solid black"><tr><td>
- +---------+ +-------------------+
- | Request |--------->| Authorize Request |
- +---------+ +-------------------+
- |
- v
- +-------------------+
- | Configure Ruwiki |
- +-------------------+
- |
- v
- +-------------------+
- | Parse Request |
- +-------------------+
- |
- v
- +-------------------+
- | Perform Action |
- +-------------------+
- |
- v
- +-------------------+
- | Prepare Response |
- +-------------------+
- |
- v
- +--------+ +----+--------------+
- | Page |<----------| Send Page |
- +--------+ +-------------------+
- </td></tr></table>
-
- The diagram above shows the general pipeline. The difference is that
- the action will be its own object. In general, it will need to know
- how to process certain URL formats.
-
- In the process of defining the action objects, \ActionCards will be
- created. Below is an example \ActionCard for the default action,
- <tt>_show</tt>. In \ActionCards, everything is relative to the Ruwiki
- root URI. Important to note is that \ActionCards are an ideal: they may
- not represent something that can be accomplished for 0.10.0, 0.11.0,
- or even 1.0. They do, however, represent the ultimate target.
-
- Ruwiki does some implicit URI rewriting in the general form of:
-
- <table summary="Ruwiki URI rewriting" style="border: 1px solid black; border-collapse: collapse">
- <tr><th style="border: 1px solid black">URI</th><th style="border: 1px solid black">Rewritten URI</th></tr>
- <tr><td style="border: 1px solid black">/</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Action</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action</td></tr>
- <tr><td style="border: 1px solid black">/Topic</td><td style="border: 1px solid black">/Project<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Topic/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/</td><td style="border: 1px solid black">/Project/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/Action</td><td style="border: 1px solid black">/Project/Topic<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%">/Action</td></tr>
- <tr><td style="border: 1px solid black">/Project/Topic</td><td style="border: 1px solid black">/Project/Topic/Action<sub style="border: 1px solid black; font-size: 50%">Default</sub style="border: 1px solid black; font-size: 50%"></td></tr>
- <tr><td style="border: 1px solid black">/Project/Topic/Action</td><td style="border: 1px solid black">/Project/Topic/Action</td></tr>
- </table>
-
- <table summary="_show Action Card" style="border: 1px solid black"><tr><td>
- === Action: Show [_show] <strong>DEFAULT</strong>
- The Show action is the default action that will be performed when
- there is no action specified. Without any arguments, the latest
- version of the page will be displayed.
-
- ==== Action Arguments
- ; ?r=<em>revision</em> : Show the specified revision of the page.
- ; ?r : Show the list of revisions known to the page.
- ; ?r=<em>revision1</em>:<em>revision2</em> : Shows the difference of revision1 and revision2 for the page.
- ; ?r=:<em>revision</em> : Shows the difference between the current page and the specified revision.
- ; ?d=<em>yyyymmdd[:hh[mm[ss]]]</em> : Shows the last revision from at or before the specified date and time. If time is not specified, it is assumed to be 23:59:59.
-
- ==== Interaction Notes
- Without arguments, _show generates pages pages that are editable and
- indexable (<meta name="robots" content="index,follow,archive">). If
- any argument is specified, the page is still editable, but not
- indexable (<meta name="robots" content="noindex,nofollow,noarchive">).
- </td></tr></table>
-
- == Ruwiki 0.11.0: &ldquo;What&rsquo;s My Line?&rdquo;
- The antispam techniques introduced in 0.9.0 are positive steps in the
- fight against wiki defacement. They are hopefully effective, too. The
- problem is that because 0.9.0 doesn&rsquo;t offer users or user
- authentication, there&rsquo;s no way of safely allowing the edit of
- the antispam lists. Thus, to allow this and other potentially
- dangerous actions, a user and capability framework will be added to
- Ruwiki. This framework will allow for user identification,
- authentication, and authorization to indicate what users are allowed
- to perform what actions.
-
- Authenticated users will be able to bypass blacklist checking; thus,
- if &ldquo;msn.com&rdquo; is blocked, &ldquo;joe.blog@msn.com&rdquo;
- could still authenticate with Ruwiki and edit the pages. Some users
- will be able to manage user permissions (including user management),
- edit antispam lists, etc.
-
- Other actions will be added, including the ability to rename topics
- and move topics between projects. In both cases, the topic change
- history must be maintained.
-
- The documentation for Ruwiki will be substantially complete with this
- version, lacking only specific information on the features that will
- be added in Ruwiki 1.0.0.
-
- == Ruwiki 1.0.0: &ldquo;Yes, Minister&rdquo;
- A combined strength and weakness of Ruwiki is that it currently does
- little to protect against arbitrary HTML being inserted into the
- current topic. The allowed subset of HTML should be restricted to a
- safe subset to prevent cross-site-scripting attacks.
-
- Pages and projects have properties: we need to provide the ability to
- edit those properties. Part of the properties that should be editable
- include whether a page is frozen &mdash; this means that the page is
- no longer editable by any user (unless it is unfrozen) and is
- effectively a plain HTML page. Other properties include the static
- header and footer information in a page or project.
-
- Modern Wikis require an RSS feed. Ruwiki will provide one.
-
- == The Future: &ldquo;Yes, Prime Minister&rdquo;
- Ruwiki 1.0.0 does not represent the end of the line for Ruwiki, but
- what the future holds is unclear. We&rsquo;ll see what the future
- brings.
-properties!project: Ruwiki
-properties!title: Roadmap
-properties!topic: Roadmap
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki b/ruwiki/trunk/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
deleted file mode 100644
index d738c18..0000000
--- a/ruwiki/trunk/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
+++ /dev/null
@@ -1,155 +0,0 @@
-page!content: = Ruwiki %RV#% Templating
- Ruwiki uses a heavily modified version of the \RDoc
- &ldquo;cheap-n-cheerful&rdquo; HTML page template system. This a
- line-oriented, text-based templating system.
-
- == Templates
- Templates in the templating system are essentially plain strings with
- particular references to templating keys or an include directive.
-
- The template interacts with value and message hashes provided by
- Ruwiki. The keys known to the templates expected by Ruwiki are
- detailed in Extending_Ruwiki. Nested key references are found from the
- inside-out. That is, the closest resolving key to the current level is
- found, not the furthest resolving key.
-
- === Including Other Templates
- Templates may include other templates to any arbitrary level by using
- the <tt>!INCLUDE!</tt> directive. When the \TemplatePage is created,
- an array of template strings are provided; these will be used to
- satisfy <tt>!INCLUDE!</tt> directives. If there are not enough
- template strings provided, <tt>!INCLUDE!</tt> won&rsquo;t be
- translated.
-
- : This may change before Ruwiki reaches 1.0, so that templates are
- : named instead of iterated.
-
- === Simple Template Keys
- Strings of the format <tt>%<em>key</em>%</tt> or
- <tt>%?<em>key</em>%</tt> are simple template keys. <em>key</em> is
- looked up in the provided value hash and is presented as the string
- value of the result. <tt>%key%</tt> template keys are mandatory; if
- the key is not found in the value hash, an exception will be raised.
- <tt>%?key%</tt> template keys are optional; if they key is not found
- in the value hash, an empty string (&ldquo;&rdquo;) will be used.
-
- === Labels
- Strings of the format <tt>#<em>key</em>#</tt> or
- <tt>#?<em>key</em>#</tt> are labels. <em>key</em> is looked up in the
- provided message hash as a Symbol (e.g.,
- <tt><em>key</em>.intern</tt>). As with simple template keys,
- <tt>#key#</tt> labels are mandatory and <tt>#?key#</tt> labels are
- optional.
-
- === Links
- Strings of the format <tt>HREF:\ref:name</tt> will become HTML links.
- Both <em>ref</em> and <em>name</em> are keys to be looked up.
- <em>name</em> is mandatory; an exception will be raised if it is not
- found.
-
- === Control Structures
- The templating library supports both looping and conditional control
- structures in both single-line and multi-line forms. Single-line
- control structures <strong>may not</strong> be nested; multi-line
- control structures <strong>may</strong> be nested arbitrarily deeply.
-
- ==== Looping Control Structures
- There are two forms of looping control structures.
-
- [:key|stuff:]
-
- START:key
- ... stuff ...
- END:key
-
- ===== Single-Line Looping
- [:key|stuff:]
-
- The value of <em>key</em> may be <tt>nil</tt>, an integer value, a
- range, or an array. When <em>key</em> represents:
- # <tt>nil</tt>, the looping structure will be replaced with an empty string.
- # An integer, <em>stuff</em> will be repeated <em>key</em> times. Values from 1 to <em>key</em> will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # A range, <em>stuff</em> will be repeated once for each successive value in the range of <em>key</em>. Each value will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # An array, the behaviour will differ depending on the contents of the array.
- ## If the array contains hashes, the behaviour is the same as a multi-line looping construct. See below for details.
- ## Otherwise, the template iterates through the array, providing each value to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
-
- As an example, if we have:
-
- "[:b|%b% ]"
-
- # <tt>val["b"] = 3 -> "1&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = (0..2) -> "0&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = ["a", "B"] -> "a&nbsp;B&nbsp;"</tt>
-
- ==== Multi-Line Looping
- START:key
- ... stuff ....
- END:key
-
- The value of <tt>key</tt> must be an array of hashes. <tt>... stuff
- ...</tt> will be repeated once for each entry in the array. The hashes
- will be passed as nested value hashes.
-
- %a% [:b|%a% ]%a%
-
- When the above template string is run with the following hash:
-
- val["a"] = 1
- val["b"] = [ { "a" => 2 }, { "a" => 3 } ]
-
- The result is:
-
- 1 2 3 1
-
- The behaviour is the same for multi-line blocks.
-
- ==== Conditional Block Keys
- IF:key
- ... stuff ...
- ENDIF:key
-
- The block between <tt>\IF:key</tt> and <tt>\ENDIF:key</tt> will be included in
- the output only if the corresponding key is set in the value hash.
-
- == Example
- Given the set of templates T1, T2, and T3 (shown below), here&rsquo;s how we would
- use the templating system.
-
- values = { "name" => "Dave", "state" => "TX" }
- t = TemplatePage.new(T1, T2, T3)
- File.open(name, w) { |f| t.process(f, values) }
-
- or:
-
- <!-- Source -->
- val1 = { "name" => "Dave", "state" => "TX" }
- val2 = { "name" => "Dave" }
- msgs = { }
- res = ""
- t.process(res, values, msgs)
-
- <!-- T1 -->
- Templates can subsitute a wide variety of values.
- !INCLUDE!
-
- <!-- T2 -->
- Name: %name% !INCLUDE!
-
- <!-- T3 -->
- IF:state
- State: %state%
- ENDIF:state
-
- The result will be:
-
- Name: Dave
- State: TX
-
- Name: Dave
-properties!project: Ruwiki
-properties!title: RuwikiTemplatingLibrary
-properties!topic: RuwikiTemplatingLibrary
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/RuwikiUtilities.ruwiki b/ruwiki/trunk/data/Ruwiki/RuwikiUtilities.ruwiki
deleted file mode 100644
index aef7e1f..0000000
--- a/ruwiki/trunk/data/Ruwiki/RuwikiUtilities.ruwiki
+++ /dev/null
@@ -1,156 +0,0 @@
-page!content: = Ruwiki %RV#% Utilities
- Ruwiki %RV#% provides two utilities and three sample programs for
- deployment.
-
- == Managing Ruwiki Deployments
- A major change to the way that Ruwiki %RV#% works as compared to
- versions of Ruwiki 0.8.0 or earlier is that Ruwiki %RV#% supports being
- installed in a central location by one of the two major packaging
- systems available for Ruby (\RubyGems and RPA). Managing these
- deployments is accomplished with the utility appropriately enough named
- <tt>ruwiki</tt>, stored in the directory of the distribution.
-
- This utility has little value for users of the standalone release
- (either of the versions packaged in tarfiles or zipfiles), but is
- developed because packaging systems present a particular challenge to
- Ruwiki, as simply running &ldquo;ruwiki_servlet&rdquo; with no
- arguments will look for the data files and the template files relative
- to the current directory. With \RubyGems, though, this would require
- that the user specify something like:
-
- ruwiki_servlet \
- --template-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.9.0/templates \
- --flatfiles-data-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.9.0/data
-
- This is not the preferred option because Wiki installations may be
- private and the /usr/local directory is a system-wide shared
- directory. Additionally, since Ruwiki works as a CGI, the system
- shared data and template paths will not be generally accessible (and
- should not be world-writeable!) to CGI executables.
-
- This utility also encapsulates Win32 service management through
- Win32::Service for the \WEBrick servlet runner.
-
- === <tt>ruwiki <command> [<em>parameters</em>]</tt>
- The <tt>ruwiki</tt> utility will recognise four different commands on
- all platforms and a fourth command on Windows. These commands are:
-
- ; help : Displays general help or command-specific help.
- ; install : Installs the default deployment package.
- ; package : Packages a Ruwiki installation.
- ; unpackage : Unpackages a Ruwiki installation.
- ; service : Manages a Win32::Service for Ruwiki.
-
- ==== <tt>ruwiki help commands</tt>
- The list of known commands can be displayed by providing this command.
-
- % ruwiki help commands
- ==== <tt>ruwiki help <command></tt>
- The help for the named command (one of install, package, unpackage, or
- service) will be displayed upon providing this command to the ruwiki
- utility.
-
- % ruwiki help install
- ==== <tt>ruwiki install [<em>OPTIONS</em>] [<em>--to DEST</em>]
- Creates a new Ruwiki instance in the current directory or the directory
- specified by the <tt>--to</tt> option. By default, the data, template,
- and a default configuration file are installed to the destination
- directory. OPTIONS may be one of the following:
-
- ; servlet : Installs the Ruwiki WEBrick servlet stub.
- ; service : Installs the Ruwiki Win32::Service stub.
- ; cgi : Installs the Ruwiki CGI script model.
- ; data : Default; installs the Ruwiki default data, templates, and configuraiton file.
-
- Installation option names can be disabled with a dash (&lsquo;-&rsquo;)
- or the word &lsquo;no&rsquo;, making &lsquo;-data&rsquo; and
- &lsquo;nodata&rsquo; functionally equivalent.
-
- % ruwiki install cgi data
- ==== <tt>ruwiki package [<em>SOURCE</em>] [<em>--output PACKAGE</em>|<em>-o PACKAGE</em>] [<em>--replace</em>]</tt>
- Packages the Ruwiki files (data, templates, and executables) from the
- specified source or the current directory into the specified output
- package (or &ldquo;./ruwiki.pkg&rdquo;). If the SOURCE is a ruwiki
- configuration file (e.g., &ldquo;ruwiki.conf&rdquo;), then that will be
- used to determine the location and name of the data and template
- directories.
-
- Specify <tt>--replace</tt> to replace the existing output package. If
- an output package is specified that already exists, then <tt>ruwiki
- package</tt> will refuse to output to the file unless
- <tt>--replace</tt> is specified. If an output package is not specified
- and <tt>--replace</tt> is not specified, then an incremental package
- will be generated (e.g., &ldquo;./ruwiki-1.pkg&rdquo;).
-
- : NOTE: The packaging process will normalize the data and templates
- : directory names to be relative to the unpacking directory. They will
- : NEVER be absolute paths.
-
- % ruwiki package
- ==== <tt>ruwiki unpackage [<em>SOURCE</em>] [<em>--output DIRECTORY</em>|<em>-o DIRECTORY</em>]</tt>
- Unpackages the provided Ruwiki package (default "./%1$s") into the
- specified directory (default ".").
-
- % ruwiki unpackage
- ==== <tt>ruwiki service <command> <NAME> [<em>command-options</em>]</tt>
- Manages a Ruwiki WEBrick servlet as a Win32 service (with the
- assistance of
- [http://raa.ruby-lang.org/list.rhtml?name=win32-service win32-service]).
- This works in ways similar to a daemon on Unix. The sub-commands
- available to <tt>ruwiki service</tt> are:
- ===== <tt>ruwiki service install NAME [DESCRIPTION] [options]</tt>
- Installs the Ruwiki WEBrick servlet as the named Win32 service.
- <tt>install</tt> accepts an optional description (all non-options will
- be included in the description). The options for <tt>install</tt> are:
- ; --rubybin RUBYPATH : The path to the Ruby binary.
- ; --exec SERVICEPATH : The path to the service executable.
- ; --home PATHTOHOME : The path to the home directory.
- ===== <tt>ruwiki service start NAME</tt>
- Starts the named Ruwiki service.
- ===== <tt>ruwiki service stop NAME</tt>
- Stops the named Ruwiki service.
- ===== <tt>ruwiki service delete NAME</tt>
- Deletes the named Ruwiki service.
-
- : NOTE: This command can probably be used to manage other Win32
- : services that respond to the appropriate commands.
-
- == Upgrading and Converting: ruwiki_convert
- : This section was formerly a separate entry in the Wiki entitled
- : &ldquo;Upgrading and Converting&rdquo;.
-
- The flatfile backend format in Ruwiki %RV#% is not compatible with that
- of versions of Ruwiki earlier than 0.8.0. There are a number of
- reasons for this, but because of this and that there are now three
- different backend formats, Ruwiki now has a converter utility between
- backends.
-
- There are two other incompatibilities of note:
- # Ruwiki now defaults to &ldquo;ruwiki&rdquo; as an extension (e.g., \ProjectIndex.ruwiki) to the storage files. This is, of course, is something that can be modified with a configuration option, but you may find it desirable to rename your files to match this naming convention.
- # The rdiff format is incompatible. It is recommended that you remove all .rdiff files from your data directory before using Ruwiki.
-
- === ruwiki_convert [options] <directory>+
- The converter utility will work on all files in a directory and its
- subdirectories.
-
- When a file is encountered, it will be examined to be a known form of a
- Ruwiki backend (marshal, yaml, flatfiles, or "old" flatfiles). If the
- file is not one of these forms, then the file is skipped. Otherwise, it
- is converted to the specified format. By default, the converted files
- will be backed up.
-
- ==== ruwiki_convert Options
- ; --format=FORMAT : Converts encountered files (regardless of the current format), to the specified format. Default is yaml. Allowed formats are: yaml marshal flatfiles
- ; --[no-]backup : Create backups of upgraded files. Default is --backup.
- ; --backup-extension=EXTENSION : Specify the backup extension. Default is "~", which is appended to the data filename.
- ; --extension=EXTENSION : Specifies the extension of Ruwiki data files. The default is .ruwiki
- ; --no-extension : Indicates that the Ruwiki data files have no extension.
- ; --quiet : Runs quietly. Default is to run with normal messages.
- ; --verbose : Runs with full messages. Default is to run with normal messages.
- ; --help : Shows this text.
-properties!project: Ruwiki
-properties!title: RuwikiUtilities
-properties!topic: RuwikiUtilities
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/SandBox.ruwiki b/ruwiki/trunk/data/Ruwiki/SandBox.ruwiki
deleted file mode 100644
index dfe4911..0000000
--- a/ruwiki/trunk/data/Ruwiki/SandBox.ruwiki
+++ /dev/null
@@ -1,8 +0,0 @@
-page!content: This page is intended for users to play with freely to practice
- their \WikiFormatting.
-properties!project: Ruwiki
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/To_Do.ruwiki b/ruwiki/trunk/data/Ruwiki/To_Do.ruwiki
deleted file mode 100644
index 38242fd..0000000
--- a/ruwiki/trunk/data/Ruwiki/To_Do.ruwiki
+++ /dev/null
@@ -1,50 +0,0 @@
-page!content: = Ruwiki %RV#% To Do Tracking
- Completed to-do items can be found in the ChangeLog. Bugs in Ruwiki
- are tracked in BugTracking.
-
- == Well-Defined To Do Items
- === Ruwiki 0.10.0
- ; Versioning : complete the change history interface. Change history is currently stored in a file <em>topic[.extension]</em>.rdiff. There is no way to display the change history at this point.
- ; Action objects : Actions will be generalised to pull the processing out of the main ruwiki.rb inasmuch as is possible.
- ; Function tokens : generalize the %&lt;function-name&gt;[(&lt;args&gt;)] calling method so that function tokens can be created without having to create a custom regular expression.
- ; Search work : There is further search work required. The current mechanism is effective, but inefficient, as it must load and convert each file in a project to a page and then search selectively within that page. The search mechanism must be improved.
- ; Frozen content : make it so that frozen content can be provided on a per-page or Wiki basis. Will provide both headers and footers. <strong>Note:</strong> Ruwiki 0.9.0 will only provide the ability to present the information, not create or modify it.
- ; Blacklisting : Allow the specification of an allow/deny list for \IPs or hostnames, aimed at blocking known spammers. Entries in this list can be permanent or temporary (e.g., &ldquo;* DENY&rdquo;, &ldquo;spammer.com DENY UNTIL 20040723&rdquo;, &ldquo;139.244.33.25 ALLOW&rdquo;).
- ; External URL redirection : Add whitelisting of known good external URIs.
- ; \GlobalRecentChanges : Recent changes for all projects.
- ;
- === Ruwiki 0.11.0
- ; Authentication : complete authentication to provide for a standard Ruwiki authentication mechanism, not just an external API. This may require changes to the existing external API. Allows for user creation and authentication. Authenticate users bypass blacklist checking; thus, if &ldquo;msn.com&rdquo; is blocked, joe.blog@msn.com could still authenticate with Ruwiki and edit the pages.
- ; Topic renaming : add the ability to rename a topic within a project. Topic change history should be maintained.
- ; Topic moving : add the ability to move and/or rename a topic between projects. Topic change history should be maintained.
- ; Complete documentation : Complete the documentation of Ruwiki.
- ; Antispam : Allow the on-line editing of antispam lists to authenticated and authorised users.
- === Ruwiki 1.0.0
- ; RSS Feed : Ruwiki must be able to offer \RecentChanges and \GlobalRecentChanges as RSS feeds. This may not be ideal with the current \RecentChanges format. It may be easier to move to a two-stage \RecentChanges format.
- ; Static content : Allow the creation and editing of static content.
- ; Frozen pages : provide the ability to freeze content in place; the page is no longer &ldquo;wiki&rdquo; editable and is effectively a plain HTML page.
- ; Page properties : provide the ability to generally edit the properties of a given page.
-
- == General Future To Do Items
- ; E-mail gateway : accept topic appends via e-mail.
- ; alternative backends : access other wiki data storage, or other formats, e.g. e-mail boxes in mh or mbox formats
- ; bug tracker backend : with alternate markup
- ; add setup and user config methods : for backend plugin classes, then we can use them with an interactive or gui tool frontend to setup data storage backends. The user might have to run as root or other user with database create permissions.
- ; add id="" to various markup elements (make id specific to topic) : Later we can allow users to tweak a page using uploaded css fragments which might get appended onto the standard css contents.
- ; ruby action : upload a ruby code fragment to add a smart &ldquo;action&rdquo; to that wiki page. Need some sort of security + approval system to handle this safely.
- ; Preview button : add a preview button to the save page.
- ; Alternative templating systems : not as high priority now that there&rsquo;s a real templating system in place.
- ; Alternative markup systems : potentially allow \RedCloth (Textile) and/or \BlueCloth (Markdown) to be processed for a page. This could be implemented as a %function.
- ; Project/topic security : allow certain projects to be restricted/authenticated for read/write based on user.
- ; Track last <em>n</em> links/topics : ?
- ; Write a markup debugger : ?
- ; Validate topic formatting from cgi : ?
- ; Validate project from cgi : ?
- ; Project-based backend : Allow different projects to have different backends.
- ; Arbitrary-depth project namespace support : Foo::Bar::\BazPage.
-properties!project: Ruwiki
-properties!title: To_Do
-properties!topic: To_Do
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/TroubleShooting.ruwiki b/ruwiki/trunk/data/Ruwiki/TroubleShooting.ruwiki
deleted file mode 100644
index 7ccfde4..0000000
--- a/ruwiki/trunk/data/Ruwiki/TroubleShooting.ruwiki
+++ /dev/null
@@ -1,32 +0,0 @@
-page!content: = Ruwiki %RV#%
- = Ruwiki %RV#% Troubleshooting Tips
- Following are some tips contributed by users of Ruwiki. Remember:
- Ruwiki currently requires Ruby version 1.8; the YAML backend requires
- Ruby version 1.8.2 or the latest CVS of Ruby 1.9.
-
- == No such file or directory
- (Unix systems only.) If you get something like:
-
- % ./ruwiki_servlet
- : no such file or directory
-
- run the following in the Ruwiki directory:
-
- % find . | xargs dos2unix
-
- The developers of Ruwiki do what they can to ensure that Ruwiki is
- distributed in a way that works well for both Unix and Windows
- systems, but this will occasionally cause problems.
-
- == undefined method
- % ./ruwiki_servlet
- ./ruwiki_servlet:64: undefined method `[]=' for nil (NameError)
-
- This may appear if you are running Ruby 1.6. Ruwiki requires Ruby 1.8
- or higher; certain features require Ruby 1.8.2 preview 3 or better.
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/WikiFeatures.ruwiki b/ruwiki/trunk/data/Ruwiki/WikiFeatures.ruwiki
deleted file mode 100644
index e47ffdd..0000000
--- a/ruwiki/trunk/data/Ruwiki/WikiFeatures.ruwiki
+++ /dev/null
@@ -1,16 +0,0 @@
-page!content: Ruwiki is a [http://www.ruby-lang.org Ruby]-based wiki. It is
- ideal for personal or small team use.
-
- Ruwiki:
- * Uses the [http://www.ruby-lang.org Ruby] language.
- * Runs quickly and easily as a CGI or \WEBrick servlet.
- * Uses a simple templating system and CSS for presentation.
- * Has flatfile storage with simple versioning.
- * Offers project namespaces. Different projects can have the same topic names and not collide. Thus, \Default::ReadMe and \Project::ReadMe are two different pages.
- * Offers a calendar for date-based collaborative editing.
-properties!project: Ruwiki
-properties!title: WikiFeatures
-properties!topic: WikiFeatures
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Ruwiki/WikiMarkup.ruwiki b/ruwiki/trunk/data/Ruwiki/WikiMarkup.ruwiki
deleted file mode 100644
index 3480564..0000000
--- a/ruwiki/trunk/data/Ruwiki/WikiMarkup.ruwiki
+++ /dev/null
@@ -1,260 +0,0 @@
-page!content: = Ruwiki Markup
- A [http://c2.com/cgi/wiki Wiki] obeys certain formatting rules to make
- it easy to format text without needing to know HTML. This Wiki obeys
- the following rules by default. Because Ruwiki is extensible, there may
- be additional formatting rules. These rules are those rules that apply
- as of Ruwiki %RV#%.
-
- == \WikiWords, \WikiProjects, Calendars, and External Resources
- While reading stuff on this Wiki, you will see some words mashed
- together with capitalisation (like \WikiWords). While this may seem odd
- at first, this feature allows internal links to be created across the
- Wiki.
-
- There are several allowable forms for \WikiWords.
- # Two or more words concatenated directly. Each word must begin with a capital letter and be followed by zero or more lowercase letters. Thus, \FooBar, \CPlusPlus, and \AbC are all valid \WikiWords, but ABC is not.
- # Two or more words concatenated with underscores. The first word must begin with a capital letter. This makes \Foo_Bar, \C_Plus_Plus, and \A_b_C valid \WikiWords. These \WikiWords will be displayed with spaces instead of underscores. \C_Plus_Plus will be displayed as &ldquo;C Plus Plus&rdquo;.
- # One or more words contained in double square brackets. This the form supported by [http://wikipedia.com/ Wikipedia], and looks like \[[A Wiki Phrase]]. These links will be displayed exactly as entered between the brackets.
- # One or more words contained in double square brackets with display text separated by a vertical bar. These \WikiWords look like \[[A Wiki Phrase|but show this text]]. The link will be to the page &ldquo;A Wiki Phrase&rdquo; and &ldquo;but show this text&rdquo; will be the hyperlink.
-
- If a \WikiWord is found that does not have a page defining the
- \WikiWord, then the word will be shown with a hyperlink question mark
- following it, allowing the \WikiWord to be created.
-
- === \WikiProjects
- This Wiki supports &ldquo;projects.&rdquo; Within each project, a given
- \WikiWord is unique. Thus, if you have a Default project and a Ruwiki
- project, you can have two pages called \ReadMe. Any given \WikiWord
- refers only to topics within its project. That is, if I have \WikiWord
- in the \ReadMe topic of the Default project, it will refer to the
- \WikiWord topic of the Default project. (Another term for this
- capability is &ldquo;namespaces.&rdquo;)
-
- A cross-project link is composed of the project&rsquo;s name, two colons
- (::), and the \WikiWord desired. Thus, from \Default::ReadMe, I can
- have \Ruwiki::ReadMe as a link. The project index can be referred to
- with \::Project. This is the same as doing \Project::ProjectIndex.
- Thus, \::Ruwiki becomes ::Ruwiki, which is the same as
- \Ruwiki::ProjectIndex (Ruwiki::ProjectIndex).
-
- === Project Lists and Topic Lists
- The list of known projects may be listed with the %projects() token;
- the list of known topics for the current project may be listed with the
- %topics() link. An arbitrary project may be provided to the %topics()
- token, as in %topics(Default).
-
- %topics(Default)
-
- %projects()
-
- === Calendars
- Ruwiki supports a miniature calendar. Future versions of Ruwiki will
- allow for calendar aggregation. Using the %calendar function, a
- calendar section will be generated:
-
- %calendar(<year>, <month>[, <project>])
- %calendar(today[, <project>])
-
- %calendar accepts either the English word &ldquo;today&rdquo; (displaying the
- calendar for the current month and year) or a specific month and year
- for display. A calendar for the specified month will be generated
- where each date in the month is treated as a \WikiWord (as are the
- links to the current month, the previous month, and the next month)
- ready for display or editing. As with all other \WikiWord links in
- Ruwiki, a project may be specified in %calendar, making
- &ldquo;%calendar(today, Ruwiki)&rdquo; different from &ldquo;%calendar(today, Default)&rdquo;.
-
- %calendar(today)
- %calendar(1999, 08, Default)
-
- === External Resources
- Ruwiki behaves intelligently about resources external to the Wiki
- itself.
-
- ==== External Links
- \URLs to external resources are automatically detected for web
- addresses, FTP addresses, newsgroups, and email links. They are
- automatically converted to clickable \URLs. Be aware that some things
- that look like URL schemas may be make clickable but are not really
- \URLs.
-
- * \http://www.ruby-lang.org becomes http://www.ruby-lang.org
-
- \URLs may be named with the [url name] syntax. If the name is omitted,
- the URL will be numbered. Numbering is contained to within the page.
-
- * \[http://www.rubygarden.org RubyGarden] becomes [http://www.rubygarden.org RubyGarden].
- * \[http://www.halostatue.ca] and \[http://www.halostatue.ca/ruby] become [http://www.halostatue.ca] and [http://www.halostatue.ca/ruby].
-
- ==== Images
- : <strong>Changed in Ruwiki 0.8.0!</strong>
-
- In preparation for the anti-wiki-spam features of Ruwiki 0.9.0, it has
- been necessary to remove the ability for \URLs to be converted into
- inline images automatically. Inline images are now created with the
- image markup format, generally of the format \[image:URI options]. The
- <em>options</em> format is generally the same format as an HTML
- attribute (<em>name="value"</em>; the quotes are optional for
- single-word option values) and any valid HTML attribute is also a
- valid <em>option</em>. There is one special <em>option</em>,
- <tt>numbered</tt>. This value, if set to any other value than &ldquo;false&rdquo;,
- will set the <tt>title</tt> of the image to a numbered link.
-
- If the <tt>title</tt> attribute is not specified, it will be set from
- the <tt>alt</tt> attribute (if specified) or the image&rsquo;s URL. If the
- <tt>alt</tt> attribute is not specified, it will be set from the
- <tt>title</tt> attribute.
-
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif] [image:http://www.halostatue.ca/graphics/maple_leaf.gif]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true] [image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"]
-
- ==== Ruby Mailing Lists
- If a Ruby mailing list message tag is provided, it will be converted appropriately.
-
- * \[ruby-talk:12345] will become [ruby-talk:12345]
- * \[ruby-core:12345] will become [ruby-core:12345]
- * \[ruby-doc:12345] will become [ruby-doc:12345]
-
- == Headings and Lists
- === Headings
- Use equals signs (=) for headings. Up to six equals signs can be used
- for HTML headings 1 - 6.
-
- \===== Heading five<br />
- \====== Heading six
- ===== Heading five
- ====== Heading six
-
- === Lists
- ==== Bulleted Lists
- Use asterisks (*) to create bulleted lists. More asterisks means more
- levels.
-
- \* level 1<br />
- \** level 2<br />
- \*** level 3
-
- * level 1
- ** level 2
- *** level 3
-
- ==== Numbered Lists
- Use hash marks (#) for numbered lists. More hash marks means deeper
- levels.
-
- \# level 1<br />
- \## level 2<br />
- \### level 3<br />
- \### level 3.2<br />
- \## level 2.2<br />
- \# level 1.2
-
- # level 1
- ## level 2
- ### level 3
- ### level 3.2
- ## level 2.2
- # level 1.2
-
- ==== Definition Lists
- Definitions can be created similar to other lists. Unlike &ldquo;standard&rdquo;
- lists, though, definition lists have both the term and the definition.
- They are specified like so. As with other lists, repeating the first
- item (;) will increase the indentation level. The browser may not
- respect this.
-
- \; term : definition<br />
- \;; term2 : definition<br />
- \;;; term3 : definition
-
- ; term : definition
- ;; term2 : definition
- ;;; term3 : definition
- == Paragraph Formatting
- === Rules
- Four or more dashes ("----") on a line by itself makes a horizontal
- rule, like so:
-
- \----
- ----
- === Paragraphs
- A blank line (it may have whitespace on it) marks a new paragraph. All
- other lines are joined together (excepting headers, lists, and rules).
-
- This line is a new paragraph.
-
- === Block Indent Paragraphs
- Paragraphs can be indented by beginning the paragraph with one or more
- colons (:).
-
- \: Indent Level 1<br />
- \:: Indent Level 2<br />
- \::: Indent Level 3
-
- : Indent Level 1
- :: Indent Level 2
- ::: Indent Level 3
-
- Paragraphs may be indented as &ldquo;cites&rdquo; by using one or more
- greater-than signs (>) at the beginning of the line.
-
- \> Indent Level 1<br />
- \>> Indent Level 2<br />
- \>>> Indent Level 3
-
- > Indent Level 1
- >> Indent Level 2
- >>> Indent Level 3
-
- === Code
- Text that is indented will be presented as formatted in a monospaced
- font. The only change is to escape HTML entities &lt; (&amp;lt;), &gt;
- (&amp;gt;), and &amp; (&amp;amp;).
-
- def replace
- content = @match[1]
- %Q{<pre>#{content}</pre>}
- end
-
- == Miscellaneous Formatting
- === HTML
- The Ruwiki engine currently passes through HTML without changes. Thus,
- &lt;strong&gt;strong&lt;/strong&gt; would be shown as
- <strong>strong</strong>. <strong><em>Note:</em></strong> This
- capability could be very dangerous as it could expose the Wiki to
- cross-site scripting (XSS) vulnerabilities. This will be remedied
- prior to the 1.0 release of Ruwiki.
-
- === Abbreviations
- Certain abbreviations may be known to the Wiki. While there is not yet
- any way for a user to query what abbreviations are known, if the
- abbreviations are told to the users, they may be used. Abbreviations
- are presented with @{key}, where <em>key</em> is the abbreviation
- desired. This Wiki, for example, knows that \@{matz} means &ldquo;@{matz}&rdquo;.
- The special form \@{} will produce the current list of known
- abbreviations. Unknown abbreviations will simply be put back into the
- data stream unchanged. Thus, \@{unknownkey} results in @{unknownkey}.
-
- ==== Known Abbreviations
- @{}
-
- === Preventing Formatting
- If you wish to prevent a word or sequence from being interpreted, put
- a backslash (\) in front of it. This works on all formatting options
- except paragraph positioning. Thus, if I want to prevent a \WikiWord
- from being turned into a hyperlink, I need to backslash it:
- \\WikiWord.
-
- === Other Possible Considerations
- I&rsquo;m looking at adding styles similar to what is shown on the Wiki
- below.
-
- * http://www.pmichaud.com/wiki/PmWiki/WikiStyles
-properties!project: Ruwiki
-properties!title: WikiMarkup
-properties!topic: WikiMarkup
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Tutorial/AddingPages.ruwiki b/ruwiki/trunk/data/Tutorial/AddingPages.ruwiki
deleted file mode 100644
index c405b70..0000000
--- a/ruwiki/trunk/data/Tutorial/AddingPages.ruwiki
+++ /dev/null
@@ -1,15 +0,0 @@
-page!content: = Adding Pages
- To add a new page to Ruwiki, all you need to do is come up with a
- meaningful title, turn it into a \WikiWord (see Ruwiki::WikiMarkup) and
- Ruwiki will automatically recognise it as a reference to a page that
- does not yet exist.
-
- At the end of the new \WikiWord is a hyperlinked question mark;
- clicking on this will open the edit page for the new \WikiWord in
- Ruwiki.
-properties!project: Tutorial
-properties!title: AddingPages
-properties!topic: AddingPages
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Tutorial/AddingProjects.ruwiki b/ruwiki/trunk/data/Tutorial/AddingProjects.ruwiki
deleted file mode 100644
index 6f27415..0000000
--- a/ruwiki/trunk/data/Tutorial/AddingProjects.ruwiki
+++ /dev/null
@@ -1,15 +0,0 @@
-page!content: = Adding Projects
- To add a new project to Ruwiki, all you need to do is come up with a
- meaningful one-word name, and then turn it into a project link, e.g.,
- \::Project. Projects may <strong>only</strong> be a single word &mdash;
- they are not normal \WikiWords (see Ruwiki::WikiMarkup for details).
- Ruwiki will recognise this as a project that does not yet exist. At the
- end of the Project link is a hyperlinked question mark; clicking on
- this will open the \Project::ProjectIndex in Ruwiki for editing and
- create the new project.
-properties!project: Tutorial
-properties!title: AddingProjects
-properties!topic: AddingProjects
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Tutorial/ProjectIndex.ruwiki b/ruwiki/trunk/data/Tutorial/ProjectIndex.ruwiki
deleted file mode 100644
index 25aaefd..0000000
--- a/ruwiki/trunk/data/Tutorial/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,10 +0,0 @@
-page!content: = Ruwiki %RV#% Tutorial
- This tutorial is incomplate.
-
- %topics(Tutorial)
-properties!project: Tutorial
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/Tutorial/SandBox.ruwiki b/ruwiki/trunk/data/Tutorial/SandBox.ruwiki
deleted file mode 100644
index 0488031..0000000
--- a/ruwiki/trunk/data/Tutorial/SandBox.ruwiki
+++ /dev/null
@@ -1,8 +0,0 @@
-page!content: This page is intended for users to play with freely to practice
- their \WikiFormatting.
-properties!project: Tutorial
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: %RV#%
diff --git a/ruwiki/trunk/data/agents.banned b/ruwiki/trunk/data/agents.banned
deleted file mode 100644
index 93500d9..0000000
--- a/ruwiki/trunk/data/agents.banned
+++ /dev/null
@@ -1,60 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of User Agent strings which will be greeted
-# with "403 Forbidden" responses by Ruwiki. These are generally known email
-# harvesters or link directory builders for reciprocal link partners. These
-# may also be robots that routinely ignore the robots.txt file.
-#
-# This list is generated from a wide variety of sources including:
-# * http://www.clockwatchers.com/robots_list.html
-# * http://searchenginewatch.com/webmasters/article.php/2167991
-# * http://www.neilgunton.com/spambot_trap/
-# * http://www.robotstxt.org/wc/active/all.txt
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# foo
-# bar
-#
-# becomes:
-#
-# %r{foo|bar}x
-#++
-
- # Known email harvesters
-(?i:^nicerspro)
-(?i:^teleport)
-^CherryPicker
-^Crescent # Crescent Internet ToolPak
-^EmailCollector
-^EmailSiphon
-^EmailWolf
-^ExtractorPro
-^Microsoft\sURL
-^WebEMailExtrac
-
- # Link directory builders.
-^LinkWalker
-^Zeus.*Webster
-
- # Strongly suspected spoofed user agents from spam harvesters. These user
- # agents have been reported patterns by other antispam fighters.
-^[A-Z]+$
-^Internet\sExplore\s5.x
-^Mozilla.*NEWT
-^Mozilla\/4.0$
-MSIECrawler
diff --git a/ruwiki/trunk/data/agents.readonly b/ruwiki/trunk/data/agents.readonly
deleted file mode 100644
index e7168c5..0000000
--- a/ruwiki/trunk/data/agents.readonly
+++ /dev/null
@@ -1,321 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of User Agent strings which will be given
-# readonly versions of the wiki instance.
-#
-# This list is generated from a wide variety of sources including:
-# * http://www.clockwatchers.com/robots_list.html
-# * http://searchenginewatch.com/webmasters/article.php/2167991
-# * http://www.neilgunton.com/spambot_trap/
-# * http://www.robotstxt.org/wc/active/all.txt
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# foo
-# bar
-#
-# becomes:
-#
-# %r{foo|bar}x
-#++
-
-(?:^.*HTTrack)
-(?:^.*LWP)
-(?:^Digimarc)
-(?:ChristCrawler.com|ChristCrawler@ChristCENTRAL.com)
-(?:Net|Web)Mechanic
-(?:PerlCrawler|Xavatoria)/
-(?:pjspider|PortalJuice.com)
-(?:spider_monkey|mouse.house)
-(?:tach_bw|Black\sWidow)
-(?:topiclink|TLSpider)
-(?i:(?-i:ComputingSite\s)?Robi)
-(?i:^curl)
-(?i:^googlebot)
-(?i:^gulliver) # NorthernLight
-(?i:^Scooter) # Altavista
-(?i:^w[@a]pSpider)
-(?i:infoseek) # InfoSeek
-^ABCdatos\sBotLink # http://www.abcdatos.com/botlink/
-^AITCSRobot/
-^anthill
-^appie
-^Arachnoidea # Euroseek
-^Arachnophilia
-^arale
-^araneo
-^AraybOt
-^ArchitextSpider # Excite, WebCrawler
-^ariadne
-^arks
-^Ask\s?Jeeves/Teoma
-^ASpider/
-^ATN_Worldwide
-^Atomz
-^AURESYS/
-^BackRub/
-^BaySpider
-^bbot
-^Big\sBrother
-^Bjaaland
-^BlackWidow
-^borg-bot/
-^(?i:boxseabot)
-^BSpider/
-^CACTVS\sChemistry\sSpider
-^calif
-^Checkbot/
-^cienciaficcion.net
-^CMCM/
-^combine
-(?i:^confuzzledbot)
-^CoolBot
-^cosmos
-^crawlpaper
-^cusco
-^cyberspyder
-(?i:^cydralspider)
-^desert\s?realm
-^Deweb
-^Die\sBlinde\sKuh
-^dienstspider/
-^digger
-^Digger
-^DIIbot
-^dlw3robot/
-^DNAbot/
-^downloadexpress
-^DragonBot
-^Duppies
-^dwcp
-^ebiness
-^ecollector
-^EIT-Link-Verifier-Robot/
-^elfinbot
-^Emacs-w3/
-^EMC\sSpider
-(?i:^esculapio)
-^ESI
-^esther
-^Evliya\sCelebi
-^explorersearch
-^fast # Fast/AllTheWeb
-^fastcrawler
-^FDSE
-^FELIX\s?IDE
-^fido
-^Fish-Search-Robot
-^fouineur
-^Freecrawl
-^FunnelWeb-
-^gammaSpider
-^gazz
-^gcreep
-^gestalttIconoclast/
-^Getterrobo-?Plus
-^GetURL\.rexx
-^golem
-^grabber
-^griffon
-^Gromit
-^gulper
-^hambot
-^havIndex
-^HKU\sWWW\sRobot
-^Hometown\sSpider\sPro
-^Hämähäkki
-^hotwired
-^htdig
-^htmlgobble
-^IAGENT/
-^iajabot
-^IBM_Planetwide
-^image\.kapsi\.net
-^IncyWincy
-^Informant
-^InfoSpiders
-^INGRID/
-^inspectorwww
-^Internet\sCruiser\sRobot
-^irobot
-^Iron33
-^IsraeliSearch/
-^JavaBee
-^JBot
-^jcrawler
-^jobo
-^Jobot/
-^JoeBot/
-^JubiiRobot/
-^jumpstation
-^Katipo/
-^KDD-Explorer
-^KIT-Fireball # Fireball.de
-^ko_yappo_robot
-^label-grabber
-^LabelGrab/
-^larbin
-^legs
-^Linkidator
-^LinkScan\s(?:Server|Workstation)
-^Lockon
-^logo\.gif\scrawler
-^logo_gif_crawler
-^Lycos_Spider_(T-Rex) # Lycos
-^M/
-^Magpie/
-^marvin
-^mattie
-^mediafox
-^MerzScope
-^MindCrawler
-^moget
-^MOMspider/
-^Monster
-^Motor
-^Mozilla/3\.01\s(Win95;\sI) # InfoSeek
-^Mozilla\/3.0.+Indy\sLibrary
-^msnbot
-^muncher
-(?i:^muninn)
-^MuscatFerret
-^MwdSearch
-^NDSpider/
-^NEC-MeshExplorer
-^Nederland.zoek
-^Net.Vampire
-^NetCarta
-^NetScoop
-^newscan-online
-^NHSEWalker/
-^Nomad
-^NorthStar
-^NPBot # Detects IP violations(?)
-^ObjectsSearch
-^Occam
-^Openbot # OpenFind
-^Openfind
-^Orbsearch
-^PackRat
-^pageboy
-^parasite
-^patric
-^PBWF
-^pegasus
-^Peregrinator-Mathematics/
-^PGP-KA/
-^phpdig
-^piltdownman
-^Pimptrain
-^Pioneer
-^Plucker
-^PlumtreeWebAccessor
-^Poppi/
-^PortalBSpider
-^psbot
-^Raven
-^Resume\sRobot
-^RHCS
-^RixBot
-^Road\s?Runner
-^Robbie
-^RoboCrawl
-^robofox
-^Robot\sdu\sCRIM
-^Robozilla/
-^root/
-^Roverbot
-^RuLeS/
-^SafetyNet\sRobot
-^Search-AU
-^searchprocess
-^searchterms\.it
-^Senrigan
-^SG-Scout
-^Shagseeker
-^Shai'Hulud
-^sharp-info-agent
-^SimBot
-^Site\sValet
-^sitecheck
-^SiteTech-Rover
-^SLCrawler
-^Sleek\sSpider
-^Slurp # Inktomi, AOL
-^snooper
-^solbot
-^speedy
-^SpiderBot
-^spiderline
-^SpiderMan
-^SpiderView
-^ssearcher
-^suke
-^suntek
-(?i:http://www.sygol.com)
-^T-H-U-N-D-E-R-S-T-O-N-E
-^Tarantula/
-^tarspider
-^TechBOT
-^Templeton
-^TeomaAgent # Teoma
-^TITAN
-^titin
-^TurnitinBot # Plagiarism detector
-^UCSD-Crawler
-^UdmSearch
-^udmsearch
-^Ukonline
-^uptimebot
-^URL\sSpider\sPro
-^urlck
-^Valkyrie
-^verticrawl
-^Victoria
-^vision-search
-^void-bot
-^Voyager
-^VWbot_K
-^w3index
-^W3M2/
-^w3mir
-^WebBandit
-^webcatcher
-^WebCopier
-^WebCopy
-^WebFetcher/
-^weblayers/
-^WebLinker/
-^WebMoose
-^webquest
-^WebReaper
-^webs
-^webspider
-^webvac
-^webwalk
-^WebWalker
-^WebWatch
-^wget
-^whowhere
-^winona
-^wired-digital-newsbot/
-^wlm
-^WOLP
-^WWWC
-^WWWWanderer
-^XGET
-^ZyBorg # WiseNut/LookSmart
diff --git a/ruwiki/trunk/data/clean.uri b/ruwiki/trunk/data/clean.uri
deleted file mode 100644
index cf38b6f..0000000
--- a/ruwiki/trunk/data/clean.uri
+++ /dev/null
@@ -1,37 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of URIs or partial URIs that will not be
-# redirected by the automatic redirection technique. It is recommended that the
-# Regular Expression be specific and be anchored to prevent "similar" URIs from
-# being handled poorly. Non HTTP/HTTPS URIs are not redirected at this time.
-#
-# This file is in "extended" regular expression format, one optional expression
-# to a line. Spaces are not significant and comments are allowed. If you want
-# to recognise a space in your regular expression, do so either with a
-# character class ([ ]) or the whitespace meta-character (\s). Hash marks must
-# be escaped (\#) or they will be treated as comment markers. Blank or
-# comment-only lines are ignored. All other lines will be joined together:
-#
-# ^http://[^/]*?ruby-lang.org/?.*$
-# ^http://[^/]*?rubyforge.org/?.*$
-#
-# becomes:
-#
-# %r{^http://[^/]*?ruby-lang.org/?.*$|^http://[^/]*?rubyforge.org/?.*$}
-#++
-(?ix-m:^http://[^/]*?ruby-lang.org/?.*$)
-(?ix-m:^http://[^/]*?rubyforge.org/?.*$)
-(?ix-m:^http://rubyforge.halostatue.info/?.*$)
-(?ix-m:^http://[^/]*?ruwiki.org/?.*$)
-(?ix-m:^http://[^/]*?ruby-doc.org/?.*$)
-(?ix-m:^http://[^/]*?pragmaticprogrammers.com/?.*$)
-(?ix-m:^http://127\.0\.0\.(\d|\d\d|1\d\d|2[0-4]\d|25[0-5])/?.*$)
-(?ix-m:^http://localhost/?.*$)
diff --git a/ruwiki/trunk/data/hostip.banned b/ruwiki/trunk/data/hostip.banned
deleted file mode 100644
index b7f3c55..0000000
--- a/ruwiki/trunk/data/hostip.banned
+++ /dev/null
@@ -1,30 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of IP address strings which will be greeted with
-# "403 Forbidden" responses by Ruwiki. These are generally known email
-# harvesters or link directory builders for reciprocal link partners. These may
-# also be robots that routinely ignore the robots.txt file.
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will be
-# joined together:
-#
-# 192\.168\.0\..*
-# 127\.0\.0\..*
-#
-# becomes:
-#
-# %r{192\.168\.0\..*|127\.0\.0\..*}
-#++
diff --git a/ruwiki/trunk/data/hostip.readonly b/ruwiki/trunk/data/hostip.readonly
deleted file mode 100644
index 55d589c..0000000
--- a/ruwiki/trunk/data/hostip.readonly
+++ /dev/null
@@ -1,28 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#
-# This file contains the list of IP address strings which will be given
-# readonly versions of the wiki instance.
-#
-# This file is in "extended" regular expression format, one optional
-# expression to a line. Spaces are not significant and comments are
-# allowed. If you want to recognise a space in your regular expression, do
-# so either with a character class ([ ]) or the whitespace meta-character
-# (\s). Hash marks must be escaped (\#) or they will be treated as comment
-# markers. Blank or comment-only lines are ignored. All other lines will
-# be joined together:
-#
-# 192\.168\.0\..*
-# 127\.0\.0\..*
-#
-# becomes:
-#
-# %r{192\.168\.0\..*|127\.0\.0\..*}
-#++
diff --git a/ruwiki/trunk/lib/ruwiki.rb b/ruwiki/trunk/lib/ruwiki.rb
deleted file mode 100644
index d533763..0000000
--- a/ruwiki/trunk/lib/ruwiki.rb
+++ /dev/null
@@ -1,626 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-class Ruwiki
- VERSION = '0.9.3'
- CONTENT_VERSION = 2
-end
-
-require 'cgi'
-require 'ruwiki/handler'
-require 'ruwiki/auth'
-require 'ruwiki/template'
-require 'ruwiki/lang/en' # Default to the English language.
-require 'ruwiki/config'
-require 'ruwiki/backend'
-require 'ruwiki/wiki'
-require 'ruwiki/page'
-
- # = Ruwiki
- # Ruwiki is a simple, extensible Wiki written in Ruby. It supports both
- # CGI and WEBrick interfaces, templates, and CSS formatting. Additionally,
- # it supports project namespaces, so that two pages can be named the same
- # for differing projects without colliding or having to resort to odd
- # naming conventions. Please see the ::Ruwiki project in the running Wiki
- # for more information. Ruwiki has German and Spanish translations
- # available.
- #
- # == Quick Start (CGI)
- # 1. Place the Ruwiki directory in a place that your webserver can execute
- # CGI programs and ensure that ruwiki.cgi is executable on your webserver.
- # 2. Point your web browser to the appropriate URL.
- #
- # == Quick Start (WEBrick)
- # 1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
- # 2. Point your web browser to <http://localhost:8808/>.
- #
- # == Configuration
- # There are extensive configuration options available. The Ruwiki WEBrick
- # servlet offers command-line options that simplify the configuration of
- # Ruwiki without editing the servlet; use ruwiki_servlet --help for more
- # information.
- #
- # == Copyright
- # Copyright:: Copyright © 2002 - 2004, Digikata and HaloStatue, Ltd.
- # Authors:: Alan Chen (alan@digikata.com)
- # Austin Ziegler (ruwiki@halostatue.ca)
- # Licence:: Ruby's
-class Ruwiki
- ALLOWED_ACTIONS = %w(edit create)
- EDIT_ACTIONS = %w(save cancel)
- EDIT_VARS = %w(newpage version edcomment q)
- RESERVED = ['save', 'preview', 'cancel', EDIT_VARS].flatten
-
- # Returns the current configuration object.
- attr_reader :config
- # Returns the current Response object.
- attr_reader :response
- # Returns the current Request object.
- attr_reader :request
- # Returns the current Markup object.
- attr_reader :markup
- # Returns the current Backend object.
- attr_reader :backend
- # Sets the configuration object to a new configuration object.
- def config=(cc)
- raise self.message[:config_not_ruwiki_config] unless cc.kind_of?(Ruwiki::Config)
- @config = cc
- self.config!
- end
-
- def config!
- @markup.default_project = @config.default_project
- @markup.message = self.message
- end
-
- def load_config(filename)
- @config = Ruwiki::Config.read(filename)
- self.config!
- end
-
- # The message hash.
- def message
- @config.message
- end
-
- # Initializes Ruwiki.
- def initialize(handler)
- @request = handler.request
- @response = handler.response
-
- @config = Ruwiki::Config.new
-
- @path_info = @request.determine_request_path || ''
-
- @type = nil
- @error = {}
-
- @markup = Ruwiki::Wiki.new(@config.default_project,
- @request.script_url,
- @config.title)
- end
-
- # Initializes the backend for Ruwiki.
- def set_backend
- @backend = BackendDelegator.new(self, @config.storage_type)
- @markup.backend = @backend
- # Load the blacklists here because I don't as of yet know where else
- # to put them. :(
- @banned_agents = load_blacklist('agents.banned')
- @banned_hostip = load_blacklist('hostip.banned')
- @readonly_agents = load_blacklist('agents.readonly')
- @readonly_hostip = load_blacklist('hostip.readonly')
- # Prevent Google redirection against these URIs.
- Ruwiki::Wiki.no_redirect = load_blacklist('clean.uri')
- end
-
- def load_blacklist(filename)
- data = []
- filename = File.join(@config.storage_options[@config.storage_type]['data-path'], filename)
- ii = '^'
- jj = /^#{ii}/o
- File.open(filename, 'rb') do |f|
- f.each do |line|
- line.gsub!(%r{^\s*#.*$}, '')
- line.strip!
- if line.empty?
- data << nil
- else
- if line =~ jj
- data << "(?:#{line}\n)"
- else
- data << line
- end
- end
- end
- end
- data.compact!
- if data.empty?
- nil
- else
- Regexp.new(data.join("|"), Regexp::EXTENDED)
- end
- rescue
- return nil
- end
-
- def check_useragent
- addr = @request.environment['REMOTE_ADDR']
- user = @request.environment['HTTP_USER_AGENT']
-
- if user.nil? or user.empty?
- :forbidden
- elsif @banned_hostip and addr and addr =~ @banned_hostip
- :forbidden
- elsif @banned_agents and user =~ @banned_agents
- :forbidden
- elsif @readonly_hostip and addr and addr =~ @readonly_hostip
- :read_only
- elsif @readonly_agents and user =~ @readonly_agents
- :read_only
- else
- :clean
- end
- end
-
- # Runs the steps to process the wiki.
- def run
- @config.verify
- set_backend
- set_page
- process_page
- render
- rescue Exception => ee
- render(:error, ee)
- ensure
- output
- end
-
- # Initializes current page for Ruwiki.
- def set_page
- path_info = @path_info.split(%r{/}, -1).map { |ee| ee.empty? ? nil : ee }
-
- if path_info.size == 1 or (path_info.size > 1 and path_info[0])
- raise self.message[:invalid_path_info_value] % [@path_info] unless path_info[0].nil?
- end
-
- # path_info[0] will ALWAYS be nil.
- path_info.shift
-
- case path_info.size
- when 0 # Safety check.
- nil
- when 1 # /PageTopic OR /_edit
- set_page_name_or_action(path_info[0])
- when 2 # /Project/ OR /Project/PageTopic OR /Project/_edit OR /Project/create
- @project = path_info.shift
- set_page_name_or_action(path_info[0])
- else # /Project/PageTopic/_edit OR /Project/diff/3,4 OR something else.
- @project = path_info.shift
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- else
- @topic = item
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- end
- end
- end
-
-# @request.each_parameter { |key, val| puts "#{key} :: #{val.class}" }
-
- @project ||= @config.default_project
- @topic ||= @config.default_page
- end
-
- PROJECT_LIST_ITEM = %[%1$s (a href='\\%2$s/%1$s/_topics' class='rw_minilink')%3$s\\</a\\>]
-
- # Processes the page through the necessary steps. This is where the edit,
- # save, cancel, and display actions are present.
- def process_page
- content = nil
- formatted = false
-
- @page = Ruwiki::Page.new(@backend.retrieve(@topic, @project))
- @type = :content
-
- agent_ok = check_useragent
- case agent_ok
- when :read_only
- @page.editable = false
- case @action
- when 'edit', 'save', 'preview', 'cancel', 'search'
- @page.indexable = false
- end
- when :forbidden
- forbidden
- return
- else
- unless @config.auth_mechanism.nil?
- @auth_token = Ruwiki::Auth[@config.auth_mechanism].authenticate(@request, @response, @config.auth_options)
- @page.editable = @auth_token.permissions['edit']
- end
- end
-
- # TODO Detect if @action has already been set.
- @action ||= @request.parameters['action'].downcase if @request.parameters['action']
- @action ||= 'save' if @request.parameters['save']
- @action ||= 'cancel' if @request.parameters['cancel']
- @action ||= 'preview' if @request.parameters['preview']
-
- unless @page.editable
- case @action
- when 'edit', 'save', 'preview', 'cancel'
- @action = 'show'
- end
- end
-
- case @action
- when 'search'
- # get, validate, and cleanse the search string
- # TODO: add empty string rejection.
- srchstr = validate_search_string(@request.parameters['q'])
- if not srchstr.nil?
- srchall = @request.parameters['a']
-
- @page.editable = false
- @page.indexable = false
-
- @page.content = self.message[:search_results_for] % [srchstr]
- @page.topic = srchstr || ""
-
- unless srchall.nil?
- hits = @backend.search_all_projects(srchstr)
- else
- hits = @backend.search_project(@page.project, srchstr)
- end
-
- # turn hit hash into content
- hitarr = []
- # organize by number of hits
- hits.each { |key, val| (hitarr[val] ||= []) << key }
-
- rhitarr = hitarr.reverse
- maxhits = hitarr.size
- rhitarr.each_with_index do |tarray, rnhits|
- next if tarray.nil? or tarray.empty?
- nhits = maxhits - rnhits - 1
-
- if nhits > 0
- @page.content << "\n== #{self.message[:number_of_hits] % [nhits]}\n* "
- @page.content << tarray.join("\n* ")
- end
- end
-
- @type = :search
- else
- @sysmessage = self.message[:no_empty_search_string] % [ @page.project, @page.topic ]
- @type = :content
- end
- when 'topics'
- if @backend.project_exists?(@page.project)
- topic_list = @backend.list_topics(@page.project)
- else
- topic_list = []
- end
-
- @page.editable = false
-
- # todo: make this localized
- if topic_list.empty?
- @page.content = self.message[:no_topics] % [@page.project]
- else
- topic_list.map! do |tt|
- uu = CGI.unescape(tt)
- if (uu != tt) or (tt !~ Ruwiki::Wiki::RE_WIKI_WORDS)
- "[[#{CGI.unescape(tt)}]]"
- else
- tt
- end
- end
- @page.content = <<EPAGE
-= #{self.message[:topics_for_project] % [@page.project]}
-* #{topic_list.join("\n* ")}
-EPAGE
- end
-
- @type = :content
- when 'projects'
- proj_list = @backend.list_projects
-
- @page.editable = false
-
- if proj_list.empty?
- @page.content = self.message[:no_projects]
- else
- # TODO make this localized
- proj_list.map! { |proj| PROJECT_LIST_ITEM % [ proj, @request.script_url, self.message[:project_topics_link] ] }
- @page.content = <<EPAGE
-= #{self.message[:wiki_projects] % [@config.title]}
-* ::#{proj_list.join("\n* ::")}
-EPAGE
- end
-
- content = @page.to_html(@markup)
- content.gsub!(%r{\(a href='([^']+)/_topics' class='rw_minilink'\)}, '<a href="\1/_topics" class="rw_minilink">') #'
- content.gsub!(%r{\\&lt;}, '<')
- content.gsub!(%r{\\&gt;}, '>')
- formatted = true
- @type = :content
- when 'edit', 'create'
- # Automatically create the project if it doesn't exist or if the
- # action is 'create'.
- @backend.create_project(@page.project) if @action == 'create'
- @backend.create_project(@page.project) unless @backend.project_exists?(@page.project)
- @page.creator = @auth_token.name if @action == 'create' and @auth_token
- @page.indexable = false
- @lock = @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR']) rescue nil
-
- if @lock.nil?
- @type = :content
- @sysmessage = self.message[:page_is_locked]
- else
- content = nil
- formatted = true
- @type = :edit
- end
- when 'save', 'preview'
- np = @request.parameters['newpage'].gsub(/\r/, '').chomp
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.editor_ip = @request.environment['REMOTE_ADDR']
- @page.indexable = false
-
- save_ver = @backend.retrieve(@page.topic, @page.project)['properties']['version'].to_i
- sent_ver = @request.parameters['version'].to_i
-
- if sent_ver < save_ver
- @type = :edit
-
- np = np.split($/)
- content_diff = Diff::LCS.sdiff(np, @page.content.split($/), Diff::LCS::ContextDiffCallbacks)
- content_diff.reverse_each do |hunk|
- case hunk
- when Array
- hunk.reverse_each do |diff|
- case diff.action
- when '+'
-# np.insert(diff.old_position, "+#{diff.new_element}")
- np.insert(diff.old_position, "#{diff.new_element}")
- when '-'
- np.delete_at(diff.old_position)
-# np[diff.old_position] = "-#{diff.old_element}"
- when '!'
- np[diff.old_position] = "-#{diff.old_element}"
- np.insert(diff.old_position + 1, "+#{diff.new_element}")
- end
- end
- when Diff::LCS::ContextChange
- case hunk.action
- when '+'
- np.insert(hunk.old_position, "#{hunk.new_element}")
-# np.insert(hunk.old_position, "+#{hunk.new_element}")
- when '-'
- np.delete_at(hunk.old_position)
-# np[diff.old_position] = "-#{hunk.old_element}"
- when '!'
- np[hunk.old_position] = "-#{hunk.old_element}"
- np.insert(hunk.old_position + 1, "+#{hunk.new_element}")
- end
- end
- end
- @page.content = np.join("\n")
-
- edc = @request.parameters['edcomment']
- unless (edc.nil? or edc.empty? or edc == "*")
- @page.edit_comment = edc
- end
-
- @sysmessage = self.message[:not_editing_current_version] % [ @page.project, @page.topic ]
- else
- if @action == 'save'
- @page.editor = @auth_token.name if @auth_token
- op = @page.content
- else
- op = nil
- end
-
- if (np == op) and (@action == 'save')
- @type = :content
- else
- @page.content = np
- edc = @request.parameters['edcomment']
- unless (edc.nil? or edc.empty? or edc == "*")
- @page.edit_comment = edc
- end
-
- if @action == 'save'
- @type = :save
- @page.version = @request.parameters['version'].to_i + 1
- @backend.store(@page)
-
- # hack to ensure that Recent Changes are updated correctly
- if @page.topic == 'RecentChanges'
- recent = Ruwiki::Page.new(@backend.retrieve(@page.topic, @page.project))
- @page.content = recent.content
- end
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- else
- @type = :preview
- @lock = @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR'])
- content = nil
- formatted = true
- end
- end
- end
- when 'cancel'
-# @page.topic = @request.parameters['topic']
-# @page.project = @request.parameters['project']
-# @page.version = @request.parameters['version'].to_i
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- @type = :content
- else
- # TODO AZ: This should probably return a 501 Not Implemented or some
- # other error unless @action.nil?
- nil
- end
- content = @page.to_html(@markup) if not formatted
- rescue Exception => ee # rescue for def process_page
- @type = :error
- if ee.kind_of?(Ruwiki::Backend::BackendError)
- name = "#{self.message[:error]}: #{ee.to_s}"
- else
- name = "#{self.message[:complete_utter_failure]}: #{ee.to_s}"
- end
- @error[:name] = CGI.escapeHTML(name)
- @error[:backtrace] = ee.backtrace.map { |el| CGI.escapeHTML(el) }.join("<br />\n")
- content = nil
- ensure
- @content = content
- end # def process_page
-
- # Renders the page.
- def render(*args)
- if args.empty?
- type = @type
- error = @error
- else
- raise ArgumentError, self.message[:render_arguments] unless args.size == 2
- type = args[0]
- error = {
- :name => Ruwiki.clean_entities(args[1].inspect),
- :backtrace => args[1].backtrace.join("<br />\n")
- }
- @page = Ruwiki::Page.new(Ruwiki::Page::NULL_PAGE)
- end
-
- @rendered_page = ""
- values = {
- "css_link" => @config.css_link,
- "home_link" => %Q(<a href="#{@request.script_url}">#{@config.title}</a>),
- "cgi_url" => @request.script_url,
- "content" => @content,
- }
-
- if @page.nil?
- values["page_project"] = ""
- values["page_raw_topic"] = ""
- values["page_topic"] = ""
- values["editable"] = false
- values["indexable"] = false
- else
- values["page_project"] = @page.project
- values["page_raw_topic"] = @page.topic
- values["page_topic"] = CGI.unescape(@page.topic)
- values["editable"] = @page.editable
- values["indexable"] = @page.indexable
- end
-
- values["url_project"] = %Q(#{values["cgi_url"]}/#{values["page_project"]})
- values["url_topic_search"] = %Q(#{values["url_project"]}/_search?q=#{values["page_topic"]})
- values["link_topic_search"] = %Q(<a href='#{values["url_topic_search"]}'><strong>#{values["page_topic"]}</strong></a>)
- values["message"] = @sysmessage unless @sysmessage.nil?
-
- case type
- when :content, :save, :search
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}" if @page.nil?
- values["wiki_title"] ||= "#{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["label_topic_or_search"] = self.message[:label_topic]
- values["page_topic_name"] = values["page_topic"]
- if type == :content or type == :search
- template = TemplatePage.new(@config.template(:body), @config.template(:content), @config.template(:controls), @config.template(:footer))
- if type == :search
- values["label_topic_or_search"] = self.message[:label_search]
- else
- values["page_topic"] = values["link_topic_search"]
- end
- else
- # action type was save
- values["page_topic"] = values["link_topic_search"]
- template = TemplatePage.new(@config.template(:body), @config.template(:save), @config.template(:controls), @config.template(:footer))
- end
- when :edit, :preview
- template = TemplatePage.new(@config.template(:body), @config.template(:edit))
- values["wiki_title"] = "#{self.message[:editing]}: #{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_content"] = @page.content
- values["page_version"] = @page.version.to_s
- values["unedited_page_content"] = @page.to_html(@markup)
- values["pre_page_content"] = CGI.escapeHTML(@page.content)
- if @request.parameters["edcomment"].nil? or @request.parameters["edcomment"].empty?
- values["edit_comment"] = "*"
- else
- values["edit_comment"] = @request.parameters["edcomment"]
- end
- when :error
- template = TemplatePage.new(@config.template(:body), @config.template(:error))
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}"
- values["name"] = error[:name]
- values["backtrace"] = error[:backtrace]
- values["backtrace_email"] = error[:backtrace].gsub(/<br \/>/, '')
- values["webmaster"] = @config.webmaster
- end
-
- template.to_html(values, :messages => @config.message,
- :output => @rendered_page)
- end
-
- # Outputs the page.
- def output
- return if @response.written?
-# if @request.environment["HTTP_ACCEPT"] =~ %r{application/xhtml\+xml}
-# @response.add_header("Content-type", "application/xhtml+xml")
-# else
- @response.add_header("Content-type", "text/html")
-# end
- @response.add_header("Cache-Control", "max_age=0")
- @response.write_headers
- @response << @rendered_page
- end
-
- def forbidden
- protocol = @request.environment["SERVER_PROTOCOL"] || "HTTP/1.0"
- @response.write_status "#{protocol} 403 FORBIDDEN\nDate: #{CGI::rfc1123_date(Time.now)}\n\n"
- end
-
- # nil if string is invalid
- def validate_search_string(instr)
- return nil if instr.empty?
-
- modstr = instr.dup
-
- #TODO: add validation of modstr
- return modstr
- end
-
- def self.clean_entities(data)
- data.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;')
- end
-
-private
- RE_ACTION = %r{^_([[:lower:]]+)$}
-
- def set_page_name_or_action(item)
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- else
- @topic = item
- end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/auth.rb b/ruwiki/trunk/lib/ruwiki/auth.rb
deleted file mode 100644
index ab4c923..0000000
--- a/ruwiki/trunk/lib/ruwiki/auth.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Auth
- class << self
- def [](name)
- @delegate ||= {}
-
- if @delegate.has_key?(name)
- @delegate[name]
- else
- require "ruwiki/auth/#{name}"
- @delegate[name] = Ruwiki::Auth.const_get(name.capitalize)
- end
- end
- end
-
- class Token
- def initialize(name = nil, groups = [], permissions = {})
- @user_name = name
- @groups = groups
- @permissions = permissions
- end
-
- def found?
- not @user_name.nil?
- end
-
- def name
- @user_name
- end
-
- def member?(unix_group_name)
- @groups.include?(unix_group_name)
- end
-
- def groups
- @groups
- end
-
- def allowed?(action)
- @permission[action]
- end
-
- def permissions
- @permissions
- end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/auth/gforge.rb b/ruwiki/trunk/lib/ruwiki/auth/gforge.rb
deleted file mode 100644
index 70895a1..0000000
--- a/ruwiki/trunk/lib/ruwiki/auth/gforge.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-begin
- require 'gforge_auth'
-rescue LoadError
- class GForgeAuthenticator
- class AuthenticationResult
- def initialize(name = nil, groups = [])
- @user_name = name
- @groups = groups
- end
-
- def found?
- not @user_name.nil?
- end
-
- def user_name
- raise "No session associated with the given key was found" unless found?
- @user_name
- end
-
- def member?(unix_group_name)
- raise "No session associated with the given key was found" unless found?
- @groups.include?(unix_group_name)
- end
-
- def groups
- raise "No session associated with the given key was found" unless found?
- @groups
- end
- end
-
- def self.authenticate(sessionkey, options = {})
- sql = %Q(SELECT user_name FROM users u, user_session us WHERE us.session_hash = '#{sessionkey}' AND us.user_id = u.user_id;)
- res = %x{psql -q -t -U #{options['user']} #{options['pass']} -c \"#{sql}\"}
- rows = res.split(/\n/)
- return AuthenticationResult.new if rows.size != 1
-
- user_name = rows[0].strip
- sql = %Q(SELECT unix_group_name FROM groups g, users u, user_group ug WHERE u.user_name = '#{user_name}' AND ug.user_id = u.user_id AND g.group_id = ug.group_id)
-
- res = %x(psql -q -t -U #{options['user']} #{options['pass']} -c \"#{sql}\")
- groups = []
- res.split(/\n/).each {|row| groups << row.strip }
- AuthenticationResult.new(user_name, groups)
- end
- end
-end
-
-class Ruwiki::Auth::Gforge < Ruwiki::Auth
- def self.authenticate(request, response, options = {})
- options['user'] = options['user'].gsub!(%r{^(\w+)}, '\1')
- options['pass'] = options['pass'].gsub!(%r{^(\w+)}, '\1')
- session_key = request.cookies['session_ser'].value[0].split(%r{-\*-})[-1]
- token = GForgeAuthenticator.authenticate(session_key, options)
- token = Ruwiki::Auth::Token.new(token.user_name, token.groups)
- token.permissions.default = true if token.found?
- rescue
- token = Ruwiki::Auth::Token.new
- token.permissions.default = false
- ensure
- return token
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/backend.rb b/ruwiki/trunk/lib/ruwiki/backend.rb
deleted file mode 100644
index 063666e..0000000
--- a/ruwiki/trunk/lib/ruwiki/backend.rb
+++ /dev/null
@@ -1,318 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-begin
- if defined?(Gem::Cache)
- require_gem 'diff-lcs', '~> 1.1.2'
- else
- require 'diff/lcs'
- end
-rescue LoadError => ex
- $stderr.puts ex.message
- raise
-end
-
-class Ruwiki
- # The list of known backends.
- KNOWN_BACKENDS = %w(flatfiles)
-
- # The Ruwiki backend delegator. Ruwiki will always instantiate a version
- # of this class which delegates the actual method execution to the Backend
- # class. Error handling is handled by capturing (and possibly forwarding)
- # exceptions raised by the delegate class.
- class BackendDelegator
- def initialize(ruwiki, backend)
- @message = ruwiki.config.message
- @time_format = ruwiki.config.time_format || "%H:%M:%S"
- @date_format = ruwiki.config.date_format || "%Y.%m.%d"
- @datetime_format = ruwiki.config.datetime_format || "#{@date_format} #{@time_format}"
- options = ruwiki.config.storage_options
- options['default-page'] = ruwiki.config.default_page
-
- unless Ruwiki::KNOWN_BACKENDS.include?(backend)
- raise RuntimeError, @message[:backend_unknown] % [backend]
- end
-
- beconst = backend.capitalize
-
- require "ruwiki/backend/#{backend}"
-
- beoptions = options[backend]
- @delegate = Ruwiki::Backend.const_get(beconst).new(beoptions)
- rescue Ruwiki::Backend::BackendError => ex
- if ex.kind_of?(Array)
- raise Ruwiki::Backend::BackendError.new(nil), @message[ex.reason[0]] % ex.reason[1]
- else
- raise
- end
- end
-
- # Retrieve the specified topic and project page. Calls Backend#load
- # after verifying that the project exists.
- def retrieve(topic, project = 'Default')
- unless page_exists?(topic, project)
- exported = Ruwiki::Page::NULL_PAGE.dup
- exported['properties'] = {
- 'title' => topic,
- 'topic' => topic,
- 'project' => project,
- 'create-date' => Time.now.utc,
- 'edit-date' => Time.now.utc,
- 'editable' => true,
- 'indexable' => true,
- 'entropy' => 0.0,
- 'html-headers' => [],
- 'version' => 0
- }
- exported['page'] = {
- 'header' => nil,
- 'footer' => nil
- }
-
- if project_exists?(project)
- exported['page']['content'] = ""
- else
- exported['page']['content'] = @message[:project_does_not_exist] % [project]
- end
- return exported
- end
-
- return @delegate.load(topic, project)
- rescue Ruwiki::Backend::InvalidFormatError => ex
- raise Ruwiki::Backend::BackendError.new(nil), @message[:page_not_in_backend_format] % [project, topic, @delegate.class]
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_read_topic] % [project, topic]
- rescue Exception => ex
- mm = [project, topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_retrieve_topic] % mm
- end
-
- # Stores the specified topic and project page.
- def store(page)
- @delegate.store(page)
-
- # update change page
- begin
- recent_changes = nil
- if (page.topic == 'RecentChanges')
- recent_changes = page.dup
- else
- recent_changes = Page.new(retrieve('RecentChanges', page.project))
- end
-
- changeline = "\n; #{page.editor_ip} (#{Time.now.utc.strftime(@datetime_format)}), #{page.topic} : #{page.edit_comment}"
-
- # add changeline to top of page
- recent_changes.content = changeline + (recent_changes.content || "")
- @delegate.store(recent_changes)
- rescue Exception => ex
- raise "Couldn't save RecentChanges\n#{ex.backtrace}"
- end
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_store_topic] % [page.project, page.topic]
- rescue Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_store_topic] % mm
- end
-
- # Destroys the specified topic and project page.
- def destroy(page)
- @delegate.destroy(page)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_destroy_topic] % [page.project, page.topic]
- rescue Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_destroy_topic] % mm
- end
-
- # Releases the lock on the page.
- def release_lock(page, address = 'UNKNOWN')
- time = Time.now.utc.to_i
- @delegate.release_lock(page, time, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_release_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:error_releasing_lock] % mm
- end
-
- # Attempts to obtain a lock on the page. The lock
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- time = Time.now.utc.to_i
- expire = time + timeout
- @delegate.obtain_lock(page, time, expire, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_obtain_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => ex
- mm = [page.project, page.topic, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:error_creating_lock] % mm
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- @delegate.project_exists?(project)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- @delegate.page_exists?(topic, project)
- end
-
- # Attempts to create the project.
- def create_project(project)
- @delegate.create_project(project)
- rescue Ruwiki::Backend::ProjectExists => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:project_already_exists] % [project]
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_create_project] % [project]
- rescue Exception => ex
- mm = [project, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_create_project] % mm
- end
-
- # Attempts to destroy the project.
- def destroy_project(project)
- @delegate.destroy_project(project)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_to_destroy_project] % [project]
- rescue Exception => ex
- mm = [project, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_destroy_project] % mm
- end
-
- def search_all_projects(searchstr)
- if @delegate.respond_to?(:search_all_projects)
- @delegate.search_all_projects(searchstr)
- else
- search_all_projects_default(searchstr)
- end
- end
-
- # Attempts to search all projects. This is the default
- # search_all_projects used unless the delegate implements
- # a specialized search_all_projects.
- def search_all_projects_default(searchstr)
- hits = {}
- list_projects.each do |project|
- lhits = search_project(project, searchstr)
- # Transform the keys from project local to global links.
- lhits.each { |key, val| hits["#{project}::#{key}"] = val }
- end
- hits
- end
-
- # Attempts to search a project
- def search_project(project, searchstr)
- #TODO: Validate searchstr is a safe regexp?
- @delegate.search_project(project, searchstr)
- rescue Exception => ex
- mm = [project, searchstr, ex.class, %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:search_project_fail] % mm
- end
-
- # Return an array of projects
- def list_projects
- @delegate.list_projects
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_list_projects]
- rescue Exception => ex
- mm = ['', %Q~#{ex}<br />\n#{ex.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_list_projects] % mm
- end
-
- # Return an array of projects
- def list_topics(projname)
- @delegate.list_topics(projname)
- rescue Errno::EACCES => ex
- raise Ruwiki::Backend::BackendError.new(ex), @message[:no_access_list_topics] % [projname]
- rescue Exception => ex
- mm = [projname, ex.message]
- raise Ruwiki::Backend::BackendError.new(ex), @message[:cannot_list_topics] % mm
- end
- end
-
- # The Ruwiki backend abstract class and factory.
- class Backend
- class ProjectExists < RuntimeError #:nodoc:
- end
- class InvalidFormatError < RuntimeError #:nodoc:
- end
- class BackendError < RuntimeError #:nodoc:
- attr_reader :reason
-
- def initialize(reason, *args)
- if @reason.respond_to?(:message)
- @reason = reason.message
- else
- @reason = reason
- end
- end
- end
- def initialize(storage_options)
- end
-
- private
- NL_RE = %r{\n} #:nodoc:
-
- def map_diffset(diffset)
- diffset.map do |hunk|
- if hunk.kind_of?(Array)
- hunk.map { |change| change.to_a }
- else
- hunk.to_a
- end
- end
- end
-
- # Creates the current diff object. This is made from two
- # Ruwiki::Page#export hashes.
- def make_diff(oldpage, newpage)
- oldpage = oldpage.export if oldpage.kind_of?(Ruwiki::Page)
- newpage = newpage.export if newpage.kind_of?(Ruwiki::Page)
-
- diff = Hash.new
-
- newpage.keys.sort.each do |sect|
- newpage[sect].keys.sort.each do |item|
- oldval = oldpage[sect][item]
- newval = newpage[sect][item]
-
- case [sect, item]
- when ['properties', 'html-headers']
- # Protect against NoMethodError.
- oldval ||= []
- newval ||= []
- val = Diff::LCS.sdiff(oldval, newval, Diff::LCS::ContextDiffCallbacks)
- when ['ruwiki', 'content-version'], ['properties', 'version'],
- ['properties', 'entropy']
- val = Diff::LCS.sdiff([oldval], [newval], Diff::LCS::ContextDiffCallbacks)
- when ['properties', 'create-date'], ['properties', 'edit-date']
- val = Diff::LCS.sdiff([oldval.to_i], [newval.to_i], Diff::LCS::ContextDiffCallbacks)
- else
- # Protect against NoMethodError.
- val = Diff::LCS.sdiff(oldval.to_s.split(NL_RE), newval.to_s.split(NL_RE), Diff::LCS::ContextDiffCallbacks)
- end
-
- (diff[sect] ||= {})[item] = map_diffset(val) unless val.nil? or val.empty?
- end
- end
-
- diff_hash = {
- 'old_version' => oldpage['properties']['version'],
- 'new_version' => newpage['properties']['version'],
- 'edit-date' => newpage['properties']['edit-date'].to_i,
- 'editor-ip' => newpage['properties']['editor-ip'],
- 'editor' => newpage['properties']['editor'],
- 'diff' => diff
- }
- end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/backend/flatfiles.rb b/ruwiki/trunk/lib/ruwiki/backend/flatfiles.rb
deleted file mode 100644
index e9a9ae2..0000000
--- a/ruwiki/trunk/lib/ruwiki/backend/flatfiles.rb
+++ /dev/null
@@ -1,216 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Flatfiles < Ruwiki::Backend
- # Initializes the Flatfiles backend. The known options for the Flatfiles
- # backend are documented below.
- #
- # data-path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # format:: The format of the files in the backend. By default,
- # this is 'exportable', a tagged data format produced by
- # Ruwiki::Exportable; alternative formats are 'yaml'
- # (::YAML.dump) and 'marshal' (::Marshal.dump).
- # default-page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- @data_path = options['data-path'] || File.join(".", "data")
- @extension = options['extension']
- @format = case options['format']
- when 'exportable', nil
- Ruwiki::Exportable
- when 'yaml'
- ::YAML
- when 'marshal'
- ::Marshal
- end
-
- if @extension.nil?
- @extension_re = /$/
- else
- @extension_re = /\.#{@extension}$/
- end
-
- @default_page = options['default-page'] || "ProjectIndex"
- if not (File.exists?(@data_path) and File.directory?(@data_path))
- raise Ruwiki::Backend::BackendError.new([:flatfiles_no_data_directory, [@data_path]])
- end
-
- super
- end
-
- # Destroys the topic page.
- def destroy(page)
- pf = page_file(page.topic, page.project)
- File.unlink(pf) if File.exists?(pf)
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- pd = project_directory(project)
- File.exists?(pd) and File.directory?(pd)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- pf = page_file(topic, project)
- project_exists?(project) and File.exists?(pf)
- end
-
- # Tries to create the project.
- def create_project(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::ProjectExists if File.exists?(pd)
- Dir.mkdir(pd)
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # String search all topic names and content in a project and
- # return a hash of topic hits.
- def search_project(project, searchstr)
- re_search = Regexp.new(searchstr, Regexp::IGNORECASE)
-
- hits = Hash.new { |hh, kk| hh[kk] = 0 }
- topic_list = list_topics(project)
-
- return hits if topic_list.empty?
-
- # search topic content
- topic_list.each do |topic|
- # search name
- hits[topic] += topic.scan(re_search).size
-
- # check content
- page = load(topic, project) rescue Ruwiki::Page::NULL_PAGE
- page['page'].each_value do |item|
- item = item.join("") if item.kind_of?(Array)
- item ||= ""
- hits[topic] += item.scan(re_search).size
- end
- end
-
- hits
- end
-
- def lock_okay?(page, time, address = 'UNKNOWN')
- lockokay = false
- lockfile = "#{page_file(page.topic, page.project)}.lock"
-
- if File.exists?(lockfile)
- data = File.read(lockfile).split(%r{!})
- # If the lock belongs to this address, we don't care how old it is.
- # Thus, release it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lockokay = true
- end
- end
-
- # Attempts to obtain a lock on the topic page. This must return the lock
- def obtain_lock(page, time, expire, address = 'UNKNOWN')
- lock = "#{address}!#{expire}"
-
- if lock_okay?(page, time, address)
- File.open("#{page_file(page.topic, page.project)}.lock", 'wb') { |lfh| lfh.puts lock }
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- lock
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, time, address = 'UNKNOWN')
- lockfile = "#{page_file(page.topic, page.project)}.lock"
-
- if lock_okay?(page, time, address)
- File.unlink(lockfile) if File.exists?(lockfile)
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- true
- end
-
- # list projects found in data path
- def list_projects
- Dir[File.join(@data_path, "*")].select do |dd|
- File.directory?(dd) and File.exist?(page_file(@default_page, File.basename(dd)))
- end.map { |dd| File.basename(dd) }
- end
-
- # list topics found in data path
- def list_topics(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::BackendError.new(:no_project) unless File.exist?(pd)
-
- Dir[File.join(pd, "*")].select do |ff|
- ff !~ /\.rdiff$/ and ff !~ /\.lock$/ and File.file?(ff) and ff =~ @extension_re
- end.map { |ff| File.basename(ff).sub(@extension_re, "") }
- end
-
- def project_directory(project) # :nodoc:
- File.join(@data_path, project)
- end
-
- def page_file(topic, project = 'Default') # :nodoc:
- if @extension.nil?
- File.join(project_directory(project), topic)
- else
- File.join(project_directory(project), "#{topic}.#{@extension}")
- end
- end
-
- def make_rdiff(page_file, new_page)
- diff_file = "#{page_file}.rdiff"
-
- old_page = self.class.load(pf) rescue Ruwiki::Page::NULL_PAGE
-
- diffs = []
- File.open(diff_file, 'rb') { |ff| diffs = Marshal.load(ff) } if File.exists?(diff_file)
- diffs << make_diff(old_page, new_page)
- changes = Marshal.dump(diffs)
-
- File.open(diff_file, 'wb') { |ff| ff << changes }
- end
-
- # Provides a HEADER marker.
- # Loads the topic page from disk.
- def load(topic, project)
- data = nil
- File.open(page_file(topic, project), 'rb') { |ff| data = ff.read }
-
- Ruwiki::Page::NULL_PAGE.merge(@format.load(data))
- rescue Ruwiki::Exportable::InvalidFormatError, TypeError, ArgumentError
- raise Ruwiki::Backend::InvalidFormatError
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = @format.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |ff| ff.puts newpage }
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/config.rb b/ruwiki/trunk/lib/ruwiki/config.rb
deleted file mode 100644
index d01dca1..0000000
--- a/ruwiki/trunk/lib/ruwiki/config.rb
+++ /dev/null
@@ -1,244 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # Ruwiki configuration.
-class Ruwiki::Config
- include Ruwiki::Exportable
-
- CONFIG_NAME = 'ruwiki.conf'
-
- exportable_group 'ruwiki-config'
- # Sets or returns the logger. The logger, if set, must respond to the same
- # methods as WEBrick::Logger.
- attr_accessor :logger
- # Sets or returns the time format whenever time is outputted in Ruwiki.
- # Default is <tt>%H:%M:%S</tt> (23:59:59).
- attr_accessor :time_format
- exportable :time_format
- # Sets or returns the date format whenever time is outputted in Ruwiki.
- # Default is <tt>%Y.%m.%d</tt> (2004.08.04).
- attr_accessor :date_format
- exportable :date_format
- # Sets or returns the date-time format whenever time is outputted in
- # Ruwiki. Default is <tt>%Y.%m.%d %H:%M:%S</tt> (2004.08.04 23:59:59).
- attr_accessor :datetime_format
- exportable :datetime_format
- # Adds additional information to the (rare) error reports. Defaults to
- # +false+.
- attr_accessor :debug
- exportable :debug
- # The default page for display when Ruwiki is called without any arguments.
- # Defaults to +ProjectIndex+
- attr_accessor :default_page
- exportable :default_page
- # The default project for display when Ruwiki is called without any
- # arguments or a project specification. Defaults to +Default+
- attr_accessor :default_project
- exportable :default_project
- # The authentication mechanism name as a String. Corresponds to
- # a filename that will be found in ruwiki/auth. The authenticator must
- # have a single class method, +authenticate+, which accepts the
- # +request+, the +response+, and the +#auth_options+. This API is
- # a draft API and is likely to change in future versions of Ruwiki. In
- # this version of Ruwiki, only one authentication mechanism will be
- # found -- for dealing with authenticating users already logged into
- # RubyForge.
- attr_accessor :auth_mechanism
- exportable :auth_mechanism
- # Options for the authentication mechanism as a Hash. This will be
- # passed to the authenticator defined in +#auth_mechanism+.
- attr_accessor :auth_options
- exportable :auth_options
- # The storage type as a String. Corresponds to a filename that will be
- # found in ruwiki/backend. NOTE: The yaml and marshal storage types have
- # been removed from Ruwiki 0.9.0, to be replaced with a single storage
- # type of Flatfiles. Now, the YAML and Marshal formats can be enabled by
- # setting options in the @storage_options field.
- attr_accessor :storage_type
- exportable :storage_type
- # The options for the specified storage type. This is a hash of hashes with
- # auto-vifification. See the storage type for available options.
- attr_reader :storage_options
- exportable :storage_options
- # The path for templates. Defaults to <tt>./templates/</tt>.
- attr_accessor :template_path
- exportable :template_path
- # The name of the Wiki. Defaults to <tt>ruwiki</tt>
- attr_accessor :title
- exportable :title
- # The email address of the webmaster for the Wiki. Defaults to +nil+.
- attr_accessor :webmaster
- exportable :webmaster
- # The name of the Ruwiki CSS file. Defaults to <tt>ruwiki.css</tt>.
- attr_accessor :css
- exportable :css
- # The template set. Templates are always named as
- # <template_path>/<template_set>/<template_name>. Template filename. Must
- # be reachable by File#read.
- attr_accessor :template_set
- exportable :template_set
- # Ruwiki is internationalized. This method sets the Ruwiki error
- # messages (and a few other messages) to the specified language Module.
- # The language Module must have a constant Hash called +Message+
- # containing a set of symbols and localized versions of the messages
- # associated with them.
- #
- # If the file 'ruwiki/lang/es.rb' contains the module
- # <tt>Ruwiki::Lang::ES</tt>, the error messages for RSS could be
- # localized to Español thus:
- #
- # require 'ruwiki/lang/es'
- # ...
- # wiki.config.language = Ruwiki::Lang::ES
- #
- # Localization is per wiki instance. In a servlet environment, this may
- # mean that only a single language is recognised.
- #
- # See Ruwiki::Lang::EN for more information.
- attr_accessor :language
- exportable :language
- # The message hash.
- attr_reader :message
-
- def language=(ll) #:nodoc:
- if ll.kind_of?(String)
- @language = Ruwiki::Lang::const_get(ll.upcase)
- else
- @language = ll
- end
- @message = @language::Message
- end
-
- # Returns the specified template as a string.
- def template(name)
- File.read(File.join(@template_path, @template_set, "#{name.to_s}.tmpl"))
- rescue Errno::ENOENT
- raise ConfigError, message[:no_template_found] % [name.inspect, @template_set]
- end
-
- # Returns the CSS stylesheet content for the Wiki. This previously
- # returned the <link> to the stylesheet, but instead returns a <style>
- # block in the head so that the CSS is kept with the template set, which
- # may be kept outside of the HTML area.
- def css_link
- %Q[<style type="text/css" media="screen,print">#{File.read(File.join(@template_path, @template_set, @css))}</style>]
- end
-
- # Creates a new configuration object.
- def initialize(exportable = {})
- rc = exportable['ruwiki-config'] || {}
- @debug = (rc['debug'] == "false") ? false : true
- @default_project = rc['default-project'] || "Default"
- @default_page = rc['default-page'] || "ProjectIndex"
- @auth_mechanism = rc['auth-mechanism'] || nil
-
- case rc['auth-options']
- when nil, ""
- @auth_options = {}
- else
- @auth_options = Ruwiki::Exportable.load(rc['auth-options'])['default']
- end
-
- case rc['storage-type']
- when nil, ""
- @storage_type = 'flatfiles'
- else
- @storage_type = rc['storage-type']
- end
-
- # in 'type!name:<Tab>value\n' format.
- if rc['storage-options'].nil? or rc['storage-options'].empty?
- @storage_options = Hash.new { |hh, kk| hh[kk] = {} }
- else
- @storage_options = Ruwiki::Exportable.load(rc['storage-options'])
- @storage_options.keys.each do |key|
- @storage_options[key] = @storage_options.delete(key)
- end
- end
- if @storage_options.empty?
- @storage_options[@storage_type]['extension'] = "ruwiki"
- @storage_options[@storage_type]['data-path'] = "./data"
- @storage_options[@storage_type]['format'] = "exportable"
- end
-
- @storage_options.each_value do |vv|
- if vv['extension'].nil? or vv['extension'].empty?
- vv['extension'] = "ruwiki"
- end
- if vv['data-path'].nil? or vv['data-path'].empty?
- vv['data-path'] = "./data"
- end
- end
-
- @template_path = rc['template-path'] || "./templates/"
- @template_set = rc['template-set'] || "default"
- @css = rc['css'] || "ruwiki.css"
- @webmaster = rc['webmaster']
- @title = rc['title'] || "Ruwiki"
- @time_format = rc['time-format'] || "%H:%M:%S"
- @date_format = rc['date-format'] || "%Y.%m.%d"
- @datetime_format = rc['datetime-format'] || "#{@date_format} #{@time_format}"
- case rc['language']
- when nil, ""
- self.language = Ruwiki::Lang::EN
- else
- self.language = Ruwiki::Lang::const_get(rc['language'].upcase)
- end
- end
-
- # Verifies that required configuration options are actually set. Right
- # now, it only checks the values that are defaulted to +nil+.
- def verify
- raise ConfigError, message[:no_webmaster_defined] if @webmaster.nil? or @webmaster.empty?
- raise ConfigError, message[:invalid_template_dir] % [@template_path] unless File.exists?(@template_path) and File.directory?(@template_path)
- tt = File.join(@template_path, @template_set)
- raise ConfigError, message[:no_template_set] % [@template_set] unless File.exists?(tt) and File.directory?(tt)
- end
-
- # Provides the canonical export hash.
- def export
- exportable = super
-
- rc = exportable['ruwiki-config']
-
- rc['auth-options'] = Ruwiki::Exportable.dump({ 'default' => rc['auth-options']})
-
- rc['storage-options'] = Ruwiki::Exportable.dump(rc['storage-options'])
- rc['storage-type'] = rc['storage-type'].to_s
- rc['language'] = "#{rc['language']}".sub(/^.*?::([A-Z]+)$/, '\1').downcase
- exportable
- end
-
- class << self
- def write(file, config)
- if file.respond_to?(:write)
- file.puts(config.dump)
- else
- File.open(file, 'wb') { |ff| ff.puts(config.dump) }
- end
- end
-
- def read(file)
- data = nil
- if file.respond_to?(:read)
- data = file.read
- else
- File.open(file, 'rb') { |ff| data = ff.read }
- end
- hash = Ruwiki::Exportable.load(data)
-
- Ruwiki::Config.new(hash)
- end
- end
-
- class ConfigError < StandardError; end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/exportable.rb b/ruwiki/trunk/lib/ruwiki/exportable.rb
deleted file mode 100644
index c18290f..0000000
--- a/ruwiki/trunk/lib/ruwiki/exportable.rb
+++ /dev/null
@@ -1,192 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # == Synopsis
- # Generalises a marshaling format that is easily read and edited by humans
- # and is relatively easy to manage by software. When an attribute is marked
- # #exportable, the name of the attribute is transformed and stored in
- # a two-level hash, e.g.:
- #
- # exportable_group 'group1'
- # exportable :var_1
- # exportable :var_2
- # exportable_group 'group2'
- # exportable :var_3
- # exportable :var_4
- #
- # Results in an exportable hash of:
- #
- # { 'group1' =>
- # { 'var-1' => @var1,
- # 'var-2' => @var2, },
- # 'group2' =>
- # { 'var-3' => @var3,
- # 'var-4' => @var4, }, }
- #
-module Ruwiki::Exportable
- class InvalidFormatError < RuntimeError; end
-
- class << self
- # Adds two methods and an attribute to the class that is including Exportable
- #
- # <tt>__exportables</tt>:: Contains the list of exportable symbols by group.
- # <tt>exportable_group</tt>:: Defines the current group for exportable
- # symbols. Default is 'default'.
- # <tt>exportable</tt>:: Accepts two arguments, the attribute being
- # exported and an option hash, containing the
- # values :name and :group, where :name
- # indicates the name of the attribute (so
- # that the default name transformation is
- # not applied) and :group overrides the
- # current #exportable_group. By default, the
- # name of the attribute is transformed such
- # that underscores are converted to dashes
- # (<tt>var_1</tt> becomes 'var-1').
- def append_features(mod)
- super
-
- class << mod
- attr_reader :__exportables
-
- define_method(:exportable_group) do |name|
- @__exportable_group = name || 'default'
- end
-
- define_method(:exportable) do |*symset|
- symbol = symset.shift
- options = symset.shift || {}
-
- @__exportables ||= {}
-
- options[:name] ||= symbol.to_s.gsub(/_/, '-')
- options[:group] ||= @__exportable_group || 'default'
-
- @__exportables[options[:group]] ||= {}
- @__exportables[options[:group]][options[:name]] = "@#{symbol.to_s}".intern
- end
- end
- end
-
- # Looks for comments. Comments may ONLY be on single lines.
- COMMENT_RE = %r{^#}
- # Looks for newlines
- NL_RE = %r{\n}
- # Looks for a line that indicates an exportable value. See #dump.
- HEADER_RE = %r{^([a-z][-a-z]+)!([a-z][-a-z]+):[ \t](.*)$}
- # Looks for an indented group indicating that the last group is
- # a multiline value.
- FIRST_TAB = %r{^[ \t]}
-
- # Dumps the provided exportable hash in the form:
- #
- # section!name:<Tab>Value
- # section!name:<Space>Value
- #
- # Multiline values are indented either one space or one tab:
- #
- # section!name:<Tab>Value Line 1
- # <Tab>Value Line 2
- # <Tab>Value Line 3
- # <Tab>Value Line 4
- #
- # All values in the exportable hash are converted to string
- # representations, so only values that can meaningfully be reinstantiated
- # from string representations should be stored in the exportable hash. It
- # is the responsibility of the class preparing the exportable hash
- # through Exportable#export to make the necessary transformations.
- def dump(export_hash)
- dumpstr = ""
-
- export_hash.keys.sort.each do |sect|
- export_hash[sect].keys.sort.each do |item|
- val = export_hash[sect][item].to_s.split(NL_RE).join("\n\t")
- dumpstr << "#{sect}!#{item}:\t#{val}\n"
- end
- end
-
- dumpstr
- end
-
- # Loads a buffer in the form provided by #dump into an exportable hash.
- # Skips comment lines.
- def load(buffer)
- hash = {}
- return hash if buffer.nil? or buffer.empty?
-
- # Split the buffer and eliminate comments.
- buffer = buffer.split(NL_RE).delete_if { |line| line =~ COMMENT_RE }
-
- if HEADER_RE.match(buffer[0]).nil?
- raise Ruwiki::Exportable::InvalidFormatError
- end
-
- sect = item = nil
-
- buffer.each do |line|
- line.chomp!
- match = HEADER_RE.match(line)
-
- # If there is no match, add the current line to the previous match.
- # Remove the leading \t, though.
- if match.nil?
- raise Ruwiki::Exportable::InvalidFormatError if FIRST_TAB.match(line).nil?
- hash[sect][item] << "\n#{line.gsub(FIRST_TAB, '')}"
- else
- sect = match.captures[0]
- item = match.captures[1]
- hash[sect] ||= {}
- hash[sect][item] = match.captures[2]
- end
- end
-
- hash
- end
- end
-
- # Converts #exportable attributes to an exportable hash, in the form:
- # { 'group1' =>
- # { 'var-1' => @var1,
- # 'var-2' => @var2, },
- # 'group2' =>
- # { 'var-3' => @var3,
- # 'var-4' => @var4, }, }
- #
- # Classes that #include Exportable are encouraged to override export to
- # ensure safe transformations of values. An example use might be:
- #
- # class TimeClass
- # include Ruwiki::Exportable
- #
- # def export
- # sym = super
- #
- # sym['default']['time'] = sym['default']['time'].to_i
- # sym
- # end
- #
- # In this way, the 'time' value is converted to an integer rather than the
- # default string representation.
- def export
- sym = {}
-
- self.class.__exportables.each do |group, gval|
- gname = group || @__exportable_group || 'default'
- gsym = {}
- gval.each do |name, nval|
- val = self.instance_variable_get(nval)
- gsym[name] = val unless val.nil?
- end
- sym[gname] = gsym
- end
-
- sym
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/handler.rb b/ruwiki/trunk/lib/ruwiki/handler.rb
deleted file mode 100644
index c6a9375..0000000
--- a/ruwiki/trunk/lib/ruwiki/handler.rb
+++ /dev/null
@@ -1,342 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Handler
- class << self
- # Generate a new Handler pair from a CGI request.
- def from_cgi(cgi, output_stream = $stdout)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::CGIRequest.new(cgi)
- o.response = Ruwiki::Handler::CGIResponse.new(cgi, output_stream)
- end
- end
-
- # Generate a new Handler pair from a WEBrick request.
- def from_webrick(req, res)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::WEBrickRequest.new(req)
- o.response = Ruwiki::Handler::WEBrickResponse.new(res)
- end
- end
- end
-
- # Returns the handler's request object.
- attr_accessor :request
- # Returns the handler's response object.
- attr_accessor :response
-
- # Creates the handler pair.
- def initialize(&block) #:yields: self
- @request = nil
- @response = nil
- yield self if block_given?
- end
-
- # Essentially a clone of WEBrick::Cookie for use with Ruwiki.
- class Cookie
- attr_reader :name
- attr_accessor :value
- attr_accessor :version
-
- FIELDS = %w(domain path secure comment max_age expires)
-
- FIELDS.each { |field| attr_accessor field.intern }
-
- def initialize(name, value)
- @name = name
- @value = value
- @version = 0 # Netscape Cookie
-
- FIELDS.each { |field| instance_variable_set("@#{field}", nil) }
-
- yield self if block_given?
- end
-
- def expires=(t) #:nodoc:
- @expires = if t.nil? or t.kind_of?(Time)
- t
- else
- Time.parse(t.to_s)
- end
- end
-
- def to_s
- ret = "#{@name}=#{@value}"
- ret << "; Version=#{@version.to_s}" if @version > 0
- ret << "; Domain=#{@domain}" if @domain
- ret << "; Expires=#{CGI::rfc1123_date(@expires)}" if @expires
- ret << "; Max-Age=#{CGI::rfc1123_date(@max_age)}" if @max_age
- ret << "; Comment=#{@comment}" if @comment
- ret << "; Path=#{@path}" if @path
- ret << "; Secure" if @secure
- ret
- end
- end
-
- # Represents an abstract incoming request. This insulates the rest of
- # the code from knowing whether parameters are passed as part of the
- # path, as parameters in the URL, or in some other fashion.
- class AbstractRequest
- def initialize(*args)
- end
- end
-
- # Handles all requests from web applications.
- #
- # Subclasses should provide:
- # @parameters:: Hash-like object that responds to #[] and #hash_key?]
- # @environment:: Hash-like object that responds to #[]
- class AbstractWebRequest < AbstractRequest
- # The parameters provided via the web request.
- attr_reader :parameters
- # The environment provided to the web request.
- attr_reader :environment
- # The request path.
- attr_reader :path
-
- # The list of cookies.
- attr_reader :cookies
-
- def each_parameter #:yields parameter, value:
- @parameters.each { |kk, vv| yield kk, vv }
- end
-
- def each_environment #:yields variable, value
- @environment.each { |kk, vv| yield kk, vv }
- end
-
- def each_cookie #:yields name, value:
- @cookies.each { |kk, vv| yield kk, vv }
- end
-
- # Return the URL of our server.
- def server_url
- res = "http://" # should detect whether we're in secure server mode.
- if @environment['HTTP_HOST']
- res << @environment['HTTP_HOST']
- else
- res << "#{@environment['SERVER_NAME']}:#{@environment['SERVER_PORT']}"
- end
- end
-
- # Return the URL of this script.
- def script_url
- server_url << @environment['SCRIPT_NAME'].to_s
- end
-
- # Return the URL of this request.
- def request_url
- res = script_url
- res << @environment['PATH_INFO'] if @environment['PATH_INFO']
- query = @environment['QUERY_STRING']
- res << "?#{@environment['QUERY_STRING']}" if query && !query.empty?
- res
- end
-
- # Convert a file path into a URL
- def make_url(project, path)
- "#{server_url}/#{project}/#{path}"
- end
-
- def determine_request_path
- @path = ""
- return @path if @environment['PATH_INFO'].nil?
- @path = @environment['PATH_INFO'].dup
- end
- end
-
- # Request for CGI-based activity to ruwiki.
- class CGIRequest < AbstractWebRequest
- def initialize(cgi, output_stream = $stdout)
- @environment = ENV
- @cgi = cgi
- @parameters = {}
- cgi.params.each { |kk, vv| @parameters[kk] = vv[0] }
- @cookies = {}
- cgi.cookies.each do |name, cookie|
- @cookies[name] = Ruwiki::Handler::Cookie.new(name, cookie.value) do |oc|
- oc.version = cookie.version if cookie.respond_to?(:version)
- oc.domain = cookie.domain
- oc.path = cookie.path
- oc.secure = cookie.secure
- oc.comment = cookie.comment if cookie.respond_to?(:comment)
- oc.expires = cookie.expires
- end
- end
- super
- end
- end
-
- # Request for WEBrick based servlet activity to ruwiki.
- class WEBrickRequest < AbstractWebRequest
- def initialize(req)
- @environment = req.meta_vars
- @parameters = req.query
- @cookies = {}
- req.cookies.each do |rqc|
- @cookies[rqc.name] = Ruwiki::Handler::Cookie.new(rqc.name, rqc.value) do |oc|
- oc.version = rqc.version
- oc.domain = rqc.domain
- oc.path = rqc.path
- oc.secure = rqc.secure
- oc.comment = rqc.comment
- oc.expires = rqc.expires
- oc.max_age = rqc.max_age
- end
- end
- super
- end
- end
-
- # Used to write responses in different execution environments such as
- # CGI and Webrick.
- #
- # If you want to create a new response object, you'll need to implement
- # #add_header, #write_headers, #write_cookies, and #<<.
- #
- # The Response object is instantiated with an output stream which must
- # supply +<<+ and +puts+ methods.
- class AbstractResponse
- # Add to the list of headers to be sent back to the client.
- def add_header(key, value)
- raise "Not implemented"
- end
-
- # Write the accumulated headers back to the client.
- def write_headers
- raise "Not implemented"
- end
-
- # Write the string to the client.
- def <<(string)
- raise "Not implemented"
- end
-
- def add_cookies(*cookies)
- cookies.each do |cookie|
- @cookies << cookie
- end
- end
-
- def write_cookies
- raise "Not implemented"
- end
-
- # output_stream must respond to #<< and #puts.
- def initialize(output_stream = $stdout)
- @headers = {}
- @cookies = []
- @written = false
- @status = nil
- @output_stream = output_stream
- end
-
- def written?
- @written
- end
- end
-
- # CGIResponse is the response object for CGI mode.
- class CGIResponse < AbstractResponse
- # output_stream must respond to #<< and #puts.
- def initialize(cgi, output_stream = $stdout)
- @cgi = cgi
- @done = {
- :headers => false,
- :cookies => false,
- :body => false
- }
- super(output_stream)
- end
-
- # Add the header pair for later output as a CGI header.
- def add_header(key, value)
- @headers[key] = value
- end
-
- # Write the headers to the stream. The headers can only be written
- # once.
- def write_headers
- return if @done[:headers]
- @headers.each { |key, value| @output_stream.puts "#{key}: #{value}\r\n" }
- write_cookies
- @output_stream.puts
- @done[:headers] = true
- end
-
- # Write the cookies to the stream. The cookies can only be written
- # once.
- def write_cookies
- return if @done[:cookies]
- @cookies.each do |cookie|
- @output_stream.puts "Set-Cookie: #{cookie.to_s}"
- end
- @done[:cookes] = true
- end
-
- # Output the string to the stream provided.
- def <<(string)
- @output_stream << string
- @written = true
- end
-
- def write_status(status)
- unless status.nil?
- @output_stream << status
- @written = true
- end
- end
- end
-
- # WEBrickResponse is the response object for WEBrick servlet mode.
- class WEBrickResponse < AbstractResponse
- def initialize(webrick_response)
- @response = webrick_response
- @cookies = []
- @done = {
- :headers => false,
- :cookies => false,
- :body => false
- }
- end
-
- def add_header(key, value)
- @response[key] = value
- end
-
- # Copy the cookies into the WEBrick::HTTPResponse cookies array.
- def write_cookies
- return if @done[:cookies]
- @cookies.each do |cookie|
- @response.cookies << cookie.to_s
- end
- @done[:cookes] = true
- end
-
- def write_headers
- write_cookies
- # Webrick will take care of this on its own.
- end
-
- def <<(string)
- @response.body << string.to_s
- @written = true
- end
-
- def write_status(status)
- unless status.nil?
- match = %r{^HTTP/(?:\d|\.)+ (\d+) .*}.match(status)
- @response.status = match.captures[0]
- @response.body << status
- @written = true
- end
- end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/lang/de.rb b/ruwiki/trunk/lib/ruwiki/lang/de.rb
deleted file mode 100644
index b9db0ef..0000000
--- a/ruwiki/trunk/lib/ruwiki/lang/de.rb
+++ /dev/null
@@ -1,339 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Translation by Christian Neukirchen (chneukirchen@yahoo.de) on 22oct2003
-# Updated by Christian Neukirchen (purl.org/net/chneukirchen) on 27aug2004
-# Updated by Christian Neukirchen (purl.org/net/chneukirchen) on 09nov2004
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::DE is the German-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module DE
- Message = Hash.new { |hh, kk| hh[kk] = "Sprachdatei-FEHLER: Unbekannter Nachrichten-Typ #{k.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Unbekanntes Backend %1$s.",
- :cannot_create_project => "Kann %1$s nicht erstellen: %2$s",
- :cannot_destroy_project => "Kann %1$s nicht zerstören: %2$s",
- :cannot_destroy_topic => "Kann %1$s::%2$s nicht zerstören: %3$s",
- :cannot_obtain_lock => "Kann keine Sperre für %1$s::%2$s erhalten. Bitte in Kürze nochmal versuchen.",
- :cannot_release_lock => "Kann die Sperre für %1$s::%2$s nicht lösen. Bitte später nochmal versuchen.",
- :cannot_retrieve_topic => "Kann auf %1$s::%2$s nicht zugreifen: %3$s",
- :cannot_store_topic => "Kann %1$s::%2$s nicht speichern: %3$s",
- :cannot_list_topics => "Kann Themen für Projekt %1$s nicht auflisten: %2$s",
- :error_creating_lock => "Fehler beim Erzeugen der Sperre von %1$s::%2$s: %3$s",
- :error_releasing_lock => "Fehler beim Lösen der Sperre von %1$s::%2$s: %3$s",
- :flatfiles_no_data_directory => "Das Daten-Verzeichnis (%1$s) existiert nicht.",
- :no_access_list_projects => "Keine Berechtigung zum Auflisten der Projekte.",
- :no_access_list_topics => "Keine Berechtigung zum Auflisten der Themen von Projekt %1$s.",
- :no_access_to_create_project => "Keine Berechtigung um Projekt %1$s zu erzeugen.",
- :no_access_to_destroy_project => "Keine Berechtigung um Projekt %1$s zu zerstören.",
- :no_access_to_destroy_topic => "Keine Berechtigung um Thema %1$s::%2$s zu zerstören.",
- :no_access_to_read_topic => "Keine Berechtigung um Thema %1$s::%2$s zu lesen.",
- :no_access_to_store_topic => "Keine Berechtigung um Thema %1$s::%2$s zu speichern.",
- :page_not_in_backend_format => "%1$s::%2$s ist in einem von Backend %3$s nicht unterstütztem Format.",
- :project_already_exists => "Project %1$s existiert bereits.",
- :project_does_not_exist => "Project %1$s existiert nicht.",
- :search_project_fail => "Suche in Projekt %1$s nach Zeichenkette %2$s gescheitert.",
- :yaml_requires_182_or_higher => "YAML-Flatfile-Support existiert nur für Ruby 1.8.2 oder höher.",
- :not_editing_current_version => <<EOM ,
-Sie haben eine alte Version von %1$s::%2$s abgeschickt. Die Unterschiede
-zwischen ihrer und der jetzigen Version wurden kombiniert. Konfliktierende
-Zeilen zeigen beide Zeilen. Bitte gehen sie sicher, dass sie die gesammte
-Seite bearbeitet haben bevor sie nochmals speichern.
-EOM
- :no_empty_search_string => <<EOM ,
-Das Suchfeld darf nicht leer sein. Bitte etwas eingeben bevor der Suchknopf
-gedrückt wird.
-EOM
- :page_is_locked => "Die Seite ist bereits zur Bearbeitung gesperrt. Bitte warte ein paar Minuten und versuche es dann noch ein mal.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Die Konfiguration muss von Typ der Klasse Ruwiki::Config sein.",
- :invalid_template_dir => "Der angegebene Pfad für Schablonen (%1$s) existiert nicht oder ist kein Verzeichnis.",
- :no_template_found => "Keine Schablone %1$s im Schablonen-Set '%2$s' gefunden.",
- :no_template_set => "Es gibt kein Schablonen-Set '%1$s' im Schablonen-Pfad.",
- :no_webmaster_defined => "Konfigurations-Fehler: Kein Webmaster definiert.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fataler Fehler",
- :editing => "Editieren",
- :error => "Fehler",
- :invalid_path_info_value => "Fataler Fehler in der Web-Umgebung. PATH_INFO = %1$s",
- # Should this really get translated? --chris
- :render_arguments => "Ruwiki#render muss mit zwei oder mehr Argumenten aufgerufen werden.",
- :unknown_feature => "Unbekanntes Feature %1$s.",
- :topics_for_project => "Themen for Projekt ::%1$s",
- :project_topics_link => "(Themen)",
- :wiki_projects => "Projekte in %1$s",
- :no_projects => "Keine Projekte bekannt.",
- :no_topics => "Keine Themen in Projekt %1$s.",
- :search_results_for => "= Suchergebnisse für: %1$s",
- :number_of_hits => "%d Treffer",
-
- # Labels
- :label_search_project => "Durchsuche Projekt",
- :label_search_all => "Alles",
- :label_search => "Suche: ",
- :label_project => "Projekt: ",
- :label_topic => "Thema: ",
- :label_edit => "Editieren",
- :label_recent_changes => "Aktuelle Änderungen",
- :label_topics => "Themen",
- :label_projects => "Projekte",
- :label_editing => "Editieren",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Anmerkung: ",
- :label_comment_accelerator => "R",
- :label_save => "Speichern",
- :label_save_accelerator => "S",
- :label_cancel => "Abbrechen",
- :label_cancel_accelerator => "A",
- :label_preview => "Vorschau",
- :label_preview_accelerator => "V",
- :label_original_text => "Ursprüngliche Version",
- :label_raw => "Formatfrei",
- :label_formatted => "Formatiert",
- :label_send_report_by => "Schicken Sie dem Webmaster einen Report via Email.",
- :label_send_report => "Report schicken.",
- :label_saved_page => "Gespeicherte Seite: ",
-
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Benutzung: %1$s [Optionen] <Verzeichnis>+",
- :converter_format_desc => [ "Konvertiert gefundene Dateien (Jetziges",
- "Format egal) in das angegebene Format",
- "Standard ist flatfiles. Erlaubte",
- "Formate sind: yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Erzeugt Backups der aktualisierten",
- "Dateien. Standard ist --backup." ],
- :converter_backupext_desc => [ 'Gibt die Backup-Erweiterung an. Standard',
- 'ist "~", das dem Datendateinamen',
- 'angehängt wird.' ],
- :converter_backupext_error => "Die Backup-Erweiterung darf nicht leer sein.",
- :converter_extension_desc => [ "Gibt die Erweiterung der Ruwiki-",
- "Datendateien an. Standard ist .ruwiki" ],
- :converter_extension_error => "Die Erweiterung darf nicht leer sein.",
- :converter_noextension_desc => [ "Gibt an, dass Ruwiki-Datendateien",
- "keine Dateierweiterung haben." ],
- :converter_quiet_desc => [ "Still sein. Standard sind normale",
- "Mitteilungen." ],
- :converter_language_desc => [ "Sprache auf LANG setzen. Standard ist",
- "en (Englisch). Bekannte Sprachen sind:",
- "en es de" ],
- :converter_verbose_desc => [ "Gesprächig sein. Standard sind normale",
- "Mitteilungen." ],
- :converter_help_desc => [ "Diesen Text zeigen." ],
- :converter_num_arguments => "Fehler: Nicht genug Parameter.",
- :converter_directory => "Verzeichnis",
- :converter_converting_from => "Wandle von %1$s nach %2$s um... ",
- :converter_done => "fertig.",
- :converter_not_ruwiki => "Keine Ruwiki-Datei; übersprungen.",
- :converter_nosave_modified => "Kann veränderte Datei %1$s nicht speichern.",
- :converter_page_format_error => "Fehler: Kann Seitenformat nicht erkennen.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Unbekannter Befehl: %1$s",
- :manager_help_commands => <<EOH ,
-Es gibt diese 'ruwiki'-Befehle:
-
- ruwiki install Standard-Entwicklungspaket installieren.
- ruwiki package Ruwiki-Installation einpacken.
- ruwiki unpackage Ruwiki-Installation auspacken.
- ruwiki service Win32::Service für Ruwiki verwalten.
-
-EOH
- :manager_help_help => <<-EOH ,
-Diese Hilfsnachricht zeigt, wie man mehr Informationen zu diesem
-Kommandozeilenwerkzeug erhalten kann:
-
- ruwiki help commands Alle 'ruwiki' Befehle anzeigen.
- ruwiki help <BEFEHL> Hilfe zu <BEFEHL> zeigen.
- (e.g., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Fehlender Parameter für Option: %1$s",
- :manager_dest_not_directory => "Das Ziel (%1$s) ist kein Verzeichnis.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPTIONEN] [--to ZIEL]
-
-Erzeugt eine neue Ruwiki-Instanz. Standardmäßig installiert dies die Daten,
-Schablonen und eine Standard-Konfigurationsdatei im derzeitigen Verzeichnis.
-Das Ziel kann mit --to geändert werden, und was installiert werden soll mit
-der OPTIONEN-Liste. Die Elemente der OPTIONEN-Liste dürfen durch Leerzeichen,
-Komma oder Semikola getrennt werden. Daher haben
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-alle die gleiche Wirkung. Die Groß-/Kleinschreibung spielt keine Rolle.
-Die OPTIONEN sind:
-
- servlet # Den Ruwiki servlet stub installieren
- service # Den Ruwiki Win32::Service stub installieren
- CGI # Das Ruwiki CGI-Skript installieren
- data # Ruwiki-Daten, Schablonen, und Konfiguration installieren
-
-Optionen können durch voranstellen von '-' oder 'no' abgeschaltet werden:
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-Dies würde das CGI-Skript, nicht aber die Daten installieren.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [QUELL] [--output PAKET] [--replace]
- ruwiki package [QUELL] [-o PAKET] [--replace]
-
-Packt die Ruwiki-Dateien (Daten, Schablonen und Programme) vom angegebenen
-QUELL-Verzeichnis oder dem derzeitigen Verzeichnis in das angegebene Paket
-(oder "./%1$s"). Sollte QUELL eine Ruwuki-Konfigurationsdatei sein (z.B.
-"%2$s"), dann wird sie verwendet, um Ort und Name der Daten- und Schablonen-
-Verzeichnisse zu erfahren.
-
- MERKE: Der Einpack-Prozess normalisiert die Daten- und Schablonen-
- Verzeichnisnamen relativ zum Einpackverzeichnis. Es werden
- niemals absolute Pfade sein.
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [QUELL] [--output VERZEICHNIS]
- ruwiki unpackage [QUELL] [-o VERZEICHNIS]
-
-Entpackt das gegebene Rukwiki-Paket (Standard: "./%1$s") in das angebene
-Verzeichnis (oder ".").
-EOH
- :manager_service_broken => "Kann keinen Win32-Service verwalten, wenn Win32::Service nicht installiert ist.",
- :manager_service_lo_argcount => "Ungenügene Parameteranzahl: %1$s",
- :manager_service_hi_argcount => "Zu viele Parameter: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NAME [BESCHREIBUNG] [Optionen]
- ruwiki service start NAME
- ruwiki service stop NAME
- ruwiki service delete NAME
-
-Verwaltet das Ruwiki WEBrick servlet als Windows-Service. Der Service muss
-benannt (NAME) sein. install unterstützt folgende zusätzliche Optionen:
-
- --rubybin RUBYPFAD Der Pfad zum Ruby-Binärverzeichnis.
- --exec SERVICEPFAD Der Pfad zum Service-Programm.
- --home PFADNACHAHAUSE Der Pfad zum Heimverzeichnis.
-EOH
- :manager_package_exists => "Das Paket %1$s existiert bereits.",
- :manager_service_installed => "Service %1$s installiert.",
- :manager_one_moment => "Moment, %1$s ...",
- :manager_service_started => "Service %1$s gestartet.",
- :manager_service_stopped => "Service %1$s gestoppt.",
- :manager_service_deleted => "Service %1$s gelöscht.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Verwendung: %1$s [Optionen]",
- :runner_general_options => "Allgemeine Optionen:",
- :runner_saveconfig_desc => [ "Sichert die Konfiguration nach FILENAME",
- "und beendet. Falls FILENAME nicht",
- "gegben ist, wird die Standardkonfig-",
- "urationsdatei verwendet. Alle Optionen",
- "werden von der bestehenen Konfiguration",
- "und der Kommandozeile und gesichert.",
- "Das Servlet wird nicht gestartet.",
- "Der Standardname ist:" ],
- :runner_config_desc => [ "Standardkonfiguration von FILENAME",
- "statt der Standardkonfigurationsdatei",
- "lesen. Optionen die bislang gesetzt",
- "wurden werden zu den Werten, die in der",
- "Konfigurationsdatei stehen,",
- " zurückgesetzt." ],
- :runner_webrick_options => "WEBrick-Optionen:",
- :runner_port_desc => [ "Lässt das Ruwiki-Servlet auf dem gegebenen",
- "Port laufen. Standard: 8808." ],
- :runner_address_desc => [ "Schränkt das Ruwiki-Servlet so ein, dass",
- "es nur die (Komma-separierten) Adressen",
- "akzepiert. Kann mehrfach angegeben werden",
- "Standardmäßig wird nicht eingeschränkt." ],
- :runner_local_desc => [ "Lässt das Ruwiki-Servlet nur lokale",
- "Verbindungen akzeptieren (127.0.0.1).",
- "Hebt vorige -A Adressen auf." ],
- :runner_mountpoint_desc => [ "Die relative URI unter der Ruwiki",
- 'zugreifbar wird. Standard: "/".' ],
- :runner_log_desc => [ "Protokolliere WEBrick. Standard ist --log." ],
- :runner_logfile_desc => [ "Die Datei, in die das WEBrick-Protokoll",
- "geschrieben wird. Standard: Standard-",
- "fehlerausgabe." ],
- :runner_threads_desc => [ "Setzt den WEBrick-Threadcount." ],
- :runner_ruwiki_options => "Ruwiki-Optionen:",
- :runner_language_desc => [ 'Wählt die Oberflächensprache für Ruwiki.',
- 'Standard: "en". Kann "en", "de", oder',
- '"es" sein.' ],
- :runner_webmaster_desc => [ 'Die Ruwiki-Wwebmaster Email-Adresse.',
- 'Standard: "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Aktiviert Ruwuki-Debugging. Standard:',
- '--no-debug.' ],
- :runner_title_desc => [ 'Gibt den Ruwiki-Titel an. Standard ist',
- '"Ruwiki".' ],
- :runner_defaultpage_desc => [ 'Eine andere Standardseite. Standard ist',
- '"ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'Eine andere Standardprojektseite.',
- 'Standard ist "Default".' ],
- :runner_templatepath_desc => [ 'Ort, an dem Ruwiki-Schablonen sind.',
- 'Standard ist "./templates".' ],
- :runner_templatename_desc => [ 'Name der Ruwiki-Schablonen. Default',
- 'Standard ist "default".' ],
- :runner_cssname_desc => [ 'Name der CSS-Datei im Schablonenpfad',
- 'Standard ist "ruwiki.css".' ],
- :runner_storage_desc => [ 'Wähle den Speichertyp:' ],
- :runner_datapath_desc => [ 'Ort, an dem Datendateien gespeichert sind.',
- 'Standard ist "./data".' ],
- :runner_extension_desc => [ 'Dateierweiterung für Datendateien.',
- 'Standard ist "ruwiki".' ],
- :runner_central_desc => [ 'Lässt Ruwiki mit den Daten des Standard-',
- 'RubyGem-Orts laufen .' ],
- :runner_general_info => "Allgemeine Information:",
- :runner_help_desc => [ "Zeigt diesen Text an." ],
- :runner_version_desc => [ "Zeigt die Ruwuki-Version." ],
- :runner_rejected_address => "Adresse %1$s abgewiesen. Nur Verbindungen von %2$s werden akzeptiert.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-WEBrick-Optionen:
- Port %2$d
- Erlaubte Adressen %3$s
- Mount Point %4$s
- Protokollieren? %5$s
- Protokollpfad %6$s
- Threads %7$s
-
-Ruwiki-Options:
- Webmaster %8$s
- Debugging? %9$s
- Titel %10$s
- Standardprojekt %11$s
- Standardseite %12$s
- Schablonenpfad %13$s
- Schablone %14$s
- CSS-Datei %15$s
-
- Speichertyp %16$s
- Datenpfad %17$s
- Dateierweiterung %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/lang/en.rb b/ruwiki/trunk/lib/ruwiki/lang/en.rb
deleted file mode 100644
index de0771a..0000000
--- a/ruwiki/trunk/lib/ruwiki/lang/en.rb
+++ /dev/null
@@ -1,334 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::EN is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module EN
- Message = Hash.new { |hh, kk| hh[kk] = "Language ERROR: Unknown message key #{kk.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Backend %1$s is unknown.",
- :cannot_create_project => "Cannot create project %1$s: %2$s",
- :cannot_destroy_project => "Cannot destroy project %1$s: %2$s",
- :cannot_destroy_topic => "Cannot destroy %1$s::%2$s: %3$s",
- :cannot_obtain_lock => "Unable to obtain a lock on %1$s::%2$s. Try again shortly.",
- :cannot_release_lock => "Unable to release the lock on %1$s::%2$s. Try again shortly.",
- :cannot_retrieve_topic => "Cannot retrieve %1$s::%2$s: %3$s",
- :cannot_store_topic => "Cannot store %1$s::%2$s: %3$s",
- :cannot_list_topics => "Cannot list topics for project %1$s: %2$s",
- :error_creating_lock => "Error creating lock on %1$s::%2$s: %3$s",
- :error_releasing_lock => "Error releasing lock on %1$s::%2$s: %3$s",
- :flatfiles_no_data_directory => "The data directory (%1$s) does not exist.",
- :no_access_list_projects => "No permission to list projects.",
- :no_access_list_topics => "No permission to list topics in project %1$s.",
- :no_access_to_create_project => "No permission to create project %1$s.",
- :no_access_to_destroy_project => "No permission to destroy project %1$s::%2$s.",
- :no_access_to_destroy_topic => "No permission to destroy topic %1$s::%2$s.",
- :no_access_to_read_topic => "No permission to retrieve the %1$s::%2$s.",
- :no_access_to_store_topic => "No permission to store the %1$s::%2$s.",
- :page_not_in_backend_format => "%1$s::%2$s is not in the format supported by the backend %3$s.",
- :project_already_exists => "Project %1$s already exists.",
- :project_does_not_exist => "Project %1$s does not exist.",
- :search_project_fail => "Failure searching project %1$s with string %2$s.",
- :yaml_requires_182_or_higher => "YAML flatfile support exists only for Ruby version 1.8.2 or higher.",
- :not_editing_current_version => <<EOM ,
-You have submitted an old version of %1$s::%2$s. The differences between
-your version and the current version of this page have been merged.
-Conflicting lines have both lines shown. Please ensure that you have edited
-the entire page before saving again.
-EOM
- :no_empty_search_string => <<EOM ,
-The search field may not be empty. Please enter something in the search box
-before pressing the search button.
-EOM
- :page_is_locked => "The page is locked for editing. Please wait a few minutes and try again.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Configuration must be of class Ruwiki::Config.",
- :invalid_template_dir => "The specified path for templates (%1$s) does not exist or is not a directory.",
- :no_template_found => "No template of %1$s found in template set %2$s.",
- :no_template_set => "There is no template set '%1$s' in the template path.",
- :no_webmaster_defined => "Configuration error: Webmaster is unset.",
- # Miscellaneous messages.
- :complete_utter_failure => "Complete and Utter Failure",
- :editing => "Editing",
- :error => "Error",
- :invalid_path_info_value => "Something has gone seriously wrong with the web environment. PATH_INFO = %1$s",
- :render_arguments => "Ruwiki#render must be called with zero or two arguments.",
- :unknown_feature => "Unknown feature %1$s.",
- :topics_for_project => "Topics for Project ::%1$s",
- :project_topics_link => "(topics)",
- :wiki_projects => "Projects in %1$s",
- :no_projects => "No known projects.",
- :no_topics => "No topics in project %1$s.",
- :search_results_for => "= Search results for: %1$s",
- :number_of_hits => "%1$d Hits",
-
- # Labels
- :label_search_project => "Search Project",
- :label_search_all => "All",
- :label_search => "Search: ",
- :label_project => "Project: ",
- :label_topic => "Topic: ",
- :label_edit => "Edit",
- :label_recent_changes => "Recent Changes",
- :label_topics => "Topics",
- :label_projects => "Projects",
- :label_editing => "Editing",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Edit Comment: ",
- :label_comment_accelerator => "O",
- :label_save => "Save",
- :label_save_accelerator => "S",
- :label_cancel => "Cancel",
- :label_cancel_accelerator => "C",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Original Text",
- :label_raw => "Raw",
- :label_formatted => "Formatted",
- :label_send_report_by => "Send the Wiki maintainer a report by email.",
- :label_send_report => "Send report.",
- :label_saved_page => "Saved page: ",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Usage: %1$s [options] <directory>+",
- :converter_format_desc => [ "Converts encountered files (regardless",
- "of the current format), to the specified",
- "format. Default is flatfiles. Allowed",
- "formats are: yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Create backups of upgraded files.",
- "Default is --backup." ],
- :converter_backupext_desc => [ 'Specify the backup extension. Default',
- 'is "~", which is appended to the data',
- 'filename.' ],
- :converter_backupext_error => "The backup extension must not be empty.",
- :converter_extension_desc => [ "Specifies the extension of Ruwiki data",
- "files. The default is .ruwiki" ],
- :converter_extension_error => "The extension must not be empty.",
- :converter_noextension_desc => [ "Indicates that the Ruwiki data files",
- "have no extension." ],
- :converter_quiet_desc => [ "Runs quietly. Default is to run with",
- "normal messages." ],
- :converter_language_desc => [ "Sets the language to LANG. Defaults",
- "to en (English). Known languages",
- "are: en es de" ],
- :converter_verbose_desc => [ "Runs with full message. Default is to",
- "run with normal messages." ],
- :converter_help_desc => [ "Shows this text." ],
- :converter_num_arguments => "Error: not enough arguments.",
- :converter_directory => "directory",
- :converter_converting_from => "converting from %1$s to %2$s ... ",
- :converter_done => "done.",
- :converter_not_ruwiki => "not a Ruwiki file; skipping.",
- :converter_nosave_modified => "cannot save modified %1$s.",
- :converter_page_format_error => "Error: Cannot detect the page format.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Unknown command: %1$s",
- :manager_help_commands => <<EOH ,
-The commands known to 'ruwiki' are:
-
- ruwiki install Installs the default deployment package.
- ruwiki package Packages a Ruwiki installation.
- ruwiki unpackage Unpackages a Ruwiki installation.
- ruwiki service Manages a Win32::Service for Ruwiki.
-
-EOH
- :manager_help_help => <<-EOH ,
-This is a basic help message containing pointers to more information on how
-to use this command-line tool. Try:
-
- ruwiki help commands list all 'ruwiki' commands
- ruwiki help <COMMAND> show help on <COMMAND>
- (e.g., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Missing parameter for option: %1$s",
- :manager_dest_not_directory => "The destination (%1$s) is not a directory.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPTIONS] [--to DEST]
-
-Creates a new Ruwiki instance. By default this installs the data, templates,
-and a default configuration file to the current directory. The destination
-can be changed with the --to option, and what is installed can be specified
-with the OPTIONS list. The OPTIONS list may be space, comma, or semi-colon
-separated. Thus,
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-are all equivalent. The options may be specified in any case. The
-installation OPTIONS are:
-
- servlet # Installs the Ruwiki servlet stub
- service # Installs the Ruwiki Win32::Service stub
- CGI # Installs the Ruwiki CGI script
- data # Installs the Ruwiki data, templates, and configuration
-
-Options may be disabled with by prepending a dash or 'no':
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-These will install the CGI script but not the data.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [SOURCE] [--output PACKAGE] [--replace]
- ruwiki package [SOURCE] [-o PACKAGE] [--replace]
-
-Packages the Ruwiki files (data, templates, and executables) from the
-specified SOURCE or the current directory into the specified output package
-(or "./%1$s"). If the SOURCE is a ruwiki configuration file (e.g.,
-"%2$s"), then that will be used to determine the location and name of
-the data and template directories.
-
- NOTE: The packaging process will normalize the data and templates
- directory names to be relative to the unpacking directory. They
- will NEVER be absolute paths.
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [SOURCE] [--output DIRECTORY]
- ruwiki unpackage [SOURCE] [-o DIRECTORY]
-
-Unpackages the provided Ruwiki package (default "./%1$s") into the
-specified directory (default ".").
-EOH
- :manager_service_broken => "Cannot manage a Win32 service if Win32::Service is not installed.",
- :manager_service_lo_argcount => "Insufficient arguments: %1$s",
- :manager_service_hi_argcount => "Too many arguments: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NAME [DESCRIPTION] [options]
- ruwiki service start NAME
- ruwiki service stop NAME
- ruwiki service delete NAME
-
-Manages the Ruwiki WEBrick servlet as a Windows service. The service must be
-NAMEd. install supports the following additional options:
-
- --rubybin RUBYPATH The path to the Ruby binary.
- --exec SERVICEPATH The path to the service executable.
- --home PATHTOHOME The path to the home directory.
-EOH
- :manager_package_exists => "Package %1$s already exists.",
- :manager_service_installed => "%1$s service installed.",
- :manager_one_moment => "One moment, %1$s ...",
- :manager_service_started => "%1$s service started.",
- :manager_service_stopped => "%1$s service stopped.",
- :manager_service_deleted => "%1$s service deleted.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Usage: %1$s [options]",
- :runner_general_options => "General options:",
- :runner_saveconfig_desc => [ "Saves the configuration to FILENAME and",
- "exit. If FILENAME is not used, then the",
- "default configuration file will be",
- "used. All options will be read from the",
- "existing configuration file and the",
- "command-line and saved. The servlet",
- "will not start. The default name is:" ],
- :runner_config_desc => [ "Read the default configuration from",
- "FILENAME instead of the default config",
- "file. Options set until this point will",
- "be reset to the values from those read",
- "configuration file." ],
- :runner_webrick_options => "WEBrick options:",
- :runner_port_desc => [ "Runs the Ruwiki servlet on the specified",
- "port. Default 8808." ],
- :runner_address_desc => [ "Restricts the Ruwiki servlet to accepting",
- "connections from the specified address or",
- "(comma-separated) addresses. May be",
- "specified multiple times. Defaults to all",
- "addresses." ],
- :runner_local_desc => [ "Restricts the Ruwiki servlet to accepting",
- "only local connections (127.0.0.1).",
- "Overrides any previous -A addresses." ],
- :runner_mountpoint_desc => [ "The relative URI from which Ruwiki will",
- 'be accessible. Defaults to "/".' ],
- :runner_log_desc => [ "Log WEBrick activity. Default is --log." ],
- :runner_logfile_desc => [ "The file to which WEBrick logs are",
- "written. Default is standard error." ],
- :runner_threads_desc => [ "Sets the WEBrick threadcount." ],
- :runner_ruwiki_options => "Ruwiki options:",
- :runner_language_desc => [ 'The interface language for Ruwiki.',
- 'Defaults to "en". May be "en", "de", or',
- '"es".' ],
- :runner_webmaster_desc => [ 'The Ruwiki webmaster email address.',
- 'Defaults to "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Turns on Ruwiki debugging. Defaults',
- 'to --no-debug.' ],
- :runner_title_desc => [ 'Provides the Ruwiki title. Default is',
- '"Ruwiki".' ],
- :runner_defaultpage_desc => [ 'An alternate default page. Default is',
- '"ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'An alternate default project. Default is',
- '"Default".' ],
- :runner_templatepath_desc => [ 'The location of Ruwiki templates. Default',
- 'is "./templates".' ],
- :runner_templatename_desc => [ 'The name of the Ruwiki templates. Default',
- 'is "default".' ],
- :runner_cssname_desc => [ 'The name of the CSS file in the template',
- 'path. Default is "ruwiki.css".' ],
- :runner_storage_desc => [ 'Select the storage type:' ],
- :runner_datapath_desc => [ 'The path where data files are stored.',
- 'Default is "./data".' ],
- :runner_extension_desc => [ 'The extension for data files.',
- 'Default is "ruwiki".' ],
- :runner_central_desc => [ 'Runs Ruwiki with the data in the default',
- 'RubyGem location.' ],
- :runner_general_info => "General info:",
- :runner_help_desc => [ "Shows this text." ],
- :runner_version_desc => [ "Shows the version of Ruwiki." ],
- :runner_rejected_address => "Rejected peer address %1$s. Connections are only accepted from %2$s.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-WEBrick options:
- Port %2$d
- Accepted Addresses %3$s
- Mount Point %4$s
- Logging? %5$s
- Log Destination %6$s
- Threads %7$s
-
-Ruwiki options:
- Webmaster %8$s
- Debugging? %9$s
- Title %10$s
- Default Project %11$s
- Default Page %12$s
- Template Path %13$s
- Template Set %14$s
- CSS Source %15$s
-
- Storage Type %16$s
- Data Path %17$s
- Extension %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/lang/es.rb b/ruwiki/trunk/lib/ruwiki/lang/es.rb
deleted file mode 100644
index 4a9ee2a..0000000
--- a/ruwiki/trunk/lib/ruwiki/lang/es.rb
+++ /dev/null
@@ -1,339 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Mauricio Julio Fernández Pradier (batsman.geo@yahoo.com)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::ES is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module ES
- Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Identificador de mensaje desconocido: #{kk.inspect}."; hh[kk] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Backend %1$s desconocido.",
- :cannot_create_project => "No pudo crearse el proyecto %1$s: %2$s",
- :cannot_destroy_project => "No pudo borrarse el proyecto %1$s: %2$s",
- :cannot_destroy_topic => "No pudo borrarse %1$s::%2$s: %3$s",
- :cannot_obtain_lock => "No pudo obtenerse el cerrojo para %1$s::%2$s. Reinténtelo de nuevo en breve.",
- :cannot_release_lock => "No pudo liberarse el cerrojo para %1$s::%2$s. Reinténtelo de nuevo en breve.",
- :cannot_retrieve_topic => "No pudo obtenerse %1$s::%2$s: %3$s",
- :cannot_store_topic => "No pudo almacenarse %1$s::%2$s: %3$s",
- :cannot_list_topics => "No se pudo listar los temas del proyecto %1$s: %2$s",
- :error_creating_lock => "Error al crear el cerrojo para %1$s::%2$s: %3$s",
- :error_releasing_lock => "Error al liberar el cerrojo para %1s::%2$s: %3$s",
- :flatfiles_no_data_directory => "El directorio de datos (%1$s) no existe.",
- :no_access_list_projects => "Permiso denegado al listar los proyectos.",
- :no_access_list_topics => "Permiso denegado al listar los temas del proyecto %1$s.",
- :no_access_to_create_project => "Permiso denegado al crear el proyecto %1$s.",
- :no_access_to_destroy_project => "Permiso denegado al borrar el proyecto %1$s::%2$s.",
- :no_access_to_destroy_topic => "Permiso denegado al borrar el borrar el tema %1$s::%2$s.",
- :no_access_to_read_topic => "Permiso denegado al acceder a %1$s::%2$s.",
- :no_access_to_store_topic => "Permiso denegado al almacenar %1$s::%2$s.",
- :page_not_in_backend_format => "%1$s::%2$s no está en un formato soportado por el backend %3$s.",
- :project_already_exists => "El proyecto %1$s ya existe.",
- :project_does_not_exist => "El proyecto %1$s no existe.",
- :search_project_fail => "Error al buscar la cadena %2$s en el proyecto %1$s.",
- :yaml_requires_182_or_higher => "El soporte para archivos YAML sólo está disponible en Ruby versión 1.8.2 o superior.",
- :not_editing_current_version => <<EOM ,
-Ha enviado una versión antigua de %1$s::%2$s. Las diferencias entre su versión
-y la actual han sido fusionadas. En caso de conflicto, las líneas de ambas
-versiones serán mostradas. Asegúrese de editar la página en su totalidad
-antes de salvar de nuevo.
-EOM
- :no_empty_search_string => <<EOM ,
-El campo de búsqueda no puede estar vacío. Por favor introduzca el texto
-a buscar antes de pulsar sobre el botón de búsqueda.
-EOM
- :page_is_locked => "La pagina no puede ser editada al estar bloqueada en este momento. Por favor espere unos minutos y vuelva a intentar.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "La configuración debe ser de clase Ruwiki::Config.",
- :invalid_template_dir => "El path para plantillas (%1$s) no existe o no es un directorio.",
- :no_template_found => "No pudo encontrarse la plantilla para %1$s en el conjunto %2$s.",
- :no_template_set => "No pudo encontrarse el conjunto de plantillas '%1$s' en el path.",
- :no_webmaster_defined => "Error de configuración: Webmaster no está definido.",
- # Miscellaneous messages.
- :complete_utter_failure => "Error catastrófico",
- :editing => "Edición",
- :error => "Error",
- :invalid_path_info_value => "Algo huele a podrido en su entorno Web. PATH_INFO = %1$s",
- :render_arguments => "Ruwiki#render debe ser llamado con cero o dos argumentos.",
- :unknown_feature => "Característica desconocida: %1$s.",
- :topics_for_project => "Temas del Proyecto ::%1$s",
- :project_topics_link => "(temas)",
- :wiki_projects => "Proyectos en %1$s",
- :no_projects => "Ningún proyecto.",
- :no_topics => "El proyecto %1$s no tiene nigún tema.",
- :search_results_for => "= Resultados de la búsqueda de: %1$s",
- :number_of_hits => "%1$d Resultados",
-
- # Labels
- :label_search_project => "Buscar en projecto",
- :label_search_all => "Todo",
- :label_search => "Buscar: ",
- :label_project => "Proyecto: ",
- :label_topic => "Tema: ",
- :label_edit => "Editar",
- :label_recent_changes => "Cambios recientes",
- :label_topics => "Temas",
- :label_projects => "Proyectos",
- :label_editing => "Edición",
- :label_text => "Texto:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Editar Comentario: ",
- :label_comment_accelerator => "O",
- :label_save => "Salvar",
- :label_save_accelerator => "S",
- :label_cancel => "Cancelar",
- :label_cancel_accelerator => "C",
- :label_preview => "Previsualizar",
- :label_preview_accelerator => "P",
- :label_original_text => "Text Original",
- :label_raw => "Crudo",
- :label_formatted => "Formateado",
- :label_send_report_by => "Enviar notificación al administrador del Wiki por email.",
- :label_send_report => "Enviar notificación.",
- :label_saved_page => "Página salvada: ",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :converter_usage => "Modo de empleo: %1$s [opciones] <dir.>",
- :converter_format_desc => [ "Convertir los ficheros encontrados",
- "(independientemente de su formato), al",
- "formato especificado; por defecto ",
- "archivos planos. Formatos permitidos:",
- " yaml marshal flatfiles" ],
- :converter_backup_desc => [ "Crear copias de seguridad de ficheros ",
- "actualizados. La opción por defecto es ",
- "--backup." ],
- :converter_backupext_desc => [ 'Especificar la extensión para las copias',
- 'de seguridad (por defecto "~") que se',
- 'añade al nombre del fichero de datos' ],
- :converter_backupext_error => [ "La extensión para copias de seguridad",
- "no debe estar vacía." ],
- :converter_extension_desc => [ "Especifica la extensión de los ficheros",
- "de datos de Ruwiki (por defecto .ruwiki)" ],
- :converter_extension_error => "La extensión no debe estar vacía.",
- :converter_noextension_desc => [ "Indica que los ficheros de datos de",
- "Ruwiki no tienen ninguna extensión." ],
- :converter_quiet_desc => [ "Ejecución silenciosa. Por defecto se ",
- "ejecuta con mensajes normales." ],
- :converter_language_desc => [ "Especifica el idioma a emplear con LANG.",
- "Por defecto 'en' (inglés).",
- "Idiomas disponibles: en es de" ],
- :converter_verbose_desc => [ "Información detallada de ejecución.",
- "Por defecto se ejecuta con un nivel de ",
- "detalle inferior." ],
- :converter_help_desc => [ "Mostrar este texto." ],
- :converter_num_arguments => "Error: número de argumentos insuficiente.",
- :converter_directory => "directorio",
- :converter_converting_from => "convertiendo de %1$s a %2$s ... ",
- :converter_done => "hecho.",
- :converter_not_ruwiki => "no es un fichero de Ruwiki; ignorando.",
- :converter_nosave_modified => "no pudo salvarse %1$s.",
- :converter_page_format_error => "Error: No pudo detectarse el formato de la página.",
-
- # Messages from Ruwiki::Utils::Manager
- :manager_unknown_command => "Comando desconocido: %1$s",
- :manager_help_commands => <<EOH ,
-Los comandos reconocidos por 'ruwiki' son:
-
- ruwiki install Instala el entorno por defecto.
- ruwiki package Empaqueta una instalación de Ruwiki.
- ruwiki unpackage Desempaqueta una instalación de Ruwiki.
- ruwiki service Gestiona un Win32::Service para Ruwiki.
-
-EOH
- :manager_help_help => <<-EOH ,
-Este es un mensaje de ayuda básico con referencias a información suplementaria
-relativa a esta herramienta de la línea de comandos. Intente:
-
- ruwiki help commands mostrar todos los comandos de ruwiki
- ruwiki help <COMANDO> mostrar ayuda sobre <COMANDO>
- (p.ej., 'ruwiki help install')
-
-EOH
- :manager_missing_parameter => "Falta parámetro para la opción: %1$s",
- :manager_dest_not_directory => "El destino (%1$s) no es un directorio.",
- :manager_service_broken => "No pudo crearse un servicio de Win32 al no estar instalado Win32::Service.",
- :manager_install_help => <<-EOH ,
- ruwiki install [OPCIONES] [--to DEST]
-
-Crea una instancia de Ruwiki. Por defecto, se instala los ficheros de datos,
-plantillas y la configuración por defecto en el directorio actual. El destino
-puede ser cambiado con la opción --to, y los elementos a instalar con la lista
-de OPCIONES, que puede ser delimitada por espacios, comas o puntos y comas.
-Así pues,
-
- ruwiki install data;servlet
- ruwiki install data,servlet
- ruwiki install data servlet
-
-son equivalentes. Las opciones pueden especificarse en mayúsculas/minúsculas.
-Las opciones de instalación son:
-
- servlet # Instala el stub para el servlet Ruwiki
- service # Instala el stub para el Win32::Service Ruwiki
- CGI # Instala el script CGI Ruwiki
- data # Instala los datos, plantillas y configuración de Ruwiki
-
-Las opciones pueden deshabilitarse precediéndolas de un guión o 'no':
-
- ruwiki install cgi -data
- ruwiki install cgi nodata
-
-instalarán el script CGI pero no los datos.
-EOH
- :manager_package_help => <<-EOH ,
- ruwiki package [FUENTE] [--output PAQUETE] [--replace]
- ruwiki package [FUENTE] [-o PAQUETE] [--replace]
-
-Empaqueta los ficheros de Ruwiki (datos, plantillas y ejecutables) de la
-FUENTE especificada o el directorio actual en el archivo de salida
-especificado (o "../%1$s"). Si la FUENTE es un fichero de configuración
-de rukiwi (p.ej. "%2$s"), será empleado para determinar la localización
-y el nombre de los directorios de datos y plantillas.
-
- NOTA: El proceso de empaquetado normaliza los nombres de los
- ficheros de datos y plantillas para que sean relativos al
- directorio de desempaquetado. NUNCA serán paths absolutos.
-
-EOH
- :manager_unpackage_help => <<-EOH ,
- ruwiki unpackage [FUENTE] [--output DIRECTORIO]
- ruwiki unpackage [FUENTE] [-o DIRECTORIO]
-
-Desempaqueta el paquete de Ruwiki provisto (por defecto "./%1$s")
-en el directorio indicado (por defecto ".").
-EOH
- :manager_service_lo_argcount => "Argumentos insuficientes: %1$s",
- :manager_service_hi_argcount => "Demasiados argumentos: %1$s",
- :manager_service_help => <<-EOH ,
- ruwiki service install NOMBRE [DESCRIPCION] [opciones]
- ruwiki service start NOMBRE
- ruwiki service stop NOMBRE
- ruwiki service delete NOMBRE
-
-Gestiona el servlet Ruwiki para WEBrick como un servicio de Windows, bajo el
-NOMBRE indicado. install soporta además las opciones siguientes:
-
- --rubybin RUBYPATH Path del ejecutable Ruby.
- --exec SERVICEPATH Path del ejecutable del servicio.
- --home PATHTOHOME Path del directorio home.
-EOH
- :manager_package_exists => "El paquete %1$s ya existe.",
- :manager_service_installed => "Servicio %1$s instalado.",
- :manager_one_moment => "Un momento, %1$s ...",
- :manager_service_started => "Servicio %1$s iniciado.",
- :manager_service_stopped => "Servicio %1$s parado.",
- :manager_service_deleted => "Servicio %1$s borrado.",
-
- # Messages from Ruwiki::Utils::Converter
- # Note to translators: certain words should be left alone. These
- # will be marked in comments. Description lines are restricted to 40
- # characters and should be an array. Use this as a ruler.
- # => [ "----------------------------------------" ]
- :runner_usage => "Modo de empleo: %1$s [opciones]",
- :runner_general_options => "Opciones generales:",
- :runner_saveconfig_desc => [ "Salvar la configuración en FILENAME y",
- "salir. Si no se emplea FILENAME, la",
- "configuración por defecto será usada.",
- "Todas las opciones serán leídas del",
- "fichero existente y de la línea de",
- "comandos y salvadas. El servlet no se",
- "arrancará. El nombre por defecto es:" ],
- :runner_config_desc => [ "Leer la configuración por defecto de",
- "FILENAME en vez del fichero por defecto",
- "Las opciones especificadas anteriormente",
- "serán sobrescritas" ],
- :runner_webrick_options => "Opciones de WEBrick:",
- :runner_port_desc => [ "Ejecutar el servlet Ruwiki en el puerto",
- "especificado; por defecto 8808." ],
- :runner_address_desc => [ "Aceptar únicamente conexiones desde las",
- "direcciones especificadas (separadas por",
- "comas). Puede usarse repetidamente. Por",
- "defecto todas las direcciones serán",
- "aceptadas" ],
- :runner_local_desc => [ "Aceptar únicamente conexiones locales",
- "(127.0.0.1). Anula las direcciones",
- "indicadas previamente en -A" ],
- :runner_mountpoint_desc => [ "URI relativo en el que Ruwiki estará",
- 'accesible. Por defecto "/".' ],
- :runner_log_desc => [ "Realizar log de la actividad de WEBrick.",
- "Por defecto se usa --log." ],
- :runner_logfile_desc => [ "Fichero en el que escribir los logs de",
- "WEBrick. Por defecto, el standard error." ],
- :runner_threads_desc => [ "Asigna al threadcount de WEBrick." ],
- :runner_ruwiki_options => "Opciones de Ruwiki:",
- :runner_language_desc => [ 'Idioma de la inferfaz de Ruwiki.',
- 'Por defecto "en". Puede ser "en", ',
- '"de", o "es".' ],
- :runner_webmaster_desc => [ 'Email del webmaster de Ruwiki.',
- 'Por defecto "webmaster@domain.tld".' ],
- :runner_debug_desc => [ 'Activa debugging de Ruwiki. Por defecto',
- 'inhabilitado.' ],
- :runner_title_desc => 'Título del Ruwiki. Por defecto "Ruwiki".',
- :runner_defaultpage_desc => [ 'Página por defecto alternativa; por',
- 'defecto "ProjectIndex".' ],
- :runner_defaultproject_desc => [ 'Proyecto por defecto. Por defecto',
- '"Default".' ],
- :runner_templatepath_desc => [ 'Localización de las plantillas.',
- 'Por defecto "./templates".' ],
- :runner_templatename_desc => [ 'Nombre de las plantillas. Por defecto',
- '"default".' ],
- :runner_cssname_desc => [ 'Nombre del fichero CSS en el directorio',
- 'de plantillas. Por defecto "ruwiki.css".' ],
- :runner_storage_desc => [ 'Tipo de almacenamiento:' ],
- :runner_datapath_desc => [ 'Path donde salvar los ficheros de datos.',
- 'Por defecto; "./data".' ],
- :runner_extension_desc => [ 'Extensión para ficheros de datos.',
- 'Por defecto "ruwiki".' ],
- :runner_central_desc => [ 'Ejecuta Ruwiki con los datos del',
- 'directorio RubyGem.' ],
- :runner_general_info => "Información general:",
- :runner_help_desc => [ "Muestra este texto." ],
- :runner_version_desc => [ "Muestra la versión de Ruwiki." ],
- :runner_rejected_address => "Dirección remota %1$s rechazada. Sólo se admiten conexiones desde %2$s.",
- :runner_banner => <<-BANNER ,
-%1$s
-
-Opciones de WEBrick:
- Puerto %2$d
- Direcciones admitidas %3$s
- Punto de montaje %4$s
- Logging? %5$s
- Destino del log %6$s
- Hebras %7$s
-
-Opciones de Ruwiki:
- Webmaster %8$s
- Debugging? %9$s
- Título %10$s
- Proyecto por defecto %11$s
- Página por defecto %12$s
- Path para plantillas %13$s
- Conjunto de plantillas %14$s
- Fuente CSS %15$s
-
- Tipo de almacenamiento %16$s
- Path de datos %17$s
- Extensión %18$s
-BANNER
- }
- message.each { |kk, vv| Message[kk] = vv }
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/page.rb b/ruwiki/trunk/lib/ruwiki/page.rb
deleted file mode 100644
index e94521f..0000000
--- a/ruwiki/trunk/lib/ruwiki/page.rb
+++ /dev/null
@@ -1,262 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # The page class for Ruwiki. The page defines the data and meta-data for a
- # page.
-class Ruwiki::Page
- include Ruwiki::Exportable
-
- exportable_group 'ruwiki'
- # Returns the content version of the page. If the page has a greater
- # content version than this version of Ruwiki does, we should probably
- # throw an exception, because attempting to save such a page will cause
- # a loss of data. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +content-version+
- attr_reader :content_version
- exportable :content_version
- # Returns the version of Ruwiki from which this page was generated.
- # Informational only. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +version+
- attr_reader :ruwiki_version
- exportable :ruwiki_version, :name => 'version'
-
- exportable_group 'properties'
- # Returns or sets the displayed title of the page, which may differ from
- # the topic of the page. As of Ruwiki 0.8.0, this is not currently used
- # and it may disappear.
- #
- # Class:: +properties+
- # ID:: +title+
- attr_accessor :title
- exportable :title
- # Returns or sets the topic of the page, which may differ from the
- # title. This is used to set the topic on a page being saved.
- #
- # Class:: +properties+
- # ID:: +topic+
- attr_accessor :topic
- exportable :topic
- # Returns or sets the project of the page, which may differ from the
- # title. This is used to set the project on a page being saved.
- #
- # Class:: +properties+
- # ID:: +project+
- attr_accessor :project
- exportable :project
- # Returns or sets the creator of the page. Unless we know the user
- # (through the authentication mechanism, only partially implemented for
- # Ruwiki 0.9.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +creator+
- attr_accessor :creator
- exportable :creator
- # Returns or sets the creator's IP address. This should always be set.
- # It will have a value of "UNKNOWN" on the off-chance that something
- # prevents this from working.
- #
- # Class:: +properties+
- # ID:: +creator-ip+
- attr_accessor :creator_ip
- exportable :creator_ip
- # Returns or sets the date of creation.
- #
- # Class:: +properties+
- # ID:: +create-date+
- attr_accessor :create_date
- exportable :create_date
- # Returns or sets the last editor of the page. Unless we know the user
- # (through the authentication mechanism, only partially implemented for
- # Ruwiki 0.9.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +editor+
- attr_accessor :editor
- exportable :editor
- # Returns or sets the last editor's IP address. This should always be
- # set. It will have a value of "UNKNOWN" on the off-chance that
- # something prevents this from working.
- #
- # Class:: +properties+
- # ID:: +editor-ip+
- attr_accessor :editor_ip
- exportable :editor_ip
- # Returns or sets the date of the last edit.
- #
- # Class:: +properties+
- # ID:: +edit-date+
- attr_accessor :edit_date
- exportable :edit_date
- # Indicates whether the page is editable. Non-editable pages are
- # effectively static pages.
- #
- # Class:: +properties+
- # ID:: +editable+
- attr_accessor :editable
- exportable :editable
- # Indicates whether the page is indexable. Non-indexable pages are
- # invisible to compliant web robots, and their links may not be
- # followed.
- #
- # Class:: +properties+
- # ID:: +indexable+
- attr_accessor :indexable
- exportable :indexable
- # The current version of the page. The old version is always (#version
- # - 1).
- #
- # Class:: +properties+
- # ID:: +version+
- attr_accessor :version
- exportable :version
- # An array of complete tags that will appear in the HTML <HEAD> section.
- # Can be used to specify additional CSS, <META> tags, or even JavaScript
- # on a per-page basis. Currently unused.
- #
- # Class:: +properties+
- # ID:: +html-headers+
- attr_accessor :html_headers
- exportable :html_headers
- # The entropy of the page. This is a ratio of the number of lines
- # changed in the file vs. the total number of lines in the file. This
- # value is currently unused. (And, sad to say, I don't remember why
- # I included it. However, it's an interesting value that may be useful
- # in spam fighting techniques. It is currently stored in the meta-data,
- # but that may change moving forward.)
- #
- # Class:: +properties+
- # ID:: +entropy+
- attr_reader :entropy
- exportable :entropy
- # The edit comment for the current revision of the page.
- #
- # Class:: +properties+
- # ID:: +edit-comment+
- attr_accessor :edit_comment
- exportable :edit_comment
-
- exportable_group 'page'
- # The header content of the page. This is static content (in either Wiki
- # or HTML formats) that appears before the editable contents of the
- # page. If both this and Wiki-level header content are specified, this
- # will appear *after* the Wiki-level header content.
- #
- # Class:: +page+
- # ID:: +header+
- attr_accessor :header
- exportable :header
- # The footer content of the page. This is static content (in either Wiki
- # or HTML formats) that appears before the editable contents of the
- # page. If both this and Wiki-level footer content are specified, this
- # will appear *before* the Wiki-level footer content.
- #
- # Class:: +page+
- # ID:: +footer+
- attr_accessor :footer
- exportable :footer
- # The editable unformatted Wiki content of the page.
- #
- # Class:: +page+
- # ID:: +content+
- attr_accessor :content
- exportable :content
-
- # Creates a Ruwiki page. This must be created from the canonical export
- # hash.
- def initialize(exported = {})
- ruwiki = exported['ruwiki']
- @content_version = (ruwiki['content-version'] || Ruwiki::CONTENT_VERSION).to_i
- @ruwiki_version = ruwiki['version'] || Ruwiki::VERSION
-
- props = exported['properties']
- @title = props['title']
- @topic = props['topic'] || "NewTopic"
- @project = props['project'] || "Default"
- @creator = props['creator'] || ""
- @creator_ip = props['creator-ip'] || "UNKNOWN"
- @create_date = Time.at((props['create-date'] || Time.now.utc).to_i)
- @editor = props['editor'] || ""
- @editor_ip = props['editor-ip'] || "UNKNOWN"
- @edit_date = Time.at((props['edit-date'] || Time.now.utc).to_i)
- @edit_comment = props['edit-comment'] || ""
- case props['editable']
- when "false"
- @editable = false
- else
- @editable = true
- end
- case props['indexable']
- when "false"
- @indexable = false
- else
- @indexable = true
- end
- @entropy = (props['entropy'] || 0).to_f
- @html_headers = props['html-headers'] || []
- @version = (props['version'] || 0).to_i
-
- page = exported['page']
- @header = page['header'] || ""
- @content = page['content'] || ""
- @footer = page['footer'] || ""
-
- # Fix the possibility that the content might be an array of chunks.
- @content = @content.join("") if @content.kind_of?(Array)
-
- @content.gsub!(/\r/, "")
- end
-
- # Outputs the HTML version of the page.
- def to_html(markup)
- # Normalise the content, first
- @content.gsub!(/\r/, "")
- markup.parse(@content, @project)
- end
-
- # Provides the canonical export hash.
- def export
- sym = super
-
- sym.each_key do |sect|
- if sect == 'ruwiki'
- sym[sect]['content-version'] = Ruwiki::CONTENT_VERSION
- sym[sect]['version'] = Ruwiki::VERSION
- else
- sym[sect].each_key do |item|
- case [sect, item]
- when ['properties', 'create-date'], ['properties', 'edit-date']
- sym[sect][item] = sym[sect][item].to_i
- when ['properties', 'editable'], ['properties', 'indexable']
- sym[sect][item] = (sym[sect][item] ? 'true' : 'false')
- else
- sym[sect][item] = sym[sect][item].to_s
- end
- end
- end
- end
-
- sym
- end
-
- NULL_PAGE = {
- 'ruwiki' => {
- 'content-version' => Ruwiki::CONTENT_VERSION,
- 'version' => Ruwiki::VERSION
- },
- 'properties' => { },
- 'page' => { },
- }
-end
diff --git a/ruwiki/trunk/lib/ruwiki/servlet.rb b/ruwiki/trunk/lib/ruwiki/servlet.rb
deleted file mode 100644
index 373482e..0000000
--- a/ruwiki/trunk/lib/ruwiki/servlet.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'webrick'
-
-class Ruwiki::Servlet < WEBrick::HTTPServlet::AbstractServlet
- class << self
- attr_accessor :config
- end
-
- def initialize(config)
- @config = config
- end
-
- # Converts a POST into a GET.
- def do_POST(req, res)
- do_GET(req, res)
- end
-
- def do_GET(req, res)
- # Generate the reponse handlers for Ruwiki from the request and response
- # objects provided.
- wiki = Ruwiki.new(Ruwiki::Handler.from_webrick(req, res))
-
- # Configuration defaults to certain values. This overrides the defaults.
- wiki.config = Ruwiki::Servlet.config unless Ruwiki::Servlet.config.nil?
- wiki.config!
- wiki.config.logger = @config.logger
- wiki.run
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/template.rb b/ruwiki/trunk/lib/ruwiki/template.rb
deleted file mode 100644
index af26151..0000000
--- a/ruwiki/trunk/lib/ruwiki/template.rb
+++ /dev/null
@@ -1,553 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file is originally from rdoc by Dave Thomas (dave@pragprog.com).
-#
-# $Id$
-#++
-require 'cgi'
-
- # Ruwiki templating, based originally on RDoc's "cheap-n-cheerful" HTML
- # page template system, which is a line-oriented, text-based templating
- # system.
- #
- # Templates can contain:
- #
- # * The directive !INCLUDE!, which will include the next template from the
- # provided list. This is processed before any template substitution, so
- # repeating and optional blocks work on the values within the template
- # substitution.
- # * Substitutable variable values between percent signs (<tt>%key%</tt>).
- # Optional variable values can be preceded by a question mark
- # (<tt>%?key%</tt>).
- # * Label values between hash marks (<tt>#key#</tt>). Optional label
- # values can be preceded by a question mark (<tt>#?key#</tt>).
- # * Links (<tt>HREF:ref:name:</tt>).
- # * Repeating substitution values (<tt>[:key| stuff :]</tt>). The value of
- # +key+ may be an integer value or a range (in which case key will be
- # used as an iterator, providing the current value of key on successive
- # values), an array of scalar values (substituting each value), or an
- # array of hashes (in which case it works like repeating blocks, see
- # below). These must NOT be nested. Note that integer value counting is
- # one-based.
- # * Optional substitution values (<tt>[?key| stuff ?]</tt> or <tt>[!key|
- # stuff ?]</tt>. These must NOT be nested.
- # * Repeating blocks:
- # START:key
- # ... stuff
- # END:key
- # * Optional blocks:
- # IF:key
- # ... stuff
- # ENDIF:key
- # or:
- # IFNOT:key
- # ... stuff
- # ENDIF:key
- #
- # When generating the output, a hash of values is provided and an optional
- # hash of labels is provided. Simple variables are resolved directly from
- # the hash; labels are resolved as Symbols from the label hash or are
- # otherwise treated as variables. Labels are always resolved from a single
- # message hash.
- #
- # The +key+ for repeating blocks (one-line or multi-line) must be an array
- # of hashes. The repeating block will be generated once for each entry.
- # Blocks can be nested arbitrarily deeply.
- #
- # Optional blocks will only be generated if the test is true. IF blocks
- # test for the presence of +key+ or that +key+ is non-+nil+; IFNOT blocks
- # look for the absence or +nil+ value of +key+. IFBLANK blocks test for
- # the absence, +nil+ value, or emptiness of +key+; IFNOTBLANK blocks test
- # for the presence of +key+ and that it is neither +nil+ nor empty.
- #
- # Usage: Given a set of templates <tt>T1</tt>, <tt>T2</tt>, etc.
- #
- # values = { "name" => "Dave", "state" => "TX" }
- # fr = { :name => "Nom", :state => "Etat" }
- # en = { :name => "Name", :state => "State" }
- # tt = TemplatePage.new(T1, T2, T3)
- #
- # res = ""
- # tt.process(res, values, fr)
- # tt.process(res, values, en)
- #
-class Ruwiki::TemplatePage
- BLOCK_RE = %r{^\s*(IF|IFNOT|IFBLANK|IFNOTBLANK|ENDIF|START|END):(\w+)?}
- HREF_RE = %r{HREF:(\w+?):(\w+?):}
- LABEL_RE = %r{#(\??)(-?)(\w+?)#}
- VARIABLE_RE = %r{%(\??)(-?)(\w+?)%}
- IFLINE_RE = %r{\[([?!])(\w+?)\|(.*?)\?\]}
- BLOCKLINE_RE = %r{\[:(\w+?)\|(.*?):\]}
- INCLUDE_RE = %r{!INCLUDE!}
-
- DDLB_RES = [
- [ :check, %r{%check:(\w+?)%} ],
- [ :date, %r{%date:(\w+?)%} ],
- [ :popup, %r{%popup:(\w+?):(\w+?)%} ],
- [ :ddlb, %r{%ddlb:(\w+?):(\w+?)%} ],
- [ :vsortddlb, %r{%vsortddlb:(\w+?):(\w+?)%} ],
- [ :radio, %r{%radio:(\w+?):(\w+?)%} ],
- [ :radioone, %r{%radioone:(\w+?):(\w+?)%} ],
- [ :input, %r{%input:(\w+?):(\d+?):(\d+?)%} ],
- [ :text, %r{%text:(\w+?):(\d+?):(\d+?)%} ],
- [ :pwinput, %r{%pwinput:(\w+?):(\d+?):(\d+?)%} ],
- [ :pair, %r{%pair(\d)?:([^:]+)(\w+?)%} ]
- ]
-
- # Nasty hack to allow folks to insert tags if they really, really want to
- OPEN_TAG = "\001"
- CLOSE_TAG = "\002"
- BR = "#{OPEN_TAG}br#{CLOSE_TAG}"
-
- # A Context holds a stack of key/value pairs (like a symbol table). When
- # asked to resolve a key, it first searches the top of the stack, then the
- # next level, and so on until it finds a match (or runs out of entries).
- class Context
- def initialize
- @stack = []
- end
-
- def push(hash)
- @stack.push(hash)
- end
-
- def pop
- @stack.pop
- end
-
- # Find a scalar value, throwing an exception if not found. This method is
- # used when substituting the %xxx% constructs
- def find_scalar_raw(key)
- @stack.reverse_each do |level|
- if level.has_key?(key)
- val = level[key]
- return val unless val.kind_of?(Array)
- end
- end
- raise "Template error: can't find variable '#{key}'."
- end
-
- def find_scalar(key)
- find_scalar_raw(key) || ''
- end
-
- # Lookup any key in the stack of hashes
- def lookup(key)
- @stack.reverse_each do |level|
- return level[key] if level.has_key?(key)
- end
- nil
- end
- end
-
- # Simple class to read lines out of a string
- class LineReader
- attr_reader :lines
- def initialize(lines)
- @lines = lines
- end
-
- # read the next line
- def read
- @lines.shift
- end
-
- # Return a list of lines up to the line that matches a pattern. That last
- # line is discarded.
- def read_up_to(pattern)
- res = []
- while line = read
- if pattern.match(line)
- return LineReader.new(res)
- else
- res << line
- end
- end
- raise "Missing end tag in template: #{pattern.source}"
- end
-
- # Return a copy of ourselves that can be modified without affecting us
- def dup
- LineReader.new(@lines.dup)
- end
- end
-
- # +templates+ is an array of strings containing the templates. We start at
- # the first, and substitute in subsequent ones where the string
- # <tt>!INCLUDE!</tt> occurs. For example, we could have the overall page
- # template containing
- #
- # <html><body>
- # <h1>Master</h1>
- # !INCLUDE!
- # </body></html>
- #
- # and substitute subpages in to it by passing [master, sub_page]. This
- # gives us a cheap way of framing pages
- def initialize(*templates)
- result = templates.shift.dup
- templates.each { |content| result.sub!(INCLUDE_RE, content) }
- @lines = LineReader.new(result.split(/\r?\n/))
- end
-
- attr_reader :lines
-
- def set_options(opts = {})
- @message = opts[:messages] || {}
- @output = opts[:output] || $stdout
- end
-
- # Render templates as HTML. Compatibility method for Rublog and
- # Rdoc.
- def write_html_on(op, value_hash, message_hash = {})
- to_html(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as HTML
- def to_html(value_hash, options = {})
- set_options(options)
- esc = proc { |str| CGI.escapeHTML(str) }
- @output << process(value_hash, esc)
- end
-
- # Render templates as TeX. Compatibility method for Rublog and
- # Rdoc.
- def write_tex_on(op, value_hash, message_hash = {})
- to_tex(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as TeX
- def to_tex(value_hash, options = {})
- set_options(options)
-
- esc = proc do |str|
- str.
- gsub(/&lt;/, '<').
- gsub(/&gt;/, '>').
- gsub(/&amp;/) { '\\&' }.
- gsub(/([$&%\#{}_])/) { "\\#$1" }.
- gsub(/>/, '$>$').
- gsub(/</, '$<$')
- end
- str = ""
-
- str << process(value_hash, esc)
- @output << str
- end
-
- # Render templates as plain text. Compatibility method for Rublog and
- # Rdoc.
- def write_plain_on(op, value_hash, message_hash = {})
- to_plain(value_hash, { :output => op, :messages => message_hash })
- end
-
- # Render templates as plain text.
- def to_plain(value_hash, options = {})
- set_options(options)
- esc = proc {|str| str}
- @output << process(value_hash, esc)
- end
-
- # Render the templates. The The <tt>value_hash</tt> contains key/value
- # pairs used to drive the substitution (as described above). The
- # +escaper+ is a proc which will be used to sanitise the contents of the
- # template.
- def process(value_hash, escaper)
- @context = Context.new
- sub(@lines.dup, value_hash, escaper).
- tr("\000", '\\').
- tr(OPEN_TAG, '<').
- tr(CLOSE_TAG, '>')
- end
-
- # Substitute a set of key/value pairs into the given template. Keys with
- # scalar values have them substituted directly into the page. Those with
- # array values invoke <tt>substitute_array</tt> (below), which examples a
- # block of the template once for each row in the array.
- #
- # This routine also copes with the <tt>IF:</tt>_key_ directive, removing
- # chunks of the template if the corresponding key does not appear in the
- # hash, and the START: directive, which loops its contents for each value
- # in an array
- def sub(lines, values, escaper)
- @context.push(values)
- skip_to = nil
- result = []
-
- while line = lines.read
- mv = line.match(BLOCK_RE)
-
- if mv.nil?
- result << expand(line.dup, escaper)
- next
- else
- cmd = mv.captures[0]
- tag = mv.captures[1]
- end
-
- case cmd
- when "IF", "IFNOT", "IFNOTBLANK", "IFBLANK"
- raise "#{cmd}: must have a key to test." if tag.nil?
-
- val = @context.lookup(tag)
- case cmd # Skip lines if the value is...
- when "IF" # false or +nil+ (not false => true)
- test = (not val)
- when "IFBLANK" # +nil+ or empty
- test = (not (val.nil? or val.empty?))
- when "IFNOT"
- test = val
- when "IFNOTBLANK" #
- test = (val.nil? or val.empty?)
- end
- lines.read_up_to(/^\s*ENDIF:#{tag}/) if test
- when "ENDIF"
- nil
- when "START"
- raise "#{cmd}: must have a key." if tag.nil?
-
- body = lines.read_up_to(/^\s*END:#{tag}/)
- inner = @context.lookup(tag)
- raise "unknown tag: #{tag}" unless inner
- raise "not array: #{tag}" unless inner.kind_of?(Array)
- inner.each { |vals| result << sub(body.dup, vals, escaper) }
- result << "" # Append the missing \n
- else
- result << expand(line.dup, escaper)
- end
- end
-
- @context.pop
-
- result.join("\n")
- end
-
- # Given an individual line, we look for %xxx%, %?xxx%, #xxx#, #?xxx#,
- # [:key| xxx :], [?key| stuff ?], [!key| stuff ?] and HREF:ref:name:
- # constructs, substituting as appropriate.
- def expand(line, escaper)
- # Generate a cross-reference if a reference is given. Otherwise, just
- # fill in the name part.
- line = line.gsub(HREF_RE) do
- ref = @context.lookup($1)
- name = @context.find_scalar($2)
-
- if ref and not ref.kind_of?(Array)
- %Q(<a href="#{ref}">#{name}</a>)
- else
- name
- end
- end
-
- # Look for optional content.
- line = line.gsub(IFLINE_RE) do
- type = $1
- name = $2
- stuff = $3
-
- case type
- when '?'
- test = @context.lookup(name)
- when '!'
- test = (not @context.lookup(name))
- end
-
- if test
- stuff
- else
- ""
- end
- end
-
- # Look for repeating content.
- line = line.gsub(BLOCKLINE_RE) do |match|
- name = $1
- stuff = $2
-
- val = @context.lookup(name)
- ss = ""
- case val
- when nil
- nil
- when Fixnum
- val.times { |ii| ss << stuff.sub(/%#{name}%/, "#{ii + 1}") }
- when Range
- val.each { |ii| ss << stuff.sub(/%#{name}%/, "#{ii}") }
- when Array
- if not val.empty? and val[0].kind_of?(Hash)
- val.each do |vv|
- @context.push(vv)
- ss << expand(stuff, escaper)
- @context.pop
- end
- else
- val.each { |ee| ss << stuff.sub(/%#{name}%/, "#{ee}") }
- end
- end
- ss
- end
-
- # Substitute in values for #xxx# constructs.
- line = line.gsub(LABEL_RE) do
- mandatory = $1.nil?
- escaped = $2.nil?
- key = $3.intern
- val = @message[key]
-
- if val.nil?
- raise "Template error: can't find label '#{key}'." if mandatory
- ""
- else
- val = val.to_s
- val = escaper.call(val) if escaped
- val.tr('\\', "\000")
- end
- end
-
- # Substitute in values for %xxx% constructs. This is made complex
- # because the replacement string may contain characters that are
- # meaningful to the regexp (like \1)
- line = line.gsub(VARIABLE_RE) do
- mandatory = $1.nil?
- escaped = $2.nil?
- key = $3
- val = @context.lookup(key)
-
- if val.nil?
- raise "Template error: can't find variable '#{key}'." if mandatory
- ""
- else
- val = val.to_s
- val = escaper.call(val) if escaped
- val.tr('\\', "\000")
- end
- end
-
- # Substitute DDLB controls:
- DDLB_RES.each do |ddlb|
- line = line.gsub(ddlb[1]) do
- self.send(ddlb[0], Regexp.last_match.captures)
- end
- end
-
- line
- rescue Exception => ex
- raise "Error in template: #{ex}\nOriginal line: #{line}\n#{ex.backtrace[0]}"
- end
-
- def check(*args)
- value = @context.find_scalar_raw(args[0])
- checked = value ? " checked" : ""
- "<input type=\"checkbox\" name=\"#{name}\"#{checked}>"
- end
-
- def vsortddlb(*args)
- ddlb(*(args.dup << true))
- end
-
- def ddlb(*args)
- value = @context.find_scalar(args[0]).to_s
- options = @context.lookup(args[1])
- sort_on = args[2] || 0
-
- unless options and options.kind_of?(Hash)
- raise "Missing options #{args[1]} for ddlb #{args[0]}."
- end
-
- res = %Q(<select name="#{args[0]}">)
-
- sorted = options.to_a.sort do |aa, bb|
- if aa[0] == -1
- -1
- elsif bb[0] == -1
- 1
- else
- aa[sort_on] <=> bb[sort_on]
- end
- end
-
- sorted.each do |key, val|
- selected = (key.to_s == value) ? " selected" : ""
- res << %Q(<option value="#{key}"#{selected}>#{val}</option>)
- end
- res << "</select>"
- end
-
- def date(*args)
- yy = "#{argv[0]}_y"
- mm = "#{argv[0]}_m"
- dd = "#{argv[0]}_d"
- %Q<#{input(yy, 4, 4)}&nbsp;.&nbsp;#{input(mm, 2, 2)}&nbsp;.&nbsp;#{input(dd, 2, 2)}>
- end
-
- def radioone(*args)
- radio(*(args.dup << ""))
- end
-
- def radio(*args)
- value = @context.find_scalar(argv[0]).to_s
- options = @context.lookup(argv[1])
- br = argv[2] || "<br />"
-
- unless options and options.kind_of?(Hash)
- raise "Missing options #{args[1]} for radio #{args[0]}."
- end
-
- res = ""
- options.keys.sort.each do |key|
- val = options[key]
- checked = (key.to_s == value) ? " checked" : ""
- res << %Q(<label>
- <input type="radio" name="#{args[0]}"
- value="#{key}"#{checked}">#{val}</label>#{br})
- end
- res
- end
-
- def text(*args)
- value = @context.find_scalar(args[0]).to_s
- %Q(<textarea name="#{args[0]}" cols="#{args[1]}" rows="#{args[2]}">
-#{CGI.escapeHTML(value)}
-</textarea>)
- end
-
- def pwinput(*args)
- input(*(args.dup << "password"))
- end
-
- def input(*args)
- name = args[0]
- value = @context.find_scalar(name).to_s
- width = args[1]
- max = args[2]
- iptype = args[3] || "text"
- %Q(<input type="#{iptype}" name="#{name}" value="#{value}" size="#{width}" maxsize="#{max}">)
- end
-
- def popup(*args)
- url = CGI.escapeHTML(@context.find_scalar(args[0]).to_s)
- text = @context.find_scalar(args[1]).to_s
- %Q|<a href="#{url}" target="Popup" class="methodtitle" onClick="popup('#{url}'); return false;">#{text}</a>|
- end
-
- def pair(*args)
- label = args[0]
- name = args[1]
- colsp = args[2]
-
- value = @context.find_scalar(name).to_s
- value = case value
- when "true" then "Yes"
- when "false" then "No"
- else value
- end
- td = (colsp.nil? or colsp.empty?) ? "<td>" : %Q{<td colspan="#{colsp}">}
- "#{Html.tag(label)}#{td}#{value}</td>"
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/utils.rb b/ruwiki/trunk/lib/ruwiki/utils.rb
deleted file mode 100644
index c58a9f4..0000000
--- a/ruwiki/trunk/lib/ruwiki/utils.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # So that Ruwiki doesn't have to be loaded in full to use the bloody thing.
-unless defined?(Ruwiki)
- class Ruwiki
- VERSION = "0.9.0"
- end
-end
-
-module Ruwiki::Utils
- RUN_PATH = Dir.pwd
-end
diff --git a/ruwiki/trunk/lib/ruwiki/utils/command.rb b/ruwiki/trunk/lib/ruwiki/utils/command.rb
deleted file mode 100644
index ba7c060..0000000
--- a/ruwiki/trunk/lib/ruwiki/utils/command.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # Implements the command pattern. Commands are used by the command-line
-class Ruwiki::Utils::CommandPattern
- class AbstractCommandError < Exception; end
- class UnknownCommandError < RuntimeError; end
- class CommandAlreadyExists < RuntimeError; end
- class MissingParameterError < ArgumentError
- def initialize(argument)
- @argument = argument
- end
-
- attr_reader :argument
- end
-
- class << self
- def add(command)
- command = command.new if command.kind_of?(Class)
-
- @commands ||= {}
- if @commands.has_key?(command.name)
- raise CommandAlreadyExists
- else
- @commands[command.name] = command
- end
-
- if command.respond_to?(:altname)
- unless @commands.has_key?(command.altname)
- @commands[command.altname] = command
- end
- end
- end
-
- def <<(command)
- add(command)
- end
-
- attr_accessor :default
- def default=(command) #:nodoc:
- if command.kind_of?(Ruwiki::Utils::CommandPattern)
- @default = command
- elsif command.kind_of?(Class)
- @default = command.new
- elsif @commands.has_key?(command)
- @default = @commands[command]
- else
- raise UnknownCommandError
- end
- end
-
- def command?(command)
- @commands.has_key?(command)
- end
-
- def command(command)
- if command?(command)
- @commands[command]
- else
- @default
- end
- end
-
- def [](cmd)
- self.command(cmd)
- end
-
- def default_ioe(ioe = {})
- ioe[:input] ||= $stdin
- ioe[:output] ||= $stdout
- ioe[:error] ||= $stderr
- ioe
- end
- end
-
- def [](args, opts = {}, ioe = {})
- call(args, opts, ioe)
- end
-
- def name
- raise AbstractCommandError
- end
-
- def call(args, opts = {}, ioe = {})
- raise AbstractCommandError
- end
-
- def help
- raise AbstractCommandError
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/utils/converter.rb b/ruwiki/trunk/lib/ruwiki/utils/converter.rb
deleted file mode 100644
index 0261af8..0000000
--- a/ruwiki/trunk/lib/ruwiki/utils/converter.rb
+++ /dev/null
@@ -1,297 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-
-module Ruwiki::Utils::Converter
- class << self
- TARGETS = %w(flatfiles yaml marshal)
-
- # Create the regular expressions that are used in Ruwiki 0.6.2
- OLD_HEADER_RE = /^\s*([a-z]+)\s*:\s*(.*)$/
- OLD_HEADER_END_RE = /^#EHDR$/
- DATA_HEADER_END_RE = /\A#EHDR\z/
- NL_RE = /\n/
-
- def with(obj)
- yield obj if block_given?
- end
-
- # Only allow this to be run once. Silently fail otherwise.
- def set_defaults
- return unless @options.nil?
- @options = OpenStruct.new
-
- with @options do |oo|
- oo.traverse_directories = true
- oo.backup_old_files = true
- oo.backup_extension = "~"
- oo.quiet = false
- oo.verbose = false
- oo.extension = 'ruwiki'
- oo.target_format = 'flatfiles'
- end
- end
-
- def message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def message(id)
- if @message[id].nil?
- []
- else
- @message[id]
- end
- end
-
- def display_options
- end
-
- def summary
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- set_defaults
-
- @input = input
- @output = output
- @error = error
-
- language = 'en'
- find_lang = argv.grep(%r{^--lang})
- find_lang.each do |ee|
- if ee =~ %r{^--lang=}
- language = ee.sub(%r{^--lang=}, '')
- else
- language = argv[argv.index(ee).succ]
- end
- end
-
- require "ruwiki/lang/#{language.downcase}"
- self.message = Ruwiki::Lang.const_get(language.upcase)
-
- argv.options do |opts|
- opts.banner = message(:converter_usage) % File.basename($0)
- opts.separator ''
- opts.on('--format=FORMAT', *message(:converter_format_desc)) do |ff|
- @options.target_format = ff
- end
- opts.on('--[no-]backup', *message(:converter_backup_desc)) do |bb|
- @options.backup_old_files = bb
- end
- opts.on('--backup-extension=EXTENSION', *message(:converter_backupext_desc)) do |ee|
- if ee.nil? or ee.empty?
- @error << message(:converter_backupext_error) << "\n" if ee.nil? or ee.empty?
- @error << "#{opts}\n"
- return 0
- end
- @options.backup_extension = ee
- end
- opts.on('--extension=EXTENSION', *message(:converter_extension_desc)) do |ee|
- if ee.nil? or ee.empty?
- @error << message(:converter_extension_error) << "\n" if ee.nil? or ee.empty?
- @error << "#{opts}\n"
- return 0
- end
- @options.extension = ee
- end
- opts.on('--no-extension', *message(:converter_noextension_desc)) do
- @options.extension = nil
- end
- opts.on('--lang=LANG', *message(:converter_language_desc)) do |lang|
- self.message = Ruwiki::Lang.const_get(lang.upcase)
- end
- opts.on('--quiet', *message(:converter_quiet_desc)) do |qq|
- @options.quiet = qq
- @options.verbose = (not qq)
- end
- opts.on('--verbose', *message(:converter_verbose_desc)) do |vv|
- @options.quiet = (not vv)
- @options.verbose = vv
- end
- opts.separator ''
- opts.on_tail('--help', *message(:converter_help_desc)) do
- @error << "#{opts}\n"
- return 0
- end
-
- opts.parse!
- end
-
- if argv.empty?
- @error << message(:converter_num_arguments) << "\n#{argv.options}\n" unless @options.quiet
- return 127
- end
-
- display_options if @options.verbose
-
- @options.target_format.capitalize!
- @options.target_format_class = Ruwiki::Backend.const_get(@options.target_format)
-
- argv.each { |file| process_file(file) }
-
- summary if not @options.quiet
- end
-
- # Process a single file.
- def process_file(file)
- if @options.backup_old_files
- return if file =~ /#{@options.backup_extension}/
- end
- @out << "#{file}: " unless @options.quiet
-
- if File.directory?(file) and @options.traverse_directories
- @out << message(:converter_directory) << "\n" unless @options.quiet
- Dir.chdir(file) { Dir['*'].each { |entry| process_file(entry) } }
- else
- begin
- page, page_format = load_page(file)
- @out << message(:converter_converting_from) % [ page_format, @options.target_format ] if @options.verbose
- save_page(file, page)
- @out << message(:converter_done) << "\n" unless @options.quiet
- rescue PageLoadException
- @out << message(:converter_not_ruwiki) << "\n" unless @options.quiet
- rescue PageSaveException
- @out << message(:cannot_nosave_modified) << "\n" % [ file ] unless @options.quiet
- end
- end
- end
-
- def load_page(file)
- data = File.read(file)
- page_format = nil
-
- if data =~ OLD_HEADER_END_RE
- page_format = 'OldFlatfiles'
-
- page = Ruwiki::Page::NULL_PAGE.dup
-
- unless data.empty?
- rawbuf = data.split(NL_RE).map { |ee| ee.chomp }
-
- loop do
- if rawbuf[0] =~ OLD_HEADER_END_RE
- rawbuf.shift
- break
- end
-
- match = OLD_HEADER_RE.match(rawbuf[0])
-
- unless match.nil?
- case match.captures[0]
- when 'topic'
- page['properties']['topic'] = match.captures[1]
- page['properties']['title'] = match.captures[1]
- when 'version'
- page['properties']['version'] = match.captures[1].to_i
- else
- nil
- end
- end
- rawbuf.shift
- end
-
- page['page']['content'] = rawbuf.join("\n")
-
- with page['properties'] do |pp|
- pp['project'] = File.basename(File.dirname(File.expand_path(file)))
- pp['editable'] = true
- pp['indexable'] = true
- pp['entropy'] = 0.0
- end
- end
- end
-
- # Try Marshal
- if page_format.nil?
- begin
- page = ::Marshal.load(data)
- page_format = 'Marshal'
- rescue Exception
- nil
- end
- end
-
- # Try YAML
- if page_format.nil?
- begin
- page = ::YAML.load(data)
- page_format = 'YAML'
- rescue Exception
- nil
- end
- end
-
- # Try the Flatfiles format
- if page_format.nil?
- begin
- page = Ruwiki::Backend::Flatfiles.load(data)
- page_format = 'Exportable'
- rescue Exception => ex
- nil
- end
- end
-
- if page_format.nil? # Cannot detect page type.
- @error << @message[:converter_page_format_error] << "\n"
- raise PageLoadException
- end
- [page, page_format]
- rescue PageLoadException
- raise
- rescue Exception => ex
- @error << %Q|#{ex.message}\n#{ex.backtrace.join("\n")}\n| if @options.verbose
- raise PageLoadException
- end
-
- def save_page(file, page)
- if @options.backup_extension != '~'
- backup = "#{file}.#{@options.backup_extension}"
- else
- backup = "#{file}#{@options.backup_extension}"
- end
-
- # Always backup the file -- we are transactional.
- FileUtils.cp(file, backup)
-
- if @options.target_format == 'Marshal'
- method = :print
- else
- method = :puts
- end
- File.open(file, 'wb') { |ff| ff.__send__(method, @options.target_format_class.dump(page)) }
- rescue Exception => ex
- FileUtils.mv(backup, file) if File.exists?(backup)
- @error << %Q|#{ex.message}\n#{ex.backtrace.join("\n")}\n| if @options.verbose
- raise PageSaveException
- ensure
- # If we aren't *supposed* to back up the file, then get rid of the
- # backup.
- if File.exists?(backup) and (not @options.backup_old_files)
- FileUtils.rm(backup)
- end
- end
-
- class PageLoadException < RuntimeError; end
- class PageSaveException < RuntimeError; end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/utils/manager.rb b/ruwiki/trunk/lib/ruwiki/utils/manager.rb
deleted file mode 100644
index aaf978d..0000000
--- a/ruwiki/trunk/lib/ruwiki/utils/manager.rb
+++ /dev/null
@@ -1,648 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-require 'stringio'
-require 'zlib'
-require 'ruwiki/exportable'
-require 'ruwiki/utils/command'
-require 'ruwiki/config'
-
-begin
- if defined?(Gem::Cache)
- require_gem 'archive-tar-minitar', '~> 0.5.1'
- else
- require 'archive/tar/minitar'
- end
-rescue LoadError => ex
- $stderr.puts ex.message
- raise
-end
-
-module Ruwiki::Utils::Manager
- DEFAULT_PACKAGE_NAME = 'ruwiki.pkg'
-
- def self.message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def self.message(id)
- @message[id]
- end
-
- class ManagerError < RuntimeError; end
-
- EXECUTABLES = %w(ruwiki.cgi ruwiki_servlet ruwiki_servlet.bat \
- ruwiki_servlet.cmd ruwiki_service.rb)
-
- class ManagerHelp < Ruwiki::Utils::CommandPattern
- def name
- "help"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- help_on = args.shift
- output = ""
-
- if Ruwiki::Utils::CommandPattern.command?(help_on)
- ioe[:output] << Ruwiki::Utils::CommandPattern[help_on].help
- elsif help_on == "commands"
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_help_commands)
- else
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_unknown_command) % [ help_on ] << "\n" % [ help_on ] unless help_on.nil? or help_on.empty?
- ioe[:output] << self.help
- end
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_help_help)
- end
- end
-
- class ManagerInstall < Ruwiki::Utils::CommandPattern
- def name
- "install"
- end
-
- def call(args, opts = {}, ioe = {})
- argv = []
-
- replace = false
- dest = "."
- name = nil
-
- while (arg = args.shift)
- case arg
- when '--to'
- dir = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if dir.nil?
- if File.exist?(dir)
- if not File.directory?(dir)
- raise ArgumentError, Ruwiki::Utils::Manager.message(:manager_dest_not_directory)
- end
- else
- FileUtils.mkdir_p(dir)
- end
- dest = dir
- when /;/o
- argv.push(*(arg.split(/;/o)))
- when /,/o
- argv.push(*(arg.split(/,/o)))
- else
- argv << arg
- end
- end
-
- options = { 'data' => true }
-
- while (arg = argv.shift)
- case arg
- when /^(?:-|no)(.*$)/
- options.delete($1)
- else
- options[arg] = true
- end
- end
-
- Ruwiki::Utils::Manager.install(dest, options)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_install_help)
- end
- end
-
- class ManagerPackage < Ruwiki::Utils::CommandPattern
- def name
- "package"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- argv = []
- replace = false
- dest = "."
- name = nil
-
- while (arg = args.shift)
- case arg
- when '--replace'
- replace = true
- when '-o', '--output'
- name = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if name.nil?
- dest = File.dirname(name)
- name = File.basename(name)
- else
- argv << arg
- end
- end
-
- if argv.size > 1
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_hi_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 1
- end
- source = argv.shift || "."
-
- Ruwiki::Utils::Manager.package(source, dest, name, replace)
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_package_help) % [ "./#{Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME}",
- Ruwiki::Config::CONFIG_NAME ]
- end
- end
-
- class ManagerUnpackage < Ruwiki::Utils::CommandPattern
- def name
- "unpackage"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
- argv = []
- dir = "."
-
- while (arg = args.shift)
- case arg
- when '-o', '--output'
- dir = args.shift
- raise Ruwiki::Utils::CommandPatter::MissingParameterError.new(arg) if dir.nil? or not File.directory?(dir)
- else
- argv << arg
- end
- end
-
- if argv.size > 1
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_hi_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 1
- end
- source = argv.shift || Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME
-
- Ruwiki::Utils::Manager.unpackage(source, dir)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_unpackage_help) % [ "./#{Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME}" ]
- end
- end
-
- if RUBY_PLATFORM =~ /win32/
- class ManagerService < Ruwiki::Utils::CommandPattern
- def name
- "service"
- end
-
- def call(args, opts = {}, ioe = {})
- ioe = Ruwiki::Utils::CommandPattern.default_ioe(ioe)
-
- if args.size < 2
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_lo_argcount) % [ args.join(" ") ] << "\n"
- ioe[:output] << self.help
- return 0
- end
-
- command = args.shift
- service = args.shift
-
- options ||= {}
- options[:service_name] = service
- options[:service_home] = File.expand_path(".")
-
- argv = []
- while (arg = args.shift)
- case arg
- when "--rubybin"
- options[:ruby_bin] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:ruby_bin].nil?
- when "--exec"
- options[:service_bin] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:service_bin].nil?
- when "--home"
- options[:service_home] = args.shift
- raise Ruwiki::Utils::CommandPattern::MissingParameterError.new(arg) if options[:service_home].nil?
- else
- argv << arg
- end
- end
-
- options[:service_desc] = args.join(" ") if args.size > 0
-
- case command
- when "install"
- options[:service_install] = true
- when "start"
- options[:service_start] = true
- when "stop"
- options[:service_stop] = true
- when "delete"
- options[:service_delete] = true
- else
- raise ArgumentError, Ruwiki::Utils::Manager.message(:manager_unknown_command) % [ command ]
- end
-
- Ruwiki::Utils::Manager.manage_windows_service(options, ioe)
-
- 0
- end
-
- def help
- Ruwiki::Utils::Manager.message(:manager_service_help)
- end
- end
- Ruwiki::Utils::CommandPattern << ManagerService
- end
-
- Ruwiki::Utils::CommandPattern << ManagerHelp
- Ruwiki::Utils::CommandPattern << ManagerInstall
- Ruwiki::Utils::CommandPattern << ManagerPackage
- Ruwiki::Utils::CommandPattern << ManagerUnpackage
- Ruwiki::Utils::CommandPattern.default = Ruwiki::Utils::CommandPattern["help"]
-
- class << self
- attr_accessor :shared
- attr_reader :ruwiki_servlet
- attr_reader :ruwiki_servlet_bat
- attr_reader :ruwiki_servlet_cmd
- attr_reader :ruwiki_service
- attr_reader :ruwiki_cgi
- attr_reader :ruwiki_pkg
- def shared=(shared)
- @shared = shared
- @ruwiki_servlet = File.join(@shared, "bin", "ruwiki_servlet")
- @ruwiki_servlet_bat = File.join(@shared, "bin", "ruwiki_servlet.bat")
- @ruwiki_servlet_cmd = File.join(@shared, "bin", "ruwiki_servlet.cmd")
- @ruwiki_service = File.join(@shared, "bin", "ruwiki_service.rb")
- @ruwiki_cgi = File.join(@shared, "bin", "ruwiki.cgi")
- @ruwiki_pkg = File.join(@shared,
- Ruwiki::Utils::Manager::DEFAULT_PACKAGE_NAME)
- end
-
- def with(obj)
- yield obj if block_given?
- end
-
- def tar_files(list, name)
- ff = StringIO.new
- gz = Zlib::GzipWriter.new(ff)
- to = Archive::Tar::Minitar::Output.new(gz)
- list.each { |item| Archive::Tar::Minitar.pack_file(item, to) }
- data = ff.string
- group = {
- :name => name,
- :data => data,
- :mode => 0644,
- }
- return group
- rescue Exception => ex
- puts ex.message, ex.backtrace.join("\n")
- ensure
- to.close
- group[:size] = group[:data].size
- end
-
- def package(source, dest, name = nil, replace = false)
- # If the package name is nil, use the default name. If replace is
- # false, then append a number on the end if the file already exists.
- # Increment the number until we have a unique filename.
- if name.nil?
- pkg = File.join(dest, DEFAULT_PACKAGE_NAME)
- if File.exists?(pkg) and (not replace)
- pbn = "#{File.basename(DEFAULT_PACKAGE_NAME, '.pkg')}-%02d.pkg"
- ii = 1
- while File.exists?(pkg)
- pkg = File.join(dest, pbn % ii)
- ii += 1
- end
- end
- else
- pkg = File.join(dest, name)
- if File.exists?(pkg) and (not replace)
- raise ManagerError, Ruwiki::Utils::Manager.message(:manager_package_exists)
- end
- end
-
- files = []
-
- if File.directory?(source)
- Dir.chdir(source) do
- if File.exists?(Ruwiki::Config::CONFIG_NAME)
- cs = File.stat(Ruwiki::Config::CONFIG_NAME)
- files << {
- :name => Ruwiki::Config::CONFIG_NAME,
- :data => File.read(Ruwiki::Config::CONFIG_NAME),
- :mtime => cs.mtime,
- :mode => 0644,
- :size => cs.size
- }
- end
-
- EXECUTABLES.each do |ff|
- if File.exists?(ff)
- cs = File.stat(ff)
- files << {
- :name => ff,
- :data => File.read(ff),
- :mtime => cs.mtime,
- :mode => 0755,
- :size => cs.size
- }
- end
- end
-
- f_data = Dir["data/**/**"].select { |dd| dd !~ /CVS\// }
- f_data.unshift("data")
- f_data.map! do |dd|
- res = { :name => dd, :mode => 0644 }
- if File.directory?(dd)
- res[:mode] = 0755
- res[:dir] = true
- end
- res
- end
-
- f_tmpl = Dir["templates/**/**"].select { |tt| tt !~ /CVS\// }
- f_tmpl.unshift("templates")
- f_tmpl.map! do |tt|
- res = { :name => tt, :mode => 0644 }
- if File.directory?(tt)
- res[:mode] = 0755
- res[:dir] = true
- end
- res
- end
-
- files << tar_files(f_data, "data.pkg")
- files << tar_files(f_tmpl, "tmpl.pkg")
- end
- else
- stat = File.stat(source)
- files << {
- :name => File.basename(source),
- :data => File.read(source),
- :mtime => stat.mtime,
- :mode => 0644,
- :size => stat.size
- }
-
- EXECUTABLES.each do |ff|
- ff = File.join(File.dirname(source), ff)
- if File.exists?(ff)
- cs = File.stat(ff)
- files << {
- :name => ff,
- :data => File.read(ff),
- :mtime => cs.mtime,
- :mode => 0755,
- :size => cs.size
- }
- end
- end
-
- cc = Ruwiki::Exportable.load(files[0][:data])
- tp = cc['ruwiki-config']['template-path']
- tp = "./templates" if tp.nil? or tp.empty?
- so = cc['ruwiki-config']['storage-options']
-
- if so.nil? or so.empty?
- dp = "./data"
- else
- so = Ruwiki::Exportable.load(so)
- key = 'flatfiles'
- dp = so[key]['data-path']
- end
-
- dp = "./data" if dp.nil? or dp.empty?
- bndp = File.basename(dp)
- bntp = File.basename(tp)
-
- so[key]['data-path'] = bndp
- cc['ruwiki-config']['storage-options'] = Ruwiki::Exportable.dump(so)
- cc['ruwiki-config']['template-path'] = bntp
- files[0][:data] = Ruwiki::Exportable.dump(cc)
- files[0][:size] = files[0][:data].size
-
- Dir.chdir(File.dirname(dp)) do
- f_data = Dir["#{bndp}/**/**"].select { |dd| dd !~ /CVS\// }
- f_data.map! { |dd| { :name => dd, :mode => 0644 } }
- files << tar_files(f_data, "data.pkg")
- end
-
- Dir.chdir(File.dirname(tp)) do
- f_tmpl = Dir["#{bntp}/**/**"].select { |tt| tt !~ /CVS\// }
- f_tmpl.map! { |tt| { :name => tt, :mode => 0644 } }
- files << tar_files(f_tmpl, "tmpl.pkg")
- end
- end
-
- ff = File.open(pkg, "wb")
- gz = Zlib::GzipWriter.new(ff)
- tw = Archive::Tar::Minitar::Writer.new(gz)
-
- files.each do |entry|
- tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
- end
-
- nil
- rescue Exception => ex
- puts ex, ex.backtrace.join("\n")
- ensure
- tw.close if tw
- gz.close if gz
- end
-
- def unpackage(source, dest)
- ff = File.open(source, "rb")
- gz = Zlib::GzipReader.new(ff)
- Archive::Tar::Minitar::Input.open(gz) do |it|
- it.each do |entry|
- case entry.full_name
- when "data.pkg", "tmpl.pkg"
- pkg = StringIO.new(entry.read)
- pkgz = Zlib::GzipReader.new(pkg)
- Archive::Tar::Minitar::Input.open(pkgz) do |inner|
- inner.each { |item| inner.extract_entry(dest, item) }
- end
- else
- it.extract_entry(dest, entry)
- end
- end
- end
-
- nil
- end
-
- def install(dest, options = {})
- if options['servlet']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet, dest, :mode => 0755)
- if RUBY_PLATFORM =~ /win32/
- if File.exists?(Ruwiki::Utils::Manager.ruwiki_servlet_bat)
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet_bat, dest, :mode => 0755)
- end
- if File.exists?(Ruwiki::Utils::Manager.ruwiki_servlet_cmd)
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_servlet_cmd, dest, :mode => 0755)
- end
- end
- end
-
- if RUBY_PLATFORM =~ /win32/ and options['service']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_service, dest, :mode => 0755)
- end
-
- if options['cgi']
- FileUtils.install(Ruwiki::Utils::Manager.ruwiki_cgi, dest, :mode => 0755)
- end
-
- if options['data']
- unpackage(Ruwiki::Utils::Manager.ruwiki_pkg, dest)
- if options['service']
- cfn = File.join(dest, 'ruwiki.conf')
- cfg = nil
- File.open(cfn, "rb") { |f| cfg = f.read }
- cfg.gsub!(%r{\./data}, File.join(File.expand_path(dest), "data"))
- cfg.gsub!(%r{\./templates}, File.join(File.expand_path(dest), "templates"))
- File.open(cfn, "wb") { |f| f.write(cfg) }
- end
- end
- end
-
- if RUBY_PLATFORM =~ /win32/
- begin
- require 'win32/service'
- require 'rbconfig'
- HasWin32Service = true
- rescue LoadError
- HasWin32Service = false
- end
-
- # The work here is based on Daniel Berger's Instiki Service Tutorial.
- # http://rubyforge.org/docman/view.php/85/107/instiki_service_tutorial.txt
- def manage_windows_service(options, ioe)
- raise Ruwiki::Utils::Manager.message(:manager_service_broken) unless HasWin32Service
-
- service_name = options[:service_name] || 'RuwikiSvc'
-
- if options[:service_install]
- service_home = options[:service_home]
-
- program = options[:service_bin]
- if program.nil? or program.empty?
- program = File.join(service_home, "ruwiki_service.rb")
- elsif program !~ %r{[/\\]}
- program = File.join(service_home, program)
- end
- program = %<"#{program}">
-
- ruby = options[:ruby_bin] || %<"#{File.join(Config::CONFIG['bindir'], 'ruby.exe')}">
-
- service_desc = options[:service_desc] || 'Ruwiki'
-
- binpath = "#{ruby} #{program}".tr('/', '\\')
-
- service = Win32::Service.new
- service.create_service do |svc|
- svc.service_name = service_name
- svc.display_name = service_desc
- svc.binary_path_name = binpath
- svc.dependencies = [] # Required because of a bug in Win32::Service
- end
- service.close
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_installed) % [ service_name ] << "\n"
- end
-
- if options[:service_start]
- Win32::Service.start(service_name)
- started = false
- while (not started)
- status = Win32::Service.status(service_name)
- started = (status.current_state == "running")
- break if started
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_one_moment) % [ status.current_state ] << "\n"
- sleep 1
- end
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_started) % [ service_name ] << "\n"
- end
-
- if options[:service_stop]
- Win32::Service.stop(service_name)
- stopped = false
- while (not stopped)
- status = Win32::Service.status(service_name)
- stopped = (status.current_state == "stopped")
- break if stopped
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_one_moment) % [ status.current_state ] << "\n"
- sleep 1
- end
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_stopped) % [ service_name ] << "\n"
- end
-
- if options[:service_delete]
- Win32::Service.stop(service_name) rescue nil
- Win32::Service.delete(service_name)
- ioe[:output] << Ruwiki::Utils::Manager.message(:manager_service_deleted) % [ service_name ] << "\n"
- end
- end
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- ioe = {
- :input => input,
- :output => output,
- :error => error
- }
-
- language = 'en'
- find_lang = argv.grep(%r{^--lang})
- find_lang.each do |ee|
- eepos = argv.index(ee)
- if ee =~ %r{^--lang=}
- language = ee.sub(%r{^--lang=}, '')
- else
- language = argv[eepos.succ]
- argv.delete_at(eepos.succ)
- end
- argv.delete_at(eepos)
- end
-
- require "ruwiki/lang/#{language.downcase}"
- Ruwiki::Utils::Manager.message = Ruwiki::Lang.const_get(language.upcase)
-
- command = Ruwiki::Utils::CommandPattern[(argv.shift or "").downcase]
- return command[argv, {}, ioe]
- rescue Ruwiki::Utils::CommandPattern::MissingParameterError => ee
- ioe[:error] << Ruwiki::Utils::Manager.message(:manager_missing_parameter) % [ ee.argument ] << "\n"
- return 1
- rescue ArgumentError, ManagerError => ee
- ioe[:error] << ee.message << "\n"
- return 1
- end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/utils/servletrunner.rb b/ruwiki/trunk/lib/ruwiki/utils/servletrunner.rb
deleted file mode 100644
index 91dc916..0000000
--- a/ruwiki/trunk/lib/ruwiki/utils/servletrunner.rb
+++ /dev/null
@@ -1,296 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-require 'webrick'
-
-require 'ruwiki/utils'
-require 'ruwiki/exportable'
-require 'ruwiki/servlet'
-require 'ruwiki/lang/en'
-require 'ruwiki/lang/de'
-require 'ruwiki/lang/es'
-
-require 'optparse'
-require 'ostruct'
-
-module Ruwiki::Utils::ServletRunner
- COPYRIGHT = <<-"COPYRIGHT"
-Ruwiki #{Ruwiki::VERSION}
- Copyright © 2002 - 2004, Digikata and HaloStatue
-
- http://rubyforge.org/projects/ruwiki/
-
- Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-
-Licensed under the same terms as Ruby.
-
-$Id$
-COPYRIGHT
-
- class WEBrickConfig
- include Ruwiki::Exportable
-
- exportable_group 'webrick-config'
- attr_accessor :port
- exportable :port
- attr_accessor :addresses
- exportable :addresses
- attr_accessor :mount
- exportable :mount
- attr_accessor :do_log
- exportable :do_log
- attr_accessor :log_dest
- exportable :log_dest
- attr_accessor :threads
- exportable :threads
-
- def export
- hash = super
- sc = hash['webrick-config']
- sc['addresses'] = sc['addresses'].join(";")
- sc['do-log'] = (sc['do-log'] ? 'true' : 'false')
- hash
- end
-
- # Because the servlet can be started from the command-line, provide
- # defaults for all possible configuration options.
- def initialize(exported = {})
- sc = exported['webrick-config'] || {}
- @port = sc['port'] || 8808
- @mount = sc['mount'] || '/'
- @addresses = sc['addresses']
- @do_log = ((sc['do-log'] == 'false') ? false : true)
- @log_dest = sc['log-dest']
- @threads = sc['threads'] || 1
-
- if @addresses.nil? or @addresses.empty?
- @addresses = []
- else
- @addresses = @addresses.split(/;/)
- end
-
- if @log_dest.nil? or @log_dest.empty?
- @log_dest = "<STDERR>"
- end
- end
- end
-
- def self.message=(lang)
- if lang.kind_of?(Hash)
- @message = lang
- elsif "constant" == defined?(lang::Message)
- @message = lang::Message
- else
- raise ArgumentError
- end
- end
- def self.message(id)
- @message[id]
- end
-
- class << self
- # This is for the WEBrick version of Ruwiki. This has been abstracted to
- # accept a Config global variable to reconfigure Ruwiki after initial
- # creation.
- def read_config(filename)
- ch = {}
- if File.exists?(filename)
- File.open(filename, 'rb') { |ff| ch = Ruwiki::Exportable.load(ff.read) }
- end
-
- @sc = WEBrickConfig.new(ch)
- @rc = Ruwiki::Config.new(ch)
-
- if @rc.webmaster.nil? or @rc.webmaster.empty?
- @rc.webmaster = "webmaster@domain.tld"
- end
- end
-
- def run(argv, input = $stdin, output = $stdout, error = $stderr)
- read_config(Ruwiki::Config::CONFIG_NAME)
-
- save_config = nil
-
- language = 'en'
- find_lang = argv.grep(%r{^--language})
- find_lang.each do |ee|
- if ee =~ %r{^--language=}
- language = ee.sub(%r{^--language=}, '')
- else
- language = argv[argv.index(ee).succ]
- end
- end
-
- require "ruwiki/lang/#{language.downcase}"
- @rc.language = Ruwiki::Lang.const_get(language.upcase)
- self.message = @rc.language
-
- argv.options do |oo|
- oo.banner = self.message(:runner_usage) % [ File.basename($0) ]
- oo.separator self.message(:runner_general_options)
- oo.on('--save-config [FILENAME]', *([ self.message(:runner_saveconfig_desc), Ruwiki::Config::CONFIG_NAME ].flatten)) { |fname|
- save_config = fname || Ruwiki::Config::CONFIG_NAME
- }
- oo.on('--config FILENAME', *self.message(:runner_config_desc)) { |fn|
- read_config(fn)
- }
- oo.separator ""
- oo.separator self.message(:runner_webrick_options)
- oo.on('-P', '--port PORT', Numeric, *self.message(:runner_port_desc)) { |port|
- @sc.port = port
- }
- oo.on('-A', '--accept ADDRESS,ADDRESS,ADDRESS', Array, *self.message(:runner_address_desc)) { |address|
- @sc.addresses += address
- }
- oo.on('-L', '--local', *self.message(:runner_local_desc)) {
- @sc.addresses = ["127.0.0.1"]
- }
- oo.on('-M', '--mount MOUNT-POINT', *self.message(:runner_mountpoint_desc)) { |mp|
- @sc.mount = mp
- }
- oo.on('--[no-]log', *self.message(:runner_log_desc)) { |log|
- @sc.do_log = log
- }
- oo.on('--logfile LOGFILE', *self.message(:runner_logfile_desc)) { |lf|
- @sc.log_dest = lf
- }
- oo.on('-T', '--threads THREADS', Integer, *self.message(:runner_threads_desc)) { |tc|
- @sc.threads = tc
- }
- oo.separator ""
- oo.separator self.message(:runner_ruwiki_options)
- oo.on('--language=LANGUAGE', *self.message(:runner_language_desc)) { |lang|
- nil
- }
- oo.on('--webmaster WEBMASTER', *self.message(:runner_webmaster_desc)) { |wm|
- @rc.webmaster = wm
- }
- oo.on('--[no-]debug', *self.message(:runner_debug_desc)) { |dd|
- @rc.debug = dd
- }
- oo.on('--title TITLE', *self.message(:runner_title_desc)) { |tt|
- @rc.title = tt
- }
- oo.on('--default-page PAGENAME', *self.message(:runner_defaultpage_desc)) { |dp|
- @rc.default_page = dp
- }
- oo.on('--default-project PAGENAME', *self.message(:runner_defaultproject_desc)) { |dp|
- @rc.default_project = dp
- }
- oo.on('--template-path TEMPLATE_PATH', *self.message(:runner_templatepath_desc)) { |tp|
- @rc.template_path = tp
- }
- oo.on('--templates TEMPLATES', *self.message(:runner_templatename_desc)) { |tp|
- @rc.template_set = tp
- }
- oo.on('--css CSS_NAME', *self.message(:runner_cssname_desc)) { |css|
- @rc.css = css
- }
- oo.on('--storage-type TYPE', Ruwiki::KNOWN_BACKENDS, *([self.message(:runner_storage_desc), Ruwiki::KNOWN_BACKENDS.join(", ")].flatten)) { |st|
- @rc.storage_type = st
- @rc.storage_options[@rc.storage_type]['data-path'] ||= "./data/"
- @rc.storage_options[@rc.storage_type]['extension'] ||= "ruwiki"
- }
- oo.on('--data-path PATH', *self.message(:runner_datapath_desc)) { |fdp|
- @rc.storage_options['flatfiles']['data-path'] = fdp
- }
- oo.on('--extension EXT', *self.message(:runner_extension_desc)) { |ext|
- @rc.storage_options['flatfiles']['data-path'] = fdp
- }
- if defined?(Gem::Cache)
- oo.separator ""
- oo.on('--central', *self.message(:runner_central_desc)) {
- gempath = Gem::Cache.from_installed_gems.search("ruwiki", "=#{Ruwiki::VERSION}").last.full_gem_path
- @rc.storage_type = 'flatfiles'
- @rc.storage_options['flatfiles']['data-path'] = "#{gempath}/data"
- @rc.storage_options['flatfiles']['extension'] = "ruwiki"
- @rc.storage_options['flatfiles']['format'] = "exportable"
- @rc.template_path = "#{gempath}/templates"
- @rc.template_set = "sidebar"
- }
- end
-
- # TODO: Add options for time, date, and datetime formats.
- oo.separator ""
- oo.separator self.message(:runner_general_info)
- oo.on_tail('--help', *self.message(:runner_help_desc)) {
- error << oo << "\n"
- return 0
- }
- oo.on_tail('--version', *self.message(:runner_version_desc)) {
- error << COPYRIGHT << "\n"
- return 0
- }
- oo.parse!
- end
-
- if save_config
- sc = @sc.export
- rc = @rc.export
- cf = sc.merge(rc)
-
- File.open(save_config, 'wb') { |ff| ff.puts Ruwiki::Exportable.dump(cf) }
- return 0
- end
-
- # If the list of accepted addresses is not empty, provide IP-based
- # restrictions.
- if not @sc.addresses.empty?
- localonly = lambda do |sock|
- if not @sc.addresses.include?(sock.peeraddr[3])
- raise WEBrick::ServerError, self.message(:runner_rejected_address) % [ sock.peeraddr[3], @sc.addresses.join(", ") ]
- end
- end
- else
- localonly = nil
- end
-
- if @sc.do_log
- if "<STDERR>" == @sc.log_dest
- dest = $stderr
- else
- dest = File.open(@sc.log_dest, "wb+")
- end
- logger = WEBrick::Log.new(dest, WEBrick::Log::DEBUG)
- else
- logger = nil
- end
-
- banner = self.message(:runner_banner) %
- [ Ruwiki::Utils::ServletRunner::COPYRIGHT, @sc.port,
- @sc.addresses.join(", "), @sc.mount, @sc.do_log, @sc.log_dest,
- @sc.threads, @rc.webmaster, @rc.debug, @rc.title,
- @rc.default_project, @rc.default_page, @rc.template_path,
- @rc.template_set, @rc.css, @rc.storage_type,
- @rc.storage_options[@rc.storage_type]['data-path'],
- @rc.storage_options[@rc.storage_type]['extension'] ]
-
- banner.each { |bb| logger.info(bb) } unless logger.nil?
-
- server = WEBrick::HTTPServer.new(:Port => @sc.port.to_i,
- :StartThreads => @sc.threads.to_i,
- :AcceptCallback => localonly,
- :Logger => logger)
- @rc.logger = logger
- Ruwiki::Servlet.config = @rc
-
- server.mount(@sc.mount, Ruwiki::Servlet)
- trap("INT") { server.shutdown; return 0 }
- server.start
- return 0
- end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/wiki.rb b/ruwiki/trunk/lib/ruwiki/wiki.rb
deleted file mode 100644
index 3ae5a91..0000000
--- a/ruwiki/trunk/lib/ruwiki/wiki.rb
+++ /dev/null
@@ -1,171 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
- # Ruwiki's Wiki markup class. This will convert the Wiki markup known by
- # Ruwiki (defined by Token classes). The algorithm is as follows:
- #
- # 1. For each known Token class, match each instance of it in the content
- # stream. Replace each instance in the content stream with a Token
- # marker: TOKEN_x or \TOKEN_x, where x is a digit representing the Token.
- # (\TOKEN_x is a special case of token matching. See
- # Ruwiki::Markup::Token for more information.) Store the Token for later
- # processing.
- # 2. Go back through the content, replacing each instance of \TOKEN_x with
- # the Token's defined restore value (which should be the same value as was
- # originally matched).
- # 3. Go through the content, replacing each instance of TOKEN_x with the
- # Token's defined replacement value.
- # 4. Go through the tokens, in reverse, and execute the post replacement
- # routine defined by the Token. (This may be necessary to collapse
- # consecutive HTML structures.)
- # 5. Return the parsed content and the collected metadata.
- #
- # == Tokens
- # Look at Ruwiki::Markup::Token describes how to create Token objects.
-class Ruwiki::Wiki
- ESCAPED_TAGS_RE = %r{\\<([^>]+)>}
-
- def parse(content, project)
- content = clean(content)
- tokens = []
- project ||= @default_project
-
- content.gsub!(ESCAPED_TAGS_RE) do |mm|
- tag = Regexp.last_match.captures[0]
- %Q(&lt;#{tag}&gt;)
- end
-
- Token.tokenlist.each do |token|
- content.gsub!(token.regexp) do |mm|
- match = Regexp.last_match
- tc = token.new(match, project, @backend, @script, @message, @title)
- tokens << tc
- if mm[0, 1] == '\\'
- "\\TOKEN_#{tokens.size - 1}"
- else
- "TOKEN_#{tokens.size - 1}"
- end
- end
- end
-
- replaced = []
- ss = true
- loop do
- break if replaced.size >= tokens.size
- break if ss.nil?
- ss = content.gsub!(/\\TOKEN_(\d+)/) { |mm|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].restore
- }
-
- ss = content.gsub!(/TOKEN_(\d+)/) { |mm|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].replace
- }
- end
-
- token_classes = tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
-
- content
- end
-
- attr_accessor :default_project
- attr_accessor :script
- attr_accessor :backend
- attr_accessor :message
-
- # Creates the markup class.
- def initialize(default_project, script, title)
- @default_project = default_project
- @script = script
- @title = title
- end
-
- # A regular expression that will prevent redirection.
- class << self
- attr_accessor :no_redirect
-
- def redirect(uri)
- if uri =~ %r{^https?://}
- if self.no_redirect and uri =~ self.no_redirect
- uri
- else
- "http://www.google.com/url?sa=D&amp;q=#{CGI.escape(uri)}"
- end
- else
- uri
- end
- end
- end
-
-private
- # Find HTML tags
- SIMPLE_TAG_RE = %r{<[^<>]+?>} # Ensure that only the tag is grabbed.
- HTML_TAG_RE = %r{\A< # Tag must be at start of match.
- (/)? # Closing tag?
- ([\w:]+) # Tag name
- (?:\s+ # Space
- ([^>]+) # Attributes
- (/)? # Singleton tag?
- )? # The above three are optional
- >}x
- ATTRIBUTES_RE = %r{([\w:]+)(=(?:\w+|"[^"]+?"|'[^']+?'))?}x
- STYLE_NOVD_RE = %r{(?:\s?(visibility|display):[^'";]+;?)}x
- ALLOWED_ATTR = %w(style title type lang dir class id cite datetime abbr) +
- %w(colspan rowspan compact start media)
- ALLOWED_HTML = %w(abbr acronym address b big blockquote br caption cite) +
- %w(code col colgroup dd del dfn dir div dl dt em h1 h2 h3) +
- %w(h4 h5 h6 hr i ins kbd li menu ol p pre q s samp small) +
- %w(span strike strong style sub sup table tbody td tfoot) +
- %w(th thead tr tt u ul var)
-
- # Clean the content of unsupported HTML and attributes. This includes
- # XML namespaced HTML. Sorry, but there's too much possibility for
- # abuse.
- def clean(content)
- content = content.gsub(SIMPLE_TAG_RE) do |tag|
- tagset = HTML_TAG_RE.match(tag)
-
- if tagset.nil?
- tag = Ruwiki.clean_entities(tag)
- else
- closer, name, attributes, single = tagset.captures
-
- if ALLOWED_HTML.include?(name.downcase)
- unless closer or attributes.nil?
- attributes = attributes.scan(ATTRIBUTES_RE).map do |set|
- if ALLOWED_ATTR.include?(set[0].downcase)
- if set[0] == 'style'
- set[1].gsub!(STYLE_NOVD_RE, '')
- end
- set.join
- else
- nil
- end
- end.compact.join(" ")
- tag = "<#{closer}#{name} #{attributes}#{single}>"
- else
- tag = "<#{closer}#{name}>"
- end
- else
- tag = Ruwiki.clean_entities(tag)
- end
- end
- tag.gsub(%r{((?:href|src)=["'])(#{Ruwiki::Wiki::RE_URI_SCHEME})}) { "#{$1}\\#{$2}" }
- end
- end
-end
-
-require 'ruwiki/wiki/tokens'
diff --git a/ruwiki/trunk/lib/ruwiki/wiki/tokens.rb b/ruwiki/trunk/lib/ruwiki/wiki/tokens.rb
deleted file mode 100644
index 0ef744d..0000000
--- a/ruwiki/trunk/lib/ruwiki/wiki/tokens.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
- # The base Token class. All Token classes must inherit from Token and
- # *must* implement the following methods:
- #
- # [self.regexp] The regular expression that the Token will be replacing.
- # [replace] The mechanism for replacing the Token with the desired
- # results.
- #
- # Token classes <i>should</i> implement the following method:
- # [self.rank] Default: <tt>5000</tt>. Affects the sort order.
- # Must return an integer.
- #
- # Token classes <i>may</i> implement the following methods:
- # [restore] Restores the token without replacement. Implements
- # the results of the escape character. NOTE: each
- # Token class is responsible for its own restore.
- # Tokens that are anchored to the beginning of a line
- # are the most likely to need to reimplement this.
- # [self.post_replace] Performs any necessary massaging of the data. See
- # the implementation of Ruwiki::Wiki::Lists for more
- # information.
-class Ruwiki::Wiki::Token
- @tokenlist = []
- @sorted = false
-
- class << self
- # Tokens should define rank if they must be first or last in
- # processing. Otherwise, they are sorted in the order defined.
- def rank
- 5000
- end
-
- # The Wiki parsing routine uses Token.tokenlist to determine the
- # tokens that are processed, and the order in which they are
- # processed. See Token.rank for more information.
- def tokenlist(sort = true)
- if sort and not @sorted
- @tokenlist.sort! { |aa, bb| aa.rank <=> bb.rank }
- @sorted = true
- end
- @tokenlist
- end
-
- def inherited(child_class) #:nodoc:
- # Make the child class post_replace a blank function because we
- # don't want to propogate the currently defined post_replace. The
- # current post_replace is specific to Token_Base only.
- class << child_class
- def self.post_replace(content)
- content
- end
- end
-
- @tokenlist << child_class
- @sorted = false
- end
-
- # The replacement regular expression.
- def regexp
- /TOKEN_(\d*)/o
- end
- end
-
- # All Token classes must match this header signature if they define
- # #initialize.
- #
- # [match] The MatchData object for this Token.
- # [project] The project being processed.
- # [backend] The backend for the wiki. This is used to determine if
- # the page or project exists. The object passed must
- # respond to #project_exists?(project) and
- # #page_exists?(page, project).
- # [script] The URI to the script.
- # [message] The message hash for localized messages.
- # [title] The title of the Wiki.
- def initialize(match, project, backend, script, message, title)
- @match = match
- @project = project
- @backend = backend
- @script = script
- @message = message
- @title = title
- end
-
- # The replacement method. Uses @match to replace the token with the
- # appropriate values.
- def replace
- "TOKEN_#{@match[1]}"
- end
-
- # Restores the token without replacement. By default, replaces
- # "dangerous" HTML characters.
- def restore
- Ruwiki.clean_entities(@match[0])
- end
-
- # The content may need massaging after processing.
- def self.post_replace(content)
- content
- end
-end
-
- # Load the tokens from the ruwiki/wiki/tokens directory.
-tokens_dir = 'ruwiki/wiki/tokens'
-
-$LOAD_PATH.each do |path|
- target = "#{path}/#{tokens_dir}"
- if File.exists?(target) and File.directory?(target)
- Dir::glob("#{target}/*.rb") do |token|
- begin
- require token
- rescue LoadError, TypeError
- nil
- end
- end
- end
- Ruwiki::Wiki::Token.tokenlist.each { |tk| tk.freeze }
-end
diff --git a/ruwiki/trunk/lib/ruwiki/wiki/tokens/00default.rb b/ruwiki/trunk/lib/ruwiki/wiki/tokens/00default.rb
deleted file mode 100644
index d78d148..0000000
--- a/ruwiki/trunk/lib/ruwiki/wiki/tokens/00default.rb
+++ /dev/null
@@ -1,208 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-# $debug = File.open("output.txt", "wb")
-
-class Ruwiki::Wiki
- # The Paragraph Token class changes blank lines to <p> tags. This class,
- # under the current implementation, should be *first* in the Token list
- # after Token.
- class Paragraph < Ruwiki::Wiki::Token
- # This Token is #rank 0, because it should be first in the Token list.
- def self.rank
- 0
- end
-
- # Matches blank lines. %r{^$}
- def self.regexp
- %r{(^$)}
- end
-
- def replace
- %Q(</p><p class="rwtk_Paragraph">)
- end
-
- # Ensures that <p> won't be surrounded by <br> tags.
- def self.post_replace(content)
- content.gsub!(%r{\A}, '<p class="rwtk_Paragraph">')
- content.gsub!(%r{\z}, '</p>')
- content.gsub!(%r{\n(</p>)}, '\1')
- content.gsub!(%r{(<p[^>]*>)\n}, '\1')
- content.gsub!(%r{(</p>)(<p[^>]*>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{<p[^>]*></p>}, '')
- content.gsub!(%r{^\n(<p[^>]*>)}, '\1')
- content
- end
- end
-
- # The Code Token class converts indented text to "unformatted" (<pre>)
- # text. This class should be *second* in the Token list.
- class Code < Ruwiki::Wiki::Token
- # This Token is #rank 1, because it should be second in the Token list.
- def self.rank
- 1
- end
-
- # Matches indented text. %r{^(\s+\S?.*)$}
- def self.regexp
- %r{^([ \t]+[^\n]*)}
- end
-
- # Replaces the text to <pre>content</pre>.
- def replace
- content = Ruwiki.clean_entities(@match.captures[0])
-
- %Q{</p><pre class="rwtk_Code">#{content}</pre>\n}
- end
-
- # Converts cases of %r{</pre>(\n|<br ?/?>)<pre>} to \1.
- def self.post_replace(content)
- content.gsub!(%r{</pre>((\n)*</p>(\n)*)?<pre[^>]*>}, "\n")
- content.gsub!(%r{</pre>(\n|<br ?/?>)?<pre[^>]*>}, '\1')
- content.gsub!(%r{<p[^>]*>(<pre[^>]*>)}, '\1')
- content.gsub!(%r{</pre></p>}, '</pre>')
-# content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content
- end
- end
-
- RE_URI_SCHEME = %r{[-a-z0-9+.]{3,}?:}
- RE_URI_PATH = %r{[^\s<>\]]}
- RE_URI_TEXT = %r{[^\]]*}
-
- class << self
- def increment_numbered_links
- @numbered_links_count ||= 0
- @numbered_links_count += 1
- end
-
- def reset_numbered_links
- @numbered_links_count = 0
- end
- end
-
- # Converts URLs in the form of [url] to numbered links.
- class NumberedLinks < Ruwiki::Wiki::Token
-
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\]}
- end
-
- def replace
- extlink = @match.captures[0]
-
- name = "[#{Ruwiki::Wiki.increment_numbered_links}]"
-
- %Q{<a class="rwtk_NumberedLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{name}</a>}
- end
- end
-
- class Image < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- RE_IMAGE_OPTIONS=%r{([^=]+)=("[^"]+"|[^ ]+)}
-
- def self.regexp
- %r{\[image\s*:\s*(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)(\s+[^\]]+)?\]}
- end
-
- def replace
- options = { 'src' => %Q("#{@match.captures[0]}") }
- groups = @match.captures[1]
- unless groups.nil?
- groups.scan(RE_IMAGE_OPTIONS).each { |gg| options[gg[0].strip] = gg[1].strip }
- end
-
- unless options['numbered'].nil? or options['numbered'] == "false"
- options['title'] = %Q("[#{Ruwiki::Wiki.increment_numbered_links}]")
- options.delete('numbered')
- end
-
- options['title'] ||= options['alt']
- options['title'] ||= options['src']
- options['alt'] ||= options['title']
-
- ss = ""
- options.keys.sort.map { |kk| ss << %Q( #{kk}=#{options[kk]}) }
-
- %Q{<img class="rwtk_Image"#{ss} />}
- end
- end
-
- # Converts URLs in the form of [url name] to named links.
- class NamedLinks < Ruwiki::Wiki::Token
- def self.rank
- 3
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\s+(#{RE_URI_TEXT})\]}
- end
-
- def replace
- extlink = @match.captures[0]
- name = @match.captures[1]
-
- %Q{<a class="rwtk_NamedLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{name}</a>}
- end
- end
-
- # Converts URLs to links where the "name" of the link is the URL itself.
- class ExternalLinks < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{\b(#{RE_URI_SCHEME}#{RE_URI_PATH}+)}
- end
-
- def restore
- @match[0]
- end
-
- def replace
- extlink = @match.captures[0]
-
- %Q{<a class="rwtk_ExternalLinks" href="#{Ruwiki::Wiki.redirect(extlink)}">#{extlink}</a>}
- end
- end
-
- # Creates a horizontal rule.
- class HRule < Ruwiki::Wiki::Token
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def replace
- %Q(<hr class="rwtk_HRule" />)
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(<p[^>]*>)*(<hr[^ />]* ?/?>)(</p>)*}, '\1')
- content.gsub!(%r{\n<hr />}, "</p>\n<hr />")
- content.gsub!(%r{<hr ?/?>\n<br ?/?>}, "<hr />")
- content.gsub!(%r{(\n|<br ?/?>)?<hr>(\n|<br ?/?>)?}, "<hr />")
- content
- end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/wiki/tokens/01wikilinks.rb b/ruwiki/trunk/lib/ruwiki/wiki/tokens/01wikilinks.rb
deleted file mode 100644
index 442a201..0000000
--- a/ruwiki/trunk/lib/ruwiki/wiki/tokens/01wikilinks.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # This provides the basic WikiWord match. This supports WikiWord,
- # CPlusPlus, ThisIsALink, and C_Plus_Plus.
- RE_WIKI_WORDS = %r{[[:upper:]][\w_]*(?:[[:lower:]]+[[:upper:]_]|[[:upper:]_]+[[:lower:]])[\w_]*}
- # This provides wikipedia format matches, e.g., [[wikipedia links]]. The
- # only restriction on words in this format is that they must NOT begin
- # with an underscore ('_').
- RE_WIKIPEDIA_WORDS = %r{\[\[([^_].*?)\]\]}
- # This provides the basic Wiki Project match.
- RE_PROJECT_WORD = %r{[[:upper:]][[:lower:]]+}
-
- # This provides the Wiki view link format:
- VIEW_LINK = %Q[<a class="rwtk_WikiLink" href="%s">%s</a>]
- EDIT_LINK = %Q[<span class="rwtk_EditWikiLink">%s</span><a class="rwtk_WikiLink" href="%s">?</a>]
-
- # Creates a crosslink for a Project::WikiPage.
- class ProjectCrossLink < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::(#{RE_WIKI_WORDS})}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic.gsub(/_/, ' ')}"]
- else
- EDIT_LINK % ["#{project}::#{topic.gsub(/_/, ' ')}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a crosslink for a Project::WikiPage using a Wikipedia link
- # format.
- class ProjectCrossLinkWikipedia < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::#{RE_WIKIPEDIA_WORDS}}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic}"]
- else
- EDIT_LINK % ["#{project}::#{topic}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to the project index from ::Project.
- class ProjectIndex < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{(\B|\\)::(#{RE_PROJECT_WORD})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- project = @match.captures[1]
-
- if @backend.page_exists?('ProjectIndex', project)
- VIEW_LINK % ["#{@script}/#{project}/ProjectIndex", project]
- else
- if @backend.project_exists?(project)
- EDIT_LINK % [project, "#{@script}/#{project}/ProjectIndex/_edit"]
- else
- EDIT_LINK % [project, "#{@script}/#{project}/_create"]
- end
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project.
- class WikiLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\b|\\)(#{RE_WIKI_WORDS})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic.gsub(/_/, ' ')]
- else
- EDIT_LINK % [topic.gsub(/_/, ' '), "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project using a Wikipedia
- # link format.
- class WikipediaLinks < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(\B|\\)#{RE_WIKIPEDIA_WORDS}\B}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- ALT_TEXT = %r{(.+)\|(.+)}o
-
- def replace
- captures = @match.captures
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- at = ALT_TEXT.match(topic)
-
- if not at.nil?
- topic = at.captures[1]
- link = CGI.escape(at.captures[0])
- end
-
- if @backend.page_exists?(link, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic]
- else
- EDIT_LINK % [topic, "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/wiki/tokens/02actions.rb b/ruwiki/trunk/lib/ruwiki/wiki/tokens/02actions.rb
deleted file mode 100644
index 8ad0950..0000000
--- a/ruwiki/trunk/lib/ruwiki/wiki/tokens/02actions.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # Produces a list of topics.
- class TopicList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%topics\((#{Ruwiki::Wiki::RE_PROJECT_WORD})?\)$}
- end
-
- def replace
- project = @match.captures[0] || @project
-
- if @backend.project_exists?(project)
- topic_list = @backend.list_topics(project)
- else
- topic_list = []
- end
-
- if topic_list.empty?
- ss = @message[:no_topics] % [project]
- else
- ss = %Q(<h4 class="rwtk_Headings">#{@message[:topics_for_project] % [project]}</h4>\n<ul class="rwtk_Lists">\n)
- topic_list.each do |tt|
- ss << %Q(<li class="rwtk_Lists">)
- ss << VIEW_LINK % ["#{@script}/#{project}/#{tt}", "#{CGI::unescape(tt.gsub(/_/, ' '))}"]
- ss << "</li>\n"
- end
- ss << "</ul>\n"
- end
-
- ss
- end
- end
-
- class ProjectList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%projects\(\)$}
- end
-
- def replace
- proj_list = @backend.list_projects
-
- ss = %Q(<h4 class="rwtk_Headings">#{@message[:wiki_projects] % [@title]}</h4>\n<ul class="rwtk_Lists">\n)
- proj_list.each do |pp|
- ss << %Q(<li class="rwtk_Lists">)
- ss << VIEW_LINK % ["#{@script}/#{pp}/ProjectIndex", pp]
- ss << %Q! <a href='#{@script}/#{pp}/_topics' class='rw_minilink'>#{@message[:project_topics_link]}</a>!
- ss << "</li>\n"
- end
- ss << "</ul>\n"
- end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/wiki/tokens/abbreviations.rb b/ruwiki/trunk/lib/ruwiki/wiki/tokens/abbreviations.rb
deleted file mode 100644
index b928085..0000000
--- a/ruwiki/trunk/lib/ruwiki/wiki/tokens/abbreviations.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Converts abbreviations.
- class Abbreviations < Ruwiki::Wiki::Token
- ABBREVIATIONS = {
- "matz" => "Yukihiro Matsumoto",
- }
-
- def self.regexp
- %r!@\{([^\}]*)\}!
- end
-
- def replace
- kk = @match.captures[0]
- if kk.nil? or kk.empty?
- data = %Q(<dl class="rwtk_Abbreviations">)
- ABBREVIATIONS.each do |kk, vv|
- data << %Q(<dt class="rwtk_Abbreviations">#{kk}</dt><dd class="rwtk_Abbreviations">#{vv}</dd>)
- end
- data << %Q(</dl>)
- else
- if ABBREVIATIONS.has_key?(kk)
- data = ABBREVIATIONS[kk]
- else
- data = @match[0]
- end
- end
- data
- end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/wiki/tokens/calendar.rb b/ruwiki/trunk/lib/ruwiki/wiki/tokens/calendar.rb
deleted file mode 100644
index c78dc45..0000000
--- a/ruwiki/trunk/lib/ruwiki/wiki/tokens/calendar.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces a mini-calendar with dates as WikiWords.
- class Calendar < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?%calendar\((?:(today)|(\d+),\s*(\d+))(?:,\s*(#{RE_PROJECT_WORD}))?\)}
- end
-
- def self.make(year, month)
- result = []
- tt = Time.local(year, month, 1)
- rr = Array.new(tt.wday, nil)
- rr << 1
-
- 2.upto(31) do |ii|
- break if Time.local(year, month, ii).month != month
- rr << ii
- end
-
- rr += Array.new((- rr.size) % 7, nil)
-
- 0.step(rr.size - 1, 7) do |ii|
- result << rr[ii, 7]
- end
- result
- end
-
- def make_month_link(project, year, month, state = nil)
- ym = "%04d%02d" % [year, month]
- case state
- when :prev
- title = "&laquo; #{year}.#{month}"
- when :next
- title = "#{year}.#{month} &raquo;"
- else
- title = "#{project}::#{year}.#{month}"
- end
- url = "#{@script}/#{project}/#{ym}"
-
- if @backend.page_exists?(ym, project)
- VIEW_LINK % [url, title]
- else
- EDIT_LINK % [title, "#{url}/_edit"]
- end
- end
-
- def replace
- today = @match.captures[0]
- project = @match.captures[3] || @project
- now = Time.now
-
- if today.nil?
- year = @match.captures[1].to_i
- month = @match.captures[2].to_i
- else
- year = now.year
- month = now.month
- end
-
- if (year == now.year) and (month == now.month)
- show_today = now.day
- else
- show_today = nil
- end
-
- result = <<-"CALENDAR_HEAD"
-</p>
-<div class="rwtk_Calendar">
-<table class="rwtk_Calendar" summary="calendar for ::#{project}: #{year}.#{month}">
-<thead>
- CALENDAR_HEAD
-
- result << %Q{ <tr>\n<th colspan="7" class="rwtk_Calendar_current_month">}
- result << make_month_link(project, year, month)
- result << %Q{</th>\n </tr>\n <tr>\n<th colspan="2" class="rwtk_Calendar_prev_month">}
- result << make_month_link(project, year, month - 1, :prev)
- result << %Q{</th>\n<th colspan="3"></th>\n<th colspan="2" class="rwtk_Calendar_next_month">}
- result << make_month_link(project, year, month + 1, :next)
- result << "</th>\n"
-
- result << <<-"CALENDAR_HEAD2"
- </tr>
- <tr>
- <th class="rwtk_Calendar_weekend">Su</th>
- <th class="rwtk_Calendar_weekday">Mo</th>
- <th class="rwtk_Calendar_weekday">Tu</th>
- <th class="rwtk_Calendar_weekday">We</th>
- <th class="rwtk_Calendar_weekday">Th</th>
- <th class="rwtk_Calendar_weekday">Fr</th>
- <th class="rwtk_Calendar_weekend">Sa</th>
- </tr>
-</thead>
-<tbody>
- CALENDAR_HEAD2
-
- Calendar.make(year, month).each do |week|
- result << " <tr>\n"
- week.each do |day|
- if day.nil?
- result << %Q{ <td class="rwtk_Calendar_day"></td>\n}
- else
- date = "%04d%02d%02d" % [year, month, day]
- # Add the ability to create pages based on date here.
- if show_today == day
- result << %Q{ <td class="rwtk_Calendar_today">}
- else
- result << %Q{ <td class="rwtk_Calendar_day">}
- end
- if @backend.page_exists?(date, project)
- result << VIEW_LINK % ["#{@script}/#{project}/#{date}", day]
- else
- result << EDIT_LINK % [day, "#{@script}/#{project}/#{date}/_edit"]
- end
- result << %Q{</td>\n}
- end
- end
- result << " </tr>\n"
- end
-
- result << %Q(</tbody>\n</table>\n</div>\n<p class="rwtk_Paragraph">)
- result
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*>(\s*</?div(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?table(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?t(?:head|body|r)(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*<t[hd].+?</t[hd]>\s*)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/wiki/tokens/headings.rb b/ruwiki/trunk/lib/ruwiki/wiki/tokens/headings.rb
deleted file mode 100644
index cfc3001..0000000
--- a/ruwiki/trunk/lib/ruwiki/wiki/tokens/headings.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts headings.
- class Headings < Ruwiki::Wiki::Token
-# def self.rank
-# 5
-# end
-
- def self.regexp
- %r{^\\?(=+)\s+(.*)}
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def replace
- level = @match.captures[0].count("=")
- content = @match.captures[1]
- level = 6 if level > 6
- %Q(<h#{level} class="rwtk_Headings">#{content}</h#{level}>)
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(</h\d>)\n}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{(</h\d>)</p>\n<p>}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{<p[^>]*>(<h\d[^>]*>)}, '\1')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/wiki/tokens/lists.rb b/ruwiki/trunk/lib/ruwiki/wiki/tokens/lists.rb
deleted file mode 100644
index 1615c2c..0000000
--- a/ruwiki/trunk/lib/ruwiki/wiki/tokens/lists.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Produces Lists
- class Lists < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?([*#]+)\s+(.*)$}
- end
-
- def replace
- indent = @match.captures[0].scan(/./).map { |ee| ee == "*" ? 'ul' : 'ol' }
- content = @match.captures[1]
-
- pre = ''
- post = ''
- indent.each { |elem| pre << %Q(<#{elem} class="rwtk_Lists">) }
- indent.reverse_each { |elem| post << %Q(</#{elem}>) }
- %Q(#{pre}<li class="rwtk_Lists">#{content}</li>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- RE_NESTED_LISTS = %r{</[uo]l>\s*<[uo]l[^>]*>}
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*><([uo]l[^>]*)>}, '<\1>')
- content.gsub!(%r{</([uo]l)></p>}, '</\1>')
- content.gsub!(RE_NESTED_LISTS, '') while content =~ RE_NESTED_LISTS
- content
- end
- end
-
- # Produces block quotes.
- class Blockquotes < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((:+)|(>+))(\s+.*)$}
- end
-
- def replace
- content = @match.captures[3]
-
- if @match.captures[2].nil?
- char = ':'
- cite = ''
- else
- char = '>'
- cite = ' type="cite"'
- end
- indent = @match.captures[0].count(char)
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<blockquote#{cite} class="rwtk_Blockquotes">)
- post << %Q(</blockquote>)
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1].gsub(/^>/, '&gt;')
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</blockquote>(\n|<br ?/?>)?<blockquote[^>]*>}, '')
- content.gsub!(%r{(</?blockquote[^>]*>\n?)\s*}, '\1')
- content.gsub!(%r{</blockquote>(<blockquote[^>]*>)+}, '\1')
- content
- end
- end
-
- # Produces definition lists. Does not completely work correctly.
- class Definitions < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(;+)\s+(.+?)\s+:\s+(.*)}
- end
-
- def replace
- definition = @match.captures[2]
- term = @match.captures[1]
- indent = @match.captures[0].count(';')
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<dl class="rwtk_Definitions">)
- post << %Q(</dl>)
- end
- %Q(#{pre}<dt class="rwtk_Definitions">#{term}</dt><dd class="rwtk_Definitions">#{definition}</dd>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</dl>(\n|<br ?/?>)?<dl[^>]*>}, '')
- content.gsub!(%r{</dl>(<dl[^>]*>)+}, '\1')
- content
- end
- end
-end
diff --git a/ruwiki/trunk/lib/ruwiki/wiki/tokens/rubylists.rb b/ruwiki/trunk/lib/ruwiki/wiki/tokens/rubylists.rb
deleted file mode 100644
index b765ad1..0000000
--- a/ruwiki/trunk/lib/ruwiki/wiki/tokens/rubylists.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Convert ruby-talk mailing list references (e.g., [ruby-talk:12345])
- # into named links.
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
-# %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/#{lm}">#{@match[0]}</a>)
- end
- end
-
- # Convert ruby-core/ext/dev/list/math mailing list references (e.g.,
- # [ruby-core:12345]) into named links.
- class OtherRubyLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-(list|doc|core|dev|ext|math):(\d+)\]}
- end
-
- def replace
- ln, lm = @match.captures[0..1]
- %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-#{ln}/#{lm}">#{@match[0]}</a>)
- end
- end
- end
-end
diff --git a/ruwiki/trunk/ruwiki.conf b/ruwiki/trunk/ruwiki.conf
deleted file mode 100644
index 72e4cc6..0000000
--- a/ruwiki/trunk/ruwiki.conf
+++ /dev/null
@@ -1,22 +0,0 @@
-ruwiki-config!auth-options:
-ruwiki-config!css: ruwiki.css
-ruwiki-config!date-format: %Y.%m.%d
-ruwiki-config!datetime-format: %Y.%m.%d %H:%M:%S
-ruwiki-config!debug: true
-ruwiki-config!default-page: ProjectIndex
-ruwiki-config!default-project: Default
-ruwiki-config!language: en
-ruwiki-config!storage-options: flatfiles!data-path: ./data
- flatfiles!extension: ruwiki
-ruwiki-config!storage-type: flatfiles
-ruwiki-config!template-path: ./templates/
-ruwiki-config!template-set: default
-ruwiki-config!time-format: %H:%M:%S
-ruwiki-config!title: Ruwiki
-ruwiki-config!webmaster: webmaster@domain.tld
-webrick-config!addresses:
-webrick-config!do-log: true
-webrick-config!log-dest: <STDERR>
-webrick-config!mount: /
-webrick-config!port: 8808
-webrick-config!threads: 1
diff --git a/ruwiki/trunk/templates/default/body.tmpl b/ruwiki/trunk/templates/default/body.tmpl
deleted file mode 100644
index baaa259..0000000
--- a/ruwiki/trunk/templates/default/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow,noarchive" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/trunk/templates/default/content.tmpl b/ruwiki/trunk/templates/default/content.tmpl
deleted file mode 100644
index 7f662b2..0000000
--- a/ruwiki/trunk/templates/default/content.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/trunk/templates/default/controls.tmpl b/ruwiki/trunk/templates/default/controls.tmpl
deleted file mode 100644
index 8f855c2..0000000
--- a/ruwiki/trunk/templates/default/controls.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_header">
- <form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- <!-- Right-hand tabs must go in reverse order! -->
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/trunk/templates/default/edit.tmpl b/ruwiki/trunk/templates/default/edit.tmpl
deleted file mode 100644
index 9e5dbb5..0000000
--- a/ruwiki/trunk/templates/default/edit.tmpl
+++ /dev/null
@@ -1,27 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_navbar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_navbar_righttab" id="rw_editing_tab"><strong><em>#label_editing#</em> #%page_version%</strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <div class="rw_content">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/trunk/templates/default/error.tmpl b/ruwiki/trunk/templates/default/error.tmpl
deleted file mode 100644
index a3887b2..0000000
--- a/ruwiki/trunk/templates/default/error.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/trunk/templates/default/footer.tmpl b/ruwiki/trunk/templates/default/footer.tmpl
deleted file mode 100644
index 48146ea..0000000
--- a/ruwiki/trunk/templates/default/footer.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_footer">
-<!--<form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- {!-- Right-hand tabs must go in reverse order! --}
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>-->
-</div>
diff --git a/ruwiki/trunk/templates/default/ruwiki.css b/ruwiki/trunk/templates/default/ruwiki.css
deleted file mode 100644
index cfe7bf6..0000000
--- a/ruwiki/trunk/templates/default/ruwiki.css
+++ /dev/null
@@ -1,297 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_footer
-{
-/*position: absolute;
- width: 100%;
- bottom: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;*/
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_footer { position: fixed; }
-
-body > div#rw_footer > .rw_navbar { position: fixed; bottom: 0; }
-body > div#rw_footer > .rw_navbar > div { position: relative; top: -2em; }
-
-body
-{
- margin: 0.5em;
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_navbar
-{
- width: 100%;
- margin: 0;
- padding: 0.1em;
- font-size: 0.7em;
- border: 1px solid black;
- color: white;
- background-color: #27C;
- height: 0.5em;
- z-index: 2;
-}
-
-.rw_navbar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_navbar a:visited
-{
- color: #2E7;
- font-weight: normal;
- border-bottom: 1px dashed #2E7;
-}
-
-.rw_navbar a:hover
-{
- text-decoration: none;
-}
-
-.rw_navbar_tab
-{
- float: left;
- background-color: #27C;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_navbar_tab:hover
-{
- background-color: #49E;
-}
-
-.rw_navbar_righttab
-{
- float: right;
- padding-left: 0.8em;
- padding-top: 0.3em;
- padding-right: 0.8em;
- border: 1px solid #059;
- background-color: #27C;
- margin: 0 0.3em;
- height: 2em;
-}
-
-.rw_navbar_righttab:hover
-{
- background-color: #49E;
-}
-
-.rw_content
-{
- clear: both;
- margin-top: 2em;
- margin-left: 3em;
- margin-right: 3em;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- font-weight: bolder;
- clear: both;
- font-size: 90%;
- padding: 1em;
- margin-top: 3em;
- margin-left: 5em;
- margin-right: 5em;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #27C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #27C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab { background-color: #C72; }
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
-
diff --git a/ruwiki/trunk/templates/default/save.tmpl b/ruwiki/trunk/templates/default/save.tmpl
deleted file mode 100644
index 04069b1..0000000
--- a/ruwiki/trunk/templates/default/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/trunk/templates/sidebar/body.tmpl b/ruwiki/trunk/templates/sidebar/body.tmpl
deleted file mode 100644
index 2f3c10f..0000000
--- a/ruwiki/trunk/templates/sidebar/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/trunk/templates/sidebar/content.tmpl b/ruwiki/trunk/templates/sidebar/content.tmpl
deleted file mode 100644
index fa2d67e..0000000
--- a/ruwiki/trunk/templates/sidebar/content.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/trunk/templates/sidebar/controls.tmpl b/ruwiki/trunk/templates/sidebar/controls.tmpl
deleted file mode 100644
index 6e12b22..0000000
--- a/ruwiki/trunk/templates/sidebar/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_titlebar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_titlebar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- </div>
-</div>
diff --git a/ruwiki/trunk/templates/sidebar/edit.tmpl b/ruwiki/trunk/templates/sidebar/edit.tmpl
deleted file mode 100644
index eb04395..0000000
--- a/ruwiki/trunk/templates/sidebar/edit.tmpl
+++ /dev/null
@@ -1,27 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_titlebar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_titlebar_tab" id="rw_editing_tab"><strong><em>#label_editing#</em> #%page_version%</strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <div class="rw_content_edit">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/trunk/templates/sidebar/error.tmpl b/ruwiki/trunk/templates/sidebar/error.tmpl
deleted file mode 100644
index 5a2882e..0000000
--- a/ruwiki/trunk/templates/sidebar/error.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/trunk/templates/sidebar/footer.tmpl b/ruwiki/trunk/templates/sidebar/footer.tmpl
deleted file mode 100644
index 6dfc390..0000000
--- a/ruwiki/trunk/templates/sidebar/footer.tmpl
+++ /dev/null
@@ -1,22 +0,0 @@
-<div class="rw_footer">
- <form class="rw_footer_tab" action="_search">
- <div>
- <input class="rw_search_box" type="text" name="q" size="10" />
- </div>
- <div>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- </div>
- </form>
- <div class="rw_footer_tab">
- <dl>
- <dt>%page_project%::</dt>
- <dd><a href="%cgi_url%/%page_project%/_topics">#label_topics#</a><br />
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </dd>
- </div>
- <div class="rw_footer_tab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/trunk/templates/sidebar/ruwiki.css b/ruwiki/trunk/templates/sidebar/ruwiki.css
deleted file mode 100644
index 0f2b4cc..0000000
--- a/ruwiki/trunk/templates/sidebar/ruwiki.css
+++ /dev/null
@@ -1,347 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
-.rw_titlebar
-{
- margin: 0 auto;
- height: 0.5em;
-}
-
- /* Normal styling from here on out. */
-body
-{
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_titlebar
-{
- font-size: 0.7em;
- border: 1px solid #059;
- color: white;
- background-color: #5C9;
- height: 0.5em;
- width: 100%;
-}
-
-.rw_titlebar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_titlebar a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_titlebar a:hover
-{
- text-decoration: none;
-}
-
-.rw_titlebar_tab
-{
- float: left;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_titlebar_tab:hover
-{
- background-color: #4E9;
-}
-
-div.rw_footer
-{
- position: fixed;
- left: 72%;
- width: 20%;
- height: 100%;
- padding: 0.2em;
- padding-top: 0.5em;
-//background-color: #95C;
- font-size: 0.9em;
-}
-
-.rw_footer
-{
-}
-
-.rw_footer a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_footer a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_footer a:hover
-{
- text-decoration: none;
-}
-
-.rw_footer_tab
-{
- color: yellow;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0.3em;
- min-height: 2em;
- clear: both;
-}
-
-.rw_footer_tab div
-{
- text-align: right;
-}
-
-div#rw_content
-{
- padding: 50px 0 0 0;
- margin-left: 0;
- voice-family: "\"}\""; /* fake out IE5/Win */
- voice-family: inherit;
- margin-left: 16px;
-}
-
-body > div#rw_content
-{
- margin-left: 0;
-}
-
-.rw_content
-{
- padding-top: 0;
- margin-left: 3em;
- width: 65%;
- float: left;
-}
-
-.rw_content_edit
-{
- width: 90%;
- margin: 0 auto;
- padding: 2em;
- padding-top: 0;
- float: left;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- float: left;
- font-weight: bolder;
- font-size: 90%;
- padding: 0.5em;
- width: 65%;
- margin-top: 3em;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #59C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #59C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #59C;
- margin: 0.1em;
-}
-
-.rw_search_box
-{
- border: 1px dotted #59C;
- width: 100%;
- margin: 0.1em;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab
-{
- background-color: #C72;
- text-align: right;
- margin-right: 2em;
- float: right;
-}
-
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/trunk/templates/sidebar/save.tmpl b/ruwiki/trunk/templates/sidebar/save.tmpl
deleted file mode 100644
index 7c4c31c..0000000
--- a/ruwiki/trunk/templates/sidebar/save.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-<div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/trunk/templates/simple/body.tmpl b/ruwiki/trunk/templates/simple/body.tmpl
deleted file mode 100644
index b3281d0..0000000
--- a/ruwiki/trunk/templates/simple/body.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/trunk/templates/simple/content.tmpl b/ruwiki/trunk/templates/simple/content.tmpl
deleted file mode 100644
index 2da5e62..0000000
--- a/ruwiki/trunk/templates/simple/content.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content -->
-[?message|<div class="rw_message">%message%</div>?]
-<div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/trunk/templates/simple/controls.tmpl b/ruwiki/trunk/templates/simple/controls.tmpl
deleted file mode 100644
index 29cdf3a..0000000
--- a/ruwiki/trunk/templates/simple/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <a href="%cgi_url%/%page_project%/">%page_project%</a>
- &raquo;
- %page_topic%
- [?editable|<a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">[#label_edit#]</a>?]
-</div>
diff --git a/ruwiki/trunk/templates/simple/edit.tmpl b/ruwiki/trunk/templates/simple/edit.tmpl
deleted file mode 100644
index b42759d..0000000
--- a/ruwiki/trunk/templates/simple/edit.tmpl
+++ /dev/null
@@ -1,25 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <strong>%page_topic%</strong>
- &raquo;
- <strong>%page_project%</strong>
- [<strong><em>#label_editing#</em> #%page_version%</strong>]
-</div>
-
-<div class="rw_content">
- [?message|<div class="rw_message">%message%</div>?]
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
-</div>
diff --git a/ruwiki/trunk/templates/simple/error.tmpl b/ruwiki/trunk/templates/simple/error.tmpl
deleted file mode 100644
index ac898ea..0000000
--- a/ruwiki/trunk/templates/simple/error.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- |
- <strong><em>%name%</em></strong>
-</div>
-<div class="rw_content">
-<h1>%name%</h1>
-<p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
-<p>%backtrace%</p>
-</div>
diff --git a/ruwiki/trunk/templates/simple/footer.tmpl b/ruwiki/trunk/templates/simple/footer.tmpl
deleted file mode 100644
index 2e7893b..0000000
--- a/ruwiki/trunk/templates/simple/footer.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<form class="rw_navbar" action="_search">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- |
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>,
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- |
- <input class="rw_search_box" type="text" name="q" size="10" />
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
-</form>
diff --git a/ruwiki/trunk/templates/simple/ruwiki.css b/ruwiki/trunk/templates/simple/ruwiki.css
deleted file mode 100644
index 57d1a09..0000000
--- a/ruwiki/trunk/templates/simple/ruwiki.css
+++ /dev/null
@@ -1,192 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #fafafa;
-}
-
-.rw_navbar
-{
- font-weight: bold;
- font-size: 1.1em;
- padding: 0.3em;
-}
-
-.rw_navbar a
-{
- border-bottom: 1px dashed black;
- font-weight: bold;
-}
-.rw_navbar a:visited
-{
- color: maroon;
- border-bottom: 1px dashed maroon;
-}
-.rw_navbar a:hover { background-color: #afafaf; }
-
-.rw_content
-{
- background-color: white;
- border: 1px dashed grey;
- padding: 0.5em;
- margin-left: 1em;
- margin-right: 1em;
-}
-
-.rw_message
-{
- background-color: #fab;
- border: 3px dotted red;
- font-weight: bolder;
- font-size: 90%;
- padding: 0.5em;
- margin-left: 3em;
- margin-right: 3em;
-}
-
-
-.rw_edit_content
-{
- border: 1px solid black;
- padding: 0.3em;
- width: 95%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px solid black;
- padding: 0.3em;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px solid black;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form { }
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px solid black;
-}
-
-.rw_pagelink { text-decoration: none; }
-.rw_projectxlink { }
-.rw_projectindex { }
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title { }
-
-.rw_edit_format div
-{
-}
-
-.rw_search_button
-{
- border: 1px solid black;
-}
-
-.rw_search_box
-{
- border: 1px solid black;
-}
-
-.rw_search_box:hover { }
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_saved_page_announcement { }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- border-left: 1em solid #999;
-}
-.rwtk_Image { border: none; }
-.rwtk_NumberedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_NamedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_ExternalLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_RubyTalkLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_OtherRubyLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dashed grey; }
-.rwtk_WikiLink { text-decoration: none; }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/trunk/templates/simple/save.tmpl b/ruwiki/trunk/templates/simple/save.tmpl
deleted file mode 100644
index 51de9f4..0000000
--- a/ruwiki/trunk/templates/simple/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/trunk/tests/harness.rb b/ruwiki/trunk/tests/harness.rb
deleted file mode 100644
index 80e7eeb..0000000
--- a/ruwiki/trunk/tests/harness.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-ENV["REQUEST_METHOD"] = "HEAD"
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_type = 'flatfiles'
-
-dp = nil
-dp = "../data" if File.exists?("../data")
-dp = "./data" if File.exists?("./data")
-raise "Cannot find either ./data or ../data for tests. Aborting." if dp.nil?
-
-$wiki.config.storage_options['flatfiles']['data-path'] = dp
-$wiki.config.storage_options['flatfiles']['format'] = "exportable"
-$wiki.config.storage_options['flatfiles']['extension'] = "ruwiki"
-
-tp = nil
-tp = "../templates" if File.exists?("../templates")
-tp = "./templates" if File.exists?("./templates")
-raise "Cannot find either ./templates or ../templates for tests. Aborting." if tp.nil?
-
-$wiki.config.template_path = tp
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/trunk/tests/tc_backend_flatfile.rb b/ruwiki/trunk/tests/tc_backend_flatfile.rb
deleted file mode 100644
index c3c815c..0000000
--- a/ruwiki/trunk/tests/tc_backend_flatfile.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-require 'fileutils'
-
-class TestBackendFlatfiles < Test::Unit::TestCase
- def setup
- @ffopts = { 'data-path' => "./test/data", 'extension' => nil }
-
- # generate a database
- raise "Setup Error: #{@ffopts['data-path']} exists" if File.exists?(@ffopts['data-path'])
-
- @flatbase = {
- 'Proj1' => ['ProjectIndex:all projects must have this',
- 'P1TopicOne:this is the content',
- 'P1TopicTwo:more content'],
- 'Proj2' => ['ProjectIndex:all projects must have this',
- 'P2TopicOne:this is the content',
- 'P2TopicTwo:more content',
- 'P2TopicThree:even more more content']
- }
-
- @flatbase.each do |key, val|
- prjdir = "#{@ffopts['data-path']}/#{key}"
- FileUtils.mkdir_p(prjdir) rescue nil
- val.each do |topcon|
- topic, content = topcon.split(":")
- File.open("#{prjdir}/#{topic}", "w") do |fh|
- fh.puts "page!content:\x09#{content}"
- end
- end
- end
-
- @backend = nil
- @pg = nil
- end
-
- def teardown
- # remove testing flatabase
- FileUtils.rm_rf(@ffopts['data-path'])
- Dir.rmdir("./test") # ugly but it works
- end
-
- def test_list_projects
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- # should be ['Proj1', 'Proj2']
- assert_equal(@flatbase.keys, @backend.list_projects)
- end
-
- def test_list_topics
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- @flatbase.keys.sort.each do |proj|
- got_topics = @backend.list_topics(proj)
- exp_topics = @flatbase[proj].map { |ent| ent.split(':')[0] }
- assert_equal(exp_topics.sort, got_topics.sort)
- end
- end
-
- # test simple one word lookups
- # need to add more complex search strings
- def test_search_project
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- assert_equal({'ProjectIndex' => 1,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 0 }.to_a.sort,
- @backend.search_project('Proj1', 'this').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 0,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'more').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'topic').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'content').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P2TopicOne' => 0,
- 'P2TopicTwo' => 1,
- 'P2TopicThree' => 2 }.to_a.sort,
- @backend.search_project('Proj2', 'more').to_a.sort)
- end
-end
diff --git a/ruwiki/trunk/tests/tc_bugs.rb b/ruwiki/trunk/tests/tc_bugs.rb
deleted file mode 100644
index 477cbeb..0000000
--- a/ruwiki/trunk/tests/tc_bugs.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-
-# see if we can reproduce the LicenseandAuthor hang
-# described in bug id 147 on rubyforge
-class TC_LicenseAndAuthorHang < Test::Unit::TestCase
- def setup
- @ffopts = { }
- dp = nil
- dp = "../data" if File.exists?("../data")
- dp = "./data" if File.exists?("./data")
- raise "Cannot find either ./data or ../data for tests. Aborting." if dp.nil?
-
- @ffopts['data-path'] = dp
- @ffopts['format'] = 'exportable'
-
- @backend = nil
- @pg = nil
- end
-
- # load "to the metal"
- def test_ffload
- assert_nothing_raised do
- @backend = ::Ruwiki::Backend::Flatfiles.new(@ffopts)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.load('LicenseAndAuthorInfo.ruwiki', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-
- # abstract backend retreive
- def test_beload
- @backend = nil
- assert_nothing_raised do
- mock_ruwiki = OpenStruct.new
- mock_ruwiki.config = OpenStruct.new
- mock_ruwiki.config.message = {}
- mock_ruwiki.config.storage_options = { 'flatfiles' => @ffopts }
-
- @backend = ::Ruwiki::BackendDelegator.new(mock_ruwiki, 'flatfiles')
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.retrieve('LicenseAndAuthorInfo', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-end
-
-# if __FILE__ == $0
-# ObjectSpace.each_object { |o| tests << o if o.kind_of?(Class) }
-# tests.delete_if { |o| !o.ancestors.include?(Test::Unit::TestCase) }
-# tests.delete_if { |o| o == Test::Unit::TestCase }
-
-# tests.each { |test| Test::Unit::UI::Console::TestRunner.run(test) }
-# end
diff --git a/ruwiki/trunk/tests/tc_exportable.rb b/ruwiki/trunk/tests/tc_exportable.rb
deleted file mode 100644
index b067240..0000000
--- a/ruwiki/trunk/tests/tc_exportable.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-class Ruwiki; end if __FILE__ == $0
-
-require 'ruwiki/exportable'
-require 'test/unit'
-
- class TCExportable < Test::Unit::TestCase
- class Exportable
- include Ruwiki::Exportable
-
- attr_accessor :a, :b, :long_name, :altname, :xform, :group2
- exportable :a
- exportable :long_name
- exportable :altname, :name => 'alt-name'
- exportable :group2, :group => 'group2'
- end
-
- def test_exportable
- __exportables = {
- 'default' => {
- 'a' => '@a'.intern,
- 'long-name' => '@long_name'.intern,
- 'alt-name' => '@altname'.intern,
- },
- 'group2' => {
- 'group2' => '@group2'.intern
- }
- }
- __values = {
- 'default' => {
- 'a' => 'a',
- 'long-name' => 'c',
- 'alt-name' => 'd',
- },
- 'group2' => { 'group2' => 'e' }
- }
- xx = nil
- ss = nil
- assert_nothing_raised do
- xx = Exportable.new
- xx.a = "a"
- xx.b = "b"
- xx.long_name = "c"
- xx.altname = "d"
- xx.xform = 22/7
- xx.group2 = "e"
- ss = xx.export
- end
- assert_equal(__exportables, xx.class.__exportables)
- assert_equal(__values, ss)
- end
- end
diff --git a/ruwiki/trunk/tests/tc_template.rb b/ruwiki/trunk/tests/tc_template.rb
deleted file mode 100644
index c4da672..0000000
--- a/ruwiki/trunk/tests/tc_template.rb
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'test/unit'
-require 'harness'
-
-class TestTemplates < Test::Unit::TestCase
- def test_include
- a = "a!INCLUDE!c"
- b = "b"
- t = Ruwiki::TemplatePage.new(a, b)
- assert_equal(["abc"], t.lines.lines)
- end
-
- def test_variables
- a = "a%b%c"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.write_plain_on("", v))
- end
-
- def test_optional_variables
- a = "a%b%%?c%d"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.write_plain_on("", v))
-
- v["c"] = "c"
- assert_equal("abcd", t.write_plain_on("", v))
- end
-
- def test_labels
- a = "a#b#c"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.write_plain_on("", v, m))
- end
-
- def test_optional_labels
- a = "a#b##?c#d"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.write_plain_on("", v, m))
-
- m[:c] = "c"
- assert_equal("abcd", t.write_plain_on("", v, m))
- end
-
- def test_hrefs
- a = "HREF:a:b:"
- t = Ruwiki::TemplatePage.new(a)
- v = { "b" => "b" }
-
- assert_equal("b", t.write_plain_on("", v))
-
- s = ""
- v["a"] = "link"
- assert_equal(%Q(<a href="link">b</a>), t.write_plain_on("", v))
- end
-
- def test_repeat_subst
- v1 = { "a" => 3 }
- v2 = { "a" => 2...4 }
- v3 = { "a" => -4...-2 }
- v4 = { "a" => [3, 1, 4, 1, 5, 9] }
- v5 = { "a" => [{ "a" => 3 }, { "a" => 1 }, { "a" => 4 }, { "a" => 1 }, { "a" => 5 }, { "a" => 9 }] }
-
- a = "[:a|xy:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("xyxyxy", t.write_plain_on("", v1))
- assert_equal("xyxy", t.write_plain_on("", v2))
- assert_equal("xyxy", t.write_plain_on("", v3))
- assert_equal("xyxyxyxyxyxy", t.write_plain_on("", v4))
- assert_equal("xyxyxyxyxyxy", t.write_plain_on("", v5))
-
- a = "[:a|%a%:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("123", t.write_plain_on("", v1))
- assert_equal("23", t.write_plain_on("", v2))
- assert_equal("-4-3", t.write_plain_on("", v3))
- assert_equal("314159", t.write_plain_on("", v4))
- assert_equal("314159", t.write_plain_on("", v5))
- end
-
- def test_optional_subst
- v1 = { "a" => "a" }
- v2 = { "a" => nil }
- a1 = "[?a|xy?]"
- a2 = "[!a|xy?]"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
-
- assert_equal("xy", t1.write_plain_on("", v1))
- assert_equal("", t1.write_plain_on("", v2))
- assert_equal("", t2.write_plain_on("", v1))
- assert_equal("xy", t2.write_plain_on("", v2))
- end
-
- def test_repeat_block
- a1 = "START:a\nxy\nEND:a"
- a2 = "START:a\nx%b%y\nEND:a"
- a3 = "START:\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- v = { "a" => [{ "b" => 3 }, { "b" => 1 }, { "b" => 4 }, { "b" => 1 }, { "b" => 5 }, { "b" => 9 }] }
-
- assert_equal("xy\nxy\nxy\nxy\nxy\nxy\n", t1.write_plain_on("", v))
- assert_equal("x3y\nx1y\nx4y\nx1y\nx5y\nx9y\n", t2.write_plain_on("", v))
- assert_raises(RuntimeError) { t3.write_plain_on("", v) }
- end
-
- def test_optional_block
- a1 = "IF:a\nxy\nENDIF:a"
- a2 = "IF:\nxy\nEND:"
- a3 = "IFNOT:a\nxy\nENDIF:a"
- a4 = "IFNOT:\nxy\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- t4 = Ruwiki::TemplatePage.new(a4)
- v1 = { "a" => true }
- v2 = { "a" => nil }
-
- assert_equal("xy", t1.write_plain_on("", v1))
- assert_equal("", t1.write_plain_on("", v2))
- assert_raises(RuntimeError) { t2.write_plain_on("", v1) }
- assert_equal("", t3.write_plain_on("", v1))
- assert_equal("xy", t3.write_plain_on("", v2))
- assert_raises(RuntimeError) { t4.write_plain_on("", v1) }
- end
-end
diff --git a/ruwiki/trunk/tests/tc_tokens.rb b/ruwiki/trunk/tests/tc_tokens.rb
deleted file mode 100644
index 929701a..0000000
--- a/ruwiki/trunk/tests/tc_tokens.rb
+++ /dev/null
@@ -1,335 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-require 'test/unit'
-require 'harness'
-
-class TokenTestCases < Test::Unit::TestCase
- def setup
- @mrw = MockRuwiki.new
- end
-
- class MockRuwiki
- def initialize
- @project = "Default"
- @tokens = []
- @script = "<uri>"
- @message = Hash.new { |h, k| h[k] = "#{k.inspect}" }
- @title = "Ruwiki"
- end
-
- def __tokenize(content, token)
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, @project, $wiki.backend, @script, @message, @title)
- @tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{@tokens.size - 1}"
- else
- "TOKEN_#{@tokens.size - 1}"
- end
- end
- content
- end
-
- def __replace(content)
- replaced = []
- s = true
- loop do
- break if replaced.size >= @tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].restore
- end
-
- s = content.gsub!(/TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].replace
- end
- end
- content
- end
-
- def __post_replace(content)
- token_classes = @tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
- content
- end
-
- end
-
- def __process(token, content, tokenized, replaced, result)
- assert_equal(tokenized, content = @mrw.__tokenize(content, token), "Tokenization failure.")
- assert_equal(replaced, content = @mrw.__replace(content), "Replacement failure.")
- assert_equal(result, content = @mrw.__post_replace(content), "Post-replace failure.")
- end
-
- def __display(token, content)
- p tokenized = @mrw.__tokenize(content.dup, token)
- p replaced = @mrw.__replace(tokenized.dup)
- p result = @mrw.__post_replace(replaced.dup)
- end
-
- def test_Paragraph
- token = Ruwiki::Wiki::Paragraph
- content = "\nABC\n\nabc\n"
- tkv = "TOKEN_0\nABC\nTOKEN_1\nabc\n"
- rpv = %Q(</p><p class="rwtk_Paragraph">\nABC\n</p><p class="rwtk_Paragraph">\nabc\n)
- res = %Q(<p class="rwtk_Paragraph">ABC</p>\n<p class="rwtk_Paragraph">abc</p>)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Image
- token = Ruwiki::Wiki::Image
- content = "[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_0"
- rpv = %Q(<img class="rwtk_Image" alt="http://www.halostatue.ca/graphics/maple_leaf.gif" src="http://www.halostatue.ca/graphics/maple_leaf.gif" title="http://www.halostatue.ca/graphics/maple_leaf.gif" />)
- res = rpv
-
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_1"
- content = %Q([image : http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" title="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="Maple Leaf" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_2"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true])
- rpv = %Q(<img class="rwtk_Image" alt="[1]" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[1]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_3"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true alt="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[2]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- content = "\[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_4"
- rpv = content
- res = content
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Code
- content = " line 1\n line 2\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_0TOKEN_1line 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2</pre>\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
-
- content = " line 1\n line 2\n \n\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_2TOKEN_3TOKEN_4\nline 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\n</p><pre class="rwtk_Code"> </pre>\n\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2\n </pre>\n\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NumberedLinks
- token = Ruwiki::Wiki::NumberedLinks
- Ruwiki::Wiki.reset_numbered_links
- content = "[http://www.yahoo.com] [http://www.ruby-lang.org] \\[http://www.rubyforge.org]"
- tkv = "TOKEN_0 TOKEN_1 \\TOKEN_2"
- uri = CGI.escape("http://www.yahoo.com")
- rpv = %Q{<a class="rwtk_NumberedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">[1]</a> <a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[2]</a> [http://www.rubyforge.org]}
- res = %Q{<a class="rwtk_NumberedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">[1]</a> <a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[2]</a> [http://www.rubyforge.org]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NamedLinks
- token = Ruwiki::Wiki::NamedLinks
- content = "[http://www.yahoo.com Yahoo!] [http://www.ruby-lang.org Ruby] \\[http://www.rubyforge.org RubyForge]"
- tkv = "TOKEN_0 TOKEN_1 \\TOKEN_2"
- uri = CGI.escape("http://www.yahoo.com")
- rpv = %Q{<a class="rwtk_NamedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">Yahoo!</a> <a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
- res = %Q{<a class="rwtk_NamedLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">Yahoo!</a> <a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ExternalLinks
- token = Ruwiki::Wiki::ExternalLinks
- content = "http://www.yahoo.com http://www.ruby-lang.org \\http://www.rubyforge.org"
- tkv = "TOKEN_0 TOKEN_1 \\TOKEN_2"
- uri = CGI.escape("http://www.yahoo.com")
- rpv = %Q{<a class="rwtk_ExternalLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">http://www.yahoo.com</a> <a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
- res = %Q{<a class="rwtk_ExternalLinks" href="http://www.google.com/url?sa=D&amp;q=#{uri}">http://www.yahoo.com</a> <a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_HRule
- token = Ruwiki::Wiki::HRule
- content = "----\n\\----"
- tkv = "TOKEN_0\n\\TOKEN_1"
- rpv = %Q(<hr class="rwtk_HRule" />\n----)
- res = %Q(<hr class="rwtk_HRule" />\n----)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLink
- token = Ruwiki::Wiki::ProjectCrossLink
- content = "Ruwiki::ChangeLog \\Ruwiki::To_Do Ruwiki::NotExist \\Ruwiki::NotExist"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLinkWikipedia
- token = Ruwiki::Wiki::ProjectCrossLinkWikipedia
- content = "Ruwiki::[[ChangeLog]] \\Ruwiki::[[To_Do]] Ruwiki::[[Does Not Exist]] \\Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 Ruwiki::[[_invalid]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectIndex
- token = Ruwiki::Wiki::ProjectIndex
- content = "::Ruwiki \\::Ruwiki ::Newproject \\::Newproject"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikiLinks
- token = Ruwiki::Wiki::WikiLinks
- content = "ProjectIndex \\ProjectIndex AustinZiegler \\AustinZiegler Alan_Chen \\Alan_Chen"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikipediaLinks
- token = Ruwiki::Wiki::WikipediaLinks
- content = "[[ProjectIndex]] \\[[ProjectIndex]] [[Austin Ziegler]] \\[[Austin Ziegler]] [[_Alan Chen]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 [[_Alan Chen]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Abbreviations
- token = Ruwiki::Wiki::Abbreviations
- content = "@{matz}\n@{}\n\\@{matz}"
- tkv = "TOKEN_0\nTOKEN_1\n\\TOKEN_2"
- rpv = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
- res = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Headings
- token = Ruwiki::Wiki::Headings
- content = "= header 1\n== header 2\n=== header 3\n==== header 4\n===== header 5\n====== header 6\n======= header 7->6\n\\== noheader 2\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\nTOKEN_6\n\\TOKEN_7\n"
- rpv = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n== noheader 2\n)
- res = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n<p class="rwtk_Paragraph">== noheader 2\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Blockquotes
- token = Ruwiki::Wiki::Blockquotes
- content = ": level 1\n:: level 2\n::: level 3\n: level 1, para 2\n\\: not a blockquote\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<blockquote class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n: not a blockquote\n)
- res = %Q(<blockquote class="rwtk_Blockquotes">level 1<blockquote class="rwtk_Blockquotes">level 2<blockquote class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n: not a blockquote\n)
- __process(token, content, tkv, rpv, res)
-
- content = "> level 1\n>> level 2\n>>> level 3\n> level 1, para 2\n\\> not a blockquote\n"
- tkv = "TOKEN_5\nTOKEN_6\nTOKEN_7\nTOKEN_8\n\\TOKEN_9\n"
- rpv = %Q(<blockquote type="cite" class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- res = %Q(<blockquote type="cite" class="rwtk_Blockquotes">level 1<blockquote type="cite" class="rwtk_Blockquotes">level 2<blockquote type="cite" class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Definitions
- token = Ruwiki::Wiki::Definitions
- content = "; word1 : val1\n;; word2 : val2\n;;; word3 : val3\n; word1/2 : val1/2\n\\; not-a-word : not-a-val\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd></dl></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl></dl>\n<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
- res = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
-
-# __display(token, content)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Lists
- content = "* level 1\n** level 2\n*** level 3\n*** level 3, item 2\n** level 2, item 2\n* level 1, item 2\n\\* not an item\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\n\\TOKEN_6\n"
- rpv = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ul></ul>\n<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- res = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ul><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n## level 2\n### level 3\n### level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_7\nTOKEN_8\nTOKEN_9\nTOKEN_10\nTOKEN_11\nTOKEN_12\n\\TOKEN_13\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ol><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n*# level 2\n*** level 3\n*#* level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_14\nTOKEN_15\nTOKEN_16\nTOKEN_17\nTOKEN_18\nTOKEN_19\n\\TOKEN_20\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ol></ul>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
- end
-
-
- def test_RubyTalkLinks
- token = Ruwiki::Wiki::RubyTalkLinks
- content = "[ruby-talk:12345] \\[ruby-talk:12345]"
- tkv = "TOKEN_0 \\TOKEN_1"
-# rpv = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
- rpv = %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
-# res = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
- res = %Q(<a class="rwtk_RubyTalkLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_OtherRubyLinks
- token = Ruwiki::Wiki::OtherRubyLinks
- content = "[ruby-list:123] \\[ruby-list:123] [ruby-doc:123] \\[ruby-doc:123] [ruby-core:123] \\[ruby-core:123] [ruby-dev:123] \\[ruby-dev:123] [ruby-ext:123] \\[ruby-ext:123] [ruby-math:123] \\[ruby-math:123]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5 TOKEN_6 \\TOKEN_7 TOKEN_8 \\TOKEN_9 TOKEN_10 \\TOKEN_11"
- rpv = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
- res = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
-
- __process(token, content, tkv, rpv, res)
- end
-end
diff --git a/ruwiki/trunk/tests/testall.rb b/ruwiki/trunk/tests/testall.rb
deleted file mode 100755
index f2e9100..0000000
--- a/ruwiki/trunk/tests/testall.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
-
-$stderr.puts "Checking for test cases:"
-Dir['tc_*.rb'].each do |testcase|
- $stderr.puts "\t#{testcase}"
- load testcase
-end
-$stderr.puts " "