summaryrefslogtreecommitdiff
path: root/ruwiki/tags/release-0.6.2
diff options
context:
space:
mode:
Diffstat (limited to 'ruwiki/tags/release-0.6.2')
-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
58 files changed, 0 insertions, 4081 deletions
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