summaryrefslogtreecommitdiff
path: root/ruwiki/tags/release-0.8.0-fixes
diff options
context:
space:
mode:
Diffstat (limited to 'ruwiki/tags/release-0.8.0-fixes')
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/README65
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/contrib/enscript-token.rb43
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/contrib/rublog_integrator.rb66
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/convert279
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/convert.bat16
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Default/ProjectIndex.ruwiki48
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/BugTracking.ruwiki34
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ChangeLog.ruwiki72
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Configuring_Ruwiki.ruwiki114
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Extending_Ruwiki.ruwiki310
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/LicenseAndAuthorInfo.ruwiki33
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ProjectIndex.ruwiki51
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Roadmap.ruwiki223
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki157
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/SandBox.ruwiki11
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/To_Do.ruwiki61
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/TroubleShooting.ruwiki27
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Upgrading+and+Converting.ruwiki37
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiFeatures.ruwiki20
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiMarkup.ruwiki264
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingPages.ruwiki17
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingProjects.ruwiki17
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Tutorial/ProjectIndex.ruwiki12
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/data/Tutorial/SandBox.ruwiki10
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki.rb452
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend.rb306
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/_corefiles.rb193
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/flatfiles.rb152
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/marshal.rb109
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/yaml.rb110
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/config.rb151
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/exportable.rb105
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/handler.rb207
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/de.rb91
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/en.rb99
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/es.rb90
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/page.rb259
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/servlet.rb35
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/template.rb331
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki.rb92
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens.rb136
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/00default.rb206
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/01wikilinks.rb166
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/02actions.rb63
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/abbreviations.rb40
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/calendar.rb147
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/headings.rb43
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/lists.rb112
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/rubylists.rb47
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/lib/tar.rb684
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/ruwiki.cgi49
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet245
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet.bat17
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/content.tmpl5
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/controls.tmpl23
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/edit.tmpl26
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/error.tmpl14
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/footer.tmpl23
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/ruwiki.css285
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/default/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/body.tmpl19
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/content.tmpl6
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/edit.tmpl26
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/error.tmpl13
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/footer.tmpl22
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/ruwiki.css336
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/sidebar/save.tmpl10
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/body.tmpl13
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/content.tmpl5
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/controls.tmpl8
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/edit.tmpl24
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/error.tmpl10
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/footer.tmpl10
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/ruwiki.css181
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/templates/simple/save.tmpl8
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/harness-cgi.rb40
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/harness.rb41
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/tc_backend_flatfile.rb98
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/tc_bugs.rb64
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/tc_exportable.rb66
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/tc_template.rb142
-rw-r--r--ruwiki/tags/release-0.8.0-fixes/tests/tc_tokens.rb327
-rwxr-xr-xruwiki/tags/release-0.8.0-fixes/tests/testall.rb18
85 files changed, 0 insertions, 8622 deletions
diff --git a/ruwiki/tags/release-0.8.0-fixes/README b/ruwiki/tags/release-0.8.0-fixes/README
deleted file mode 100644
index 544ac5e..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/README
+++ /dev/null
@@ -1,65 +0,0 @@
-Ruwiki 0.8.0
-------------
-Ruwiki is a simple, extensible Wiki-clone written in Ruby. It supports both
-CGI and WEBrick interfaces, templates, and CSS formatting. This Wiki differs
-from most other Wikis in that it supports projectt namespaces, so that two
-topics may be named the same for differing projects without colliding or
-having to resort to odd naming conventions. Please see the ::Ruwiki project
-in the running Wiki for more information. Ruwiki 0.8.0 has German and
-Spanish translations available.
-
-Upgrading
----------
-Ruwiki 0.8.0 has a flatfile format that is incompatible with older versions of
-Ruwiki. If you are upgrading from one of these versions, you must use the
-bin/convert. The simple case will be (assuming that your data files are in
-./data):
-
- % bin/convert ./data
-
-Requirements
-------------
-Ruwiki currently requires Ruby 1.8, Diff::LCS 1.1.0 (portions included). The
-YAML backend requires Ruby 1.8.2.
-
-Quick Start (CGI)
------------------
-1. Place the Ruwiki directory in a place that your webserver can execute CGI
- programs and ensure that ruwiki.cgi is executable on your webserver.
-2. Point your web browser to the appropriate URL.
-
-Quick Start (WEBrick)
----------------------
-1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
-2. Point your web browser to <http://localhost:8808/>.
-
-Configuration
--------------
-There are extensive configuration options available. The Ruwiki WEBrick
-servlet offers command-line options that simplify the configuration of
-Ruwiki without editing the servlet; use ruwiki_servlet --help for more
-information.
-
-Copyright
----------
-Copyright: Copyright © 2002 - 2004, Alan Chen and Austin Ziegler
-Authors: Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-Licence: Ruby's
-
-Credits
--------
-* This software includes portions of Diff::LCS by Austin Ziegler, available
- for download from the Ruwiki RubyForge project:
- [http://rubyforge.org/projects/ruwiki/]
-* Portions of this software are derived from Dave Thomas's RDoc system, now
- part of the Ruby distribution.
-
-* Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen]
- on 2003.10.22. Note that the initial template translations (./templates/de/)
- were done via AltaVista Babelfish and should not be blamed on Christian.
-* Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fernández]
- on 2003.10.22. Note that the initial template translations (./templates/es/)
- were done via AltaVista Babelfish and should not be blamed on Mauricio.
-
-$Id$
diff --git a/ruwiki/tags/release-0.8.0-fixes/contrib/enscript-token.rb b/ruwiki/tags/release-0.8.0-fixes/contrib/enscript-token.rb
deleted file mode 100644
index 80de23b..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/contrib/enscript-token.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# By Javier Fontan <jfontan@pc3d.cesga.es>
-
-require "open3"
-
-class Ruwiki::Wiki::CodeColor < Ruwiki::Wiki::Token
- def self.rank
- 0
- end
-
- def self.regexp
- %r<\{\{\{(?::(\w+)\b)?(.*?)\}\}\}>m
- end
-
- def replace
- cap = @match.captures
-
- if cap[0].nil?
- language = "ruby"
- else
- language = cap[0]
- end
-
- text = cap[1]
-
- i, o, e = Open3.popen3("enscript -B --color=emacs -Whtml -E#{language} -o -")
- i.print text
- i.close
-
- re_script = %r{(<pre>.*?</pre>)}mio
- c = o.readlines[1..-1].join("\n")
- re_script.match(c).captures[0]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<pre>\n}im, '<pre class="rwtk_CodeColor>')
- content.gsub!(%r{\n</pre>}im, '</pre>')
- content.gsub!(%r{<font color="(.+?)">}im, '<span style="color: \1">')
- content.gsub!(%r{</font>}im, '</span>')
- content.gsub!(%r{<B>}i, '<b>')
- content.gsub!(%r{</B}i, '</b>')
- content
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/contrib/rublog_integrator.rb b/ruwiki/tags/release-0.8.0-fixes/contrib/rublog_integrator.rb
deleted file mode 100644
index 730d42c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/contrib/rublog_integrator.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-# NOTE: This is not currently compatible with Ruwiki 0.8.0
-#
-# require 'ruwiki/wiki/handler'
-
-class Ruwiki::RubLogHandler < Ruwiki::Wiki::Handler
- def initialize(entries)
- @entries = entries
- end
-
- def page_exists?(page, project)
-# puts "pP: #{page}, #{project}"
- matches = @entries.find_entries_with_root_name(page)
- matches.each { |entry| return true if(entry.dir_name =~ /#{project}/) }
- false
- end
-
- def project_exists?(project)
- true
- end
-
- def script_url
-# request.environment['SCRIPT_NAME']
-# !!SMELL!!
- ENV['SCRIPT_NAME']
- end
-end
-
- # An experimental convertor for Ruwiki
-class RuwikiConvertor < BaseConvertor
- handles "wiki"
-
- def get_title(f)
- title = "---Untitled---"
- loop do
- line = f.gets
- if(line =~ /^topic: (\S+)/) then
- title = $1
- elsif(line =~ /^\#EHDR/) then
- return title
- end
- end
- end
-
- def convert_html(file_entry, f, all_entries)
- title = get_title(f)
- markup = Ruwiki::Wiki.new('Default', Ruwiki::RubLogHandler.new(all_entries))
- body = markup.parse(f.readlines.join("\n"), file_entry.dir_name)
- HTMLEntry.new(title, body, self)
- end
-
- # FIXME: Need to check this one
- def convert_plain(file_name, f, all_entries)
- f.read
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/convert b/ruwiki/tags/release-0.8.0-fixes/convert
deleted file mode 100644
index 657ef09..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/convert
+++ /dev/null
@@ -1,279 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
-module RuwikiConverter #:nodoc:
- PROGRAM = File.basename($0)
- PATH = File.dirname($0)
-end
-
-begin
- require 'ruwiki'
-rescue LoadError
- $LOAD_PATH.unshift "#{RuwikiConverter::PATH}/../lib"
- # Fail hard if it fails again.
- require 'ruwiki'
-end
-
- # Load all of the known backends.
-require 'ruwiki/backend/flatfiles'
-require 'ruwiki/backend/yaml'
-require 'ruwiki/backend/marshal'
-
-require 'optparse'
-require 'ostruct'
-require 'fileutils'
-
-module RuwikiConverter #:nodoc:
- TARGETS = %w(flatfiles yaml marshal)
-
- # Create the regular expressions that are used in Ruwiki 0.6.2
- OLD_HEADER_RE = /^\s*([a-z]+)\s*:\s*(.*)$/
- OLD_HEADER_END_RE = /^#EHDR$/
- DATA_HEADER_END_RE = /\A#EHDR\z/
- NL_RE = /\n/
-
-
- def with(obj)
- yield obj if block_given?
- end
-
- # Only allow this to be run once. Silently fail otherwise.
- def set_defaults
- return unless @options.nil?
- @options = OpenStruct.new
-
- with @options do |o|
- o.traverse_directories = true
- o.backup_old_files = true
- o.backup_extension = "~"
- o.quiet = false
- o.verbose = false
- o.extension = 'ruwiki'
-# o.target_format = 'yaml'
- o.target_format = 'flatfiles'
- end
- end
-
- def display_options
- end
-
- def summary
- end
-
- def process(argv, out = $stdout, err = $stderr)
- set_defaults
-
- @out = out
- @err = err
-
- argv.options do |opts|
- opts.banner = "Usage: #{PROGRAM} [options] <directory>+"
- opts.separator ''
- opts.on('--format=FORMAT', 'Converts encountered files (regardless', 'of the current format), to the specified', 'format. Default is yaml. Allowed formats', 'are: yaml marshal flatfiles') do |ff|
- @options.target_format = ff
- end
- opts.on('--[no-]backup', 'Create backups of upgraded files.', 'Default is --backup.') do |bb|
- @options.backup_old_files = bb
- end
- opts.on('--backup-extension=EXTENSION', 'Specify the backup extension. Default', 'is "~", which is appended to the data', 'filename.') do |ee|
- if ee.nil? or ee.empty?
- @err << "The backup extension must not be empty." if ee.nil? or ee.empty?
- @err << "#{opts}\n"
- return 0
- end
- @options.backup_extension = ee
- end
- opts.on('--extension=EXTENSION', 'Specifies the extension of Ruwiki data', 'files. The default is .ruwiki') do |ee|
- @options.extension = ee
- end
- opts.on('--no-extension', 'Indicates that the Ruwiki data files', 'have no extension.') do |nn|
- @options.extension = nil
- end
- opts.on('--quiet', 'Runs quietly. Default is to run with', 'normal messages.') do |qq|
- @options.quiet = qq
- @options.verbose = (not qq)
- end
- opts.on('--verbose', 'Runs with full messages. Default is to', 'run with normal messages.') do |vv|
- @options.quiet = (not vv)
- @options.verbose = vv
- end
- opts.separator ''
- opts.on_tail('--help', 'Shows this text.') do
- @err << "#{opts}\n"
- return 0
- end
-
- opts.parse!
- end
-
- if argv.empty?
- @err << "Error: not enough arguments.\n#{argv.options}\n" if not @options.quiet
- return 127
- end
-
- display_options if @options.verbose
-
- @options.target_format.capitalize!
- @options.target_format_class = Ruwiki::Backend.const_get(@options.target_format)
-
- argv.each { |file| process_file(file) }
-
- summary if not @options.quiet
- end
-
- # Process a single file.
- def process_file(file)
- if @options.backup_old_files
- return if file =~ /#{@options.backup_extension}/
- end
- @out << "#{file}: " unless @options.quiet
-
- if File.directory?(file) and @options.traverse_directories
- @out << "directory\n" unless @options.quiet
- Dir.chdir(file) { Dir['*'].each { |entry| process_file(entry) } }
- else
- begin
- page, page_format = load_page(file)
- @out << "converting from #{page_format} to #{@options.target_format} ... " if @options.verbose
- save_page(file, page)
- @out << "done.\n" unless @options.quiet
- rescue PageLoadException
- @out << "not a Ruwiki file; skipping.\n" unless @options.quiet
- rescue PageSaveException => e
- @out << "cannot save modified #{file}.\n" unless @options.quiet
- end
- end
- end
-
- def load_page(file)
- data = File.read(file)
- page_format = nil
-
- if data =~ OLD_HEADER_END_RE
- page_format = 'OldFlatfiles'
-
- page = Ruwiki::Page::NULL_PAGE.dup
-
- unless data.empty?
- rawbuf = data.split(NL_RE).map { |e| e.chomp }
-
- loop do
- if rawbuf[0] =~ OLD_HEADER_END_RE
- rawbuf.shift
- break
- end
-
- match = OLD_HEADER_RE.match(rawbuf[0])
-
- unless match.nil?
- case match.captures[0]
- when 'topic'
- page['properties']['topic'] = match.captures[1]
- page['properties']['title'] = match.captures[1]
- when 'version'
- page['properties']['version'] = match.captures[1].to_i
- else
- nil
- end
- end
- rawbuf.shift
- end
-
- page['page']['content'] = rawbuf.join("\n")
-
- with page['properties'] do |p|
- p['project'] = File.basename(File.dirname(File.expand_path(file)))
- p['editable'] = true
- p['indexable'] = true
- p['entropy'] = 0.0
- end
- end
- end
-
- # Try Marshal
- if page_format.nil?
- begin
- page = ::Marshal.load(data)
- page_format = 'Marshal'
- rescue Exception
- end
- end
-
- # Try YAML
- if page_format.nil?
- begin
- page = YAML.load(data)
- page_format = 'YAML'
- rescue Exception
- end
- end
-
- # Try the Flatfiles format
- if page_format.nil?
- begin
- page = Ruwiki::Backend::Flatfiles.load(data)
- page_format = 'Flatfiles'
- rescue Exception
- end
- end
-
- if page_format.nil? # Cannot detect page type.
- @err << %Q|Cannot detect the page format. |
- raise PageLoadException
- end
- [page, page_format]
- rescue PageLoadException
- raise
- rescue Exception => e
- @err << %Q|#{e.message}\n#{e.backtrace.join("\n")}\n| if @options.verbose
- raise PageLoadException
- end
-
- def save_page(file, page)
- if @options.backup_extension != '~'
- backup = "#{file}.#{@options.backup_extension}"
- else
- backup = "#{file}#{@options.backup_extension}"
- end
-
- # Always backup the file -- we are transactional.
- FileUtils.cp(file, backup)
-
- if @options.target_format == 'Marshal'
- method = :print
- else
- method = :puts
- end
- File.open(file, 'wb') { |f| f.__send__(method, @options.target_format_class.dump(page)) }
- rescue Exception => e
- FileUtils.mv(backup, file) if File.exists?(backup)
- @err << %Q|#{e.message}\n#{e.backtrace.join("\n")}\n| if @options.verbose
- raise PageSaveException
- ensure
- # If we aren't *supposed* to back up the file, then get rid of the
- # backup.
- if File.exists?(backup) and (not @options.backup_old_files)
- FileUtils.rm(backup)
- end
- end
-
- class PageLoadException < RuntimeError; end
- class PageSaveException < RuntimeError; end
-end
-
-if __FILE__ == $0
- include RuwikiConverter
-
- process(ARGV, $stdout, $stderr)
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/convert.bat b/ruwiki/tags/release-0.8.0-fixes/convert.bat
deleted file mode 100644
index 99a0212..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/convert.bat
+++ /dev/null
@@ -1,16 +0,0 @@
-@echo off
-REM Ruwiki 0.8.0
-REM Copyright © 2002 - 2004, Digikata and HaloStatue
-REM Alan Chen (alan@digikata.com)
-REM Austin Ziegler (ruwiki@halostatue.ca)
-REM
-REM Licensed under the same terms as Ruby.
-REM $Id$
-REM
-if "%OS%"=="Windows_NT" goto WinNT
-ruby -x "convert" %1 %2 %3 %4 %5 %6 %7 %8 %9
-goto done
-:WinNT
-ruby -x "convert" %*
-goto done
-:done
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Default/ProjectIndex.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Default/ProjectIndex.ruwiki
deleted file mode 100644
index 21b489c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Default/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,48 +0,0 @@
-page!content: = Ruwiki
- Ruwiki is a simple, extensible Wiki written in Ruby. It supports both
- CGI and \WEBrick interfaces, templates, and CSS formatting.
- Additionally, it supports project namespaces, so that two pages can be
- named the same for differing projects without colliding or odd naming
- conventions. Please see the ::Ruwiki project for more information.
-
- Ruwiki is also a partially internationalised Wiki, although more
- testing, especially testing with multibyte character encodings and
- Unicode (UTF-8) is required. There are German and Spanish translations
- of the messages included with the Ruwiki distribution.
-
- The current version is 0.8.0. Numerous enhancements have been made in
- this version, ranging from a new default look (and two additional
- schemes) to new backend format support to searching and topic listing.
- The full list of changes can be found in Ruwiki::ChangeLog, with
- discussions of various features in Ruwiki::WikiMarkup,
- Ruwiki::Configuring_Ruwiki, and Ruwiki::Extending_Ruwiki.
-
- If you are upgrading from an older version of Ruwiki, please read
- Ruwiki::[[Upgrading and Converting]].
-
- Certain Ruwiki \APIs are considered stable at this point, others will
- be changing leading up to 1.0. Some of this is discussed in
- Ruwiki::To_Do, with further architectural discussions in
- Ruwiki::[[Roadmap]].
-
- %projects()
-
- Please review ::Tutorial and ::Ruwiki if you are unfamiliar with the
- concept of Wikis in general. If you want to play with \WikiFormatting
- for Ruwiki, use the Ruwiki::SandBox.
-
- [http://rubyforge.org/projects/ruwiki Ruwiki development] is hosted at
- [http://rubyforge.org RubyForge]. The current release of Ruwiki can
- always be [http://rubyforge.org/frs/?group_id=84 downloaded] from
- \RubyForge or the development (unstable) version can be obtained from
- CVS.
-
- $Id$
-page!footer:
-page!header:
-properties!project: Default
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/BugTracking.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/BugTracking.ruwiki
deleted file mode 100644
index 0a0f1f7..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/BugTracking.ruwiki
+++ /dev/null
@@ -1,34 +0,0 @@
-page!content: = Ruwiki 0.8.0 Bug Tracking
- This page is for tracking bugs in Ruwiki. Only bugs from recent
- distributions are tracked. In addition to this source-based bug
- tracking, there is the [http://rubyforge.org RubyForge]
- [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug
- tracker] for Ruwiki.
-
- Those interested in Ruwiki development may also find the Ruwiki::To_Do
- list and the Ruwiki::[[Roadmap]] useful. The format of the bug list is
- &ldquo;version: description&rdquo;. For open bugs, the version is the
- version in which the bug was first reported. For closed bugs, the
- version is the version in which the bug was closed.
-
- ----
- == Open Bugs
- * 0.6.2: Not all formatting is applied consistently. The token rankings may need adjusting. Eivind Eklund has suggested a scheme that may help with this, but it will require architectural adjustment and will probably slow things down.
-
- ----
- == Closed Bugs
- * 0.8.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=707&group_id=84&atid=407 Sub-Numbered bullets don&rsquo;t increment]. Fixed a list numbering problem. I think that lists are a bit slower now, but they are completely accurate.
- * 0.7.0: Fixed a link detection problem in \[wikiword] format. Thanks to [mailto:eivind@FreeBSD.org Eivind Eklund] for the patch.
- * 0.7.0: Fixed a problem with &lt;pre&gt; paragraph detection and generation.
- * 0.7.0: Fixed a problem with &lt;p&gt; generation.
- * 0.7.0: [http://rubyforge.org/tracker/index.php?func=detail&aid=197&group_id=84&atid=407 Run-away ruby on some links in default distribution]. This may be related to a runaway header problem that was reported to me on IRC some time back that I believe has been fixed. Please advise.
- * 0.6.1: Projects aren&rsquo;t created appropriately.
- * 0.6.1: Saving without editing (or repost) appears to cause problems. A fix has been applied to attempt to address this. Pages that have not been changed will not be saved.
-
- $Id$
-properties!project: Ruwiki
-properties!title: BugTracking
-properties!topic: BugTracking
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ChangeLog.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ChangeLog.ruwiki
deleted file mode 100644
index 527af16..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ChangeLog.ruwiki
+++ /dev/null
@@ -1,72 +0,0 @@
-page!content: = Ruwiki 0.8.0 ChangeLog
- Uncompleted to-do items can be found in To_Do. Bugs in Ruwiki are
- tracked in BugTracking.
-
- == Version 0.8.0
- * AC: Added topic list (_topics) and project list (_projects) controls on templates and backend.
- * AZ: Added %topics() and %projects() tokens. See WikiMarkup for details.
- * AC: Added simple search on back-end (both project and global); search strings must be validated and cleansed before being sent to the back-end (the back-end must prepare the string for its own search mechanism). The back-end is wholly responsible for the searching of the pages.
- * AC: Added \RecentChanges list to backend and controls.
- * AZ: Changed default for Ruwiki::Config#storage_options[:flatfiles][:extension] to <tt>ruwiki</tt>.
- * AZ: Topic backlink search: searches for mentions of the topic in the other topics of the project.
- * AZ: New templating engine: The Rdoc templating engine has been greatly enhanced in preparation for some changes that will happen surrounding antispam capabilities.
- * AZ: Multiple flatfile-based backend support: tagged file (&ldquo;flatfiles&rdquo;), YAML (&ldquo;yaml&rdquo;), and Marshal (&ldquo;marshal&rdquo;).
- * AZ: A converter utility between backends.
- * AZ: Defined a canonical, extensible page transport format.
- * AZ: Defined a canonical, format-independent diff format.
- * AZ: Fixed list numbering problem. Modified lists to allow for mixed lists. See WikiMarkup for restrictions.
- * AZ: Removed automatic image conversion for \URIs that look like images. Now, images must be specified with the \[image:uri] format. See WikiMarkup for more details.
- * AZ: Fixed minor bugs in several tokens.
- * AZ: New look! Ruwiki now sports a new default look with CSS and template changes.
- * AZ: New look! Ruwiki has a &ldquo;simple&rdquo; template set.
- * AZ: New look! Ruwiki has a &ldquo;sidebar&rdquo; template set.
- * AZ: Fixed a long-standing bug with code tokens.
-
- == Version 0.7.0
- * Changed the tokenization API so that the #post_replace call is made at the Token class level instead of the instance level.
- * Improved HTML code generation.
- * Added servlet runner batch files for Windows. They <strong>will</strong> require modification to run properly.
- * Added %calendar(...) support. See WikiMarkup for more information.
-
- == Version 0.6.2
- * Removed dependencies on Ruwiki from a number of classes (Ruwiki::Backend, Ruwiki::Backend::Flatfiles, Ruwiki::Page, Ruwiki::Wiki, Ruwiki::Wiki::Tokens, and various tokens).
- * Ruwiki now initializes a \Ruwiki::BackendDelegator, which creates the requisite Ruwiki::Backend instance with Ruwiki::Config#storage_options.
- * Added German (Christian Neukirchen &lt;cneukirchin@yahoo.de&gt;) and Spanish translations (Mauricio Fernández &lt;batsman.geo@yahoo.com&gt;).
-
- == Version 0.6.1
- * Changed Ruwiki::Config#data_path to Ruwiki::Config#storage_options[:flatfiles][:data_path]. This represents a generalisation of storage type options so that the Ruwiki::Config object is not polluted with storage type options. Ruwiki::Config#storage_options keys should be the same Ruby Symbol as is used in Ruwiki::Config#storage_type.
- * Added Ruwiki::Config#storage_options[:flatfiles][:extension], based on a request by Chad Fowler. This allows you to have Project/\TopicFile actually stored as Project/\TopicFile.wiki if Ruwiki::Config#storage_options[:flatfiles][:extension] is set to <tt>wiki</tt>. The default for Ruwiki::Config#storage_options[:flatfiles][:extension] is <tt>nil</tt>.
- * Fixed incorrect references. I had been incorrectly attributing [http://sourceforge.net/projects/rdoc-wiki RDoc Wiki] to Dave Thomas. \RDoc Wiki is by Michael Neumann. However, the project I pulled from <strong>is</strong> by Dave Thomas, but it&rsquo;s [http://sourceforge.net/projects/rublog RubLog]. Apologies to both developers.
- * Added RuwikiTemplatingLibrary documentation.
- * Internationalized messages, except for the templating library.
- * Added configuration API for future work surrounding features. The existing wiki is mostly feature complete. Additional features (such as access controls) will be added through the feature interface.
- * Fixed project creation.
- * Fixed problems with \WikiWord links.
- * Added Wikipedia-style Wiki links (\[[list of words]]).
- * Fixed a potential problem with re-posted data or saving without editing.
- * Added the ability to put commands in the URL.
-
- == Version 0.6.0
- * Added Ruby mailing list reference support (e.g., \[ruby-talk:12345]).
- * Reorganised the code (again) to better support alternative frontends. Based, in part, on [http://sourceforge.net/projects/rublog RubLog] by Dave Thomas. (Reference corrected in 0.6.1.)
- * Added a [http://www.webrick.org WEBrick] servlet interface. Based, in part, on the \WEBrick servlet interface provided with \RubLog by Chad Fowler.
- * Added templates, using the [http://rdoc.sourceforge.net RDoc] template.rb library.
- * Changed the default topic to be \ProjectIndex instead of \DefaultProject.
- * Added a new \WikiWord format, \Wiki_Word_with_Spaces.
- * Completed lots of Ruwiki documentation.
- * Updated the save page.
- * Fixed a problem with the linking of project specific pages.
-
- == Version 0.5.0
- * Reorganized the code significantly to be easier to edit and extend.
- * Added abbreviation capabilities.
- * Cleaned up a lot of tokenizing code.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: ChangeLog
-properties!topic: ChangeLog
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Configuring_Ruwiki.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Configuring_Ruwiki.ruwiki
deleted file mode 100644
index 360c863..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Configuring_Ruwiki.ruwiki
+++ /dev/null
@@ -1,114 +0,0 @@
-page!content: = Configuring Ruwiki 0.8.0
- Ruwiki is configured similarly as both a CGI and a \WEBrick servlet.
- The biggest distinction is that because the Wiki servlet is created
- after the \WEBrick server is created (during the dispatch to the
- servlet), it is necessary to configure the wiki with a global
- Ruwiki::Config object, <em>$config</em>. Thus, in the examples below,
- replace <em>wiki.config</em> with <em>$config</em> where necessary.
-
- : Additional configuration options will be added from time to time. The
- : form for specifying configuration may be changed prior to 1.0. In
- : 0.8.1, it will be possible to initialise the configuration object
- : from storage.
-
- If you are looking for the discussion on templates, this has been moved
- to Extending_Ruwiki.
-
- == Ruwiki Configuration Options
- === wiki.config.title
-
- This configuration option names the Wiki; by default this is
- <tt>Ruwiki</tt>. This affects the display of the home link and the
- &lt;title&gt; element of pages.
-
- === wiki.config.webmaster
-
- The email address for the webmaster. This is used in generating error
- reports that can be emailed to the wiki&rsquo;s webmaster.
-
- === wiki.config.default_page, wiki.config.default_project
-
- These options indicate what will happen when the wiki&rsquo;s URL is
- specified without any parameters (the default page in the default
- project is opened), when a topic is specified without a project (the
- topic is opened in the default project), and when a project is
- specified without a topic (the default page is opened in the project).
-
- === wiki.config.storage_type, wiki.config.storage_options
-
- <tt>wiki.config.storage_type</tt> specifies the back-end storage
- mechanism as a Ruby Symbol. Currently, <tt>:flatfiles</tt>,
- <tt>:marshal</tt>, and <tt>:yaml</tt> are supported. YAML is the
- default format for Ruby version 1.8.2 or later; :flatfiles for earlier
- versions. Because of this, the Ruwiki data is stored by default in
- :flatfiles format. See Extending_Ruwiki for more information.
-
- <tt>wiki.config.storage_options</tt> is a hash of option hashes for
- each known storage type known to the Wiki. This must use the same
- Symbol as <tt>wiki.config.storage_type</tt> as the top-level hash key.
-
- ==== ...storage_options[:flatfiles][:data_path], ...storage_options[:yaml][:data_path], ...storage_options[:marshal][:data_path]
-
- The directory in which the wiki files will be found. By default, this
- is &ldquo;<tt>./data/</tt>&rdquo;.
-
- ==== ...storage_options[:flatfiles][:extension]
-
- The extension of the wiki files. By default, this is
- &ldquo;ruwiki&rdquo;. For those upgrading from a previous version of
- Ruwiki, note that you must explicitly set this value to <tt>nil</tt> if
- you wish to have no extension.
-
- === wiki.config.template_path
- This specifies the paths where the Wiki templates will be found. The
- process running the Wiki must have read access to the template_path.
-
- === wiki.config.template_set, wiki.config.css
- These two options indicate which template set will be used. Three
- template sets are provided in the release package:
- &ldquo;default&rdquo;, &ldquo;simple&rdquo;, and &ldquo;sidebar&rdquo;.
- The only CSS file used initially is &ldquo;ruwiki.css&rdquo;. Templates
- work such that they will be found in
- <em>template_path</em>/<em>template_set</em>. All CSS files are loaded
- from the template set directory and emitted as part of the output
- stream.
-
- : The bad that this means that the CSS never caches on the client side
- : as it would if it were a separate file. However, as templates may not
- : be in a web-accessible directory, this is necessary.
-
- == Ruwiki Servlet Options
- Most, if not all, of the configuration above can be achieved through
- command-line options of the ruwiki servlet.
-
- === Servlet Command-Line Options
- ; -P, --port <em>PORT</em> : Runs the Ruwiki servlet on the specified port. Default 8808.
- ; -A, --accept <em>ADDRESSES</em> : Restricts the Ruwiki servlet to accepting connections from the specified address or (comma-separated) addresses. May be specified multiple times. Defaults to all addresses.
- ; -L, --local : Restricts the Ruwiki servlet to accepting only local connections (127.0.0.1). Overrides any previous --accept addresses.
- ; -M, --mount <em>MOUNT_POINT</em> : The relative URI from which Ruwiki will be accessible. Defaults to &ldquo;/&rdquo;.
- ; --[no-]log : Log \WEBrick activity. Default is --log.
- ; --logfile <em>LOGFILE</em> : The file to which \WEBrick logs are written. Default is standard error.
- ; -T, --threads <em>THREADS</em> : Sets the \WEBrick threadcount.
-
- === Ruwiki Command-Line Options
- ; --language <em>LANGUAGE</em> : The interface language for Ruwiki. Defaults to &ldquo;en&rdquo;. May be &ldquo;en&rdquo;, &ldquo;de&rdquo;, or &ldquo;es&rdquo;.
- ; --webmaster <em>WEBMASTER</em> : The Ruwiki webmaster email address. Defaults to &ldquo;webmaster@domain.com&rdquo;.
- ; --[no-]debug : Turns on Ruwiki debugging. Defaults to --no-debug.
- ; --title <em>TITLE</em> : Provides the Ruwiki title. Default is &ldquo;Ruwiki&rdquo;.
- ; --default-page <em>PAGENAME</em> : An alternate default page. Default is &ldquo;\ProjectIndex&rdquo;.
- ; --default-project <em>PAGENAME</em> : An alternate default project. Default is &ldquo;Default&rdquo;.
- ; --template-path <em>TEMPLATE_PATH</em> : The location of Ruwiki templates. Default is &ldquo;./templates&rdquo;.
- ; --templates <em>TEMPLATES</em> : The name of the Ruwiki templates. Default is &ldquo;default&rdquo;.
- ; --css <em>CSS_NAME</em> : The name of the <acronym title="Cascading Style Sheets">CSS</acronym> file in the template path. Default is &ldquo;ruwiki.css&rdquo;.
- ; --storage-type <em>TYPE</em> : Select the storage type: flatfiles, yaml, marshal
- ; --flatfiles-data-path <em>PATH</em> : The path where data files are stored. Default is &ldquo;./data&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
- ; --flatfiles-extension <em>EXT</em> : The extension for data files. Default is &ldquo;ruwiki&rdquo;. <em>--flatfiles</em> is used even for <em>yaml</em> and <em>marshal</em> because they are all flatfile oriented systems.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: Configuring_Ruwiki
-properties!topic: Configuring_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Extending_Ruwiki.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Extending_Ruwiki.ruwiki
deleted file mode 100644
index 29bde50..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Extending_Ruwiki.ruwiki
+++ /dev/null
@@ -1,310 +0,0 @@
-page!content: = Extending Ruwiki 0.8.0
- Ruwiki is relatively easily extended to support new features. There are
- four primary ways in which Ruwiki can be extended or modified by the
- end user: templates, translating Ruwiki messages and labels, markup
- tokens, and creating new backends.
-
- == Templates
- Templating is done with a heavily modified version of the \RDoc
- template.rb library included in the distribution of Ruwiki. The
- templating library allows for nested templates, and this is used
- extensively in Ruwiki. This library is documented in
- RuwikiTemplatingLibrary.
-
- There are four major templates: content, edit, save, and error. Each of
- these has a slightly different combination of template files used, and
- this means that there are different sets of variables available.
-
- The major templates are &ldquo;composite templates&rdquo; that are
- defined as follows:
- ; content or search : body.tmpl, content.tmpl, controls.tmpl, footer.tmpl
- ; edit or preview : body.tmpl, edit.tmpl
- ; save : body.tmpl, save.tmpl, controls.tmpl, footer.tmpl
- ; error : body.tmpl, error.tmpl
-
- === Common Variables
- The following template variables are presented for all composite
- templates.
- ; <tt>%css_link%</tt> : The contents of the CSS file for the template set.
- ; <tt>%home_link%</tt> : A link to the root page of the Wiki.
- ; <tt>%editable%</tt> : A boolean value to mark the page as editable or not. Used in a conditional block in the templates.
- ; <tt>%cgi_url%</tt> : The URL for the Wiki.
- ; <tt>%content%</tt> : The formatted content of the current page.
- ; <tt>%page_project%</tt> : The project for the current page.
- ; <tt>%page_raw_topic%</tt> : The topic for the current page, escaped for safe transmission over the web.
- ; <tt>%page_topic%</tt> : The printable topic for the current page.
- ; <tt>%url_project%</tt> : The URL to the current page&rsquo;s project.
- ; <tt>%url_topic_search%</tt> : The URL to search for the current topic in the current project.
- ; <tt>%link_topic_search%</tt> : A link to the current topic search.
-
- === Variables for :content, :save, :search
- ; <tt>%wiki_title%</tt> : The title of the Wiki.
- ; <tt>%label_topic_or_search%</tt> : Either <tt>#topic#</tt> or <tt>#search#</tt>.
- ; <tt>%page_topic_name%</tt> : The same as <tt>%page_topic%</tt>.
-
- === Variables for :edit, :preview
- ; <tt>%wiki_title%</tt> : The title of the Wiki with a tag to indicate that the page is being edited.
- ; <tt>%page_content%</tt> : The content of the page.
- ; <tt>%page_version%</tt> : The current version number of the page.
- ; <tt>%unedited_page_content%</tt> : The formatted, unedited content of the page.
- ; <tt>%pre_page_content%</tt> : A Web-escaped form of the page content.
- ; <tt>%edit_comment%</tt> : The current edit comment.
-
- === Variables for :error
- ; <tt>%wiki_title%</tt> : The title of the Wiki with an error message.
- ; <tt>%name%</tt> : The name of the error.
- ; <tt>%backtrace%</tt> : The backtrace of the error.
- ; <tt>%backtrace_email%</tt> : The backtrace of the error formatted for sending by email.
- ; <tt>%webmaster%</tt> : The email address of the webmaster.
-
- == Translating Ruwiki Messages
- Ruwiki is internationalized. This method sets the Ruwiki error messages
- (and a few other messages) to the specified language Module. The
- language Module must have a constant Hash called <tt>Message</tt>
- containing a set of symbols and localized versions of the messages
- associated with them.
-
- If the file <em>ruwiki/lang/es.rb</em> contains the module
- <tt>Ruwiki::Lang::ES</tt>, the messages for RSS could be localized to
- Spanish thus:
-
- require 'ruwiki/lang/es'
- ...
- wiki.config.language = Ruwiki::Lang::ES
-
- Localization is currently per wiki instance. In a servlet environment,
- this may mean that only a single language is recognised.
-
- It is recommended that the hash be created with a default proc that
- reports unknown message keys.
-
- Message = Hash.new { |h, k| "Language ERROR: Unknown message key #{k.inspect}." }
-
- == Extending Ruwiki Markup
-
- : <strong>WARNING:</strong> These \APIs will change in Ruwiki 0.9.0,
- : replacing the instance variables @project, @backend, and @script with
- : a Handler object. There may be other changes as well.
-
- Ruwiki&rsquo;s WikiMarkup can be extended by creating a new
- Ruwiki::Wiki::Token. Tokens will be automatically loaded if they are
- placed in <em>ruwiki/wiki/tokens</em>.
-
- It is recommended that new tokens be added to the test cases in
- <tt>tests/tc_tokens.rb</tt>.
-
- The following Ruwiki::Wiki::Token class will convert strings in the
- forms of \[ruby-talk:12345] to links.
-
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- === Known Instance Variables
- ==== @match
- The match data for this token instance is is kept in @match. This is
- what will be used in #replace and #restore.
-
- ==== @project
- The project being processed.
-
- ==== @backend
- The Backend for the wiki. If you are using Ruwiki tokenizers outside of
- Ruwiki, this does not need to be a \BackendDelegator, but can be the
- direct Backend (which expects less information).
-
- ==== @script
- The URI to the script.
-
- ==== @message
- The message hash for displaying localised messages.
-
- ==== @title
- The title of the wiki instance.
-
- === Required Methods
- ==== ::regexp
- Ruwiki tokens are matched only through regular expression matches. As
- shown in the example above, the regular expression for ruby-talk
- mailing list posts is <tt>%r{\[ruby-\talk:(\d+)\]}</tt>. The purpose of
- the ::regexp method is to return the regexp for matching.
-
- For most inline matches, Ruwiki will ensure that the escape character
- (\) works automatically. For whole-line matches, it is necessary to
- match the escape character manually and provide a #restore method.
-
- As an example, the \HRule class implements these methods.
-
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- It may also be necessary to match escapes manually on inline matches
- that must be along word boundaries where the regular expression
- includes characters that normally match word boundaries. The project
- index match (e.g., \::Ruwiki) regular expression does this
- <tt>%r{(\B|\\)::([A-Z][a-z]+)}</tt>.
-
- ==== #replace
- This returns the formatted token. In the \RubyTalkLinks class above,
- the matched regular expression will be replaced with a hyperlink. The
- text of the hyperlink will be the matched text; the target of the
- hyperlink will include the first captured value.
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rw_extlink" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
-
- === Optional Methods
- ==== ::rank
- By default, a token will be processed in the order created. Tokens may
- be given a specific rank to ensure that they are processed in a
- particular order. The default rank is <tt>9999</tt>.
-
- ==== #restore
- Restores the token without replacement. Implements the results of the
- escape character. Each Token class is responsible for its own
- restoration. As noted in #regexp, whole-line tokens are most likely to
- need a #restore implementation.
-
- ==== ::post_replace
- Performs any necessary massaging of the data. The Lists token uses this
- to ensure that lists are collapsed together; the Paragraph token uses
- this to ensure that there are no empty paragraph tag pairs
- (&lt;p&gt;&lt;/p&gt;).
-
- : <strong>Note:</strong> This has been changed from Ruwiki 0.6.x.
- : Plugins written for the Ruwiki 0.6.x Token API will need to be
- : modified so that this is defined as:
-
- def self.post_replace
- ...
- end
-
- : as opposed to:
-
- def post_replace
- ...
- end
-
- == Extending Ruwiki Backends
- Ruwiki can support varying backends, as the backend interface has been
- abstracted completely from the data store. The backend
- <strong>must</strong>:
-
- # reside in <em>ruwiki/backends/</em> as <em>backend_name</em>.rb.
- # be registered by adding the <em>backend_name</em> as a symbol (e.g., :<em>backend_name</em>) to Ruwiki::KNOWN_BACKENDS.
- # inherit from Ruwiki::Backend.
- # exist as Ruwiki::Backend::<em>\Backend_name</em>.
-
- === Required Methods
- ==== #initialize(storage_options)
- The backend may only obtain its configuration information from an
- option hash provided by the \BackendDelegate. This is obtained from
- <tt>wiki.config.options[backend]</tt>. If a configuration error is
- detected during initialization, the backend should raise the
- \Ruwiki::Backend exception class \BackendError. This would be done
- with:
-
- raise Ruwiki::Backend::BackendError.new([:message_symbol, [message_parameters]])
-
- Backend writers should add appropriate messages to the
- <em>lang/en.rb</em> at a minimum. The \BackendDelegator will detect
- this and report the results appropriately.
-
- ==== #load(topic, project)
- The backend will be provided the name of the topic and project. It must
- return the selected page as a hash of hashes. The hash must match that
- of \Ruwiki::Page#export. It will be passed as the parameter to
- \Ruwiki:::Page.new.
-
- ==== #store(page)
- This method must store the provided Ruwiki::Page object. Current Ruwiki
- backend implementations store the Ruwiki::Page#export hash. This method
- is responsible for calling the private method Backend#make_diff and
- adding the result to the list of diffs for the page.
-
- ===== Backend#make_diff(oldpage, newpage)
- This method expects two page objects, or their Ruwiki::Page#export
- representation. It will return a hash representing the difference set
- between the two pages.
-
- ==== #obtain_lock(page, address = 'UKNOWN', timeout = 600)
- Obtains an exclusive lock on the page. The lock should have a timeout and
- permit access from the same IP address without restriction. This should
- <strong>not</strong> be a filesystem lock. The time stored for purposes of locking
- should include the timeout (e.g., Time.now.to_i + time).
-
- ==== #release_lock(page, address = 'UNKNOWN')
- Releases the exclusive lock on the page. The lock should not be released
- unless the IP address on the lock is the same or the lock has expired.
-
- ==== #project_exists?(project)
- Returns <tt>true</tt> if the project exists.
-
- ==== #page_exists?(topic, project = 'Default')
- Returns <tt>true</tt> if the page exists within the specified project.
-
- ==== #create_project(project)
- Attempts to create the project.
-
- ==== #search_project(project, search_string)
- String search all topic names and content in a project and return a
- hash of topic hits:
-
- topicname => hits
-
- ==== #list_projects
- Return an array of all projects.
-
- ==== #list_topics(project)
- Return an array of all topics within the project.
-
- === Future Methods
- Note that these methods are currently optional (they are not yet called
- from Ruwiki), but will become required moving forward as the functions
- are implemented in Ruwiki.
-
- ==== #destroy(page)
- Removes the page from the wiki. This should <strong>not</strong> remove
- the change history of the topic (in the event that the page has been
- removed maliciously). There will be a separate method to remove the
- page history.
-
- ==== #destroy_project(project)
- Attempts to destroy the project.
-
- === Optional Methods
- These methods are completely optional. They are guarded in the
- \BackendDelegate by a call to #respond_to?().
-
- ==== #global_search(search_string)
- The global search in the backend delegate is by default implemented as
- a looping search through all projects. A backend may have a more
- efficient backend global search mechanism. If the backend responds to
- #global_search, then the \BackendDelegate will use this method.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: Extending_Ruwiki
-properties!topic: Extending_Ruwiki
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/LicenseAndAuthorInfo.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
deleted file mode 100644
index e5fca75..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/LicenseAndAuthorInfo.ruwiki
+++ /dev/null
@@ -1,33 +0,0 @@
-page!content: = Ruwiki Licence
- Ruwiki is copyright © 2002 - 2004 [mailto:alan@digikata.com Alan Chen] and
- [mailto:ruwiki@halostatue.ca Austin Ziegler].
-
- Ruwiki is provided free of use and without any warranty express or implied.
- You may use, distribute, or modify Ruwiki under the conditions of Ruby&rsquo;s
- licence or the [http://www.gnu.org/copyleft/gpl.html GNU General Public
- Licence].
-
- * Ruwiki includes parts of Diff::LCS by Austin.
- * Ruwiki includes a modified version of rdoc/template.rb originally by Dave Thomas for use in \RDoc.
-
- == Translations
- * Translation to German by [mailto:chneukirchen@yahoo.de Christian Neukirchen] on 2003.10.22, with corrections by Mauricio Fern&aacute;ez. Note that the initial template translations (./templates/de/) were done via \AltaVista Babelfish and should not be blamed on Christian.
- * Translation to Spanish by [mailto:batsman.geo@yahoo.com Mauricio Fern&aacute;ndez] on 2003.10.22. Note that the initial template translations (./templates/es/) were done via \AltaVista Babelfish and should not be blamed on Mauricio.
-
- == Austin&rsquo;s Other Projects
- Austin has also released several other projects available on the RAA that you may be interested in:
- * [http://raa.ruby-lang.org/list.rhtml?name=mime-types MIME::Types], \RubyForge [http://rubyforge.org/projects/mime-types project].
- * [http://raa.ruby-lang.org/list.rhtml?name=pdf-writer PDF::Writer], \RubyForge [http://rubyforge.org/projects/ruby-pdf project].
- * [http://raa.ruby-lang.org/list.rhtml?name=text-format Text::Format], \RubyForge [http://rubyforge.org/projects/text-format project].
- * [http://raa.ruby-lang.org/list.rhtml?name=trans-simple Transaction::Simple], \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=uninheritable Uninheritable], Transaction::Simple&rsquo;s \RubyForge [http://rubyforge.org/projects/trans-simple project].
- * [http://raa.ruby-lang.org/list.rhtml?name=diff-lcs Diff::LCS], Ruwiki&rsquo;s \RubyForge [http://rubyforge.org/projects/ruwiki project].
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: LicenseAndAuthorInfo
-properties!topic: LicenseAndAuthorInfo
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ProjectIndex.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ProjectIndex.ruwiki
deleted file mode 100644
index 5d7a218..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,51 +0,0 @@
-page!content: = Ruwiki 0.8.0
- This is the \ProjectIndex page for Ruwiki. For any given project, the
- \ProjectIndex topic will be the default topic for plain project links.
-
- == Features and Information
- * This wiki supports a variety of WikiFeatures that you may be interested in. The rules for WikiMarkup are similar to some other wikis, but there are a few unique markup capabilities in Ruwiki.
- * Configuring_Ruwiki is simple.
- * Extending_Ruwiki is almost as simple.
- * Who wrote Ruwiki? Read the LicenseAndAuthorInfo.
-
- == Requirements
- Ruwiki currently requires Ruby 1.8, Diff::LCS 1.1.0 (portions
- included). The YAML backend requires Ruby 1.8.2.
-
- == Getting Started
- === QuickStart (CGI)
- # Place the Ruwiki directory in a place that your webserver can execute CGI programs and ensure that ruwiki.cgi is executable on your webserver.
- # Point your web browser to the appropriate URL.
- === QuickStart (\WEBrick)
- # Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
- # Point your web browser to <http://localhost:8808/>.
-
- == Support
- * Troubles with Ruwiki? See TroubleShooting for some suggestions. Have a new problem? Add it to the main [http://ruwiki.rubyforge.org/ruwiki.cgi/Ruwiki/TroubleShooting TroubleShooting] page.
- * Subscribe to [http://rubyforge.org/mailman/listinfo/ruwiki-discuss ruwiki-discuss] ([http://rubyforge.org/pipermail/ruwiki-discuss/ archives]).
- * You can also use the [http://rubyforge.org/forum/?group_id=84 Ruwiki Public Forum] or the on \RubyForge.
-
- == Tracking Ruwiki Development
- The development progress of Ruwiki is kept primarily in the wiki
- itself, but the services of [http://rubyforge.org RubyForge] are used
- as well.
- * The BugTracking page in Ruwiki keeps track of open and closed bugs in Ruwiki. Bugs can also be found in the \RubyForge [http://rubyforge.org/tracker/?atid=407&group_id=84&func=browse bug tracker] and [http://rubyforge.org/tracker/?atid=408&group_id=84&func=browse Support Requests].
- * The To_Do list keeps track of major development goals for Ruwiki. Items for this list can be found on \RubyForge in [http://rubyforge.org/tracker/?atid=410&group_id=84&func=browse Feature Requests] and [http://rubyforge.org/tracker/?atid=409&group_id=84&func=browse Patches].
- * There is a mailing list to track CVS changes: [http://rubyforge.org/mailman/listinfo/ruwiki-checkin ruwiki-checkin] ([http://rubyforge.org/pipermail/ruwiki-checkin/ archives]).
-
- == Different Features?
- If this wiki doesn&rsquo;t have the right combination of features, (or if it
- just doesn&rsquo;t feel right) try these other Ruby-based Wikis:
-
- * [http://instiki.rubyforge.org/ Instiki]
- * [http://www.walrus-ruby.org/amrita/cgi-bin/aswiki/aswiki.cgi Amrita Wiki]
- * [http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=top RWiki]
- * [http://www.xpsd.com/MiniRubyWiki MiniRubyWiki]
-
- $Id$
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Roadmap.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Roadmap.ruwiki
deleted file mode 100644
index 11fab66..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Roadmap.ruwiki
+++ /dev/null
@@ -1,223 +0,0 @@
-page!content: = Ruwiki 0.8.0: The Road Ahead
- What lies ahead for Ruwiki? The To_Do list will give a detailed list of
- what is to follow, but this list is not the roadmap. There is no clear
- indication of the reason for &mdash; and in some cases, the meaning of
- &mdash; the items on the list. The intention of this document is to
- expand on that list. As items are completed, they will be removed from
- this document.
-
- == Development Input
- The primary driver of development on Ruwiki is the needs of a few groups
- of people. First, both Alan and Austin use or will use Ruwiki at work.
- There are particular needs that both have. Austin will be replacing an
- installation of \PhpWiki with an installation of Ruwiki sometime in
- September or October 2004.
-
- Second, both [http://www.rubygarden.org/ruby RubyGarden] and
- [http://www.rubyforge.org RubyForge] have expressed an intention to
- replace the Perl-based \UseMod wiki with a Ruby-based wiki. The popular
- and easy-to-use Instiki (&ldquo;there is no step 2&rdquo;) is not an
- ideal choice for either because they either require or prefer a
- CGI-based wiki. Ruwiki has the desired level of performance and
- implemenation simplicity that impresses both groups, and it is the
- current preferred choice. Thus, the needs of both websites factor highly
- into the goals for Ruwiki.
-
- Third, Austin is giving a talk on Ruwiki at \RubyConf 2004. This
- requires that the API must be mostly stable so that the talk,
- &ldquo;Using and Extending Ruwiki&rdquo;, has relevance to current and
- potential users of Ruwiki without having to worry that the API may
- change significantly.
-
- Last, and certainly not least, feature requests and bug reports are a
- factor. One of the things that changed in Ruwiki 0.8.0 was the look and
- feel; admittedly, the look and feel in earlier versions was a bit
- garish, designed to fit in with a particular website more than be a
- general wiki theme. Users complained, and we changed this. The
- continual spam defacement of the \RubyGarden wiki suggested several
- possible improvements that could be made in Ruwiki to fight wiki spam;
- initial work has been implemented in Ruwiki 0.8.0 and other work will be
- implemented in 0.9.0 through to the release of 1.0.
-
- == Ruwiki 0.8.1: &ldquo;Keeping Up Appearances&rdquo;
- Ruwiki 0.8.1 is planned for release a week or so after the release of
- Ruwiki 0.8.0. This will mean little change for users of the standalone
- release, but some work will be done to prepare for versions of Ruwiki
- that can be installed with \RubyGems or <acronym title="Ruby Production
- Archive">RPA</acronym>&rsquo;s rpa-base.
-
- Both installation systems present a particular challenge to Ruwiki, as
- simply running &ldquo;ruwiki_servlet&rdquo; with no arguments will look
- for the data files and the template files relative to the current
- directory. With \RubyGems, though, this would require that the user
- specify something like:
-
- ruwiki_servlet \
- --template-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.8.1/templates \
- --flatfiles-data-path /usr/local/lib/ruby/gems/1.8/ruwiki-0.8.1/data
-
- Instiki does this better, by creating the templates and data files on
- the fly when a new instance is created. This will certainly be an
- option, but it will not be the only option. Since a Wiki instance may be
- private, and since Ruwiki supports CGI execution where this may not be
- an option, we need a secondary installation mechanism that copies the
- default data to a local directory. Ideally, as well, instead of
- providing all of the configuration options on the command-line, we will
- also provide a configuration file mechanism.
-
- Daniel Berger has provided instructions for users of Instiki to install
- it as a service on Win32. There is no reason that this cannot also be
- applied to Ruwiki&rsquo;s \WEBrick servlet, so it will, and it will be
- offered as an option.
-
- After all of this, Ruwiki will be offered as a \RubyGem and the RPA team
- will be asked to offer Ruwiki in the RPA.
-
- Chad Fowler&rsquo;s port of \RubLog&rsquo;s vector search may be added
- to this version if it is ready.
-
- == Ruwiki 0.9.0: &ldquo;Are You Being Served?&rdquo;
- Ruwiki 0.8.0 introduced an incompatible change in the way that page
- diffs were stored, so users were advised to remove any existing .rdiff
- files. This isn&rsquo;t as problematic as it may sound, as until 0.9.0,
- there is no way to actually view the page diffs from Ruwiki itself. One
- of the major goals
-
- In Ruwiki 0.7.0, a new token was introduced: %calendar(). The concept
- here is a sound one that can be extended to make token addition easier.
- Currently, it is necessary for token writers to create their own regular
- expressions. The &ldquo;function token&rdquo; will be added &mdash;
- although the form may not be &ldquo;%<em>function-name</em>&rdquo;
- &mdash; that will work with either a line replacement or a word
- replacement so that the regular expression does not need to be written.
- Tests for the replacement will still need to be written, but
- standardizing new custom tokens will be a good thing.
-
- If it has not been added already, Chad Fowler&rsquo;s port of
- \RubLog&rsquo;s vector search will be added.
-
- The presence of static HTML content (headers and footers) per page has
- been accounted for in Ruwiki 0.8.0, but it will not be displayed.
- Further, there is currently no way to specify or display static content
- for the wiki or the project. (A related problem here is that projects do
- not have any properties. This will become important as projects should
- be able to be marked private within a wiki in the future.)
-
- The purpose of the \WikiWikiWeb is to provide a collaborative, community
- knowledge editing environment. Unfortunately, the pondscum also known as
- spammers have figured out that the \WikiWikiWeb provides a positive
- Google \PageRank, and having their links on our Wikis is benefits them.
- Just as they don&rsquo;t care about filling our mailboxes, they
- don&rsquo;t care about defacing our community knowledge. Thus, Ruwiki
- 0.9.0 will also see the introduction of antispam techniques. They will
- include IP or hostname blacklisting (with timeouts); external URL
- redirection with an exception list; and robot exclusion. Partial robot
- exclusion is implemented in Ruwiki 0.8.0, but there is no transformation
- on actions, which is necessary.
-
- The \RecentChanges mechanism will be updated to make it possible to see
- the \GlobalRecentChanges list.
-
- The most significant change in Ruwiki 0.9.0 will be the modification of
- the request pipeline. This will not be visible to the end user, but it
- will be significant to users who wish to extend Ruwiki. Currently,
- Ruwiki processes all commands in ruwiki.rb. In Ruwiki 0.9.0, this will
- be changed to a dispatch mechanism, where Action objects are introduced,
- and ruwiki.rb dispatches requests to Action objects.
-
- .---------. .--------------------.
- | Request +--------->| Process [Request] |
- ·---------· ·----+---------------·
- |
- v
- .--------------------.
- | Perform [Action] |
- ·----+---------------·
- |
- v
- .--------------------.
- | Prepare [Response] |
- ·----+---------------·
- |
- v
- .--------. .----+---------------.
- | Page |<----------+ Send [Page] |
- ·--------· ·--------------------·
-
- The diagram above shows the general pipeline. The difference is that the
- action will be its own object. In general, it will need to know how to
- process certain URL formats.
-
- In the process of defining the action objects, ActionCards will be
- created. Below is an example \ActionCard for the default action,
- <tt>_show</tt>. In ActionCards, everything is relative to the Ruwiki
- root URI. Important to note is that ActionCards are an ideal: they may
- not represent something that can be accomplished for 0.9, 0.10, or even
- 1.0. They do, however, represent the ultimate target.
-
- === Action: Show [_show] <strong>DEFAULT</strong>
- ;; /Topic, /Topic/_show : Show <em>Topic</em> in the <em>Default</em> project.
- ;; /Project/, /Project/_show : Show <em>Project</em>::\ProjectIndex.
- ;; /Project/Topic, /Project/Topic/_show : Show <em>Project</em>::<em>Topic</em>.
- ;; /Topic?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>], /Topic/_show?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>] : Show the content of <em>Topic</em> as of the specified date, and optionally time.
- ;; /Project/?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>], /Project/_show?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>] : Show the content of <em>Project</em>::\ProjectIndex as of the specified date, and optionally time.
- ;; /Project/Topic/?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>], /Project/Topic/_show?<em>yyyymmdd</em>[&t=<em>hh[mm[ss]]</em>] : Show the content of <em>Project</em>::<em>Topic/</em> as of the specified date, and optionally time.
- ;; /Topic?v=<em>version#</em>, /Topic/_show?v=<em>version#</em> : Show the specified version of <em>Topic</em>.
- ;; /Project/?v=<em>version#</em>, /Project/_show?v=<em>version#</em> : Show the specified version of <em>Project</em>::\ProjectIndex.
- ;; /Project/Topic?v=<em>version#</em>, /Project/Topic/_show?v=<em>version#</em> : Show the specified version of <em>Project</em>::<em>Topic</em>.
- ;; /Topic?s=<em>set-id#</em>, /Topic/_show?s=<em>set-id#</em> : Show the specified set of <em>Topic</em>. This is a possible action that will work with &ldquo;changesets&rdquo;.
- ;; /Project/?s=<em>set-id#</em>, /Project/_show?s=<em>set-id#</em> : Show the specified set of <em>Project</em>::\ProjectIndex. This is a possible action that will work with &ldquo;changesets&rdquo;.
- ;; /Project/Topic?s=<em>set-id#</em>, /Project/Topic/_show?s=<em>set-id#</em> : Show the specified set of <em>Project</em>::<em>Topic</em>. This is a possible action that will work with &ldquo;changesets&rdquo;.
-
- == Ruwiki 0.10.0: &ldquo;What&rsquo;s Your Line?&rdquo;
- The antispam techniques introduced in 0.9.0 are positive steps in the
- fight against wiki defacement. They are hopefully effective, too. The
- problem is that because 0.9.0 doesn&rsquo;t offer users or user
- authentication, there&rsquo;s no way of safely allowing the edit of the
- antispam lists. Thus, to allow this and other potentially dangerous
- actions, a user and capability framework will be added to Ruwiki. This
- framework will allow for user identification, authentication, and
- authorization to indicate what users are allowed to perform what
- actions.
-
- Authenticated users will be able to bypass blacklist checking; thus, if
- &ldquo;msn.com&rdquo; is blocked, &ldquo;joe.blog@msn.com&rdquo; could
- still authenticate with Ruwiki and edit the pages. Some users will be
- able to manage user permissions (including user management), edit
- antispam lists, etc.
-
- Other actions will be added, including the ability to rename topics and
- move topics between projects. In both cases, the topic change history
- must be maintained.
-
- The documentation for Ruwiki will be substantially complete with this
- version, lacking only specific information on the features that will be
- added in Ruwiki 1.0.0.
-
- == Ruwiki 1.0.0: &ldquo;Yes, Minister&rdquo;
- A combined strength and weakness of Ruwiki is that it currently does
- little to protect against arbitrary HTML being inserted into the current
- topic. The allowed subset of HTML should be restricted to a safe subset
- to prevent cross-site-scripting attacks.
-
- Pages and projects have properties: we need to provide the ability to
- edit those properties. Part of the properties that should be editable
- include whether a page is frozen &mdash; this means that the page is no
- longer editable by any user (unless it is unfrozen) and is effectively a
- plain HTML page. Other properties include the static header and footer
- information in a page or project.
-
- Modern Wikis require an RSS feed. Ruwiki will provide one.
-
- == The Future: &ldquo;Yes, Prime Minister&rdquo;
- Ruwiki 1.0.0 does not represent the end of the line for Ruwiki, but what
- the future holds is unclear. We&rsquo;ll see what the future brings.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: Roadmap
-properties!topic: Roadmap
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
deleted file mode 100644
index 787f9c1..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki
+++ /dev/null
@@ -1,157 +0,0 @@
-page!content: = Ruwiki 0.8.0 Templating
- Ruwiki uses a heavily modified version of the \RDoc
- &ldquo;cheap-n-cheerful&rdquo; HTML page template system. This a
- line-oriented, text-based templating system.
-
- == Templates
- Templates in the templating system are essentially plain strings with
- particular references to templating keys or an include directive.
-
- The template interacts with value and message hashes provided by
- Ruwiki. The keys known to the templates expected by Ruwiki are
- detailed in Extending_Ruwiki. Nested key references are found from the
- inside-out. That is, the closest resolving key to the current level is
- found, not the furthest resolving key.
-
- === Including Other Templates
- Templates may include other templates to any arbitrary level by using the
- <tt>!INCLUDE!</tt> directive. When the \TemplatePage is created, an
- array of template strings are provided; these will be used to satisfy
- <tt>!INCLUDE!</tt> directives. If there are not enough template
- strings provided, <tt>!INCLUDE!</tt> won&rsquo;t be translated.
-
- : This may change before Ruwiki reaches 1.0, so that templates are
- : named instead of iterated.
-
- === Simple Template Keys
- Strings of the format <tt>%<em>key</em>%</tt> or
- <tt>%?<em>key</em>%</tt> are simple template keys. <em>key</em> is
- looked up in the provided value hash and is presented as the string
- value of the result. <tt>%key%</tt> template keys are mandatory; if
- the key is not found in the value hash, an exception will be raised.
- <tt>%?key%</tt> template keys are optional; if they key is not found
- in the value hash, an empty string (&ldquo;&rdquo;) will be used.
-
- === Labels
- Strings of the format <tt>#<em>key</em>#</tt> or
- <tt>#?<em>key</em>#</tt> are labels. <em>key</em> is looked up in the
- provided message hash as a Symbol (e.g.,
- <tt><em>key</em>.intern</tt>). As with simple template keys,
- <tt>#key#</tt> labels are mandatory and <tt>#?key#</tt> labels are
- optional.
-
- === Links
- Strings of the format <tt>HREF:\ref:name</tt> will become HTML links.
- Both <em>ref</em> and <em>name</em> are keys to be looked up.
- <em>name</em> is mandatory; an exception will be raised if it is not
- found.
-
- === Control Structures
- The templating library supports both looping and conditional control
- structures in both single-line and multi-line forms. Single-line
- control structures <strong>may not</strong> be nested; multi-line
- control structures <strong>may</strong> be nested arbitrarily deeply.
-
- ==== Looping Control Structures
- There are two forms of looping control structures.
-
- [:key|stuff:]
-
- START:key
- ... stuff ...
- END:key
-
- ===== Single-Line Looping
- [:key|stuff:]
-
- The value of <em>key</em> may be <tt>nil</tt>, an integer value, a
- range, or an array. When <em>key</em> represents:
- # <tt>nil</tt>, the looping structure will be replaced with an empty string.
- # An integer, <em>stuff</em> will be repeated <em>key</em> times. Values from 1 to <em>key</em> will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # A range, <em>stuff</em> will be repeated once for each successive value in the range of <em>key</em>. Each value will be provided to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
- # An array, the behaviour will differ depending on the contents of the array.
- ## If the array contains hashes, the behaviour is the same as a multi-line looping construct. See below for details.
- ## Otherwise, the template iterates through the array, providing each value to the text of <em>stuff</em> to be substituted as a simple template key of the form <tt>%key%</tt>.
-
- As an example, if we have:
-
- "[:b|%b% ]"
-
- # <tt>val["b"] = 3 -> "1&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = (0..2) -> "0&nbsp;2&nbsp;3&nbsp;"</tt>
- # <tt>val["b"] = ["a", "B"] -> "a&nbsp;B&nbsp;"</tt>
-
- ==== Multi-Line Looping
- START:key
- ... stuff ....
- END:key
-
- The value of <tt>key</tt> must be an array of hashes. <tt>... stuff
- ...</tt> will be repeated once for each entry in the array. The hashes
- will be passed as nested value hashes.
-
- %a% [:b|%a% ]%a%
-
- When the above template string is run with the following hash:
-
- val["a"] = 1
- val["b"] = [ { "a" => 2 }, { "a" => 3 } ]
-
- The result is:
-
- 1 2 3 1
-
- The behaviour is the same for multi-line blocks.
-
- ==== Conditional Block Keys
- IF:key
- ... stuff ...
- ENDIF:key
-
- The block between <tt>\IF:key</tt> and <tt>\ENDIF:key</tt> will be included in
- the output only if the corresponding key is set in the value hash.
-
- == Example
- Given the set of templates T1, T2, and T3 (shown below), here&rsquo;s how we would
- use the templating system.
-
- values = { "name" => "Dave", "state" => "TX" }
- t = TemplatePage.new(T1, T2, T3)
- File.open(name, w) { |f| t.process(f, values) }
-
- or:
-
- <!-- Source -->
- val1 = { "name" => "Dave", "state" => "TX" }
- val2 = { "name" => "Dave" }
- msgs = { }
- res = ""
- t.process(res, values, msgs)
-
- <!-- T1 -->
- Templates can subsitute a wide variety of values.
- !INCLUDE!
-
- <!-- T2 -->
- Name: %name% !INCLUDE!
-
- <!-- T3 -->
- IF:state
- State: %state%
- ENDIF:state
-
- The result will be:
-
- Name: Dave
- State: TX
-
- Name: Dave
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: RuwikiTemplatingLibrary
-properties!topic: RuwikiTemplatingLibrary
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/SandBox.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/SandBox.ruwiki
deleted file mode 100644
index 075cc47..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/SandBox.ruwiki
+++ /dev/null
@@ -1,11 +0,0 @@
-page!content: This page is intended for users to play with freely to
- practice their \WikiFormatting.
-
- $Id$
-properties!indexable: false
-properties!project: Ruwiki
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/To_Do.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/To_Do.ruwiki
deleted file mode 100644
index 8cf88f5..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/To_Do.ruwiki
+++ /dev/null
@@ -1,61 +0,0 @@
-page!content: = Ruwiki 0.8.0 To Do Tracking
- Completed to-do items can be found in the ChangeLog. Bugs in Ruwiki
- are tracked in BugTracking.
-
- == Well-Defined To Do Items
- === Ruwiki 0.8.1
- ; Non-local installation : current Ruwiki can support a non-local configuration (that is, where the data and templates are in a separate directory from the startup program), but there is no mechanism to automate this. In order to enable a \RubyGem or <acronym title="Ruby Production Archive">RPA</acronym> installation of Ruwiki, this mechanism will be necessary.
- ; Stored configurations : allow for configuration objects to be stored. This will make it easier to support non-local installations and configurations.
- ; Ruwiki installer : add a command-line program to create a new deployment of Ruwiki; this will copy the default data to the local installation.
- ; Central location : add the ability to use the data in the central installation that is provided by a \RubyGem or <acronym title="Ruby Production Archive">RPA</acronym> installation.
- ; Windows service : allow Ruwiki to be run as a Windows service for users of the Win32 build of Ruby.
- ; \RubyGem : Offer Ruwiki as a \RubyGem.
- === Ruwiki 0.9.0
- ; Versioning : complete the change history interface. Change history is currently stored in a file <em>topic[.extension]</em>.rdiff. There is no way to display the change history at this point.
- ; Action objects : Actions will be generalised to pull the processing out of the main ruwiki.rb inasmuch as is possible.
- ; Function tokens : generalize the %&lt;function-name&gt;[(&lt;args&gt;)] calling method so that function tokens can be created without having to create a custom regular expression.
- ; Search work : There is further search work required. The current mechanism is effective, but inefficient, as it must load and convert each file in a project to a page and then search selectively within that page. The search mechanism must be improved.
- ; Frozen content : make it so that frozen content can be provided on a per-page or Wiki basis. Will provide both headers and footers. <strong>Note:</strong> Ruwiki 0.9.0 will only provide the ability to present the information, not create or modify it.
- ; Blacklisting : Allow the specification of an allow/deny list for \IPs or hostnames, aimed at blocking known spammers. Entries in this list can be permanent or temporary (e.g., &ldquo;* DENY&rdquo;, &ldquo;spammer.com DENY UNTIL 20040723&rdquo;, &ldquo;139.244.33.25 ALLOW&rdquo;).
- ; External URL redirection : Force \URIs that allow redirection (e.g., HTTP and HTTPS) are redirected through a single point on an instance of Ruwiki (e.g., &lt;ruwiki-uri&gt;_redirect?&lt;url&gt;) unless the specific \URIs or hosts are whitelisted (e.g., rubycentral.com, rubyforge.org, ruby-lang.org, etc.).
- ; Robot exclusion : Recognise known robot user agents; when found, allow them to index and follow links on all pages except command pages (e.g., Project/Topic/_edit, Project/_create, etc.).
- ; \GlobalRecentChanges : Recent changes for all projects.
- === Ruwiki 0.10.0
- ; Authentication : allow user creation and authentication. Authenticate users bypass blacklist checking; thus, if &ldquo;msn.com&rdquo; is blocked, joe.blog@msn.com could still authenticate with Ruwiki and edit the pages.
- ; Topic renaming : add the ability to rename a topic within a project. Topic change history should be maintained.
- ; Topic moving : add the ability to move and/or rename a topic between projects. Topic change history should be maintained.
- ; Complete documentation : Complete the documentation of Ruwiki.
- ; Antispam : Allow the on-line editing of antispam lists to authenticated and authorised users.
- === Ruwiki 1.0.0
- ; Escape HTML Entities : HTML Entities such as &amp;, &lt;, and &gt; are not currently escaped. This may cause problems with some browsers and should be fixed <strong>without</strong> impairing the ability to add at least some raw HTML. Note that the current engine does not check raw HTML and thus could potentially be vulnerable to cross-site-scripting attacks.
- ; RSS Feed : Ruwiki must be able to offer \RecentChanges and \GlobalRecentChanges as RSS feeds. This may not be ideal with the current \RecentChanges format. It may be easier to move to a two-stage \RecentChanges format.
- ; Static content : Allow the creation and editing of static content.
- ; Frozen pages : provide the ability to freeze content in place; the page is no longer &ldquo;wiki&rdquo; editable and is effectively a plain HTML page.
- ; Page properties : provide the ability to generally edit the properties of a given page.
-
- == General Future To Do Items
- ; E-mail gateway : accept topic appends via e-mail.
- ; alternative backends : access other wiki data storage, or other formats, e.g. e-mail boxes in mh or mbox formats
- ; bug tracker backend : with alternate markup
- ; add setup and user config methods : for backend plugin classes, then we can use them with an interactive or gui tool frontend to setup data storage backends. The user might have to run as root or other user with database create permissions.
- ; add id="" to various markup elements (make id specific to topic) : Later we can allow users to tweak a page using uploaded css fragments which might get appended onto the standard css contents.
- ; ruby action : upload a ruby code fragment to add a smart &ldquo;action&rdquo; to that wiki page. Need some sort of security + approval system to handle this safely.
- ; Preview button : add a preview button to the save page.
- ; Alternative templating systems : not as high priority now that there&rsquo;s a real templating system in place.
- ; Alternative markup systems : potentially allow \RedCloth (Textile) and/or \BlueCloth (Markdown) to be processed for a page. This could be implemented as a %function.
- ; Project/topic security : allow certain projects to be restricted/authenticated for read/write based on user.
- ; Track last <em>n</em> links/topics : ?
- ; Write a markup debugger : ?
- ; Validate topic formatting from cgi : ?
- ; Validate project from cgi : ?
- ; Project-based backend : Allow different projects to have different backends.
- ; Arbitrary-depth project namespace support : Foo::Bar::\BazPage.
-
- $Id$
-properties!editable: false
-properties!project: Ruwiki
-properties!title: To_Do
-properties!topic: To_Do
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/TroubleShooting.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/TroubleShooting.ruwiki
deleted file mode 100644
index 64351ba..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/TroubleShooting.ruwiki
+++ /dev/null
@@ -1,27 +0,0 @@
-page!content: = Ruwiki 0.8.0
- = Ruwiki 0.8.0 Troubleshooting Tips
- Following are some tips contributed by users of Ruwiki. Remember:
- Ruwiki currently requires Ruby version 1.8; the YAML backend requires
- Ruby version 1.8.2 or the latest CVS of Ruby 1.9.
-
- == No such file or directory
- (Unix systems only.) If you get something like:
-
- % ./ruwiki_servlet
- : no such file or directory
-
- run the following in the Ruwiki directory:
-
- % find . | xargs dos2unix
-
- The developers of Ruwiki do what they can to ensure that Ruwiki is
- distributed in a way that works well for both Unix and Windows systems,
- but this will occasionally cause problems.
-
- $Id$
-properties!project: Ruwiki
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Upgrading+and+Converting.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Upgrading+and+Converting.ruwiki
deleted file mode 100644
index 1abf6af..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/Upgrading+and+Converting.ruwiki
+++ /dev/null
@@ -1,37 +0,0 @@
-page!content: = Ruwiki 0.8.0: Upgrading and Converting
- The flatfile backend format in Ruwiki 0.8.0 is not compatible with that
- of earlier versions of Ruwiki. There are a number of reasons for this,
- but because of this and that there are now three different backends,
- Ruwiki now has a converter utility between backends.
-
- There are two other incompatibilities of note:
- # Ruwiki now defaults to &ldquo;ruwiki&rdquo; as an extension (e.g., \ProjectIndex.ruwiki) to the storage files. This is, of course, is something that can be modified with a configuration option, but you may find it desirable to rename your files to match this naming convention.
- # The rdiff format is incompatible. It is recommended that you remove all .rdiff files from your data directory before using Ruwiki.
-
- == bin/convert [options] &lt;directory&gt;+
- The converter utility will work on all files in a directory and its
- subdirectories.
-
- When a file is encountered, it will be examined to be a known form of a
- Ruwiki backend (marshal, yaml, flatfiles, or "old" flatfiles). If the
- file is not one of these forms, then the file is skipped. Otherwise, it
- is converted to the specified format. By default, the converted files
- will be backed up.
-
- === bin/convert Options
- ; --format=FORMAT : Converts encountered files (regardless of the current format), to the specified format. Default is yaml. Allowed formats are: yaml marshal flatfiles
- ; --[no-]backup : Create backups of upgraded files. Default is --backup.
- ; --backup-extension=EXTENSION : Specify the backup extension. Default is "~", which is appended to the data filename.
- ; --extension=EXTENSION : Specifies the extension of Ruwiki data files. The default is .ruwiki
- ; --no-extension : Indicates that the Ruwiki data files have no extension.
- ; --quiet : Runs quietly. Default is to run with normal messages.
- ; --verbose : Runs with full messages. Default is to run with normal messages.
- ; --help : Shows this text.
-
- $Id$
-properties!project: Ruwiki
-properties!title: Upgrading+and+Converting
-properties!topic: Upgrading+and+Converting
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiFeatures.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiFeatures.ruwiki
deleted file mode 100644
index b4d7a2a..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiFeatures.ruwiki
+++ /dev/null
@@ -1,20 +0,0 @@
-page!content: Ruwiki is a [http://www.ruby-lang.org Ruby]-based wiki. It is
- ideal for personal or small team use.
-
- Ruwiki:
- * Uses the [http://www.ruby-lang.org Ruby] language.
- * Runs quickly and easily as a CGI or \WEBrick servlet.
- * Uses a simple templating system and CSS for presentation.
- * Has flatfile storage with simple versioning.
- * Offers project namespaces. Different projects can have the same topic names and not collide. Thus, \Default::ReadMe and \Project::ReadMe are two different pages.
- * Offers a calendar for date-based collaborative editing.
-
- $Id$
-properties!editable:
-properties!entropy: 0
-properties!project: Ruwiki
-properties!title: WikiFeatures
-properties!topic: WikiFeatures
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiMarkup.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiMarkup.ruwiki
deleted file mode 100644
index ee581e3..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Ruwiki/WikiMarkup.ruwiki
+++ /dev/null
@@ -1,264 +0,0 @@
-page!content: = Ruwiki Markup
- A [http://c2.com/cgi/wiki Wiki] obeys certain formatting rules to make
- it easy to format text without needing to know HTML. This Wiki obeys
- the following rules by default. Because Ruwiki is extensible, there may
- be additional formatting rules. These rules are those rules that apply
- as of Ruwiki 0.8.0.
-
- == \WikiWords, \WikiProjects, Calendars, and External Resources
- While reading stuff on this Wiki, you will see some words mashed
- together with capitalisation (like \WikiWords). While this may seem odd
- at first, this feature allows internal links to be created across the
- Wiki.
-
- There are several allowable forms for \WikiWords.
- # Two or more words concatenated directly. Each word must begin with a capital letter and be followed by zero or more lowercase letters. Thus, \FooBar, \CPlusPlus, and \AbC are all valid \WikiWords, but ABC is not.
- # Two or more words concatenated with underscores. The first word must begin with a capital letter. This makes \Foo_Bar, \C_Plus_Plus, and \A_b_C valid \WikiWords. These \WikiWords will be displayed with spaces instead of underscores. \C_Plus_Plus will be displayed as &ldquo;C Plus Plus&rdquo;.
- # One or more words contained in double square brackets. This the form supported by [http://wikipedia.com/ Wikipedia], and looks like \[[A Wiki Phrase]]. These links will be displayed exactly as entered between the brackets.
- # One or more words contained in double square brackets with display text separated by a vertical bar. These \WikiWords look like \[[A Wiki Phrase|but show this text]]. The link will be to the page &ldquo;A Wiki Phrase&rdquo; and &ldquo;but show this text&rdquo; will be the hyperlink.
-
- If a \WikiWord is found that does not have a page defining the
- \WikiWord, then the word will be shown with a hyperlink question mark
- following it, allowing the \WikiWord to be created.
-
- === \WikiProjects
- This Wiki supports &ldquo;projects.&rdquo; Within each project, a given
- \WikiWord is unique. Thus, if you have a Default project and a Ruwiki
- project, you can have two pages called \ReadMe. Any given \WikiWord
- refers only to topics within its project. That is, if I have \WikiWord
- in the \ReadMe topic of the Default project, it will refer to the
- \WikiWord topic of the Default project. (Another term for this
- capability is &ldquo;namespaces.&rdquo;)
-
- A cross-project link is composed of the project&rsquo;s name, two colons
- (::), and the \WikiWord desired. Thus, from \Default::ReadMe, I can
- have \Ruwiki::ReadMe as a link. The project index can be referred to
- with \::Project. This is the same as doing \Project::ProjectIndex.
- Thus, \::Ruwiki becomes ::Ruwiki, which is the same as
- \Ruwiki::ProjectIndex (Ruwiki::ProjectIndex).
-
- === Project Lists and Topic Lists
- The list of known projects may be listed with the %projects() token;
- the list of known topics for the current project may be listed with the
- %topics() link. An arbitrary project may be provided to the %topics()
- token, as in %topics(Default).
-
- %topics(Default)
-
- %projects()
-
- === Calendars
- Ruwiki supports a miniature calendar. Future versions of Ruwiki will
- allow for calendar aggregation. Using the %calendar function, a
- calendar section will be generated:
-
- %calendar(<year>, <month>[, <project>])
- %calendar(today[, <project>])
-
- %calendar accepts either the English word &ldquo;today&rdquo; (displaying the
- calendar for the current month and year) or a specific month and year
- for display. A calendar for the specified month will be generated
- where each date in the month is treated as a \WikiWord (as are the
- links to the current month, the previous month, and the next month)
- ready for display or editing. As with all other \WikiWord links in
- Ruwiki, a project may be specified in %calendar, making
- &ldquo;%calendar(today, Ruwiki)&rdquo; different from &ldquo;%calendar(today, Default)&rdquo;.
-
- %calendar(today)
- %calendar(1999, 08, Default)
-
- === External Resources
- Ruwiki behaves intelligently about resources external to the Wiki
- itself.
-
- ==== External Links
- \URLs to external resources are automatically detected for web
- addresses, FTP addresses, newsgroups, and email links. They are
- automatically converted to clickable \URLs. Be aware that some things
- that look like URL schemas may be make clickable but are not really
- \URLs.
-
- * \http://www.ruby-lang.org becomes http://www.ruby-lang.org
-
- \URLs may be named with the [url name] syntax. If the name is omitted,
- the URL will be numbered. Numbering is contained to within the page.
-
- * \[http://www.rubygarden.org RubyGarden] becomes [http://www.rubygarden.org RubyGarden].
- * \[http://www.halostatue.ca] and \[http://www.halostatue.ca/ruby] become [http://www.halostatue.ca] and [http://www.halostatue.ca/ruby].
-
- ==== Images
- : <strong>Changed in Ruwiki 0.8.0!</strong>
-
- In preparation for the anti-wiki-spam features of Ruwiki 0.9.0, it has
- been necessary to remove the ability for \URLs to be converted into
- inline images automatically. Inline images are now created with the
- image markup format, generally of the format \[image:URI options]. The
- <em>options</em> format is generally the same format as an HTML
- attribute (<em>name="value"</em>; the quotes are optional for
- single-word option values) and any valid HTML attribute is also a
- valid <em>option</em>. There is one special <em>option</em>,
- <tt>numbered</tt>. This value, if set to any other value than &ldquo;false&rdquo;,
- will set the <tt>title</tt> of the image to a numbered link.
-
- If the <tt>title</tt> attribute is not specified, it will be set from
- the <tt>alt</tt> attribute (if specified) or the image&rsquo;s URL. If the
- <tt>alt</tt> attribute is not specified, it will be set from the
- <tt>title</tt> attribute.
-
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif] [image:http://www.halostatue.ca/graphics/maple_leaf.gif]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif title="Maple Leaf"]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true] [image:http://www.halostatue.ca/graphics/maple_leaf.gif numbered=true]
- * \[image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"] [image:http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black;"]
-
- ==== Ruby Mailing Lists
- If a Ruby mailing list message tag is provided, it will be converted appropriately.
-
- * \[ruby-talk:12345] will become [ruby-talk:12345]
- * \[ruby-core:12345] will become [ruby-core:12345]
- * \[ruby-doc:12345] will become [ruby-doc:12345]
-
- == Headings and Lists
- === Headings
- Use equals signs (=) for headings. Up to six equals signs can be used
- for HTML headings 1 - 6.
-
- \===== Heading five<br />
- \====== Heading six
- ===== Heading five
- ====== Heading six
-
- === Lists
- ==== Bulleted Lists
- Use asterisks (*) to create bulleted lists. More asterisks means more
- levels.
-
- \* level 1<br />
- \** level 2<br />
- \*** level 3
-
- * level 1
- ** level 2
- *** level 3
-
- ==== Numbered Lists
- Use hash marks (#) for numbered lists. More hash marks means deeper
- levels.
-
- \# level 1<br />
- \## level 2<br />
- \### level 3<br />
- \### level 3.2<br />
- \## level 2.2<br />
- \# level 1.2
-
- # level 1
- ## level 2
- ### level 3
- ### level 3.2
- ## level 2.2
- # level 1.2
-
- ==== Definition Lists
- Definitions can be created similar to other lists. Unlike &ldquo;standard&rdquo;
- lists, though, definition lists have both the term and the definition.
- They are specified like so. As with other lists, repeating the first
- item (;) will increase the indentation level. The browser may not
- respect this.
-
- \; term : definition<br />
- \;; term2 : definition<br />
- \;;; term3 : definition
-
- ; term : definition
- ;; term2 : definition
- ;;; term3 : definition
- == Paragraph Formatting
- === Rules
- Four or more dashes ("----") on a line by itself makes a horizontal
- rule, like so:
-
- \----
- ----
- === Paragraphs
- A blank line (it may have whitespace on it) marks a new paragraph. All
- other lines are joined together (excepting headers, lists, and rules).
-
- This line is a new paragraph.
-
- === Block Indent Paragraphs
- Paragraphs can be indented by beginning the paragraph with one or more
- colons (:).
-
- \: Indent Level 1<br />
- \:: Indent Level 2<br />
- \::: Indent Level 3
-
- : Indent Level 1
- :: Indent Level 2
- ::: Indent Level 3
-
- Paragraphs may be indented as &ldquo;cites&rdquo; by using one or more
- greater-than signs (>) at the beginning of the line.
-
- \> Indent Level 1<br />
- \>> Indent Level 2<br />
- \>>> Indent Level 3
-
- > Indent Level 1
- >> Indent Level 2
- >>> Indent Level 3
-
- === Code
- Text that is indented will be presented as formatted in a monospaced
- font. The only change is to escape HTML entities &lt; (&amp;lt;), &gt;
- (&amp;gt;), and &amp; (&amp;amp;).
-
- def replace
- content = @match[1]
- %Q{<pre>#{content}</pre>}
- end
-
- == Miscellaneous Formatting
- === HTML
- The Ruwiki engine currently passes through HTML without changes. Thus,
- &lt;strong&gt;strong&lt;/strong&gt; would be shown as
- <strong>strong</strong>. <strong><em>Note:</em></strong> This
- capability could be very dangerous as it could expose the Wiki to
- cross-site scripting (XSS) vulnerabilities. This will be remedied
- prior to the 1.0 release of Ruwiki.
-
- === Abbreviations
- Certain abbreviations may be known to the Wiki. While there is not yet
- any way for a user to query what abbreviations are known, if the
- abbreviations are told to the users, they may be used. Abbreviations
- are presented with @{key}, where <em>key</em> is the abbreviation
- desired. This Wiki, for example, knows that \@{matz} means &ldquo;@{matz}&rdquo;.
- The special form \@{} will produce the current list of known
- abbreviations. Unknown abbreviations will simply be put back into the
- data stream unchanged. Thus, \@{unknownkey} results in @{unknownkey}.
-
- ==== Known Abbreviations
- @{}
-
- === Preventing Formatting
- If you wish to prevent a word or sequence from being interpreted, put
- a backslash (\) in front of it. This works on all formatting options
- except paragraph positioning. Thus, if I want to prevent a \WikiWord
- from being turned into a hyperlink, I need to backslash it:
- \\WikiWord.
-
- === Other Possible Considerations
- I&rsquo;m looking at adding styles similar to what is shown on the Wiki
- below.
-
- * http://www.pmichaud.com/wiki/PmWiki/WikiStyles
-
- $Id$
-page!footer:
-page!header:
-properties!project: Ruwiki
-properties!title: WikiMarkup
-properties!topic: WikiMarkup
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingPages.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingPages.ruwiki
deleted file mode 100644
index faf6c8c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingPages.ruwiki
+++ /dev/null
@@ -1,17 +0,0 @@
-page!content: = Adding Pages
- To add a new page to Ruwiki, all you need to do is come up with a
- meaningful title, turn it into a \WikiWord (see Ruwiki::WikiMarkup) and
- Ruwiki will automatically recognise it as a reference to a page that
- does not yet exist.
-
- At the end of the new \WikiWord is a hyperlinked question mark;
- clicking on this will open the edit page for the new \WikiWord in
- Ruwiki.
-
- $Id$
-properties!project: Tutorial
-properties!title: AddingPages
-properties!topic: AddingPages
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingProjects.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingProjects.ruwiki
deleted file mode 100644
index b96b809..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/AddingProjects.ruwiki
+++ /dev/null
@@ -1,17 +0,0 @@
-page!content: = Adding Projects
- To add a new project to Ruwiki, all you need to do is come up with a
- meaningful one-word name, and then turn it into a project link, e.g.,
- \::Project. Projects may <strong>only</strong> be a single word &mdash;
- they are not normal \WikiWords (see Ruwiki::WikiMarkup for details).
- Ruwiki will recognise this as a project that does not yet exist. At the
- end of the Project link is a hyperlinked question mark; clicking on
- this will open the \Project::ProjectIndex in Ruwiki for editing and
- create the new project.
-
- $Id$
-properties!project: Tutorial
-properties!title: AddingProjects
-properties!topic: AddingProjects
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/ProjectIndex.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/ProjectIndex.ruwiki
deleted file mode 100644
index 73a13a8..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/ProjectIndex.ruwiki
+++ /dev/null
@@ -1,12 +0,0 @@
-page!content: = Ruwiki 0.8.0 Tutorial
- This tutorial is incomplate.
-
- %topics(Tutorial)
-
- $Id$
-properties!project: Tutorial
-properties!title: ProjectIndex
-properties!topic: ProjectIndex
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/SandBox.ruwiki b/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/SandBox.ruwiki
deleted file mode 100644
index 9d4e4c8..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/data/Tutorial/SandBox.ruwiki
+++ /dev/null
@@ -1,10 +0,0 @@
-page!content: This page is intended for users to play with freely to
- practice their \WikiFormatting.
-
- $Id$
-properties!project: Tutorial
-properties!title: SandBox
-properties!topic: SandBox
-properties!version: 1
-ruwiki!content-version: 2
-ruwiki!version: 0.8.0
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki.rb
deleted file mode 100644
index 9f59e30..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki.rb
+++ /dev/null
@@ -1,452 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-class Ruwiki
- VERSION = '0.8.0'
- CONTENT_VERSION = 2
-end
-
-require 'cgi'
-require 'ruwiki/handler'
-require 'ruwiki/template'
-require 'ruwiki/lang/en' # Default to the English language.
-require 'ruwiki/config'
-require 'ruwiki/backend'
-require 'ruwiki/wiki'
-require 'ruwiki/page'
-
- # = Ruwiki
- # Ruwiki is a simple, extensible Wiki written in Ruby. It supports both CGI
- # and WEBrick interfaces, templates, and CSS formatting. Additionally, it
- # supports project namespaces, so that two pages can be named the same for
- # differing projects without colliding or having to resort to odd naming
- # conventions. Please see the ::Ruwiki project in the running Wiki for more
- # information. Ruwiki 0.7.0 has German and Spanish translations available.
- #
- # == Quick Start (CGI)
- # 1. Place the Ruwiki directory in a place that your webserver can execute
- # CGI programs and ensure that ruwiki.cgi is executable on your webserver.
- # 2. Point your web browser to the appropriate URL.
- #
- # == Quick Start (WEBrick)
- # 1. Run ruwiki_servlet (ruwiki_servlet.bat under Windows).
- # 2. Point your web browser to <http://localhost:8808/>.
- #
- # == Configuration
- # There are extensive configuration options available. The Ruwiki WEBrick
- # servlet offers command-line options that simplify the configuration of
- # Ruwiki without editing the servlet; use ruwiki_servlet --help for more
- # information.
- #
- # == Copyright
- # Copyright:: Copyright © 2002 - 2004, Digikata and HaloStatue, Ltd.
- # Authors:: Alan Chen (alan@digikata.com)
- # Austin Ziegler (ruwiki@halostatue.ca)
- # Licence:: Ruby's
-class Ruwiki
- ALLOWED_ACTIONS = %w(edit create)
- EDIT_ACTIONS = %w(save cancel)
- EDIT_VARS = %w(newpage version edcomment q)
- RESERVED = ['save', 'preview', 'cancel', EDIT_VARS].flatten
-
- # Returns the current configuration object.
- attr_reader :config
- # Returns the current Response object.
- attr_reader :response
- # Returns the current Request object.
- attr_reader :request
- # Returns the current Markup object.
- attr_reader :markup
- # Returns the current Backend object.
- attr_reader :backend
-
- # Sets the configuration object to a new configuration object.
- def config=(cc)
- raise self.message[:config_not_ruwiki_config] unless cc.kind_of?(Ruwiki::Config)
- @config = cc
- self.config!
- end
-
- def config!
- @markup.default_project = @config.default_project
- @markup.message = self.message
- end
-
- # The message hash.
- def message
- @config.message
- end
-
- # Initializes Ruwiki.
- def initialize(handler)
- @request = handler.request
- @response = handler.response
-
- @config = Ruwiki::Config.new
-
- @path_info = @request.determine_request_path || ''
-
- @type = nil
- @error = {}
-
- @markup = Ruwiki::Wiki.new(@config.default_project,
- @request.script_url,
- @config.title)
- end
-
- # Initializes the backend for Ruwiki.
- def set_backend
- @backend = BackendDelegator.new(self, @config.storage_type)
- @markup.backend = @backend
- end
-
- # Runs the steps to process the wiki.
- def run
- @config.verify
- set_backend
- set_page
- process_page
- render
- rescue Exception => ee
- render(:error, ee)
- ensure
- output
- end
-
- # Initializes current page for Ruwiki.
- def set_page
- path_info = @path_info.split(%r{/}, -1).map { |ee| ee.empty? ? nil : ee }
-
- if path_info.size == 1 or (path_info.size > 1 and path_info[0])
- raise self.message[:invalid_path_info_value] % [@path_info] unless path_info[0].nil?
- end
-
- # path_info[0] will ALWAYS be nil.
- path_info.shift
-
- case path_info.size
- when 0 # Safety check.
- nil
- when 1 # /PageTopic OR /_edit
- set_page_name_or_action(path_info[0])
- when 2 # /Project/ OR /Project/PageTopic OR /Project/_edit OR /Project/create
- @project = path_info.shift
- set_page_name_or_action(path_info[0])
- else # /Project/PageTopic/_edit OR /Project/diff/3,4 OR something else.
- @project = path_info.shift
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- else
- @topic = item
- item = path_info.shift
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- @params = path_info
- end
- end
- end
-
-# @request.each_parameter { |key, val| puts "#{key} :: #{val.class}" }
-
- @project ||= @config.default_project
- @topic ||= @config.default_page
- end
-
- # Processes the page through the necessary steps. This is where the edit,
- # save, cancel, and display actions are present.
- def process_page
- content = nil
- formatted = false
-
- @page = Ruwiki::Page.new(@backend.retrieve(@topic, @project))
- @type = :content
-
- # TODO Detect if @action has already been set.
- @action ||= @request.parameters['action'].downcase if @request.parameters['action']
- @action ||= 'save' if @request.parameters['save']
- @action ||= 'cancel' if @request.parameters['cancel']
- @action ||= 'preview' if @request.parameters['preview']
-
- case @action
- when 'search'
- # get, validate, and cleanse the search string
- # TODO: add empty string rejection.
- srchstr = validate_search_string(@request.parameters['q'])
- srchall = @request.parameters['a']
-
- @page.content = self.message[:search_results_for] % [srchstr]
- @page.topic = srchstr || ""
-
- unless srchall.nil?
- hits = @backend.search_all_projects(srchstr)
- else
- hits = @backend.search_project(@page.project, srchstr)
- end
-
- # debug hit returns
-# hits.each { |key, val| $stderr << " #{key} : #{val}\n" }
-
- # turn hit hash into content
- hitarr = []
- # organize by number of hits
- hits.each { |key, val| (hitarr[val] ||= []) << key }
-
- rhitarr = hitarr.reverse
- maxhits = hitarr.size
- rhitarr.each_with_index do |tarray, rnhits|
- next if tarray.nil? or tarray.empty?
- nhits = maxhits - rnhits - 1
-
- if nhits > 0
- @page.content << "\n== #{self.message[:number_of_hits] % [nhits]}\n* "
- @page.content << tarray.join("\n* ")
- end
- end
-
- @type = :search
- when 'topics'
- if @backend.project_exists?(@page.project)
- topic_list = @backend.list_topics(@page.project)
- else
- topic_list = []
- end
-
- # todo: make this localized
- if topic_list.empty?
- @page.content = self.message[:no_topics] % [@page.project]
- else
- topic_list.map! do |tt|
- uu = CGI.unescape(tt)
- if (uu != tt) or (tt =~ /^[A-Z][a-z]+$/)
- "[[#{CGI.unescape(tt)}]]"
- else
- tt
- end
- end
- @page.content = <<EPAGE
-= #{self.message[:topics_for_project] % [@page.project]}
-* #{topic_list.join("\n* ")}
-EPAGE
- end
-
- @type = :content
- when 'projects'
- proj_list = @backend.list_projects
-
- if proj_list.empty?
- @page.content = self.message[:no_projects]
- else
- # TODO make this localized
- proj_list.map! { |proj| %[#{proj} (a href='\\#{@request.script_url}/#{proj}/_topics' class='rw_minilink')#{self.message[:project_topics_link]}</a>] }
- @page.content = <<EPAGE
-= #{self.message[:wiki_projects] % [@config.title]}
-* ::#{proj_list.join("\n* ::")}
-EPAGE
- end
-
- content = @page.to_html(@markup)
- content.gsub!(%r{\(a href='([^']+)/_topics' class='rw_minilink'\)}, '<a href="\1/_topics" class="rw_minilink">') #'
- formatted = true
- @type = :content
- when 'edit', 'create'
- # Automatically create the project if it doesn't exist or if the action
- # is 'create'.
- @backend.create_project(@page.project) if @action == 'create'
- @backend.create_project(@page.project) unless @backend.project_exists?(@page.project)
- @backend.obtain_lock(@page, @request.environment['REMOTE_ADDR'])
-
- content = nil
- formatted = true
- @type = :edit
- when 'save', 'preview'
- np = @request.parameters['newpage'].gsub(/\r/, '').chomp
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.editor_ip = @request.environment['REMOTE_ADDR']
-
- if @action == 'save'
- op = @page.content
- else
- op = nil
- end
-
- if np == op and @action == 'save'
- @page.content = op
- @type = :content
- else
- @page.content = np
- edc = @request.parameters['edcomment']
- unless (edc.nil? or edc.empty? or edc == "*")
- @page.edit_comment = edc
- end
-
- if @action == 'save'
- @type = :save
- @page.version = @request.parameters['version'].to_i + 1
- @backend.store(@page)
-
- # hack to ensure that Recent Changes are updated correctly
- if @page.topic == 'RecentChanges'
- recent = Ruwiki::Page.new(@backend.retrieve(@page.topic, @page.project))
- @page.content = recent.content
- end
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- else
- @type = :preview
- content = nil
- formatted = true
- end
- end
- when 'cancel'
- @page.topic = @request.parameters['topic']
- @page.project = @request.parameters['project']
- @page.version = @request.parameters['version'].to_i
-
- @backend.release_lock(@page, @request.environment['REMOTE_ADDR'])
- @type = :content
- else
- # TODO AZ: This should probably return a 501 Not Implemented or some
- # other error unless @action.nil?
- nil
- end
- content = @page.to_html(@markup) if not formatted
- rescue Exception => ee # rescue for def process_page
- @type = :error
- if ee.kind_of?(Ruwiki::Backend::BackendError)
- name = "#{self.message[:error]}: #{ee.to_s}"
- else
- name = "#{self.message[:complete_utter_failure]}: #{ee.to_s}"
- end
- @error[:name] = CGI.escapeHTML(name)
- @error[:backtrace] = ee.backtrace.map { |el| CGI.escapeHTML(el) }.join("<br />\n")
- content = nil
- ensure
- @content = content
- end # def process_page
-
- # Renders the page.
- def render(*args)
- if args.empty?
- type = @type
- error = @error
- else
- raise ArgumentError, self.message[:render_arguments] unless args.size == 2
- type = args[0]
- error = {
- :name => args[1].inspect.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;'),
- :backtrace => args[1].backtrace.join("<br />\n")
- }
- @page = Ruwiki::Page.new(Ruwiki::Page::NULL_PAGE)
- end
-
- @rendered_page = ""
- values = {
- "css_link" => @config.css_link,
- "home_link" => %Q(<a href="#{@request.script_url}">#{@config.title}</a>),
- "cgi_url" => @request.script_url,
- "content" => @content,
- }
-
- if @page.nil?
- values["page_project"] = ""
- values["page_raw_topic"] = ""
- values["page_topic"] = ""
- values["editable"] = false
- values["indexable"] = false
- else
- values["page_project"] = @page.project
- values["page_raw_topic"] = @page.topic
- values["page_topic"] = CGI.unescape(@page.topic)
- values["editable"] = @page.editable
- values["indexable"] = @page.indexable
- end
-
- values["url_project"] = %Q(#{values["cgi_url"]}/#{values["page_project"]})
- values["url_topic_search"] = %Q(#{values["url_project"]}/_search?q=#{values["page_topic"]})
- values["link_topic_search"] = %Q(<a href='#{values["url_topic_search"]}'><strong>#{values["page_topic"]}</strong></a>)
-
- case type
- when :content, :save, :search
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}" if @page.nil?
- values["wiki_title"] ||= "#{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["label_topic_or_search"] = self.message[:label_topic]
- values["page_topic_name"] = values["page_topic"]
- if type == :content or type == :search
- template = TemplatePage.new(@config.template(:body), @config.template(:content), @config.template(:controls), @config.template(:footer))
- if type == :search
- values["label_topic_or_search"] = self.message[:label_search]
- else
- values["page_topic"] = values["link_topic_search"]
- end
- else
- # action type was save
- values["page_topic"] = values["link_topic_search"]
- template = TemplatePage.new(@config.template(:body), @config.template(:save), @config.template(:controls), @config.template(:footer))
- end
- when :edit, :preview
- template = TemplatePage.new(@config.template(:body), @config.template(:edit))
- values["wiki_title"] = "#{self.message[:editing]}: #{@page.project}::#{CGI.unescape(@page.topic)} - #{@config.title}"
- values["page_content"] = @page.content
- values["page_version"] = @page.version.to_s
- values["unedited_page_content"] = @page.to_html(@markup)
- values["pre_page_content"] = CGI.escapeHTML(@page.content)
- if @request.parameters["edcomment"].nil? or @request.parameters["edcomment"].empty?
- values["edit_comment"] = "*"
- else
- values["edit_comment"] = @request.parameters["edcomment"]
- end
- when :error
- template = TemplatePage.new(@config.template(:body), @config.template(:error))
- values["wiki_title"] = "#{self.message[:error]} - #{@config.title}"
- values["name"] = error[:name]
- values["backtrace"] = error[:backtrace]
- values["backtrace_email"] = error[:backtrace].gsub(/<br \/>/, '')
- values["webmaster"] = @config.webmaster
- end
-
- template.process(@rendered_page, values, @config.message)
- end
-
- # Outputs the page.
- def output
- @response.add_header("Content-type", "text/html")
- @response.add_header("Cache-Control", "max_age=0")
- @response.write_headers
- @response << @rendered_page
- end
-
- # nil if string is invalid
- def validate_search_string(instr)
- return nil if instr.empty?
-
- modstr = instr.dup
-
- #TODO: add validation of modstr
- return modstr
- end
-
-private
- RE_ACTION = %r{^_([[:lower:]]+)$}
-
- def set_page_name_or_action(item)
- action = RE_ACTION.match(item)
- if action
- @action = action.captures[0]
- else
- @topic = item
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend.rb
deleted file mode 100644
index 879d147..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend.rb
+++ /dev/null
@@ -1,306 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'diff/lcs'
-
-class Ruwiki
- # The list of known backends.
- KNOWN_BACKENDS = [:flatfiles, :yaml, :marshal]
-
- # The Ruwiki backend delegator. Ruwiki will always instantiate a version
- # of this class which delegates the actual method execution to the Backend
- # class. Error handling is handled by capturing (and possibly forwarding)
- # exceptions raised by the delegate class.
- class BackendDelegator
- def initialize(ruwiki, backend)
- @message = ruwiki.config.message
- @time_format = ruwiki.config.time_format || "%H:%M:%S"
- @date_format = ruwiki.config.date_format || "%Y.%m.%d"
- @datetime_format = ruwiki.config.datetime_format || "#{@date_format} #{@time_format}"
- options = ruwiki.config.storage_options
- options[:default_page] = ruwiki.config.default_page
-
- unless Ruwiki::KNOWN_BACKENDS.include?(backend)
- raise RuntimeError, @message[:backend_unknown] % [backend]
- end
-
- beconst = (befile = backend.id2name).capitalize
-
- require "ruwiki/backend/#{befile}"
-
- beoptions = options[backend]
- @delegate = Ruwiki::Backend.const_get(beconst).new(beoptions)
- rescue Ruwiki::Backend::BackendError => e
- if e.kind_of?(Array)
- raise Ruwiki::Backend::BackendError.new(nil), @message[e.reason[0]] % e.reason[1]
- else
- raise
- end
- end
-
- # Retrieve the specified topic and project page. Calls Backend#load
- # after verifying that the project exists.
- def retrieve(topic, project = 'Default')
- unless page_exists?(topic, project)
- exported = Ruwiki::Page::NULL_PAGE.dup
- exported['properties'] = {
- 'title' => topic,
- 'topic' => topic,
- 'project' => project,
- 'create-date' => Time.now,
- 'edit-date' => Time.now,
- 'editable' => true,
- 'indexable' => true,
- 'entropy' => 0.0,
- 'html-headers' => [],
- 'version' => 0
- }
- exported['page'] = {
- 'header' => nil,
- 'footer' => nil
- }
-
- if project_exists?(project)
- exported['page']['content'] = ""
- else
- exported['page']['content'] = @message[:project_does_not_exist] % [project]
- end
- return exported
- end
-
- return @delegate.load(topic, project)
- rescue Ruwiki::Backend::InvalidFormatError => e
- raise Ruwiki::Backend::BackendError.new(nil), @message[:page_not_in_backend_format] % [project, topic, @delegate.class]
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_read_topic] % [project, topic]
- rescue Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_retrieve_topic] % p
- end
-
- # Stores the specified topic and project page.
- def store(page)
- @delegate.store(page)
-
- # update change page
- begin
- recent_changes = nil
- if (page.topic == 'RecentChanges')
- recent_changes = page.dup
- else
- recent_changes = Page.new(retrieve('RecentChanges', page.project))
- end
-
- changeline = "\n; #{Time.now.strftime(@datetime_format)}, #{page.topic} : #{page.edit_comment}"
-
- # add changeline to top of page
- recent_changes.content = changeline + (recent_changes.content || "")
- @delegate.store(recent_changes)
- rescue Exception => e
- raise "Couldn't save RecentChanges\n#{e.backtrace}"
- end
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_store_topic] % [page.project, page.topic]
- rescue Exception => e
- p = [page.project, page.topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_store_topic] % p
- end
-
- # Destroys the specified topic and project page.
- def destroy(page)
- @delegate.destroy(page)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_destroy_topic] % [page.project, page.topic]
- rescue Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_destroy_topic] % p
- end
-
- # Releases the lock on the page.
- def release_lock(page, address = 'UNKNOWN')
- @delegate.release_lock(page, address)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_release_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:error_releasing_lock] % p
- end
-
- # Attempts to obtain a lock on the page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- @delegate.obtain_lock(page, address, timeout)
- rescue Ruwiki::Backend::BackendError
- raise Ruwiki::Backend::BackendError.new(nil), @message[:cannot_obtain_lock] % [page.project, page.topic]
- rescue Errno::EACCES, Exception => e
- p = [project, topic, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:error_creating_lock] % p
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- @delegate.project_exists?(project)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- @delegate.page_exists?(topic, project)
- end
-
- # Attempts to create the project.
- def create_project(project)
- @delegate.create_project(project)
- rescue Ruwiki::Backend::ProjectExists => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:project_already_exists] % [project]
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_create_project] % [project]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_create_project] % p
- end
-
- # Attempts to destroy the project.
- def destroy_project(project)
- @delegate.destroy_project(project)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_to_destroy_project] % [project]
- rescue Exception => e
- p = [project, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_destroy_project] % p
- end
-
- def search_all_projects(searchstr)
- if @delegate.respond_to?( :search_all_projects )
- return @delegate.search_all_projects(searchstr)
- end
-
- search_all_projects_default(searchstr)
- end
-
- # Attempts to search all projects.
- # this is the default search_all_projects used unless the delegate implements
- # a specialized search_all_projects
- def search_all_projects_default(searchstr)
- hits = {}
- list_projects.each do |project|
- lhits = search_project(project, searchstr)
- # Transform the keys from project local to global links.
- lhits.each { |key, val| hits["#{project}::#{key}"] = val }
- end
- hits
- end
-
- # Attempts to search a project
- def search_project(project, searchstr)
- #TODO: Validate searchstr is a safe regexp?
- @delegate.search_project(project, searchstr)
- rescue Exception => e
- p = [project, searchstr, e.class, %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:search_project_fail] % p
- end
-
- # Return an array of projects
- def list_projects
- @delegate.list_projects
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_list_projects]
- rescue Exception => e
- p = ['', %Q~#{e}<br />\n#{e.backtrace.join('<br />\n')}~]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_list_projects] % p
- end
-
- # Return an array of projects
- def list_topics(projname)
- @delegate.list_topics(projname)
- rescue Errno::EACCES => e
- raise Ruwiki::Backend::BackendError.new(e), @message[:no_access_list_topics] % [projname]
- rescue Exception => e
-# p = [projname, %Q~#{e.mes}<br />\n#{e.backtrace.join('<br />\n')}~]
- p = [projname, e.message]
- raise Ruwiki::Backend::BackendError.new(e), @message[:cannot_list_topics] % p
- end
- end
-
- # The Ruwiki backend abstract class and factory.
- class Backend
- class ProjectExists < RuntimeError #:nodoc:
- end
- class InvalidFormatError < RuntimeError #:nodoc:
- end
- class BackendError < RuntimeError #:nodoc:
- attr_reader :reason
-
- def initialize(reason, *args)
- if @reason.respond_to?(:message)
- @reason = reason.message
- else
- @reason = reason
- end
- end
- end
- def initialize(storage_options)
- end
-
- private
- NL_RE = %r{\n} #:nodoc:
-
- def map_diffset(diffset)
- diffset.map do |hunk|
- if hunk.kind_of?(Array)
- hunk.map { |change| change.to_a }
- else
- hunk.to_a
- end
- end
- end
-
- # Creates the current diff object. This is made from two
- # Ruwiki::Page#export hashes.
- def make_diff(oldpage, newpage)
- oldpage = oldpage.export if oldpage.kind_of?(Ruwiki::Page)
- newpage = newpage.export if newpage.kind_of?(Ruwiki::Page)
-
- diff = Hash.new
-
- newpage.keys.sort.each do |sect|
- newpage[sect].keys.sort.each do |item|
- oldval = oldpage[sect][item]
- newval = newpage[sect][item]
-
- case [sect, item]
- when ['properties', 'html-headers']
- # Protect against NoMethodError.
- oldval ||= []
- newval ||= []
- val = Diff::LCS.sdiff(oldval, newval, Diff::LCS::ContextDiffCallbacks)
- when ['ruwiki', 'content-version'], ['properties', 'version'],
- ['properties', 'entropy']
- val = Diff::LCS.sdiff([oldval], [newval], Diff::LCS::ContextDiffCallbacks)
- when ['properties', 'create-date'], ['properties', 'edit-date']
- val = Diff::LCS.sdiff([oldval.to_i], [newval.to_i], Diff::LCS::ContextDiffCallbacks)
- else
- # Protect against NoMethodError.
- val = Diff::LCS.sdiff(oldval.to_s.split(NL_RE), newval.to_s.split(NL_RE), Diff::LCS::ContextDiffCallbacks)
- end
-
- (diff[sect] ||= {})[item] = map_diffset(val) unless val.nil? or val.empty?
- end
- end
-
- diff_hash = {
- 'old_version' => oldpage['properties']['version'],
- 'new_version' => newpage['properties']['version'],
- 'edit-date' => newpage['properties']['edit-date'].to_i,
- 'editor-ip' => newpage['properties']['editor-ip'],
- 'editor' => newpage['properties']['editor'],
- 'diff' => diff
- }
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/_corefiles.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/_corefiles.rb
deleted file mode 100644
index f090de8..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/_corefiles.rb
+++ /dev/null
@@ -1,193 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # Provides common functionality for flatfile support, regardless of the
- # format.
-module Ruwiki::Backend::CoreFiles
- # Initializes the [flat-file] backend. The known options for
- # [flat-file] backends are documented below.
- #
- # :data_path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # :default_page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- @data_path = options[:data_path] || File.join(".", "data")
-
- @extension = options[:extension]
- if @extension.nil?
- @extension_re = /$/
- else
- @extension_re = /\.#{@extension}$/
- end
-
- @default_page = options[:default_page] || "ProjectIndex"
- if not (File.exists?(@data_path) and File.directory?(@data_path))
- raise Ruwiki::Backend::BackendError.new([:flatfiles_no_data_directory, [@data_path]])
- end
-
- super
- end
-
- # Destroys the topic page.
- def destroy(page)
- pf = page_file(page.topic, page.project)
- File.unlink(pf) if File.exists?(pf)
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- pd = project_directory(project)
- File.exists?(pd) and File.directory?(pd)
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- pf = page_file(topic, project)
- project_exists?(project) and File.exists?(pf)
- end
-
- # Tries to create the project.
- def create_project(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::ProjectExists if File.exists?(pd)
- Dir.mkdir(pd)
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # String search all topic names and content in a project and
- # return a hash of topic hits.
- def search_project(project, searchstr)
- re_search = Regexp.new(searchstr, Regexp::IGNORECASE)
-
- hits = Hash.new { |h, k| h[k] = 0 }
- topic_list = list_topics(project)
-
- return hits if topic_list.empty?
-
- # search topic content
- topic_list.each do |topic|
- # search name
- hits[topic] += topic.scan(re_search).size
-
- # check content
- page = load(topic, project) rescue Ruwiki::Page::NULL_PAGE
- page['page'].each_value do |item|
- item = item.join("") if item.kind_of?(Array)
- item ||= ""
- hits[topic] += item.scan(re_search).size
- end
- end
-
- hits
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
- time = Time.now.to_i
-
- lock_okay = false
- # See if we have the lock already.
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, we don't care how old it
- # is. Thus, release it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lock_okay = true
- end
-
- if lock_okay
- open(lf, 'w') { |lfh| lfh.puts "#{address}\n#{time + timeout}" }
- else
- raise Ruwiki::Backend::BackendError(nil)
- end
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- pf = page_file(page.topic, page.project)
- lf = "#{pf}.lock"
- time = Time.now.to_i
-
- lock_okay = false
- if File.exists?(lf)
- data = File.readlines(lf)
- # If the lock belongs to this address, then we can safely remove
- # it.
- lock_okay ||= (data[0].chomp == address)
- # If the lock is older than 10 minutes, release it.
- lock_okay ||= (data[1].to_i < time)
- else
- lock_okay = true
- end
-
- if lock_okay
- File.unlink(lf) if File.exists?(lf)
- else
- raise Ruwiki::Backend::BackendError.new(nil)
- end
- end
-
- # list projects found in data path
- def list_projects
- Dir[File.join(@data_path, "*")].select do |d|
- File.directory?(d) and File.exist?(page_file(@default_page, File.basename(d)))
- end.map { |d| File.basename(d) }
- end
-
- # list topics found in data path
- def list_topics(project)
- pd = project_directory(project)
- raise Ruwiki::Backend::BackendError.new(:no_project) unless File.exist?(pd)
-
- Dir[File.join(pd, "*")].select do |f|
- f !~ /\.rdiff$/ and f !~ /\.lock$/ and File.file?(f) and f =~ @extension_re
- end.map { |f| File.basename(f).sub(@extension_re, "") }
- end
-
- def project_directory(project) # :nodoc:
- File.join(@data_path, project)
- end
-
- def page_file(topic, project = 'Default') # :nodoc:
- if @extension.nil?
- File.join(project_directory(project), topic)
- else
- File.join(project_directory(project), "#{topic}.#{@extension}")
- end
- end
-
- def make_rdiff(page_file, new_page)
- diff_file = "#{page_file}.rdiff"
-
- old_page = self.class.load(pf) rescue Ruwiki::Page::NULL_PAGE
-
- diffs = []
- File.open(diff_file, 'rb') { |f| diffs = Marshal.load(f) } if File.exists?(diff_file)
- diffs << make_diff(old_page, new_page)
- changes = Marshal.dump(diffs)
-
- File.open(diff_file, 'wb') { |f| f << changes }
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/flatfiles.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/flatfiles.rb
deleted file mode 100644
index f341ecb..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/flatfiles.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-require 'ruwiki/backend/_corefiles'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Flatfiles < Ruwiki::Backend
- include Ruwiki::Backend::CoreFiles
-
- # Initializes the Flatfiles backend. The known options are known for
- # Flatfiles:
- #
- # :data_path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # :default_page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- super
- end
-
- # Provides a HEADER marker.
- # Loads the topic page from disk.
- def load(topic, project)
- page = Ruwiki::Page::NULL_PAGE.dup
- hash = Ruwiki::Exportable.load(File.read(page_file(topic, project)))
- hash.each_key { |ss| hash[ss].each { |ii, vv| page[ss][ii] = vv } }
- page
- rescue Ruwiki::Exportable::InvalidFormatError
- raise Ruwiki::Backend::InvalidFormatError
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = Ruwiki::Exportable.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |f| f.puts newpage }
- end
-
- # Destroys the topic page.
- def destroy(page)
- super
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- super
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- super
- end
-
- # Tries to create the project.
- def create_project(project)
- super
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- super
- end
-
- # String search all topic names and content in a project and
- # return a has of topic hits
- def search_project(project, searchstr)
- super
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- super
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- super
- end
-
- # list projects found in data path
- def list_projects
- super
- end
-
- # list topics found in data path
- def list_topics(project)
- super
- end
-
-# class << self
-# NL_RE = /\n/
-
-# def dump(page_hash)
-# dumpstr = ""
-
-# page_hash.keys.sort.each do |sect|
-# page_hash[sect].keys.sort.each do |item|
-# val = page_hash[sect][item].to_s.split(NL_RE).join("\n\t")
-# dumpstr << "#{sect}!#{item}:\t#{val}\n"
-# end
-# end
-
-# dumpstr
-# end
-
-# def load(buffer)
-# page = Ruwiki::Page::NULL_PAGE.dup
-# return page if buffer.empty?
-
-# buffer = buffer.split(NL_RE)
-
-# if HEADER_RE.match(buffer[0]).nil?
-# raise Ruwiki::Backend::InvalidFormatError
-# end
-
-# sect = item = nil
-#
-# buffer.each do |line|
-# line.chomp!
-# match = HEADER_RE.match(line)
-
-# # If there is no match, add the current line to the previous match.
-# # Remove the leading \t, though.
-# if match.nil?
-# raise Ruwiki::Backend::InvalidFormatError if FIRST_TAB.match(line).nil?
-# page[sect][item] << "\n#{line.gsub(FIRST_TAB, '')}"
-# else
-# sect = match.captures[0]
-# item = match.captures[1]
-# page[sect][item] = match.captures[2]
-# end
-# end
-
-# page
-# end
-# end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/marshal.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/marshal.rb
deleted file mode 100644
index 4b99610..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/marshal.rb
+++ /dev/null
@@ -1,109 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/backend/_corefiles'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Marshal < Ruwiki::Backend
- include Ruwiki::Backend::CoreFiles
-
- # Initializes the Marshal backend. The known options are known for Marshal:
- #
- # :data_path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # :default_page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- super
- end
-
- # Loads the topic page from disk.
- def load(topic, project)
- Ruwiki::Backend::Marshal.load(File.read(page_file(topic, project)))
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = Ruwiki::Backend::Marshal.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |f| f.print newpage }
- end
-
- # Destroys the topic page.
- def destroy(page)
- super
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- super
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- super
- end
-
- # Tries to create the project.
- def create_project(project)
- super
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- pd = project_directory(project)
- Dir.rmdir(pd) if File.exists?(pd) and File.directory?(pd)
- end
-
- # String search all topic names and content in a project and return a
- # has of topic hits
- def search_project(project, searchstr)
- super
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- super
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- super
- end
-
- # list projects found in data path
- def list_projects
- super
- end
-
- # list topics found in data path
- def list_topics(project)
- super
- end
-
- class << self
- def dump(page_hash)
- ::Marshal.dump(page_hash)
- end
-
- def load(buffer)
- ::Marshal.load(buffer)
- rescue TypeError
- raise Ruwiki::Backend::InvalidFormatError
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/yaml.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/yaml.rb
deleted file mode 100644
index 9b10c7c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/backend/yaml.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/backend/_corefiles'
-require 'yaml'
-
- # Stores Ruwiki pages as flatfiles.
-class Ruwiki::Backend::Yaml < Ruwiki::Backend
- include Ruwiki::Backend::CoreFiles
-
- # Initializes the Yaml backend. The known options are known for Yaml:
- #
- # :data_path:: The directory in which the wiki files will be found. By
- # default, this is "./data/"
- # :extension:: The extension of the wiki files. By default, this is
- # +nil+ in the backend.
- # :default_page:: The default page for a project. By default, this is
- # ProjectIndex. This is provided only so that the backend
- # can make reasonable guesses.
- def initialize(options)
- raise Ruwiki::Backend::BackendError.new(:yaml_requires_182_or_higher) unless RUBY_VERSION >= "1.8.2"
- super
- end
-
- # Loads the topic page from disk.
- def load(topic, project)
- Ruwiki::Backend::Yaml.load(File.read(page_file(topic, project)))
- end
-
- # Saves the topic page -- and its difference with the previous version
- # -- to disk.
- def store(page)
- pagefile = page_file(page.topic, page.project)
- export = page.export
- newpage = Ruwiki::Backend::Yaml.dump(export)
- make_rdiff(pagefile, export)
-
- File.open(pagefile, 'wb') { |f| f.puts newpage }
- end
-
- # Destroys the topic page.
- def destroy(page)
- super
- end
-
- # Checks to see if the project exists.
- def project_exists?(project)
- super
- end
-
- # Checks to see if the page exists.
- def page_exists?(topic, project = 'Default')
- super
- end
-
- # Tries to create the project.
- def create_project(project)
- super
- end
-
- # Tries to destroy the project.
- def destroy_project(project)
- super
- end
-
- # String search all topic names and content in a project and return a
- # has of topic hits
- def search_project(project, searchstr)
- super
- end
-
- # Attempts to obtain a lock on the topic page.
- def obtain_lock(page, address = 'UNKNOWN', timeout = 600)
- super
- end
-
- # Releases the lock on the topic page.
- def release_lock(page, address = 'UNKNOWN')
- super
- end
-
- # list projects found in data path
- def list_projects
- super
- end
-
- # list topics found in data path
- def list_topics(project)
- super
- end
-
- class << self
- def dump(page_hash)
- ::YAML.dump(page_hash)
- end
-
- def load(buffer)
- ::YAML.load(buffer)
- rescue ArgumentError
- raise Ruwiki::Backend::InvalidFormatError
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/config.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/config.rb
deleted file mode 100644
index 1ac3942..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/config.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # Ruwiki configuration.
-class Ruwiki::Config
- include Ruwiki::Exportable
-
- exportable_group 'ruwiki-config'
- # Sets or returns the logger. The logger, if set, must respond to the same
- # methods as WEBrick::Logger.
- attr_accessor :logger
- # Sets or returns the time format whenever time is outputted in Ruwiki.
- # Default is <tt>%H:%M:%S</tt> (23:59:59).
- attr_accessor :time_format
- exportable :time_format
- # Sets or returns the date format whenever time is outputted in Ruwiki.
- # Default is <tt>%Y.%m.%d</tt> (2004.08.04).
- attr_accessor :date_format
- exportable :date_format
- # Sets or returns the date-time format whenever time is outputted in
- # Ruwiki. Default is <tt>%Y.%m.%d %H:%M:%S</tt> (2004.08.04 23:59:59).
- attr_accessor :datetime_format
- exportable :datetime_format
- # Adds additional information to the (rare) error reports. Defaults to
- # +false+.
- attr_accessor :debug
- exportable :debug
- # The default page for display when Ruwiki is called without any arguments.
- # Defaults to +ProjectIndex+
- attr_accessor :default_page
- exportable :default_page
- # The default project for display when Ruwiki is called without any
- # arguments or a project specification. Defaults to +Default+
- attr_accessor :default_project
- exportable :default_project
- # The storage type as a Symbol. Corresponds to a filename that will be
- # found in ruwiki/backend. In this version of Ruwiki, versions for handling
- # three different types of flat files will be found. The canonical default
- # format is YAML (:yaml). Also supported in this version is :flatfiles (the
- # old flatfile format with some additions), and a format based on
- # Marshal::Dump (:marshal).
- attr_accessor :storage_type
- exportable :storage_type
- # The options for the specified storage type. This is a hash of hashes with
- # auto-vifification. See the storage type for available options.
- attr_reader :storage_options
- exportable :storage_options
- # The path for templates. Defaults to <tt>./templates/</tt>.
- attr_accessor :template_path
- exportable :template_path
- # The name of the Wiki. Defaults to <tt>ruwiki</tt>
- attr_accessor :title
- exportable :title
- # The email address of the webmaster for the Wiki. Defaults to +nil+.
- attr_accessor :webmaster
- exportable :webmaster
- # The name of the Ruwiki CSS file. Defaults to <tt>ruwiki.css</tt>.
- attr_accessor :css
- exportable :css
- # The template set. Templates are always named as
- # <template_path>/<template_set>/<template_name>. Template filename. Must
- # be reachable by File#read.
- attr_accessor :template_set
- exportable :template_set
- # Ruwiki is internationalized. This method sets the Ruwiki error messages
- # (and a few other messages) )to the specified language Module. The
- # language Module must have a constant Hash called +Message+ containing a
- # set of symbols and localized versions of the messages associated with
- # them.
- #
- # If the file 'ruwiki/lang/es.rb' contains the module
- # <tt>Ruwiki::Lang::ES</tt>, the error messages for RSS could be localized
- # to Espańol thus:
- #
- # require 'ruwiki/lang/es'
- # ...
- # wiki.config.language = Ruwiki::Lang::ES
- #
- # Localization is per wiki instance. In a servlet environment, this may
- # mean that only a single language is recognised.
- #
- # See Ruwiki::Lang::EN for more information.
- attr_accessor :language
- exportable :language
- # The message hash.
- attr_reader :message
-
- def language=(l) #:nodoc:
- @language = l
- @message = l::Message
- end
-
- # Returns the specified template as a string.
- def template(name)
- File.read(File.join(@template_path, @template_set, "#{name.to_s}.tmpl"))
- rescue Errno::ENOENT
- raise ConfigError, message[:no_template_found] % [name.inspect, @template_set]
- end
-
- # Returns the CSS stylesheet content for the Wiki. This previously
- # returned the <link> to the stylesheet, but instead returns a <style>
- # block in the head so that the CSS is kept with the template set, which
- # may be kept outside of the HTML area.
- def css_link
- %Q[<style type="text/css" media="screen,print">#{File.read(File.join(@template_path, @template_set, @css))}</style>]
- end
-
- # Creates a new configuration object.
- def initialize
- @debug = false
- @default_project = "Default"
- @default_page = "ProjectIndex"
- @storage_type = :yaml
- @storage_options = Hash.new { |h, k| h[k] = {} }
- @template_path = "./templates/"
- @template_set = "default"
- @css = "ruwiki.css"
- @webmaster = nil
- @title = "Ruwiki"
- @time_format = "%H:%M:%S"
- @date_format = "%Y.%m.%d"
- @datetime_format = "#{@date_format} #{@time_format}"
-
- self.language = Ruwiki::Lang::EN
- end
-
- # Verifies that required configuration options are actually set. Right
- # now, it only checks the values that are defaulted to +nil+.
- def verify
- raise ConfigError, message[:no_webmaster_defined] if @webmaster.nil?
- raise ConfigError, message[:invalid_template_dir] % [@template_path] unless File.exists?(@template_path) and File.directory?(@template_path)
- t = File.join(@template_path, @template_set)
- raise ConfigError, message[:no_template_set] % [@template_set] unless File.exists?(t) and File.directory?(t)
- end
-
- # Provides the canonical export hash.
- def export
- super
- end
-
- class ConfigError < StandardError; end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/exportable.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/exportable.rb
deleted file mode 100644
index 9cafb13..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/exportable.rb
+++ /dev/null
@@ -1,105 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
- # Adds a class method to mark methods exportable.
-module Ruwiki::Exportable
- class InvalidFormatError < RuntimeError; end
-
- class << self
- def append_features(mod)
- super
-
- class << mod
- attr_reader :__exportables
-
- define_method(:exportable_group) do |name|
- @__exportable_group = name || 'default'
- end
-
- define_method(:exportable) do |*symset|
- symbol = symset.shift
- options = symset.shift || {}
-
- @__exportables ||= {}
-
- options[:name] ||= symbol.to_s.gsub(/_/, '-')
- options[:group] ||= @__exportable_group || 'default'
-
- @__exportables[options[:group]] ||= {}
- @__exportables[options[:group]][options[:name]] = "@#{symbol.to_s}".intern
- end
- end
- end
-
- NL_RE = /\n/
- HEADER_RE = /^([a-z][-a-z]+)!([a-z][-a-z]+):\t(.*)$/
- FIRST_TAB = /^\t/
-
-
- def dump(export_hash)
- dumpstr = ""
-
- export_hash.keys.sort.each do |sect|
- export_hash[sect].keys.sort.each do |item|
- val = export_hash[sect][item].to_s.split(NL_RE).join("\n\t")
- dumpstr << "#{sect}!#{item}:\t#{val}\n"
- end
- end
-
- dumpstr
- end
-
- def load(buffer)
- hash = {}
- return hash if buffer.empty?
-
- buffer = buffer.split(NL_RE)
-
- if HEADER_RE.match(buffer[0]).nil?
- raise Ruwiki::Exportable::InvalidFormatError
- end
-
- sect = item = nil
-
- buffer.each do |line|
- line.chomp!
- match = HEADER_RE.match(line)
-
- # If there is no match, add the current line to the previous match.
- # Remove the leading \t, though.
- if match.nil?
- raise Ruwiki::Exportable::InvalidFormatError if FIRST_TAB.match(line).nil?
- hash[sect][item] << "\n#{line.gsub(FIRST_TAB, '')}"
- else
- sect = match.captures[0]
- item = match.captures[1]
- hash[sect] ||= {}
- hash[sect][item] = match.captures[2]
- end
- end
-
- hash
- end
- end
-
- def export
- sym = {}
-
- self.class.__exportables.each do |group, gval|
- gname = group || @__exportable_group || 'default'
- gsym = {}
- gval.each { |name, nval| gsym[name] = self.instance_variable_get(nval) }
- sym[gname] = gsym
- end
-
- sym
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/handler.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/handler.rb
deleted file mode 100644
index e31bbc1..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/handler.rb
+++ /dev/null
@@ -1,207 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Handler
- class << self
- # Generate a new Handler pair from a CGI request.
- def from_cgi(cgi, output_stream = $stdout)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::CGIRequest.new(cgi)
- o.response = Ruwiki::Handler::CGIResponse.new(cgi, output_stream)
- end
- end
-
- # Generate a new Handler pair from a WEBrick request.
- def from_webrick(req, res)
- Ruwiki::Handler.new do |o|
- o.request = Ruwiki::Handler::WEBrickRequest.new(req)
- o.response = Ruwiki::Handler::WEBrickResponse.new(res)
- end
- end
- end
-
- # Returns the handler's request object.
- attr_accessor :request
- # Returns the handler's response object.
- attr_accessor :response
-
- # Creates the handler pair.
- def initialize(&block) #:yields: self
- @request = nil
- @response = nil
- yield self if block_given?
- end
-
- # REpresents an abstract incoming request. This insulates the rest of
- # the code from knowing whether parameters are passed as part of the
- # path, as parameters in the URL, or in some other fashion.
- class AbstractRequest
- def initialize(*args)
- end
- end
-
- # Handles all requests from web applications.
- #
- # Subclasses should provide:
- # @parameters:: Hash-like object that responds to #[] and #hash_key?]
- # @environment:: Hash-like object that responds to #[]
- class AbstractWebRequest < AbstractRequest
- # The parameters provided via the web request.
- attr_reader :parameters
- # The environment provided to the web request.
- attr_reader :environment
- # The request path.
- attr_reader :path
-
- # Yields each parameter key in succession.
- def each_parameter #:yields: key, value
- @parameters.each { |k, v| yield k, v }
- end
-
- def each_environment #:yields: key, value
- @environment.each { |k, v| yield k, v }
- end
-
- # Return the URL of our server.
- def server_url
- res = "http://" # should detect whether we're in secure server mode.
- if @environment['HTTP_HOST']
- res << @environment['HTTP_HOST']
- else
- res << "#{@environment['SERVER_NAME']}:#{@environment['SERVER_PORT']}"
- end
- end
-
- # Return the URL of this script.
- def script_url
- server_url << @environment['SCRIPT_NAME'].to_s
- end
-
- # Return the URL of this request.
- def request_url
- res = script_url
- res << @environment['PATH_INFO'] if @environment['PATH_INFO']
- query = @environment['QUERY_STRING']
- res << "?#{@environment['QUERY_STRING']}" if query && !query.empty?
- res
- end
-
- # Convert a file path into a URL
- def make_url(project, path)
- "#{server_url}/#{project}/#{path}"
- end
-
- def determine_request_path
- @path = ""
- return @path if @environment['PATH_INFO'].nil?
- @path = @environment['PATH_INFO'].dup
- end
- end
-
- # Request for CGI-based activity to ruwiki.
- class CGIRequest < AbstractWebRequest
- def initialize(cgi, output_stream = $stdout)
- @environment = ENV
- @cgi = cgi
- @parameters = {}
- cgi.params.each { |k, v| @parameters[k] = v[0] }
- super
- end
- end
-
- # Request for WEBrick based servlet activity to ruwiki.
- class WEBrickRequest < AbstractWebRequest
- def initialize(req)
- @environment = req.meta_vars
- @parameters = req.query
- super
- end
- end
-
- # Used to write responses in different execution environments such as
- # CGI and Webrick.
- #
- # If you want to create a new response object, you'll need to implement
- # #add_header, #write_headers, and #<<.
- #
- # The Response object is instantiated with an output stream which must
- # supply +<<+ and +puts+ methods.
- class AbstractResponse
- # Add to the list of headers to be sent back to the client.
- def add_header(key, value)
- raise "Not implemented"
- end
-
- # Write the accumulated headers back to the client.
- def write_headers
- raise "Not implemented"
- end
-
- # Write the string to the client.
- def <<(string)
- raise "Not implemented"
- end
-
- # output_stream must respond to #<< and #puts.
- def initialize(output_stream = $stdout)
- @headers = {}
- @output_stream = output_stream
- end
- end
-
- # CGIResponse is the response object for CGI mode.
- class CGIResponse < AbstractResponse
- # output_stream must respond to #<< and #puts.
- def initialize(cgi, output_stream = $stdout)
- @cgi = cgi
- super(output_stream)
- end
-
- # Add the header pair for later output as a CGI header.
- def add_header(key, value)
- @headers[key] = value
- end
-
- # Write the headers to the stream. The headers can only be written
- # once.
- def write_headers
- return if @written
- @headers.each { |key, value| @output_stream.puts "#{key}: #{value}\r\n" }
- @output_stream.puts
- @written = true
- end
-
- # Output the string to the stream provided.
- def <<(string)
- @output_stream << string
- end
- end
-
- # WEBrickResponse is the response object for WEBrick servlet mode.
- class WEBrickResponse < AbstractResponse
- def initialize(webrick_response)
- @response = webrick_response
- end
-
- def add_header(key,value)
- @response[key] = value
- end
-
- def write_headers
- # Webrick will take care of this on its own.
- end
-
- def <<(string)
- @response.body << string
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/de.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/de.rb
deleted file mode 100644
index 7fb7b3b..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/de.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Translation by Christian Neukirchen (chneukirchen@yahoo.de) on 22oct2003
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::DE is the German-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module DE
- Message = Hash.new { |h, k| h[k] = "Sprachdatei-FEHLER: Unbekannter Nachrichten-Typ #{k.inspect}."; h[k] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Unbekanntes Backend %s.",
- :cannot_create_project => "Kann %s nicht erstellen: %s",
- :cannot_destroy_project => "Kann %s nicht zerstören: %s",
- :cannot_destroy_topic => "Kann %s::%s nicht zerstören: %s",
- :cannot_obtain_lock => "Kann keine Sperre für %s::%s erhalten. Bitte in Kürze nochmal versuchen.",
- :cannot_release_lock => "Kann die Sperre für %s::%s nicht lösen. Bitte später nochmal versuchen.",
- :cannot_retrieve_topic => "Kann auf %s::%s nicht zugreifen: %s",
- :cannot_store_topic => "Kann %s::%s nicht speichern: %s",
- :error_creating_lock => "Fehler beim Erzeugen der Sperre von %s::%s: %s",
- :error_releasing_lock => "Fehler beim Lösen der Sperre von %s::%s: %s",
- :flatfiles_no_data_directory => "Das Daten-Verzeichnis (%s) existiert nicht.",
- :no_access_to_create_project => "Keine Berechtigung um das Projekt (%s) zu erstellen.",
- :no_access_to_destroy_project => "Keine Berechtigung um das Projekt (%s) zu zerstören.",
- :no_access_to_destroy_topic => "Kann %s::%s nicht zerstören: %s.",
- :no_access_to_read_topic => "Kann auf %s::%s nicht zugreifen: %s.",
- :no_access_to_store_topic => "Kann %s::%s nicht speichern: %s.",
- :project_already_exists => "Das Projekt %s existiert bereits.",
- :project_does_not_exist => "Das Projekt %s existiert nicht.",
- :no_access_list_projects => "Keine Berechtigung um das Projektliste",
- :no_access_list_topics => "Keine Berechtigung um das Themaliste (%s).",
- :search_project_fail => "Suchprojektausfallen %s Zeichenkette %s",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Die Konfiguration muss von Typ der Klasse Ruwiki::Config sein.",
- :invalid_template_dir => "Der angegebene Pfad für Schablonen (%s) existiert nicht oder ist kein Verzeichnis.",
- :no_template_found => "Keine Schablone %s im Schablonen-Set '%s' gefunden.",
- :no_template_set => "Es gibt kein Schablonen-Set '%s' im Schablonen-Pfad.",
- :no_webmaster_defined => "Konfigurations-Fehler: Webmaster nicht definiert.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fataler Fehler",
- :editing => "Editieren",
- :error => "Fehler",
- :invalid_path_info_value => "Fataler Fehler in der Web-Umgebung. PATH_INFO = %s",
- # Should this really get translated? --chris
- :render_arguments => "Ruwiki#render muss mit zwei oder mehr Argumenten aufgerufen werden.",
- :unknown_feature => "Unbekanntes Feature %s.",
-
- # Labels
- :label_search_project => "SuchcProjeckt",
- :label_search_all => "Alles",
- :label_search => "Suchc: ",
- :label_project => "Projekt: ",
- :label_topic => "Thema: ",
- :label_edit => "Edit",
- :label_recent_changes => "Neue Änderungen",
- :label_topics => "Themaliste",
- :label_projects => "ProjektListe",
- :label_editing => "Editieren",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Redigieren Sie Anmerkung: ",
- :label_comment_accelerator => "R",
- :label_save => "Außer",
- :label_save_accelerator => "A",
- :label_cancel => "Löschen",
- :label_cancel_accelerator => "L",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Ursprüngliche Version",
- :label_raw => "Formatfreie",
- :label_formatted => "Formatierte",
- :label_send_report_by => "Schicken Sie dem webmaster einen Report durch email.",
- :label_send_report => "Schicken Report.",
- :label_saved_page => "Gespeicherte Seite: ",
- }
- message.each { |k, v| Message[k] = v }
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/en.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/en.rb
deleted file mode 100644
index f58e780..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/en.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::EN is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module EN
- Message = Hash.new { |h, k| h[k] = "Language ERROR: Unknown message key #{k.inspect}."; h[k] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Backend %s is unknown.",
- :cannot_create_project => "Cannot create project %s: %s",
- :cannot_destroy_project => "Cannot destroy project %s: %s",
- :cannot_destroy_topic => "Cannot destroy %s::%s: %s",
- :cannot_obtain_lock => "Unable to obtain a lock on %s::%s. Try again shortly.",
- :cannot_release_lock => "Unable to release the lock on %s::%s. Try again shortly.",
- :cannot_retrieve_topic => "Cannot retrieve %s::%s: %s",
- :cannot_store_topic => "Cannot store %s::%s: %s",
- :cannot_list_topics => "Cannot list topics for project %s: %s",
- :error_creating_lock => "Error creating lock on %s::%s: %s",
- :error_releasing_lock => "Error releasing lock on %s::%s: %s",
- :flatfiles_no_data_directory => "The data directory (%s) does not exist.",
- :no_access_list_projects => "No permission to list projects.",
- :no_access_list_topics => "No permission to list topics in project %s.",
- :no_access_to_create_project => "No permission to create project %s.",
- :no_access_to_destroy_project => "No permission to destroy project %s::%s.",
- :no_access_to_destroy_topic => "No permission to destroy topic %s::%s.",
- :no_access_to_read_topic => "No permission to retrieve the %s::%s.",
- :no_access_to_store_topic => "No permission to store the %s::%s.",
- :page_not_in_backend_format => "%s::%s is not in the format supported by the backend %s.",
- :project_already_exists => "Project %s already exists.",
- :project_does_not_exist => "Project %s does not exist.",
- :search_project_fail => "Failure searching project %s with string %s.",
- :yaml_requires_182_or_higher => "YAML flatfile support exists only for Ruby version 1.8.2 or higher.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "Configuration must be of class Ruwiki::Config.",
- :invalid_template_dir => "The specified path for templates (%s) does not exist or is not a directory.",
- :no_template_found => "No template of %s found in template set %s.",
- :no_template_set => "There is no template set '%s' in the template path.",
- :no_webmaster_defined => "Configuration error: Webmaster is unset.",
- # Miscellaneous messages.
- :complete_utter_failure => "Complete and Utter Failure",
- :editing => "Editing",
- :error => "Error",
- :invalid_path_info_value => "Something has gone seriously wrong with the web environment. PATH_INFO = %s",
- :render_arguments => "Ruwiki#render must be called with zero or two arguments.",
- :unknown_feature => "Unknown feature %s.",
- :topics_for_project => "Topics for Project ::%s",
- :project_topics_link => "(topics)",
- :wiki_projects => "Projects in %s",
- :no_projects => "No known projects.",
- :no_topics => "No topics in project %s.",
- :search_results_for => "= Search results for: %s",
- :number_of_hits => "%d Hits",
-
- # Labels
- :label_search_project => "Search Project",
- :label_search_all => "All",
- :label_search => "Search: ",
- :label_project => "Project: ",
- :label_topic => "Topic: ",
- :label_edit => "Edit",
- :label_recent_changes => "Recent Changes",
- :label_topics => "Topics",
- :label_projects => "Projects",
- :label_editing => "Editing",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Edit Comment: ",
- :label_comment_accelerator => "O",
- :label_save => "Save",
- :label_save_accelerator => "S",
- :label_cancel => "Cancel",
- :label_cancel_accelerator => "C",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Original Text",
- :label_raw => "Raw",
- :label_formatted => "Formatted",
- :label_send_report_by => "Send the Wiki maintainer a report by email.",
- :label_send_report => "Send report.",
- :label_saved_page => "Saved page: ",
- }
- message.each { |k, v| Message[k] = v }
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/es.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/es.rb
deleted file mode 100644
index 3249c18..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/lang/es.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (austin@halostatue.ca)
-# Mauricio Julio Fernández Pradier (batsman.geo@yahoo.com)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-module Ruwiki::Lang
- # Ruwiki::Lang::ES is the English-language output module. It contains a
- # hash, *Message*, that contains the messages that may be reported by
- # any method in the Ruwiki library. The messages are identified by a
- # Symbol.
- module ES
- Message = Hash.new { |h, k| h[k] = "ERROR De la Lengua: Llave desconocida del mensaje #{k.inspect}."; h[k] }
- message = {
- # The encoding for the webpages. This should match the encoding used
- # to create these messages.
- :charset_encoding => "iso-8859-15",
- # Backend-related messages.
- :backend_unknown => "Clase Backend desconocida: %s.",
- :cannot_create_project => "No puede crearse el proyecto %s: %s",
- :cannot_destroy_project => "No puede borrarse el proyecto %s: %s",
- :cannot_destroy_topic => "No puede borrarse %s::%s: %s",
- :cannot_obtain_lock => "Imposible obtener acceso exclusivo sobre %s::%s. Reinténtelo en breve.",
- :cannot_release_lock => "Imposible liberar acceso exclusivo sobre %s::%s. Reinténtelo en breve.",
- :cannot_retrieve_topic => "No puede leerse %s::%s: %s",
- :cannot_store_topic => "No puede archivarse %s::%s: %s",
- :error_creating_lock => "Error al crear el cerrojo sobre %s::%s: %s",
- :error_releasing_lock => "Error al liberar el cerrojo sobre %s::%s: %s",
- :flatfiles_no_data_directory => "El directorio de datos (%s) no existe.",
- :no_access_to_create_project => "Permiso denegado al crear el proyecto %s.",
- :no_access_to_destroy_project => "Permiso denegado al borrar el proyecto %s::%s.",
- :no_access_to_destroy_topic => "Permiso denegado al borrar el nodo %s::%s.",
- :no_access_to_read_topic => "Permiso denegado al leer el nodo %s::%s.",
- :no_access_to_store_topic => "Permiso denegado al salvar el nodo %s::%s.",
- :project_already_exists => "El proyecto %s ya existe.",
- :project_does_not_exist => "El proyecto %s no existe.",
- :no_access_list_projects => "Permiso denegado al lista del proyecto.",
- :no_access_list_topics => "Permiso denagado al lista del nodo, procecto: %s.",
- :search_project_fail => "Falta que busca proyecto %s con la secuencia %s.",
-
- # Config-related messages.
- :config_not_ruwiki_config => "La configuración debe ser de clase Ruwiki::Config.",
- :invalid_template_dir => "El path especificado para plantillas (%s) no existe o no es un directorio.",
- :no_template_found => "No se encontró ninguna plantilla para %s en el conjunto %s.",
- :no_template_set => "No hay ningún juego de plantillas '%s' en el path.",
- :no_webmaster_defined => "Error de configuración: Webmaster no está definido.",
- # Miscellaneous messages.
- :complete_utter_failure => "Fallo total y absoluto.",
- :editing => "Editando",
- :error => "Error",
- :invalid_path_info_value => "Algo huele a podrido en su entorno Web. PATH_INFO = %s",
- :render_arguments => "Ruwiki#render debe ser llamado con cero o dos argumentos.",
- :unknown_feature => "Clase Feature desconocida: %s.",
-
- # Labels
- :label_search_project => "Proyecto De la Búsqueda",
- :label_search_all => "<all>",
- :label_search => "Suchc: ",
- :label_project => "Proyecto: ",
- :label_topic => "Nodo: ",
- :label_edit => "Editar",
- :label_recent_changes => "Cambios Recientes",
- :label_topics => "Lista del Nodo",
- :label_projects => "Lista del Proyecto",
- :label_editing => "Editando",
- :label_text => "Text:",
- :label_text_accelerator => "T",
- :label_edit_comment => "Corrija el Commentario: ",
- :label_comment_accelerator => "O",
- :label_save => "Salvar",
- :label_save_accelerator => "S",
- :label_cancel => "Cancelar",
- :label_cancel_accelerator => "C",
- :label_preview => "Preview",
- :label_preview_accelerator => "P",
- :label_original_text => "Texto Original",
- :label_raw => "Version sin formato",
- :label_formatted => "Version con formato",
- :label_send_report_by => "Envie al admistrador de este sitio una notificación por correo electrónico.",
- :label_send_report => "Envie notificación.",
- :label_saved_page => "Página salvaguardada: ",
- }
- message.each { |k, v| Message[k] = v }
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/page.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/page.rb
deleted file mode 100644
index 165422b..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/page.rb
+++ /dev/null
@@ -1,259 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'ruwiki/exportable'
-
- # The page class for Ruwiki. The page defines the data and meta-data for a
- # page.
-class Ruwiki::Page
- include Ruwiki::Exportable
-
- exportable_group 'ruwiki'
- # Returns the content version of the page. If the page has a greater
- # content version than this version of Ruwiki does, we should probably
- # throw an exception, because attempting to save such a page will cause a
- # loss of data. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +content-version+
- attr_reader :content_version
- exportable :content_version
- # Returns the version of Ruwiki from which this page was generated.
- # Informational only. Immutable.
- #
- # Class:: +ruwiki+
- # ID:: +version+
- attr_reader :ruwiki_version
- exportable :ruwiki_version, :name => 'version'
-
- exportable_group 'properties'
- # Returns or sets the displayed title of the page, which may differ from
- # the topic of the page. As of Ruwiki 0.8.0, this is not currently used and
- # it may disappear.
- #
- # Class:: +properties+
- # ID:: +title+
- attr_accessor :title
- exportable :title
- # Returns or sets the topic of the page, which may differ from the title.
- # This is used to set the topic on a page being saved.
- #
- # Class:: +properties+
- # ID:: +topic+
- attr_accessor :topic
- exportable :topic
- # Returns or sets the project of the page, which may differ from the title.
- # This is used to set the project on a page being saved.
- #
- # Class:: +properties+
- # ID:: +project+
- attr_accessor :project
- exportable :project
- # Returns or sets the creator of the page. Unless we know the user (via a
- # cookie, not yet implemented in Ruwiki 0.8.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +creator+
- attr_accessor :creator
- exportable :creator
- # Returns or sets the creator's IP address. This should always be set. It
- # will have a value of "UNKNOWN" on the off-chance that something prevents
- # this from working.
- #
- # Class:: +properties+
- # ID:: +creator-ip+
- attr_accessor :creator_ip
- exportable :creator_ip
- # Returns or sets the date of creation.
- #
- # Class:: +properties+
- # ID:: +create-date+
- attr_accessor :create_date
- exportable :create_date
- # Returns or sets the last editor of the page. Unless we know the user (via
- # a cookie, not yet implemented in Ruwiki 0.8.0), this will be +nil+.
- #
- # Class:: +properties+
- # ID:: +editor+
- attr_accessor :editor
- exportable :editor
- # Returns or sets the last editor's IP address. This should always be set.
- # It will have a value of "UNKNOWN" on the off-chance that something
- # prevents this from working.
- #
- # Class:: +properties+
- # ID:: +editor-ip+
- attr_accessor :editor_ip
- exportable :editor_ip
- # Returns or sets the date of the last edit.
- #
- # Class:: +properties+
- # ID:: +edit-date+
- attr_accessor :edit_date
- exportable :edit_date
- # Indicates whether the page is editable. Non-editable pages are
- # effectively static pages.
- #
- # Class:: +properties+
- # ID:: +editable+
- attr_accessor :editable
- exportable :editable
- # Indicates whether the page is indexable. Non-indexable pages are
- # invisible to compliant web robots, and their links may not be followed.
- #
- # Class:: +properties+
- # ID:: +indexable+
- attr_accessor :indexable
- exportable :indexable
- # The current version of the page. The old version is always (#version -
- # 1).
- #
- # Class:: +properties+
- # ID:: +version+
- attr_accessor :version
- exportable :version
- # An array of complete tags that will appear in the HTML <HEAD> section.
- # Can be used to specify additional CSS, <META> tags, or even JavaScript on
- # a per-page basis. Currently unused.
- #
- # Class:: +properties+
- # ID:: +html-headers+
- attr_accessor :html_headers
- exportable :html_headers
- # The entropy of the page. This is a ratio of the number of lines changed
- # in the file vs. the total number of lines in the file. This value is
- # currently unused. (And, sad to say, I don't remember why I included it.
- # However, it's an interesting value that may be useful in spam fighting
- # techniques. It is currently stored in the meta-data, but that may change
- # moving forward.)
- #
- # Class:: +properties+
- # ID:: +entropy+
- attr_reader :entropy
- exportable :entropy
- # The edit comment for the current revision of the page.
- #
- # Class:: +properties+
- # ID:: +edit-comment+
- attr_accessor :edit_comment
- exportable :edit_comment
-
- exportable_group 'page'
- # The header content of the page. This is static content (in either Wiki or
- # HTML formats) that appears before the editable contents of the page. If
- # both this and Wiki-level header content are specified, this will appear
- # *after* the Wiki-level header content.
- #
- # Class:: +page+
- # ID:: +header+
- attr_accessor :header
- exportable :header
- # The footer content of the page. This is static content (in either Wiki or
- # HTML formats) that appears before the editable contents of the page. If
- # both this and Wiki-level footer content are specified, this will appear
- # *before* the Wiki-level footer content.
- #
- # Class:: +page+
- # ID:: +footer+
- attr_accessor :footer
- exportable :footer
- # The editable unformatted Wiki content of the page.
- #
- # Class:: +page+
- # ID:: +content+
- attr_accessor :content
- exportable :content
-
- # Creates a Ruwiki page. This must be created from the canonical export
- # hash.
- def initialize(exported = {})
- ruwiki = exported['ruwiki']
- @content_version = (ruwiki['content-version'] || Ruwiki::CONTENT_VERSION).to_i
- @ruwiki_version = ruwiki['version'] || Ruwiki::VERSION
-
- props = exported['properties']
- @title = props['title']
- @topic = props['topic'] || "NewTopic"
- @project = props['project'] || "Default"
- @creator = props['creator'] || ""
- @creator_ip = props['creator-ip'] || "UNKNOWN"
- @create_date = Time.at((props['create-date'] || Time.now).to_i)
- @editor = props['editor'] || ""
- @editor_ip = props['editor-ip'] || "UNKNOWN"
- @edit_date = Time.at((props['edit-date'] || Time.now).to_i)
- @edit_comment = props['edit-comment'] || ""
- case props['editable']
- when false
- @editable = false
- else
- @editable = true
- end
- case props['indexable']
- when false
- @indexable = false
- else
- @indexable = true
- end
- @entropy = (props['entropy'] || 0).to_f
- @html_headers = props['html-headers'] || []
- @version = (props['version'] || 0).to_i
-
- page = exported['page']
- @header = page['header'] || ""
- @content = page['content'] || ""
- @footer = page['footer'] || ""
-
- # Fix the possibility that the content might be an array of chunks.
- @content = @content.join("") if @content.kind_of?(Array)
-
- @content.gsub!(/\r/, "")
- end
-
- # Outputs the HTML version of the page.
- def to_html(markup)
- # Normalise the content, first
- @content.gsub!(/\r/, "")
- markup.parse(@content, @project)
- end
-
- # Provides the canonical export hash.
- def export
- sym = super
-
- sym.each_key do |sect|
- if sect == 'ruwiki'
- sym[sect]['content-version'] = Ruwiki::CONTENT_VERSION
- sym[sect]['version'] = Ruwiki::VERSION
- else
- sym[sect].each_key do |item|
- case [sect, item]
- when ['properties', 'create-date'], ['properties', 'edit-date']
- sym[sect][item] = sym[sect][item].to_i
- when ['properties', 'editable'], ['properties', 'indexable']
- sym[sect][item] = (sym[sect][item] ? 'true' : 'false')
- else
- sym[sect][item] = sym[sect][item].to_s
- end
- end
- end
- end
-
- sym
- end
-
- NULL_PAGE = {
- 'ruwiki' => {
- 'content-version' => Ruwiki::CONTENT_VERSION,
- 'version' => Ruwiki::VERSION
- },
- 'properties' => { },
- 'page' => { },
- }
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/servlet.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/servlet.rb
deleted file mode 100644
index 19feddf..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/servlet.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'webrick'
-
-class Ruwiki
- class Servlet < WEBrick::HTTPServlet::AbstractServlet
- def initialize(config)
- @config = config
- end
-
- # Converts a POST into a GET.
- def do_POST(req, res)
- do_GET(req, res)
- end
-
- def do_GET(req, res)
- # Generate the reponse handlers for Ruwiki from the request and response
- # objects provided.
- wiki = Ruwiki.new(Ruwiki::Handler.from_webrick(req, res))
-
- # Configuration defaults to certain values. This overrides the defaults.
- wiki.config = $config unless $config.nil?
- wiki.config.logger = @config.logger
- wiki.run
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/template.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/template.rb
deleted file mode 100644
index 1acbbab..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/template.rb
+++ /dev/null
@@ -1,331 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file is originally from rdoc by Dave Thomas (dave@pragprog.com).
-#
-# $Id$
-#++
-
- # Ruwiki templating, based originally on RDoc's "cheap-n-cheerful" HTML page
- # template system, which is a line-oriented, text-based templating system.
- #
- # Templates can contain:
- #
- # * The directive !INCLUDE!, which will include the next template from the
- # provided list. This is processed before any template substitution, so
- # repeating and optional blocks work on the values within the template
- # substitution.
- # * Substitutable variable values between percent signs (<tt>%key%</tt>).
- # Optional variable values can be preceded by a question mark
- # (<tt>%?key%</tt>).
- # * Label values between hash marks (<tt>#key#</tt>). Optional label values
- # can be preceded by a question mark (<tt>#?key#</tt>).
- # * Links (<tt>HREF:ref:name:</tt>).
- # * Repeating substitution values (<tt>[:key| stuff :]</tt>). The value of
- # +key+ may be an integer value or a range (in which case key will be used
- # as an iterator, providing the current value of key on successive values),
- # an array of scalar values (substituting each value), or an array of
- # hashes (in which case it works like repeating blocks, see below). These
- # must NOT be nested. Note that integer value counting is one-based.
- # * Optional substitution values (<tt>[?key| stuff ?]</tt> or <tt>[!key|
- # stuff ?]</tt>. These must NOT be nested.
- # * Repeating blocks:
- # START:key
- # ... stuff
- # END:key
- # * Optional blocks:
- # IF:key
- # ... stuff
- # ENDIF:key
- # or:
- # IFNOT:key
- # ... stuff
- # ENDIF:key
- #
- # When generating the output, a hash of values is provided and an optional
- # hash of labels is provided. Simple variables are resolved directly from the
- # hash; labels are resolved as Symbols from the label hash or are otherwise
- # treated as variables. Labels are always resolved from a single label hash.
- #
- # The +key+ for repeating blocks (one-line or multi-line) must be an array of
- # hashes. The repeating block will be generated once for each entry. Blocks
- # can be nested arbitrarily deeply.
- #
- # Optional blocks will only be generated if +key+ has a non-nil value, or if
- # +key+ has a nil value in an IFNOT block.
- #
- # Usage: Given a set of templates <tt>T1</tt>, <tt>T2</tt>, etc.
- #
- # values = { "name" => "Dave", "state" => "TX" }
- # fr = { :name => "Nom", :state => "Etat" }
- # en = { :name => "Name", :state => "State" }
- # t = TemplatePage.new(T1, T2, T3)
- #
- # res = ""
- # t.process(res, values, fr)
- # t.process(res, values, en)
- #
-class Ruwiki::TemplatePage
- BLOCK_RE = /^(IF|IFNOT|ENDIF|START|END):(\w+)?/
- HREF_RE = /HREF:(\w+?):(\w+?):/
- LABEL_RE = /#(\?)?(\w+?)#/
- VARIABLE_RE = /%(\?)?(\w+?)%/
- IFLINE_RE = /\[([?!])(\w+?)\|(.*?)\?\]/
- BLOCKLINE_RE = /\[:(\w+?)\|(.*?):\]/
-
- # A context holds a stack of key/value pairs (like a symbol table). When
- # asked to resolve a key, it first searches the top of the stack, then the
- # next level, and so on until it finds a match (or runs out of entries).
- class Context
- def initialize
- @stack = []
- end
-
- def push(hash)
- @stack.push(hash)
- end
-
- def pop
- @stack.pop
- end
-
- # Find a scalar value, throwing an exception if not found. This method is
- # used when substituting the %xxx% constructs
- def find_scalar(key)
- @stack.reverse_each do |level|
- return level[key] unless level[key].kind_of?(Array)
- end
- raise "Template error: can't find variable '#{key}'."
- end
-
- # Lookup any key in the stack of hashes
- def lookup(key)
- @stack.reverse_each do |level|
- return level[key] unless level[key].nil?
- end
- nil
- end
- end
-
- # Simple class to read lines out of a string
- class LineReader
- attr_reader :lines
- def initialize(lines)
- @lines = lines
- end
-
- # read the next line
- def read
- @lines.shift
- end
-
- # Return a list of lines up to the line that matches a pattern. That last
- # line is discarded.
- def read_up_to(pattern)
- res = []
- while line = read
- if pattern.match(line)
- return LineReader.new(res)
- else
- res << line
- end
- end
- raise "Missing end tag in template: #{pattern.source}"
- end
-
- # Return a copy of ourselves that can be modified without affecting us
- def dup
- LineReader.new(@lines.dup)
- end
- end
-
- # +templates+ is an array of strings containing the templates. We start at
- # the first, and substitute in subsequent ones where the string
- # <tt>!INCLUDE!</tt> occurs. For example, we could have the overall page
- # template containing
- #
- # <html><body>
- # <h1>Master</h1>
- # !INCLUDE!
- # </body></html>
- #
- # and substitute subpages in to it by passing [master, sub_page]. This
- # gives us a cheap way of framing pages
- def initialize(*templates)
- result = "!INCLUDE!"
- templates.each { |content| result.sub!(/!INCLUDE!/, content) }
- @lines = LineReader.new(result.split(/\r?\n/))
- end
-
- attr_reader :lines
-
- # Render the templates, storing the result on +output+ using the method
- # <tt><<</tt> The <tt>value_hash</tt> contains key/value pairs used to
- # drive the substitution (as described above). The <tt>label_hash</tt>
- # contains key/value pairs used to drive the substitution of labels (see
- # above).
- def process(output, value_hash, message_hash = {})
- @context = Context.new
- @message = message_hash
- output << sub(@lines.dup, value_hash).tr("\000", '\\')
- output
- end
-
- # Substitute a set of key/value pairs into the given template. Keys with
- # scalar values have them substituted directly into the page. Those with
- # array values invoke <tt>substitute_array</tt> (below), which examples a
- # block of the template once for each row in the array.
- #
- # This routine also copes with the <tt>IF:</tt>_key_ directive, removing
- # chunks of the template if the corresponding key does not appear in the
- # hash, and the START: directive, which loops its contents for each value
- # in an array
- def sub(lines, values)
- @context.push(values)
- skip_to = nil
- result = []
-
- while line = lines.read
- mv = line.match(BLOCK_RE)
-
- if mv.nil?
- result << expand(line.dup)
- next
- else
- cmd = mv.captures[0]
- tag = mv.captures[1]
- end
-
- case cmd
- when "IF", "IFNOT"
- raise "#{cmd}: must have a key to test." if tag.nil?
-
- test = @context.lookup(tag).nil?
- test = (cmd == "IF") ? test : (not test)
- lines.read_up_to(/^ENDIF:#{tag}/) if test
- when "ENDIF"
- nil
- when "START"
- raise "#{cmd}: must have a key." if tag.nil?
-
- body = lines.read_up_to(/^END:#{tag}/)
- inner = @context.lookup(tag)
- raise "unknown tag: #{tag}" unless inner
- raise "not array: #{tag}" unless inner.kind_of?(Array)
- inner.each { |vals| result << sub(body.dup, vals) }
- result << "" # Append the missing \n
- else
- result << expand(line.dup)
- end
- end
-
- @context.pop
-
- result.join("\n")
- end
-
- # Given an individual line, we look for %xxx%, %?xxx%, #xxx#, #?xxx#,
- # [:key| xxx :], [?key| stuff ?], [!key| stuff ?] and HREF:ref:name:
- # constructs, substituting as appropriate.
- def expand(line)
- # Generate a cross-reference if a reference is given. Otherwise, just
- # fill in the name part.
- line = line.gsub(HREF_RE) do
- ref = @context.lookup($1)
- name = @context.find_scalar($2)
-
- if ref and not ref.kind_of?(Array)
- %Q(<a href="#{ref}">#{name}</a>)
- else
- name
- end
- end
-
- # Look for optional content.
- line = line.gsub(IFLINE_RE) do
- type = $1
- name = $2
- stuff = $3
-
- case type
- when '?'
- test = @context.lookup(name)
- when '!'
- test = (not @context.lookup(name))
- end
-
- if test
- stuff
- else
- ""
- end
- end
-
- # Look for repeating content.
- line = line.gsub(BLOCKLINE_RE) do |match|
- name = $1
- stuff = $2
-
- val = @context.lookup(name)
- s = ""
- case val
- when nil
- nil
- when Fixnum
- val.times { |i| s << stuff.sub(/%#{name}%/, "#{i + 1}") }
- when Range
- val.each { |i| s << stuff.sub(/%#{name}%/, "#{i}") }
- when Array
- if not val.empty? and val[0].kind_of?(Hash)
- val.each do |v|
- @context.push(v)
- s << expand(stuff)
- @context.pop
- end
- else
- val.each { |e| s << stuff.sub(/%#{name}%/, "#{e}") }
- end
- end
- s
- end
-
- # Substitute in values for #xxx# constructs.
- line = line.gsub(LABEL_RE) do
- mandatory = $1.nil?
- key = $2.intern
- val = @message[key]
-
- if val.nil?
- raise "Template error: can't find label '#{key}'." if mandatory
- ""
- else
- "#{val}".tr('\\', "\000")
- end
- end
-
- # Substitute in values for %xxx% constructs. This is made complex
- # because the replacement string may contain characters that are
- # meaningful to the regexp (like \1)
- line = line.gsub(VARIABLE_RE) do
- mandatory = $1.nil?
- key = $2
- val = @context.lookup(key)
-
- if val.nil?
- raise "Template error: can't find variable '#{key}'." if mandatory
- ""
- else
- "#{val}".tr('\\', "\000")
- end
- end
-
- line
- rescue Exception => e
- raise "Error in template: #{e}\nOriginal line: #{line}\n#{e.backtrace[0]}"
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki.rb
deleted file mode 100644
index a060c75..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- # Ruwiki's Wiki markup class. This will convert the Wiki markup known by
- # Ruwiki (defined by Token classes). The algorithm is as follows:
- #
- # 1. For each known Token class, match each instance of it in the content
- # stream. Replace each instance in the content stream with a Token
- # marker: TOKEN_x or \TOKEN_x, where x is a digit representing the
- # Token. (\TOKEN_x is a special case of token matching. See
- # Ruwiki::Markup::Token for more information.) Store the Token for
- # later processing.
- # 2. Go back through the content, replacing each instance of \TOKEN_x
- # with the Token's defined restore value (which should be the same
- # value as was originally matched).
- # 3. Go through the content, replacing each instance of TOKEN_x with the
- # Token's defined replacement value.
- # 4. Go through the tokens, in reverse, and execute the post replacement
- # routine defined by the Token. (This may be necessary to collapse
- # consecutive HTML structures.)
- # 5. Return the parsed content and the collected metadata.
- #
- # == Tokens
- # Look at Ruwiki::Markup::Token describes how to create Token objects.
- class Wiki
- def parse(content, project)
- content = content.dup
- tokens = []
- project ||= @default_project
-
- Token.tokenlist.each do |token|
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, project, @backend, @script, @message, @title)
- tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{tokens.size - 1}"
- else
- "TOKEN_#{tokens.size - 1}"
- end
- end
- end
-
- replaced = []
- s = true
- loop do
- break if replaced.size >= tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].restore
- }
-
- s = content.gsub!(/TOKEN_(\d+)/) { |m|
- match = Regexp.last_match
- itoken = match[1].to_i
- replaced << itoken
- tokens[itoken].replace
- }
- end
-
- token_classes = tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
-
- content
- end
-
- attr_accessor :default_project
- attr_accessor :script
- attr_accessor :backend
- attr_accessor :message
-
- # Creates the markup class.
- def initialize(default_project, script, title)
- @default_project = default_project
- @script = script
- @title = title
- end
- end
-end
-
-require 'ruwiki/wiki/tokens'
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens.rb
deleted file mode 100644
index d0e47fc..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens.rb
+++ /dev/null
@@ -1,136 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # The base Token class. All Token classes must inherit from Token and
- # *must* implement the following methods:
- #
- # [self.regexp] The regular expression that the Token will be
- # replacing.
- # [replace] The mechanism for replacing the Token with the desired
- # results.
- #
- # Token classes <i>should</i> implement the following method:
- # [self.rank] Default: <tt>5000</tt>. Affects the sort order.
- # Must return an integer.
- #
- # Token classes <i>may</i> implement the following methods:
- # [restore] Restores the token without replacement.
- # Implements the results of the escape character.
- # NOTE: each Token class is responsible for its own
- # restore. Tokens that are anchored to the
- # beginning of a line are the most likely to need
- # to reimplement this.
- # [self.post_replace] Performs any necessary massaging of the data. See
- # the implementation of Ruwiki::Wiki::Lists for
- # more information.
- class Token
- @@tokenlist = []
- @@sorted = false
-
- class << self
- # Tokens should define rank if they must be first or last in
- # processing. Otherwise, they are sorted in the order defined.
- def rank
- 5000
- end
-
- # The Wiki parsing routine uses Token.tokenlist to determine the
- # tokens that are processed, and the order in which they are
- # processed. See Token.rank for more information.
- def tokenlist
- unless @@sorted
- head = @@tokenlist.shift
- @@tokenlist.sort! { |a, b| a.rank <=> b.rank }
- @@tokenlist.unshift(head)
- sorted = true
- end
- @@tokenlist
- end
-
- def inherited(child_class) #:nodoc:
- @@tokenlist << Token if @@tokenlist.empty?
-
- # Make the child class post_replace a blank function because we
- # don't want to propogate the currently defined post_replace.
- # The current post_replace is specific to Token_Base only.
- class << child_class
- def self.post_replace(content)
- content
- end
- end
-
- @@tokenlist << child_class
- @@sorted = false
- end
-
- # The replacement regular expression.
- def regexp
- /TOKEN_(\d*)/
- end
- end
-
- # All Token classes must match this header signature if they define
- # #initialize.
- #
- # [match] The MatchData object for this Token.
- # [project] The project being processed.
- # [backend] The backend for the wiki. This is used to determine if
- # the page or project exists. The object passed must
- # respond to #project_exists?(project) and
- # #page_exists?(page, project).
- # [script] The URI to the script.
- # [message] The message hash for localized messages.
- # [title] The title of the Wiki.
- def initialize(match, project, backend, script, message, title)
- @match = match
- @project = project
- @backend = backend
- @script = script
- @message = message
- @title = title
- end
-
- # The replacement method. Uses @match to replace the token with the
- # appropriate values.
- def replace
- "TOKEN_#{@match[1]}"
- end
-
- # Restores the token without replacement. By default, replaces
- # "dangerous" HTML characters.
- def restore
- @match[0].gsub(/&/, "&amp;").gsub(/</, "&lt;").gsub(/>/, "&gt;")
- end
-
- # The content may need massaging after processing.
- def self.post_replace(content)
- content
- end
- end
- end
-end
-
- # Load the tokens from the ruwiki/wiki/tokens directory.
-tokens_dir = 'ruwiki/wiki/tokens'
-
-$LOAD_PATH.each do |path|
- target = "#{path}/#{tokens_dir}"
- if File.exists?(target) and File.directory?(target)
- Dir::glob("#{target}/*.rb") do |token|
- begin
- require token
- rescue LoadError
- nil
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/00default.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/00default.rb
deleted file mode 100644
index d57544f..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/00default.rb
+++ /dev/null
@@ -1,206 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-# $debug = File.open("output.txt", "wb")
-
-class Ruwiki::Wiki
- # The Paragraph Token class changes blank lines to <p> tags. This class,
- # under the current implementation, should be *first* in the Token list
- # after Token.
- class Paragraph < Ruwiki::Wiki::Token
- # This Token is #rank 0, because it should be first in the Token list.
- def self.rank
- 0
- end
-
- # Matches blank lines. %r{^$}
- def self.regexp
- %r{(^$)}
- end
-
- def replace
- %Q(</p><p class="rwtk_Paragraph">)
- end
-
- # Ensures that <p> won't be surrounded by <br> tags.
- def self.post_replace(content)
- content.gsub!(%r{\A}, '<p class="rwtk_Paragraph">')
- content.gsub!(%r{\z}, '</p>')
- content.gsub!(%r{\n(</p>)}, '\1')
- content.gsub!(%r{(<p[^>]*>)\n}, '\1')
- content.gsub!(%r{(</p>)(<p[^>]*>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content.gsub!(%r{<p[^>]*></p>}, '')
- content.gsub!(%r{^\n(<p[^>]*>)}, '\1')
- content
- end
- end
-
- # The Code Token class converts indented text to "unformatted" (<pre>)
- # text. This class should be *second* in the Token list.
- class Code < Ruwiki::Wiki::Token
- # This Token is #rank 1, because it should be second in the Token list.
- def self.rank
- 1
- end
-
- # Matches indented text. %r{^(\s+\S?.*)$}
- def self.regexp
- %r{^([ \t]+[^\n]*)\n}
- end
-
- # Replaces the text to <pre>content</pre>.
- def replace
- content = @match.captures[0]
- content.gsub!(/&/, '&amp;')
- content.gsub!(/</, '&lt;')
- content.gsub!(/>/, '&gt;')
-
- %Q{</p><pre class="rwtk_Code">#{content}</pre>\n}
- end
-
- # Converts cases of %r{</pre>(\n|<br ?/?>)<pre>} to \1.
- def self.post_replace(content)
- content.gsub!(%r{</pre>((\n)*</p>(\n)*)?<pre[^>]*>}, "\n")
- content.gsub!(%r{</pre>(\n|<br ?/?>)?<pre[^>]*>}, '\1')
- content.gsub!(%r{<p[^>]*>(<pre[^>]*>)}, '\1')
- content.gsub!(%r{</pre></p>}, '</pre>')
-# content.gsub!(%r{(<pre[^>]*>.*?)<p[^>]*></p>(.*?</pre>)}) { "#{$1}\n#{$2}" }
- content
- end
- end
-
- RE_URI_SCHEME = %r{[-a-z0-9+.]{3,}?:}
- RE_URI_PATH = %r{[^\s<>\]]}
- RE_URI_TEXT = %r{[^\]]*}
-
- # Converts URLs in the form of [url] to numbered links.
- class NumberedLinks < Ruwiki::Wiki::Token
- class << self
- def increment
- @count ||= 0
- @count += 1
- end
-
- def reset
- @count = 0
- end
- end
-
- def self.rank
- 2
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\]}
- end
-
- def replace
- extlink = @match.captures[0]
-
- name = "[#{NumberedLinks.increment}]"
-
- %Q{<a class="rwtk_NumberedLinks" href="#{extlink}">#{name}</a>}
- end
- end
-
- class Image < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- RE_IMAGE_OPTIONS=%r{([^=]+)=("[^"]+"|[^ ]+)}
-
- def self.regexp
- %r{\[image\s*:\s*(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)(\s+[^\]]+)?\]}
- end
-
- def replace
- options = { 'src' => %Q("#{@match.captures[0]}") }
- groups = @match.captures[1]
- unless groups.nil?
- groups.scan(RE_IMAGE_OPTIONS).each { |g| options[g[0].strip] = g[1].strip }
- end
-
- unless options['numbered'].nil? or options['numbered'] == "false"
- options['title'] = %Q("[#{NumberedLinks.increment}]")
- options.delete('numbered')
- end
-
- options['title'] ||= options['alt']
- options['title'] ||= options['src']
- options['alt'] ||= options['title']
-
- ss = ""
- options.keys.sort.map { |kk| ss << %Q( #{kk}=#{options[kk]}) }
-
- %Q{<img class="rwtk_Image"#{ss} />}
- end
- end
-
- # Converts URLs in the form of [url name] to named links.
- class NamedLinks < Ruwiki::Wiki::Token
- def self.rank
- 3
- end
-
- def self.regexp
- %r{\[(#{RE_URI_SCHEME}(?:#{RE_URI_PATH})*?)\s+(#{RE_URI_TEXT})\]}
- end
-
- def replace
- extlink = @match.captures[0]
- name = @match.captures[1]
-
- %Q{<a class="rwtk_NamedLinks" href="#{extlink}">#{name}</a>}
- end
- end
-
- # Converts URLs to links where the "name" of the link is the URL itself.
- class ExternalLinks < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{\b(#{RE_URI_SCHEME}#{RE_URI_PATH}+)}
- end
-
- def replace
- extlink = @match.captures[0]
-
- %Q{<a class="rwtk_ExternalLinks" href="#{extlink}">#{extlink}</a>}
- end
- end
-
- # Creates a horizontal rule.
- class HRule < Ruwiki::Wiki::Token
- def self.regexp
- %r|^\\?-{4,}|
- end
-
- def replace
- %Q(<hr class="rwtk_HRule" />)
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(<p[^>]*>)*(<hr[^ />]* ?/?>)(</p>)*}, '\1')
- content.gsub!(%r{\n<hr />}, "</p>\n<hr />")
- content.gsub!(%r{<hr ?/?>\n<br ?/?>}, "<hr />")
- content.gsub!(%r{(\n|<br ?/?>)?<hr>(\n|<br ?/?>)?}, "<hr />")
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/01wikilinks.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/01wikilinks.rb
deleted file mode 100644
index 442a201..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/01wikilinks.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # This provides the basic WikiWord match. This supports WikiWord,
- # CPlusPlus, ThisIsALink, and C_Plus_Plus.
- RE_WIKI_WORDS = %r{[[:upper:]][\w_]*(?:[[:lower:]]+[[:upper:]_]|[[:upper:]_]+[[:lower:]])[\w_]*}
- # This provides wikipedia format matches, e.g., [[wikipedia links]]. The
- # only restriction on words in this format is that they must NOT begin
- # with an underscore ('_').
- RE_WIKIPEDIA_WORDS = %r{\[\[([^_].*?)\]\]}
- # This provides the basic Wiki Project match.
- RE_PROJECT_WORD = %r{[[:upper:]][[:lower:]]+}
-
- # This provides the Wiki view link format:
- VIEW_LINK = %Q[<a class="rwtk_WikiLink" href="%s">%s</a>]
- EDIT_LINK = %Q[<span class="rwtk_EditWikiLink">%s</span><a class="rwtk_WikiLink" href="%s">?</a>]
-
- # Creates a crosslink for a Project::WikiPage.
- class ProjectCrossLink < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::(#{RE_WIKI_WORDS})}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic.gsub(/_/, ' ')}"]
- else
- EDIT_LINK % ["#{project}::#{topic.gsub(/_/, ' ')}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a crosslink for a Project::WikiPage using a Wikipedia link
- # format.
- class ProjectCrossLinkWikipedia < Ruwiki::Wiki::Token
- def self.rank
- 500
- end
-
- def self.regexp
- %r{(#{RE_PROJECT_WORD})::#{RE_WIKIPEDIA_WORDS}}
- end
-
- def replace
- project = @match.captures[0]
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- if @backend.page_exists?(topic, project) or @backend.page_exists?(link, project)
- VIEW_LINK % ["#{@script}/#{project}/#{link}", "#{project}::#{topic}"]
- else
- EDIT_LINK % ["#{project}::#{topic}", "#{@script}/#{project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to the project index from ::Project.
- class ProjectIndex < Ruwiki::Wiki::Token
- def self.rank
- 501
- end
-
- def self.regexp
- %r{(\B|\\)::(#{RE_PROJECT_WORD})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- project = @match.captures[1]
-
- if @backend.page_exists?('ProjectIndex', project)
- VIEW_LINK % ["#{@script}/#{project}/ProjectIndex", project]
- else
- if @backend.project_exists?(project)
- EDIT_LINK % [project, "#{@script}/#{project}/ProjectIndex/_edit"]
- else
- EDIT_LINK % [project, "#{@script}/#{project}/_create"]
- end
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project.
- class WikiLinks < Ruwiki::Wiki::Token
- def self.rank
- 503
- end
-
- def self.regexp
- %r{(\b|\\)(#{RE_WIKI_WORDS})\b}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- def replace
- topic = @match.captures[1]
- link = CGI.escape(topic.dup)
-
- if @backend.page_exists?(topic, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic.gsub(/_/, ' ')]
- else
- EDIT_LINK % [topic.gsub(/_/, ' '), "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-
- # Creates a link to a WikiPage in the current project using a Wikipedia
- # link format.
- class WikipediaLinks < Ruwiki::Wiki::Token
- def self.rank
- 502
- end
-
- def self.regexp
- %r{(\B|\\)#{RE_WIKIPEDIA_WORDS}\B}
- end
-
- def restore
- @match[0][1..-1]
- end
-
- ALT_TEXT = %r{(.+)\|(.+)}o
-
- def replace
- captures = @match.captures
- topic = @match.captures[1]
- link = CGI.escape(topic)
-
- at = ALT_TEXT.match(topic)
-
- if not at.nil?
- topic = at.captures[1]
- link = CGI.escape(at.captures[0])
- end
-
- if @backend.page_exists?(link, @project) or @backend.page_exists?(link, @project)
- VIEW_LINK % ["#{@script}/#{@project}/#{link}", topic]
- else
- EDIT_LINK % [topic, "#{@script}/#{@project}/#{link}/_edit"]
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/02actions.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/02actions.rb
deleted file mode 100644
index fd0d5b8..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/02actions.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'cgi'
-
-class Ruwiki::Wiki
- # Produces a list of topics.
- class TopicList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%topics\((#{Ruwiki::Wiki::RE_PROJECT_WORD})?\)$}
- end
-
- def replace
- project = @match.captures[0] || @project
-
- if @backend.project_exists?(project)
- topic_list = @backend.list_topics(project)
- else
- topic_list = []
- end
-
- if topic_list.empty?
- s = @message[:no_topics] % [project]
- else
- s = %Q(<h4 class="rwtk_Headings">#{@message[:topics_for_project] % [project]}</h4>\n<ul class="rwtk_Lists">\n)
- topic_list.each do |tt|
- s << %Q(<li class="rwtk_Lists">)
- s << VIEW_LINK % ["#{@script}/#{project}/#{tt}", "#{CGI::unescape(tt.gsub(/_/, ' '))}"]
- s << "</li>\n"
- end
- s << "</ul>\n"
- end
-
- s
- end
- end
-
- class ProjectList < Ruwiki::Wiki::Token
- def self.regexp
- %r{^%projects\(\)$}
- end
-
- def replace
- proj_list = @backend.list_projects
-
- s = %Q(<h4 class="rwtk_Headings">#{@message[:wiki_projects] % [@title]}</h4>\n<ul class="rwtk_Lists">\n)
- proj_list.each do |pp|
- s << %Q(<li class="rwtk_Lists">)
- s << VIEW_LINK % ["#{@script}/#{pp}/ProjectIndex", pp]
- s << %Q! <a href='#{@script}/#{pp}/_topics' class='rw_minilink'>#{@message[:project_topics_link]}</a>!
- s << "</li>\n"
- end
- s << "</ul>\n"
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/abbreviations.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/abbreviations.rb
deleted file mode 100644
index 3f80d83..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/abbreviations.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Converts abbreviations.
- class Abbreviations < Ruwiki::Wiki::Token
- ABBREVIATIONS = {
- "matz" => "Yukihiro Matsumoto",
- }
-
- def self.regexp
- %r!@\{([^\}]*)\}!
- end
-
- def replace
- k = @match.captures[0]
- if k.nil? or k.empty?
- data = %Q(<dl class="rwtk_Abbreviations">)
- ABBREVIATIONS.each do |k, v|
- data << %Q(<dt class="rwtk_Abbreviations">#{k}</dt><dd class="rwtk_Abbreviations">#{v}</dd>)
- end
- data << %Q(</dl>)
- else
- if ABBREVIATIONS.has_key?(k)
- data = ABBREVIATIONS[k]
- else
- data = @match[0]
- end
- end
- data
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/calendar.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/calendar.rb
deleted file mode 100644
index 88f52d9..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/calendar.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Produces a mini-calendar with dates as WikiWords.
- class Calendar < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?%calendar\((?:(today)|(\d+),\s*(\d+))(?:,\s*(#{RE_PROJECT_WORD}))?\)}
- end
-
- def self.make(year, month)
- result = []
- t = Time.local(year, month, 1)
- r = Array.new(t.wday, nil)
- r << 1
-
- 2.upto(31) do |i|
- break if Time.local(year, month, i).month != month
- r << i
- end
-
- r += Array.new((- r.size) % 7, nil)
-
- 0.step(r.size - 1, 7) do |i|
- result << r[i, 7]
- end
- result
- end
-
- def make_month_link(project, year, month, state = nil)
- ym = "%04d%02d" % [year, month]
- case state
- when :prev
- title = "&laquo; #{year}.#{month}"
- when :next
- title = "#{year}.#{month} &raquo;"
- else
- title = "#{project}::#{year}.#{month}"
- end
- url = "#{@script}/#{project}/#{ym}"
-
- if @backend.page_exists?(ym, project)
- VIEW_LINK % [url, title]
- else
- EDIT_LINK % [title, "#{url}/_edit"]
- end
- end
-
- def replace
- today = @match.captures[0]
- project = @match.captures[3] || @project
- now = Time.now
-
- if today.nil?
- year = @match.captures[1].to_i
- month = @match.captures[2].to_i
- else
- year = now.year
- month = now.month
- end
-
- if (year == now.year) and (month == now.month)
- show_today = now.day
- else
- show_today = nil
- end
-
- result = <<-"CALENDAR_HEAD"
-</p>
-<div class="rwtk_Calendar">
-<table class="rwtk_Calendar" summary="calendar for ::#{project}: #{year}.#{month}">
-<thead>
- CALENDAR_HEAD
-
- result << %Q{ <tr>\n<th colspan="7" class="rwtk_Calendar_current_month">}
- result << make_month_link(project, year, month)
- result << %Q{</th>\n </tr>\n <tr>\n<th colspan="2" class="rwtk_Calendar_prev_month">}
- result << make_month_link(project, year, month - 1, :prev)
- result << %Q{</th>\n<th colspan="3"></th>\n<th colspan="2" class="rwtk_Calendar_next_month">}
- result << make_month_link(project, year, month + 1, :next)
- result << "</th>\n"
-
- result << <<-"CALENDAR_HEAD2"
- </tr>
- <tr>
- <th class="rwtk_Calendar_weekend">Su</th>
- <th class="rwtk_Calendar_weekday">Mo</th>
- <th class="rwtk_Calendar_weekday">Tu</th>
- <th class="rwtk_Calendar_weekday">We</th>
- <th class="rwtk_Calendar_weekday">Th</th>
- <th class="rwtk_Calendar_weekday">Fr</th>
- <th class="rwtk_Calendar_weekend">Sa</th>
- </tr>
-</thead>
-<tbody>
- CALENDAR_HEAD2
-
- Calendar.make(year, month).each do |week|
- result << " <tr>\n"
- week.each do |day|
- if day.nil?
- result << %Q{ <td class="rwtk_Calendar_day"></td>\n}
- else
- date = "%04d%02d%02d" % [year, month, day]
- # Add the ability to create pages based on date here.
- if show_today == day
- result << %Q{ <td class="rwtk_Calendar_today">}
- else
- result << %Q{ <td class="rwtk_Calendar_day">}
- end
- if @backend.page_exists?(date, project)
- result << VIEW_LINK % ["#{@script}/#{project}/#{date}", day]
- else
- result << EDIT_LINK % [day, "#{@script}/#{project}/#{date}/_edit"]
- end
- result << %Q{</td>\n}
- end
- end
- result << " </tr>\n"
- end
-
- result << %Q(</tbody>\n</table>\n</div>\n<p class="rwtk_Paragraph">)
- result
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*>(\s*</?div(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?table(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*</?t(?:head|body|r)(?: [^>]+)?>\s*)</p>}, '\1')
- content.gsub!(%r{<p[^>]*>(\s*<t[hd].+?</t[hd]>\s*)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/headings.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/headings.rb
deleted file mode 100644
index cfc3001..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/headings.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Converts headings.
- class Headings < Ruwiki::Wiki::Token
-# def self.rank
-# 5
-# end
-
- def self.regexp
- %r{^\\?(=+)\s+(.*)}
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def replace
- level = @match.captures[0].count("=")
- content = @match.captures[1]
- level = 6 if level > 6
- %Q(<h#{level} class="rwtk_Headings">#{content}</h#{level}>)
- end
-
- def self.post_replace(content)
- content.gsub!(%r{(</h\d>)\n}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{(</h\d>)</p>\n<p>}) { |m| %Q(#{$1}\n<p class="rwtk_Paragraph">) }
- content.gsub!(%r{<p[^>]*>(<h\d[^>]*>)}, '\1')
- content.gsub!(%r{(</h\d>)</p>}, '\1')
- content
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/lists.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/lists.rb
deleted file mode 100644
index 1615c2c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/lists.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki::Wiki
- # Produces Lists
- class Lists < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?([*#]+)\s+(.*)$}
- end
-
- def replace
- indent = @match.captures[0].scan(/./).map { |ee| ee == "*" ? 'ul' : 'ol' }
- content = @match.captures[1]
-
- pre = ''
- post = ''
- indent.each { |elem| pre << %Q(<#{elem} class="rwtk_Lists">) }
- indent.reverse_each { |elem| post << %Q(</#{elem}>) }
- %Q(#{pre}<li class="rwtk_Lists">#{content}</li>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- RE_NESTED_LISTS = %r{</[uo]l>\s*<[uo]l[^>]*>}
-
- def self.post_replace(content)
- content.gsub!(%r{<p[^>]*><([uo]l[^>]*)>}, '<\1>')
- content.gsub!(%r{</([uo]l)></p>}, '</\1>')
- content.gsub!(RE_NESTED_LISTS, '') while content =~ RE_NESTED_LISTS
- content
- end
- end
-
- # Produces block quotes.
- class Blockquotes < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?((:+)|(>+))(\s+.*)$}
- end
-
- def replace
- content = @match.captures[3]
-
- if @match.captures[2].nil?
- char = ':'
- cite = ''
- else
- char = '>'
- cite = ' type="cite"'
- end
- indent = @match.captures[0].count(char)
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<blockquote#{cite} class="rwtk_Blockquotes">)
- post << %Q(</blockquote>)
- end
- "#{pre}#{content}#{post}"
- end
-
- def restore
- @match[0][1 .. -1].gsub(/^>/, '&gt;')
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</blockquote>(\n|<br ?/?>)?<blockquote[^>]*>}, '')
- content.gsub!(%r{(</?blockquote[^>]*>\n?)\s*}, '\1')
- content.gsub!(%r{</blockquote>(<blockquote[^>]*>)+}, '\1')
- content
- end
- end
-
- # Produces definition lists. Does not completely work correctly.
- class Definitions < Ruwiki::Wiki::Token
- def self.regexp
- %r{^\\?(;+)\s+(.+?)\s+:\s+(.*)}
- end
-
- def replace
- definition = @match.captures[2]
- term = @match.captures[1]
- indent = @match.captures[0].count(';')
-
- pre = ''
- post = ''
- indent.times do
- pre << %Q(<dl class="rwtk_Definitions">)
- post << %Q(</dl>)
- end
- %Q(#{pre}<dt class="rwtk_Definitions">#{term}</dt><dd class="rwtk_Definitions">#{definition}</dd>#{post})
- end
-
- def restore
- @match[0][1 .. -1]
- end
-
- def self.post_replace(content)
- content.gsub!(%r{</dl>(\n|<br ?/?>)?<dl[^>]*>}, '')
- content.gsub!(%r{</dl>(<dl[^>]*>)+}, '\1')
- content
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/rubylists.rb b/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/rubylists.rb
deleted file mode 100644
index 520bedf..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/ruwiki/wiki/tokens/rubylists.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#--
-# Ruwiki
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-class Ruwiki
- class Wiki
- # Convert ruby-talk mailing list references (e.g., [ruby-talk:12345])
- # into named links.
- class RubyTalkLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-talk:(\d+)\]}
- end
-
- def replace
- lm = @match.captures[0]
- %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/#{lm}">#{@match[0]}</a>)
- end
- end
-
- # Convert ruby-core/ext/dev/list/math mailing list references (e.g.,
- # [ruby-core:12345]) into named links.
- class OtherRubyLinks < Ruwiki::Wiki::Token
- def self.rank
- 1
- end
-
- def self.regexp
- %r{\[ruby-(list|doc|core|dev|ext|math):(\d+)\]}
- end
-
- def replace
- ln, lm = @match.captures[0..1]
- %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-#{ln}/#{lm}">#{@match[0]}</a>)
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/lib/tar.rb b/ruwiki/tags/release-0.8.0-fixes/lib/tar.rb
deleted file mode 100644
index 0020397..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/lib/tar.rb
+++ /dev/null
@@ -1,684 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# This file is based on and incorporating parts of RPA::Package (rpa-base's
-# lib/rpa/package.rb and lib/rpa/util.rb) by Marucio Julio Fernández Pradier,
-# copyright © 2004.
-#
-# This file is licensed under the following conditions [NOTE: this file does
-# not fall under condition 4; there is no LEGAL file to be concerned about]:
-#
-# You can redistribute it and/or modify it under either the terms of the GNU
-# General Public License, or:
-#
-# 1. You may make and give away verbatim copies of the source form of the
-# software without restriction, provided that you duplicate all of the
-# original copyright notices and associated disclaimers.
-#
-# 2. You may modify your copy of the software in any way, provided that you do
-# at least ONE of the following:
-#
-# a) place your modifications in the Public Domain or otherwise make them
-# Freely Available, such as by posting said modifications to Usenet or an
-# equivalent medium, or by allowing the author to include your
-# modifications in the software.
-# b) use the modified software only within your corporation or organization.
-# c) give non-standard binaries non-standard names, with instructions on
-# where to get the original software distribution.
-# d) make other distribution arrangements with the author.
-# 3. You may distribute the software in object code or binary form, provided
-# that you do at least ONE of the following:
-# a) distribute the binaries and library files of the software, together
-# with instructions (in the manual page or equivalent) on where to get
-# the original distribution.
-# b) accompany the distribution with the machine-readable source of the
-# software.
-# c) give non-standard binaries non-standard names, with instructions on
-# where to get the original software distribution.
-# d) make other distribution arrangements with the author.
-# 4. You may modify and include the part of the software into any other
-# software (possibly commercial). But some files in the distribution are
-# not written by the author, so that they are not under these terms.
-#
-# For the list of those files and their copying conditions, see the file
-# LEGAL.
-# 5. The scripts and library files supplied as input to or produced as output
-# from the software do not automatically fall under the copyright of the
-# software, but belong to whomever generated them, and may be sold
-# commercially, and may be aggregated with this software.
-# 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-#
-# $Id$
-#++
-
-require 'fileutils'
-require 'find'
-
-module Tar
- class NonSeekableIO < StandardError; end
- class ArgumentError < ::ArgumentError; end
- class ClosedIO < StandardError; end
- class BadCheckSum < StandardError; end
- class TooLongFileName < StandardError; end
- class InvalidMode < ::ArgumentError; end
- class BlockNeeded < StandardError; end
-
- module FSyncDir
- private
- def fsync_dir(dirname)
- # make sure this hits the disc
- begin
- dir = open(dirname, "r")
- dir.fsync
- rescue # ignore IOError if it's an unpatched (old) Ruby
- ensure
- dir.close if dir rescue nil
- end
- end
-
- def dir?(path)
- # Apparently fixes a corrupted stat() on Windows:
- File.directory?((path[-1] == ?/) ? path : "#{path}/")
- end
- end
-
- class Header
- FIELDS = [:name, :mode, :uid, :gid, :size, :mtime, :checksum, :typeflag,
- :linkname, :magic, :version, :uname, :gname, :devmajor,
- :devminor, :prefix]
- FIELDS.each { |x| attr_reader x }
-
- # The tarfile header:
- #
- # struct tarfile_entry_posix
- # {
- # char name[100]; // ASCII (+ Z unless filled) A100
- # char mode[8]; // 0 padded, octal, null A8
- # char uid[8]; // ditto A8
- # char gid[8]; // ditto A8
- # char size[12]; // 0 padded, octal, null A12
- # char mtime[12]; // 0 padded, octal, null A12
- # char checksum[8]; // 0 padded, octal, null, space A8
- # char typeflag[1]; // file: "0" dir: "5" A
- # char linkname[100]; // ASCII + (Z unless filled) A100
- # char magic[6]; // "ustar\0" A6
- # char version[2]; // "00" A2
- # char uname[32]; // ASCIIZ A32
- # char gname[32]; // ASCIIZ A32
- # char devmajor[8]; // 0 padded, octal, null A8
- # char devminor[8]; // o padded, octal, null A8
- # char prefix[155]; // ASCII (+ Z unless filled) A155
- # };
- HEADER_PACK_FORMAT = "A100A8A8A8A12A12A8AA100A6A2A32A32A8A8A155"
-
- def self.new_from_stream(stream)
- data = stream.read(512)
- fields = data.unpack(HEADER_PACK_FORMAT)
- name = fields.shift
- mode = fields.shift.oct
- uid = fields.shift.oct
- gid = fields.shift.oct
- size = fields.shift.oct
- mtime = fields.shift.oct
- checksum = fields.shift.oct
- typeflag = fields.shift
- linkname = fields.shift
- magic = fields.shift
- version = fields.shift.oct
- uname = fields.shift
- gname = fields.shift
- devmajor = fields.shift.oct
- devminor = fields.shift.oct
- prefix = fields.shift
-
- empty = (data == "\0" * 512)
-
- new(:name => name, :mode => mode, :uid => uid, :gid => gid,
- :size => size, :mtime => mtime, :checksum => checksum,
- :typeflag => typeflag, :magic => magic, :version => version,
- :uname => uname, :gname => gname, :devmajor => devmajor,
- :devminor => devminor, :prefix => prefix, :empty => empty)
- end
-
- def initialize(vals)
- unless vals[:name] && vals[:size] && vals[:prefix] && vals[:mode]
- raise Tar::ArgumentError
- end
-
- vals[:mtime] ||= 0
- vals[:checksum] ||= ""
- vals[:typeflag] ||= "0"
- vals[:magic] ||= "ustar "
- vals[:version] ||= "\0\0"
- vals[:devmajor]
- vals[:devminor]
-
- FIELDS.each { |x| instance_variable_set "@#{x.to_s}", vals[x] }
-
- @empty = vals[:empty]
- end
-
- def empty?
- @empty
- end
-
- def to_s
- update_checksum
- header(@checksum)
- end
-
- def update_checksum
- h = header(" " * 8)
- @checksum = oct(calculate_checksum(h), 6)
- end
-
- private
- def null_pad(val, len)
- if val.nil?
- "\0" * len
- else
- %Q|#{val}#{"\0" * (len - val.size + 1)}|
- end
- end
-
- def oct(num, len)
- if num.nil?
- "\0" * (len + 1)
- else
- "%0#{len}o" % num
- end
- end
-
- def calculate_checksum(hdr)
- hdr.unpack("C*").inject { |a, b| a + b }
- end
-
- def header(chksum)
- arr = [null_pad(name, 100), oct(mode, 7), oct(uid, 7), oct(gid, 7),
- oct(size, 11), oct(mtime, 11), chksum, typeflag,
- null_pad(linkname, 100), null_pad(magic, 8), version,
- null_pad(uname, 32), null_pad(gname, 32), oct(devmajor, 7),
- oct(devminor, 7), null_pad(prefix, 155)]
- str = arr.pack(HEADER_PACK_FORMAT)
- str + "\0" * ((512 - str.size) % 512)
- end
- end
-
- class Writer
- class FileOverflow < StandardError; end
-
- class BoundedStream
- attr_reader :limit, :written
-
- def initialize(io, limit)
- @io = io
- @limit = limit
- @written = 0
- end
-
- def write(data)
- if data.size + @written > @limit
- raise FileOverflow,
- "You tried to feed more data than fits in the file."
- end
- @io.write data
- @written += data.size
- data.size
- end
- end
-
- class RestrictedStream
- def initialize(anIO)
- @io = anIO
- end
-
- def write(data)
- @io.write data
- end
- end
-
- def self.new(anIO)
- writer = super(anIO)
-
- return writer unless block_given?
-
- begin
- yield writer
- ensure
- writer.close
- end
-
- nil
- end
-
- def initialize(anIO)
- @io = anIO
- @closed = false
- end
-
- def add_file_simple(name, mode, size)
- raise BlockNeeded unless block_given?
- raise ClosedIO if @closed
-
- name, prefix = split_name(name)
-
- header = Header.new(:name => name, :mode => mode, :size => size,
- :prefix => prefix).to_s
-
- @io.write header
-
- os = BoundedStream.new(@io, size)
- yield os
- #FIXME: what if an exception is raised in the block?
-
- min_padding = size - os.written
- @io.write("\0" * min_padding)
- remainder = (512 - (size % 512)) % 512
- @io.write("\0" * remainder)
- end
-
- def add_file(name, mode)
- raise BlockNeeded unless block_given?
- raise ClosedIO if @closed
- raise NonSeekableIO unless @io.respond_to?(:pos=)
-
- name, prefix = split_name(name)
- init_pos = @io.pos
- @io.write "\0" * 512 # placeholder for the header
-
- yield RestrictedStream.new(@io)
- #FIXME: what if an exception is raised in the block?
-
- size = @io.pos - init_pos - 512
- remainder = (512 - (size % 512)) % 512
- @io.write("\0" * remainder)
- final_pos = @io.pos
- @io.pos = init_pos
-
- header = Header.new(:name => name, :mode => mode, :size => size,
- :prefix => prefix).to_s
-
- @io.write header
- @io.pos = final_pos
- end
-
- def mkdir(name, mode)
- raise ClosedIO if @closed
- name = "#{name}/" if name[-1] != ?/
- name, prefix = split_name(name)
- header = Header.new(:name => name, :mode => mode, :typeflag => "5",
- :size => 0, :prefix => prefix).to_s
- @io.write header
- nil
- end
-
- def flush
- raise ClosedIO if @closed
- @io.flush if @io.respond_to?(:flush)
- end
-
- def close
- return if @closed
- @io.write "\0" * 1024
- @closed = true
- end
-
- private
- def split_name name
- raise TooLongFileName if name.size > 256
- if name.size <= 100
- prefix = ""
- else
- parts = name.split(/\//)
- newname = parts.pop
-
- nxt = ""
-
- loop do
- nxt = parts.pop
- break if newname.size + 1 + nxt.size > 100
- newname = "#{nxt}/#{newname}"
- end
-
- prefix = (parts + [nxt]).join("/")
-
- name = newname
-
- raise TooLongFileName if name.size > 100 || prefix.size > 155
- end
- return name, prefix
- end
- end
-
- class Reader
- class UnexpectedEOF < StandardError; end
-
- module InvalidEntry
- def read(len = nil); raise ClosedIO; end
- def getc; raise ClosedIO; end
- def rewind; raise ClosedIO; end
- end
-
- class Entry
- Header::FIELDS.each { |x| attr_reader x }
-
- def initialize(header, anIO)
- @io = anIO
- @name = header.name
- @mode = header.mode
- @uid = header.uid
- @gid = header.gid
- @size = header.size
- @mtime = header.mtime
- @checksum = header.checksum
- @typeflag = header.typeflag
- @linkname = header.linkname
- @magic = header.magic
- @version = header.version
- @uname = header.uname
- @gname = header.gname
- @devmajor = header.devmajor
- @devminor = header.devminor
- @prefix = header.prefix
- @read = 0
- @orig_pos = @io.pos
- end
-
- def read(len = nil)
- return nil if @read >= @size
- len ||= @size - @read
- max_read = [len, @size - @read].min
- ret = @io.read(max_read)
- @read += ret.size
- ret
- end
-
- def getc
- return nil if @read >= @size
- ret = @io.getc
- @read += 1 if ret
- ret
- end
-
- def is_directory?
- @typeflag == "5"
- end
-
- def is_file?
- @typeflag == "0"
- end
-
- def eof?
- @read >= @size
- end
-
- def pos
- @read
- end
-
- def rewind
- raise NonSeekableIO unless @io.respond_to?(:pos=)
- @io.pos = @orig_pos
- @read = 0
- end
-
- alias_method :is_directory, :is_directory?
- alias_method :is_file, :is_file
-
- def bytes_read
- @read
- end
-
- def full_name
- if @prefix != ""
- File.join(@prefix, @name)
- else
- @name
- end
- end
-
- def close
- invalidate
- end
-
- private
- def invalidate
- extend InvalidEntry
- end
- end
-
- def self.new(anIO)
- reader = super(anIO)
- return reader unless block_given?
- begin
- yield reader
- ensure
- reader.close
- end
- nil
- end
-
- def initialize(anIO)
- @io = anIO
- @init_pos = anIO.pos
- end
-
- def each(&block)
- each_entry(&block)
- end
-
- # do not call this during a #each or #each_entry iteration
- def rewind
- if @init_pos == 0
- raise NonSeekableIO unless @io.respond_to?(:rewind)
- @io.rewind
- else
- raise NonSeekableIO unless @io.respond_to?(:pos=)
- @io.pos = @init_pos
- end
- end
-
- def each_entry
- loop do
- return if @io.eof?
- header = Header.new_from_stream(@io)
- return if header.empty?
- entry = Entry.new header, @io
- size = entry.size
- yield entry
- skip = (512 - (size % 512)) % 512
- if @io.respond_to?(:seek)
- # avoid reading...
- @io.seek(size - entry.bytes_read, IO::SEEK_CUR)
- else
- pending = size - entry.bytes_read
- while pending > 0
- bread = @io.read([pending, 4096].min).size
- raise UnexpectedEOF if @io.eof?
- pending -= bread
- end
- end
- @io.read(skip) # discard trailing zeros
- # make sure nobody can use #read, #getc or #rewind anymore
- entry.close
- end
- end
-
- def close
- end
- end
-
- class Input
- include FSyncDir
- include Enumerable
-
- class << self
- private :new
-
- def open(input)
- raise BlockRequired unless block_given?
-
- is = new(input)
- yield is
- return nil
- ensure
- is.close if is
- end
- end
-
- def initialize(input)
- if input.respond_to?(:read)
- @io = input
- else
- @io = open(filename, "rb")
- end
- @tarreader = Tar::Reader.new(@io)
- end
-
- def each(&block)
- @tarreader.each { |entry| yield entry }
- ensure
- @tarreader.rewind
- end
-
- def extract_entry(destdir, entry, expected_md5sum = nil)
- if entry.is_directory?
- dest = File.join(destdir, entry.full_name)
- if dir?(dest)
- begin
- FileUtils.chmod(entry.mode, dest)
- rescue Exception
- nil
- end
- else
- FileUtils.mkdir_p(dest, :mode => entry.mode)
- end
- fsync_dir(dest)
- fsync_dir(File.join(dest, ".."))
- return
- else # it's a file
- md5 = Digest::MD5.new if expected_md5sum
- destdir = File.join(destdir, File.dirname(entry.full_name))
- FileUtils.mkdir_p(destdir, :mode => 0755)
- destfile = File.join(destdir, File.basename(entry.full_name))
- FileUtils.chmod(0600, destfile) rescue nil # Errno::ENOENT
- File.open(destfile, "wb", entry.mode) do |os|
- loop do
- data = entry.read(4096)
- break unless data
- md5 << data if expected_md5sum
- os.write(data)
- end
- os.fsync
- end
- FileUtils.chmod(entry.mode, destfile)
- fsync_dir(File.dirname(destfile))
- fsync_dir(File.join(File.dirname(destfile), ".."))
- if expected_md5sum && expected_md5sum != md5.hexdigest
- raise BadCheckSum
- end
- end
- end
-
- def close
- @io.close
- @tarreader.close
- end
- end
-
- class Output
- class << self
- private :new
-
- def open(output, &block)
- raise BlockNeeded unless block
- outputter = new(output)
-
- yield outputter.external_handle
- return nil
- ensure
- outputter.close if outputter
- end
- end
-
- def initialize(output)
- if output.respond_to?(:write)
- @io = output
- else
- @io = ::File.open(output, "wb")
- end
- @external = Tar::Writer.new(@io)
- end
-
- def external_handle
- @external
- end
-
- def close
- @external.close
- @io.close
- end
- end
-
- class << self
- include FSyncDir
-
- def open(dest, mode = "r", &block)
- raise BlockNeeded unless block
-
- case mode
- when "r"
- Input.open(dest, &block)
- when "w"
- Output.open(dest, &block)
- else
- raise "Unknown TarFile open mode"
- end
- end
-
- def pack_entry(entry, outputter)
- entry = entry.sub(%r{\./}, '')
- stat = File.stat(entry)
- case
- when File.file?(entry)
- outputter.add_file_simple(entry, stat.mode, stat.size) do |os|
- File.open(entry, "rb") { |f| os.write(f.read(4096)) until f.eof? }
- end
- when dir?(entry)
- outputter.mkdir(entry, stat.mode)
- else
- raise "Don't yet know how to pack this type of file."
- end
- end
-
- def pack(src, dest)
- Output.open(dest) do |outp|
- if src.kind_of?(String)
- Find.find(src) { |entry| pack_entry(entry, outp) }
- else
- src.each do |ee|
- Find.find(ee) { |entry| pack_entry(entry, outp) }
- end
- end
- end
- end
-
- def unpack(src, dest, files = [])
- Input.open(src) do |inp|
- if File.exist?(dest) and (not dir?(dest))
- raise "Can't unpack to a non-directory."
- elsif not File.exist?(dest)
- FileUtils.mkdir_p(dest)
- end
-
- inp.each { |entry| inp.extract_entry(dest, entry) }
- end
- end
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/ruwiki.cgi b/ruwiki/tags/release-0.8.0-fixes/ruwiki.cgi
deleted file mode 100644
index 20ddbb1..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/ruwiki.cgi
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# This file may be renamed to change the URI for the wiki.
-#
-# $Id$
-#++
-
- # Customize this if you put the RuWiki files in a different location.
-begin
- require 'ruwiki'
-rescue LoadError
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib"
- require 'ruwiki'
-end
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-wiki.config.webmaster = "webmaster@domain.com"
-
-# wiki.config.debug = false
-# wiki.config.title = "Ruwiki"
-# wiki.config.default_page = "ProjectIndex"
-# wiki.config.default_project = "Default"
- # This next defaults to :flatfiles for Ruby 1.8.1 or earlier and to :yaml for
- # Ruby 1.8.2 or later.
-# wiki.config.storage_type = :flatfiles
-# wiki.config.storage_options[wiki.config.storage_type][:data_path] = "./data/"
-wiki.config.storage_options[wiki.config.storage_type][:extension] = "ruwiki"
-# wiki.config.template_path = "./templates/"
-# wiki.config.template_set = "default"
-# wiki.config.css = "ruwiki.css"
-# wiki.config.time_format = "%H:%M:%S"
-# wiki.config.date_format = "%Y.%m.%d"
-# wiki.config.datetime_format = "%Y.%m.%d %H:%M:%S"
-wiki.config = wiki.config
-
-wiki.run
diff --git a/ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet b/ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet
deleted file mode 100644
index 1c835a8..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet
+++ /dev/null
@@ -1,245 +0,0 @@
-#!/usr/bin/env ruby
-
- # Customize this if you put the RuWiki files in a different location.
-require 'webrick'
-
-begin
- require 'ruwiki'
-rescue LoadError
- $LOAD_PATH.unshift "#{File.dirname($0)}/lib"
- require 'ruwiki'
-end
-
-require 'ruwiki/servlet'
-require 'ruwiki/lang/en'
-require 'ruwiki/lang/de'
-require 'ruwiki/lang/es'
-
-require 'optparse'
-require 'ostruct'
-
-copyright_banner = <<-"COPYRIGHT"
-Ruwiki #{Ruwiki::VERSION}
- Copyright © 2002 - 2004, Digikata and HaloStatue
-
- http://rubyforge.org/projects/ruwiki/
-
- Alan Chen (alan@digikata.com)
- Austin Ziegler (ruwiki@halostatue.ca)
-
-Licensed under the same terms as Ruby.
-
-$Id$
-COPYRIGHT
-
- # This is for the WEBrick version of Ruwiki. This has been abstracted to
- # accept a Config global variable to reconfigure Ruwiki after initial
- # creation.
-$config = Ruwiki::Config.new
-
- # Because the servlet can be started from the command-line, provide defaults
- # for all possible configuration options.
-opts = OpenStruct.new
-opts.port = 8808
-opts.addresses = []
-opts.mount = '/'
-opts.do_log = true
-opts.log_dest = $stderr
-opts.threads = 1
-opts.language = Ruwiki::Lang::EN
-
- # Ruwiki::Config options.
-opts.webmaster = 'webmaster@domain.com'
-opts.debug = false
-opts.title = "Ruwiki"
-opts.default_page = "ProjectIndex"
-opts.default_project = "Default"
-opts.template_path = "./templates/"
-opts.template_set = "default"
-opts.css = "ruwiki.css"
-opts.time_format = "%H:%M:%S"
-opts.date_format = "%Y.%m.%d"
-opts.datetime_format = "%Y.%m.%d %H:%M:%S"
-
-# if RUBY_VERSION >= "1.8.2"
-# opts.storage_type = :yaml
-# else
-# opts.storage_type = :flatfiles
-# end
- # Temporarily disabled the above.
-opts.storage_type = :flatfiles
-
-opts.storage_options = Hash.new { |h, k| h[k] = {} }
-opts.storage_options[opts.storage_type][:data_path] = "./data/"
-opts.storage_options[opts.storage_type][:extension] = "ruwiki"
-
-ARGV.options do |o|
- o.banner = "Usage: #{File.basename($0)} [options]"
- o.separator ""
- o.separator "WEBrick options:"
- o.on('-P', '--port PORT', Numeric, 'Runs the Ruwiki servlet on the specified', 'port. Default 8808.') { |port|
- opts.port = port
- }
- o.on('-A', '--accept ADDRESS,ADDRESS,ADDRESS', Array, 'Restricts the Ruwiki servlet to accepting', 'connections from the specified address or', '(comma-separated) addresses. May be', 'specified multiple times. Defaults to all', 'addresses.') { |address|
- opts.addresses += address
- }
- o.on('-L', '--local', 'Restricts the Ruwiki servlet to accepting', 'only local connections (127.0.0.1).', 'Overrides any previous --accept addresses.') { |local|
- opts.addresses = ["127.0.0.1"]
- }
- o.on('-M', '--mount MOUNT-POINT', 'The relative URI from which Ruwiki ', 'will be accessible. Defaults to "/".') { |mp|
- opts.mount = mp
- }
- o.on('--[no-]log', 'Log WEBrick activity. Default is --log.') { |log|
- opts.do_log = log
- }
- o.on('--logfile LOGFILE', 'The file to which WEBrick logs are', 'written. Default is standard error.') { |lf|
- opts.log_dest = lf
- }
- o.on('-T', '--threads THREADS', Integer, 'Sets the WEBrick threadcount.') { |tc|
- opts.threads = tc
- }
- o.separator ""
- o.separator "Ruwiki options:"
- o.on('--language LANGUAGE', 'The interface language for Ruwiki.', 'Defaults to "en". May be "en", "de", or', '"es".') { |lang|
- case lang
- when 'en'
- opts.language = Ruwiki::Lang::EN
- when 'es'
- opts.language = Ruwiki::Lang::ES
- when 'de'
- opts.language = Ruwiki::Lang::DE
- end
- }
- o.on('--webmaster WEBMASTER', 'The Ruwiki webmaster email address.', 'Defaults to "webmaster@domain.com".') { |wm|
- opts.webmaster = wm
- }
- o.on('--[no-]debug', 'Turns on Ruwiki debugging. Defaults', 'to --no-debug.') { |d|
- opts.debug = d
- }
- o.on('--title TITLE', 'Provides the Ruwiki title. Default is', '"Ruwiki".') { |t|
- opts.title = t
- }
- o.on('--default-page PAGENAME', 'An alternate default page. Default is', '"ProjectIndex".') { |dp|
- opts.default_page = dp
- }
- o.on('--default-project PAGENAME', 'An alternate default project. Default is', '"Default".') { |dp|
- opts.default_project = dp
- }
- o.on('--template-path TEMPLATE_PATH', 'The location of Ruwiki templates. Default', 'is "./templates".') { |tp|
- opts.template_path = tp
- }
- o.on('--templates TEMPLATES', 'The name of the Ruwiki templates. Default', 'is "default".') { |tp|
- opts.template_set = tp
- }
- o.on('--css CSS_NAME', 'The name of the CSS file in the template', 'path. Default is "ruwiki.css".') { |css|
- opts.css = css
- }
- o.on('--storage-type TYPE', Ruwiki::KNOWN_BACKENDS, 'Select the storage type:', "#{Ruwiki::KNOWN_BACKENDS.join(", ")}") { |st|
- opts.storage_type = st
- opts.storage_options[opts.storage_type][:data_path] ||= "./data/"
- opts.storage_options[opts.storage_type][:extension] ||= "ruwiki"
- }
- o.on('--flatfiles-data-path PATH', 'The path where data files are stored.', 'Default is "./data".') { |fdp|
- opts.storage_options[:flatfiles][:data_path] = fdp
- opts.storage_options[:yaml][:data_path] = fdp
- opts.storage_options[:marshal][:data_path] = fdp
- }
- o.on('--flatfiles-extension EXT', 'The extension for data files.', 'Default is "ruwiki".') { |ext|
- opts.storage_options[:flatfiles][:extension] = ext
- opts.storage_options[:yaml][:extension] = ext
- opts.storage_options[:marshal][:extension] = ext
- }
-
- # TODO: Add options for time, date, and datetime formats.
- o.separator ""
- o.separator "General info:"
- o.on_tail('--help', 'Shows this text.') {
- $stderr.puts o
- exit
- }
- o.on_tail('--version', 'Shows the version of Ruwiki.') {
- $stderr.puts copyright_banner
- exit
- }
- o.parse!
-end
-
- # Configuration defaults to certain values. This overrides the defaults. The
- # webmaster.
-$config.webmaster = opts.webmaster
-$config.debug = opts.debug
-$config.title = opts.title
-$config.default_page = opts.default_page
-$config.default_project = opts.default_project
-$config.storage_type = opts.storage_type
-$config.storage_options[opts.storage_type] = opts.storage_options[opts.storage_type]
-$config.template_path = opts.template_path
-$config.template_set = opts.template_set
-$config.css = opts.css
-$config.time_format = opts.time_format
-$config.date_format = opts.date_format
-$config.datetime_format = opts.datetime_format
-$config.language = opts.language
-
- # If the list of accepted addresses is not empty, provide IP-based
- # restrictions.
-if not opts.addresses.empty?
- localonly = proc do |sock|
- if not opts.addresses.include?(sock.peeraddr[3])
- msg = "Rejected peer address #{sock.peeraddr[3]}. Connections are only accepted from: #{opts.addresses.join(", ")}."
- raise WEBrick::ServerError, msg
- end
- end
-else
- localonly = nil
-end
-
-if opts.do_log
- if opts.log_dest = $stderr
- dest = $stderr
- opts.log_dest = "stderr"
- else
- dest = File.open(opts.log_dest, "wb+")
- end
- logger = WEBrick::Log.new(dest, WEBrick::Log::DEBUG)
-else
- logger = nil
-end
-
-banner = <<-"BANNER"
-#{copyright_banner}
-
-WEBrick options:
- Port #{opts.port}
- Accepted Addresses #{opts.addresses.join(", ")}
- Mount Point #{opts.mount}
- Logging? #{opts.do_log}
- Log Destination #{opts.log_dest}
- Threads #{opts.threads}
-
-Ruwiki options:
- Webmaster #{opts.webmaster}
- Debugging? #{opts.debug}
- Title #{opts.title}
- Default Project #{opts.default_project}
- Default Page #{opts.default_page}
- Template Path #{opts.template_path}
- Template Set #{opts.template_set}
- CSS Source #{opts.css}
-
- Storage Type #{opts.storage_type}
- Data Path #{opts.storage_options[opts.storage_type][:data_path]}
- Extension #{opts.storage_options[opts.storage_type][:extension]}
-
-BANNER
-
-banner.each { |b| logger.info(b) } unless logger.nil?
-
-server = WEBrick::HTTPServer.new(:Port => opts.port.to_i,
- :StartThreads => opts.threads.to_i,
- :AcceptCallback => localonly,
- :Logger => logger)
-$config.logger = logger
-server.mount(opts.mount, Ruwiki::Servlet)
-trap("INT") { server.shutdown; exit }
-server.start
diff --git a/ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet.bat b/ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet.bat
deleted file mode 100644
index 32012f7..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/ruwiki_servlet.bat
+++ /dev/null
@@ -1,17 +0,0 @@
-@echo off
-REM Ruwiki 0.8.0
-REM Copyright © 2002 - 2004, Digikata and HaloStatue
-REM Alan Chen (alan@digikata.com)
-REM Austin Ziegler (ruwiki@halostatue.ca)
-REM
-REM Licensed under the same terms as Ruby.
-REM $Id$
-REM
-if "%OS%"=="Windows_NT" goto WinNT
-ruby -x "ruwiki_servlet" %1 %2 %3 %4 %5 %6 %7 %8 %9
-goto done
-:WinNT
-title Ruwiki
-ruby -x "ruwiki_servlet" %*
-goto done
-:done
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/body.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/body.tmpl
deleted file mode 100644
index 2f3c10f..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/content.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/content.tmpl
deleted file mode 100644
index 63b638a..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/content.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/controls.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/controls.tmpl
deleted file mode 100644
index 1137336..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/controls.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_header">
- <form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- <!-- Right-hand tabs must go in reverse order! -->
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10">
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/edit.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/edit.tmpl
deleted file mode 100644
index 02f21e4..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/edit.tmpl
+++ /dev/null
@@ -1,26 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_navbar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_navbar_righttab" id="rw_editing_tab"><strong><em>#label_editing#</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/error.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/error.tmpl
deleted file mode 100644
index a3887b2..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/error.tmpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/footer.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/footer.tmpl
deleted file mode 100644
index 2f0fdbc..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/footer.tmpl
+++ /dev/null
@@ -1,23 +0,0 @@
-<div id="rw_footer">
- <form class="rw_navbar" action="_search">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_navbar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_navbar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- <!-- Right-hand tabs must go in reverse order! -->
- <div class="rw_navbar_righttab">
- <input class="rw_search_box" type="text" name="q" size="10">
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </div>
- <div class="rw_navbar_righttab">
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>
- </div>
- <div class="rw_navbar_righttab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/ruwiki.css b/ruwiki/tags/release-0.8.0-fixes/templates/default/ruwiki.css
deleted file mode 100644
index 5c612e8..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/ruwiki.css
+++ /dev/null
@@ -1,285 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_footer
-{
- position: absolute;
- width: 100%;
- bottom: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_footer { position: fixed; }
-
-body > div#rw_footer > .rw_navbar { position: fixed; bottom: 0; }
-body > div#rw_footer > .rw_navbar > div { position: relative; top: -2em; }
-
-body
-{
- margin: 0.5em;
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_navbar
-{
- width: 100%;
- margin: 0;
- padding: 0.1em;
- font-size: 0.7em;
- border: 1px solid black;
- color: white;
- background-color: #27C;
- height: 0.5em;
- z-index: 2;
-}
-
-.rw_navbar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_navbar a:visited
-{
- color: #2E7;
- font-weight: normal;
- border-bottom: 1px dashed #2E7;
-}
-
-.rw_navbar a:hover
-{
- text-decoration: none;
-}
-
-.rw_navbar_tab
-{
- float: left;
- background-color: #27C;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_navbar_tab:hover
-{
- background-color: #49E;
-}
-
-.rw_navbar_righttab
-{
- float: right;
- padding-left: 0.8em;
- padding-top: 0.3em;
- padding-right: 0.8em;
- border: 1px solid #059;
- background-color: #27C;
- margin: 0 0.3em;
- height: 2em;
-}
-
-.rw_navbar_righttab:hover
-{
- background-color: #49E;
-}
-
-.rw_content
-{
- clear: both;
- margin-top: 2em;
- margin-left: 3em;
- margin-right: 3em;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #27C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #27C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box
-{
- border: 1px dotted #27C;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab { background-color: #C72; }
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- background-color: #999;
- border: 1px solid black;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
-
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/default/save.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/default/save.tmpl
deleted file mode 100644
index 04069b1..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/default/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div></div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/body.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/body.tmpl
deleted file mode 100644
index 2f3c10f..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/body.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
-<!--[if IE 6]>
-<style type="text/css" media="screen,print">
- html { overflow: hidden; }
- body { height: 100%; overflow: auto; }
-</style>
-<![endif]-->
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/content.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/content.tmpl
deleted file mode 100644
index 1d3ca9c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/content.tmpl
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content"><div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/controls.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/controls.tmpl
deleted file mode 100644
index 6e12b22..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_project#<a href="%cgi_url%/%page_project%/"><strong>%page_project%</strong></a></div>
- <div class="rw_titlebar_tab">%label_topic_or_search% %page_topic%</div>
- [?editable|<div class="rw_titlebar_tab"><a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">#label_edit#</a></div>?]
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/edit.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/edit.tmpl
deleted file mode 100644
index 2604b01..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/edit.tmpl
+++ /dev/null
@@ -1,26 +0,0 @@
-<div id="rw_header">
- <div class="rw_titlebar">
- <div class="rw_titlebar_tab">%home_link%</div>
- <div class="rw_titlebar_tab">#label_topic#<b>%page_topic%</b></div>
- <div class="rw_titlebar_tab">#label_project#<b>%page_project%</b></div>
- <div class="rw_titlebar_tab" id="rw_editing_tab"><strong><em>#label_editing#</em></strong></div>
- </div>
-</div>
-
-<div id="rw_content">
- <div class="rw_content_edit">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/error.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/error.tmpl
deleted file mode 100644
index 5a2882e..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/error.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<div id="rw_header">
- <div class="rw_navbar">
- <div class="rw_navbar_tab">%home_link%</div>
- <div class="rw_navbar_righttab" style="background-color: #C72"><strong><em>%name%</em></strong></div>
- </div>
-</div>
-<div id="rw_content">
- <div class="rw_content">
- <h1>%name%</h1>
- <p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
- <p>%backtrace%</p>
- </div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/footer.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/footer.tmpl
deleted file mode 100644
index f43eb32..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/footer.tmpl
+++ /dev/null
@@ -1,22 +0,0 @@
-<div class="rw_footer">
- <form class="rw_footer_tab" action="_search">
- <div>
- <input class="rw_search_box" type="text" name="q" size="10">
- </div>
- <div>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- </div>
- </form>
- <div class="rw_footer_tab">
- <dl>
- <dt>%page_project%::</dt>
- <dd><a href="%cgi_url%/%page_project%/_topics">#label_topics#</a><br />
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- </dd>
- </div>
- <div class="rw_footer_tab">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- </div>
- </form>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/ruwiki.css b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/ruwiki.css
deleted file mode 100644
index 5e9cf4f..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/ruwiki.css
+++ /dev/null
@@ -1,336 +0,0 @@
-/* $Id$ */
-/*
- * The fixed positioning for what we're doing is based on:
- * http://www.456bereastreet.com/lab/cssframes/
- */
-body, html { margin: 0; padding: 0; }
- /* Prevents content from becoming unreachable in Gecko */
-body { min-width: 720px; }
-
- /*
- * position: absolute - scrolls the whole page for all browsers. This also
- * makes the background invisible, so the text doesn't appear between tabs.
- */
-div#rw_header
-{
- position: absolute;
- width: 100%;
- top: 0;
- left: 0;
- height: 2.25em;
- background-color: #F7FEFF;
-}
-
- /* position: fixed - header and footer don't scroll; modern browsers */
-body > div#rw_header { position: fixed; }
-
-.rw_titlebar
-{
- margin: 0 auto;
- height: 0.5em;
-}
-
- /* Normal styling from here on out. */
-body
-{
- color: black;
- font-size: medium;
- font-family: "Trebuchet MS", "Verdana", sans-serif;
- background-color: #F7FEFF;
-}
-
-.rw_titlebar
-{
- font-size: 0.7em;
- border: 1px solid #059;
- color: white;
- background-color: #5C9;
- height: 0.5em;
- width: 100%;
-}
-
-.rw_titlebar a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_titlebar a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_titlebar a:hover
-{
- text-decoration: none;
-}
-
-.rw_titlebar_tab
-{
- float: left;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0 0.3em;
- height: 2em;
- vertical-align: center;
-}
-
-.rw_titlebar_tab:hover
-{
- background-color: #4E9;
-}
-
-div.rw_footer
-{
- position: fixed;
- left: 72%;
- width: 20%;
- height: 100%;
- padding: 0.2em;
- padding-top: 0.5em;
-//background-color: #95C;
- font-size: 0.9em;
-}
-
-.rw_footer
-{
-}
-
-.rw_footer a
-{
- color: white;
- border-bottom: 1px dashed white;
- font-weight: bold;
-}
-
-.rw_footer a:visited
-{
- color: #A11;
- font-weight: bold;
- border-bottom: 1px dashed #A00;
-}
-
-.rw_footer a:hover
-{
- text-decoration: none;
-}
-
-.rw_footer_tab
-{
- color: yellow;
- background-color: #595;
- padding-left: 0.8em;
- padding-right: 0.8em;
- padding-top: 0.3em;
- border: 1px solid #059;
- margin: 0.3em;
- min-height: 2em;
- clear: both;
-}
-
-.rw_footer_tab div
-{
- text-align: right;
-}
-
-div#rw_content
-{
- padding: 50px 0 0 0;
- margin-left: 0;
- voice-family: "\"}\""; /* fake out IE5/Win */
- voice-family: inherit;
- margin-left: 16px;
-}
-
-body > div#rw_content
-{
- margin-left: 0;
-}
-
-.rw_content
-{
- padding-top: 0;
- margin-left: 3em;
- width: 65%;
- float: left;
-}
-
-.rw_content_edit
-{
- width: 90%;
- margin: 0 auto;
- padding: 2em;
- padding-top: 0;
- float: left;
-}
-
-.rw_edit_content
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px dashed #059;
- padding: 0.3em;
- width: 100%;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px dashed #059;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px dotted #59C;
-}
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- border: 3px double #72C;
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title
-{
- margin: 0;
-}
-
-.rw_edit_format div
-{
- border: 3px double #59C;
-}
-
-.rw_search_button
-{
- border: 1px dotted #59C;
- margin: 0.1em;
-}
-
-.rw_search_box
-{
- border: 1px dotted #59C;
- width: 100%;
- margin: 0.1em;
-}
-
-.rw_search_box:hover
-{
- background-color: #999;
-}
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_editing_tab
-{
- background-color: #C72;
- text-align: right;
- margin-right: 2em;
- float: right;
-}
-
-#rw_saved_page_announcement { border-bottom: 1px solid black; }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- background-color: #999;
- border: 1px solid black;
-}
-.rwtk_Image { }
-.rwtk_NumberedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_NamedLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_ExternalLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_RubyTalkLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_OtherRubyLinks
-{
- border: 1px dashed #72C;
- background-color: #C7CECF;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dotted blue }
-.rwtk_WikiLink { }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/save.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/save.tmpl
deleted file mode 100644
index 7c4c31c..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/sidebar/save.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div id="rw_content">
-<div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div>
-<!-- footer -->!INCLUDE!<!-- /footer -->
-</div><!-- /content -->
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/body.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/body.tmpl
deleted file mode 100644
index b3281d0..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/body.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>%wiki_title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=#charset_encoding#" />
- [!indexable|<meta name="robots" content="noindex,nofollow" />?]
- %css_link%
- </head>
- <body>
- !INCLUDE!
- </body>
-</html>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/content.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/content.tmpl
deleted file mode 100644
index 1ba8ef7..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/content.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/controls.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/controls.tmpl
deleted file mode 100644
index 29cdf3a..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/controls.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <a href="%cgi_url%/%page_project%/">%page_project%</a>
- &raquo;
- %page_topic%
- [?editable|<a href="%cgi_url%/%page_project%/%page_raw_topic%/_edit">[#label_edit#]</a>?]
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/edit.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/edit.tmpl
deleted file mode 100644
index b427114..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/edit.tmpl
+++ /dev/null
@@ -1,24 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- &raquo;
- <strong>%page_topic%</strong>
- &raquo;
- <strong>%page_project%</strong>
- [<strong><em>#label_editing#</em></strong>]
-</div>
-
-<div class="rw_content">
- <form class="rw_edit_form" action="%cgi_url%/%page_project%/%page_raw_topic%" method="post">
- <span class="rw_accelerator">(#label_text_accelerator#)</span> #label_text#<br /><textarea accesskey="#label_text_accelerator#" class="rw_edit_content" rows="15" name="newpage">%page_content%</textarea>
- <div class="rw_edit_comment"><span class="rw_accelerator">(#label_comment_accelerator#)</span> #label_edit_comment#<input accesskey="#label_comment_accelerator#" type="text" name="edcomment" value="%edit_comment%" /></div>
- <input type="hidden" name="topic" value="%page_raw_topic%" />
- <input type="hidden" name="project" value="%page_project%" />
- <input type="hidden" name="version" value="%page_version%" /><br />
- <button class="rw_edit_form_button" accesskey="#label_save_accelerator#" type="submit" name="save"><span class="rw_accelerator">(#label_save_accelerator#)</span> #label_save#</button>
- <button class="rw_edit_form_button" accesskey="#label_cancel_accelerator#" type="submit" name="cancel"><span class="rw_accelerator">(#label_cancel_accelerator#)</span> #label_cancel#</button>
- <button class="rw_edit_form_button" accesskey="#label_preview_accelerator#" type="submit" name="preview"><span class="rw_accelerator">(#label_preview_accelerator#)</span> #label_preview#</button>
- </form>
- <h2 style="border-bottom: 1px solid black">#label_original_text#</h2>
- <div class="rw_edit_raw"><h2 class="rw_edit_title">#label_raw#</h2><pre>%pre_page_content%</pre></div>
- <div class="rw_edit_format"><h2 class="rw_edit_title">#label_formatted#</h2><div>%unedited_page_content%</div></div>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/error.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/error.tmpl
deleted file mode 100644
index ac898ea..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/error.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="rw_navbar">
- %home_link%
- |
- <strong><em>%name%</em></strong>
-</div>
-<div class="rw_content">
-<h1>%name%</h1>
-<p>#label_send_report_by# <a href="mailto:%webmaster%?subject=%name%[?backtrace_email|&amp;body=%backtrace_email%?]">#label_send_report#</a></p>
-<p>%backtrace%</p>
-</div>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/footer.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/footer.tmpl
deleted file mode 100644
index dcd65ef..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/footer.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-<form class="rw_navbar" action="_search">
- <a href="%cgi_url%/_projects">#label_projects#</a>
- |
- %page_project%::<a href="%cgi_url%/%page_project%/_topics">#label_topics#</a>,
- <a href="%cgi_url%/%page_project%/RecentChanges">#label_recent_changes#</a>
- |
- <input class="rw_search_box" type="text" name="q" size="10">
- <button class="rw_search_button" type="submit">#label_search_project#</button>
- <input class="rw_search_all_check" type="checkbox" name="a">#label_search_all#</input>
-</form>
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/ruwiki.css b/ruwiki/tags/release-0.8.0-fixes/templates/simple/ruwiki.css
deleted file mode 100644
index 0c80c74..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/ruwiki.css
+++ /dev/null
@@ -1,181 +0,0 @@
-/* $Id$ */
-body
-{
- color: black;
- font-size: medium;
- background-color: #fafafa;
-}
-
-.rw_navbar
-{
- font-weight: bold;
- font-size: 1.1em;
- padding: 0.3em;
-}
-
-.rw_navbar a
-{
- border-bottom: 1px dashed black;
- font-weight: bold;
-}
-.rw_navbar a:visited
-{
- color: maroon;
- border-bottom: 1px dashed maroon;
-}
-.rw_navbar a:hover { background-color: #afafaf; }
-
-.rw_content
-{
- background-color: white;
- border: 1px dashed grey;
- padding: 0.5em;
- margin-left: 1em;
- margin-right: 1em;
-}
-
-.rw_edit_content
-{
- border: 1px solid black;
- padding: 0.3em;
- width: 95%;
- min-height: 20.5em;
-}
-
-.rw_accelerator { text-decoration: underline; }
-
-.rw_edit_content textarea
-{
- border: 1px solid black;
- padding: 0.3em;
- min-height: 20.5em;
- height: 20.5em;
-}
-
-.rw_edit_comment
-{
- clear: both;
- margin-top: 1em;
-}
-
-.rw_edit_comment input
-{
- border: 1px solid black;
- min-width: 50%;
- width: 70%;
- max-width: 80%;
-}
-
-.rw_edit_form { }
-
-.rw_edit_form_button
-{
- font-size: 0.8em;
- border: 1px solid black;
-}
-
-.rw_pagelink { text-decoration: none; }
-.rw_projectxlink { }
-.rw_projectindex { }
-
-.rw_edit_raw
-{
- font-size: 0.8em;
- float: left;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_raw pre
-{
- overflow: scroll;
- clear: right;
-}
-
-.rw_edit_format
-{
- font-size: 0.8em;
- float: right;
- max-width: 48%;
- width: 48%;
- margin: 0;
-}
-
-.rw_edit_title { }
-
-.rw_edit_format div
-{
-}
-
-.rw_search_button
-{
- border: 1px solid black;
-}
-
-.rw_search_box
-{
- border: 1px solid black;
-}
-
-.rw_search_box:hover { }
-
-li { margin-top: 0.25em; margin-bottom: 0.25em; }
-
-.rw_minilink { font-size: 0.5em; font-weight: bold; }
-
-#rw_saved_page_announcement { }
-
- /* Token Classes */
-.rwtk_Paragraph { }
-.rwtk_Code
-{
- background-color: #EEE;
- border: 1px solid black;
-}
-.rwtk_Image { border: none; }
-.rwtk_NumberedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_NamedLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_ExternalLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_RubyTalkLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_OtherRubyLinks
-{
- border-bottom: 1px solid #00AA00;
-}
-.rwtk_HRule { }
-
-.rwtk_Abbreviations { }
-
-div.rwtk_Calendar {
- border: 1px solid black;
- float: right;
- clear: none;
-}
-.rwtk_Calendar_current_month { }
-.rwtk_Calendar_prev_month { }
-.rwtk_Calendar_next_month { }
-.rwtk_Calendar_weekend { }
-.rwtk_Calendar_weekday { }
-.rwtk_Calendar_day { }
-.rwtk_Calendar_today { background-color: #FFFFA7; }
-
-.rwtk_EditWikiLink { border: 1px dashed grey; }
-.rwtk_WikiLink { text-decoration: none; }
-
-.rwtk_Headings { }
-.rwtk_Lists { }
-.rwtk_Blockquotes { }
-.rwtk_Definitions { }
-.rwtk_Definitions dt { font-weight: bold; }
diff --git a/ruwiki/tags/release-0.8.0-fixes/templates/simple/save.tmpl b/ruwiki/tags/release-0.8.0-fixes/templates/simple/save.tmpl
deleted file mode 100644
index 51de9f4..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/templates/simple/save.tmpl
+++ /dev/null
@@ -1,8 +0,0 @@
-<!-- header -->!INCLUDE!<!-- /header -->
-<!-- content --><div class="rw_content" id="rw_saved_page_announcement">
- #label_saved_page# <a href="%cgi_url%/%page_project%/%page_raw_topic%">%page_project%::%page_topic_name%</a>
-</div>
-<div class="rw_content">
- %content%
-</div><!-- /content -->
-<!-- footer -->!INCLUDE!<!-- /footer -->
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/harness-cgi.rb b/ruwiki/tags/release-0.8.0-fixes/tests/harness-cgi.rb
deleted file mode 100644
index a0e9604..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/harness-cgi.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'harness'
-
-ENV["REQUEST_METHOD"] = "HEAD"
-
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_type = :flatfiles
-$wiki.config.storage_options[:flatfiles][:data_path] = "../data"
-$wiki.config.storage_options[:flatfiles][:extension] = "ruwiki"
-$wiki.config.template_path = "../templates/"
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/harness.rb b/ruwiki/tags/release-0.8.0-fixes/tests/harness.rb
deleted file mode 100644
index 3e65272..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/harness.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-$LOAD_PATH.unshift("../lib")
-
-ENV["REQUEST_METHOD"] = "HEAD"
-
-require 'ruwiki'
-
- # This is the CGI version of Ruwiki. Therefore, when we create the Ruwiki
- # instance, we specify that the request and response handlers are to be
- # generated from a new CGI object.
-$wiki = Ruwiki.new(Ruwiki::Handler.from_cgi(CGI.new))
-
- # Configuration defaults to certain values. This overrides the defaults.
- # The webmaster.
-$wiki.config.webmaster = "webmaster@domain.com"
-$wiki.config.storage_type = :flatfiles
-$wiki.config.storage_options[:flatfiles][:data_path] = "../data"
-$wiki.config.storage_options[:flatfiles][:extension] = "ruwiki"
-$wiki.config.template_path = "../templates/"
-$wiki.config.verify
-$wiki.set_backend
-
-# $wiki.config.debug = false
-# $wiki.config.title = "Ruwiki"
-# $wiki.config.default_page = "ProjectIndex"
-# $wiki.config.default_project = "Default"
-# $wiki.config.storage_type = :flatfiles
-# $wiki.config.storage_options[:flatfiles][:data_path] = "./data/"
-# $wiki.config.template_path = "./templates/"
-# $wiki.config.template_set = "default"
-# $wiki.config.css = "ruwiki.css"
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/tc_backend_flatfile.rb b/ruwiki/tags/release-0.8.0-fixes/tests/tc_backend_flatfile.rb
deleted file mode 100644
index 6b9969b..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/tc_backend_flatfile.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-require 'fileutils'
-
-class TestBackendFlatfiles < Test::Unit::TestCase
- def setup
- @ffopts = { :data_path => "./test/data", :extension => nil }
-
- # generate a database
- raise "Setup Error: #{@ffopts[:data_path]} exists" if File.exists?(@ffopts[:data_path])
-
- @flatbase = {
- 'Proj1' => ['ProjectIndex:all projects must have this',
- 'P1TopicOne:this is the content',
- 'P1TopicTwo:more content'],
- 'Proj2' => ['ProjectIndex:all projects must have this',
- 'P2TopicOne:this is the content',
- 'P2TopicTwo:more content',
- 'P2TopicThree:even more more content']
- }
-
- @flatbase.each do |key, val|
- prjdir = "#{@ffopts[:data_path]}/#{key}"
- FileUtils.mkdir_p(prjdir) rescue nil
- val.each do |topcon|
- topic, content = topcon.split(":")
- File.open("#{prjdir}/#{topic}", "w") { |fh| fh.puts "page!content: #{content}" }
- end
- end
-
- @backend = nil
- @pg = nil
- end
-
- def teardown
- # remove testing flatabase
- FileUtils.rm_rf(@ffopts[:data_path])
- Dir.rmdir("./test") # ugly but it works
- end
-
- def test_list_projects
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- # should be ['Proj1', 'Proj2']
- assert_equal(@flatbase.keys, @backend.list_projects)
- end
-
- def test_list_topics
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- @flatbase.keys.sort.each do |proj|
- got_topics = @backend.list_topics(proj)
- exp_topics = @flatbase[proj].map { |ent| ent.split(':')[0] }
- assert_equal(exp_topics.sort, got_topics.sort)
- end
- end
-
- # test simple one word lookups
- # need to add more complex search strings
- def test_search_project
- assert_nothing_raised { @backend = Ruwiki::Backend::Flatfiles.new(@ffopts) }
-
- assert_equal({'ProjectIndex' => 1,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 0 }.to_a.sort,
- @backend.search_project('Proj1', 'this').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 0,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'more').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'topic').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P1TopicOne' => 1,
- 'P1TopicTwo' => 1 }.to_a.sort,
- @backend.search_project('Proj1', 'content').to_a.sort)
- assert_equal({'ProjectIndex' => 0,
- 'P2TopicOne' => 0,
- 'P2TopicTwo' => 1,
- 'P2TopicThree' => 2 }.to_a.sort,
- @backend.search_project('Proj2', 'more').to_a.sort)
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/tc_bugs.rb b/ruwiki/tags/release-0.8.0-fixes/tests/tc_bugs.rb
deleted file mode 100644
index 4f6b3d0..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/tc_bugs.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'harness'
-require 'ruwiki/backend/flatfiles'
-require 'ostruct'
-require 'test/unit'
-
-# see if we can reproduce the LicenseandAuthor hang
-# described in bug id 147 on rubyforge
-class TC_LicenseAndAuthorHang < Test::Unit::TestCase
- def setup
- @ffopts = { :data_path => "../data" }
-
- @backend = nil
- @pg = nil
- end
-
- # load "to the metal"
- def test_ffload
- assert_nothing_raised do
- @backend = ::Ruwiki::Backend::Flatfiles.new(@ffopts)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.load('LicenseAndAuthorInfo.ruwiki', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-
- # abstract backend retreive
- def test_beload
- @backend = nil
- assert_nothing_raised do
- mock_ruwiki = OpenStruct.new
- mock_ruwiki.config = OpenStruct.new
- mock_ruwiki.config.message = {}
- mock_ruwiki.config.storage_options = { :flatfiles => @ffopts }
-
- @backend = ::Ruwiki::BackendDelegator.new(mock_ruwiki, :flatfiles)
- end
- assert_not_nil(@backend)
- assert_nothing_raised do
- @pg = @backend.retrieve('LicenseAndAuthorInfo', 'Ruwiki')
- end
- assert_not_nil(@pg)
- end
-end
-
-# if __FILE__ == $0
-# ObjectSpace.each_object { |o| tests << o if o.kind_of?(Class) }
-# tests.delete_if { |o| !o.ancestors.include?(Test::Unit::TestCase) }
-# tests.delete_if { |o| o == Test::Unit::TestCase }
-
-# tests.each { |test| Test::Unit::UI::Console::TestRunner.run(test) }
-# end
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/tc_exportable.rb b/ruwiki/tags/release-0.8.0-fixes/tests/tc_exportable.rb
deleted file mode 100644
index 4dc60d1..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/tc_exportable.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2004, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-if __FILE__ == $0
- $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib")
- class Ruwiki; end
-end
-
-require 'ruwiki/exportable'
-require 'test/unit'
-
- class TCExportable < Test::Unit::TestCase
- class Exportable
- include Ruwiki::Exportable
-
- attr_accessor :a, :b, :long_name, :altname, :xform, :group2
- exportable :a
- exportable :long_name
- exportable :altname, :name => 'alt-name'
- exportable :group2, :group => 'group2'
- end
-
- def test_exportable
- __exportables = {
- 'default' => {
- 'a' => '@a'.intern,
- 'long-name' => '@long_name'.intern,
- 'alt-name' => '@altname'.intern,
- },
- 'group2' => {
- 'group2' => '@group2'.intern
- }
- }
- __values = {
- 'default' => {
- 'a' => 'a',
- 'long-name' => 'c',
- 'alt-name' => 'd',
- },
- 'group2' => { 'group2' => 'e' }
- }
- xx = nil
- ss = nil
- assert_nothing_raised do
- xx = Exportable.new
- xx.a = "a"
- xx.b = "b"
- xx.long_name = "c"
- xx.altname = "d"
- xx.xform = 22/7
- xx.group2 = "e"
- ss = xx.export
- end
- assert_equal(__exportables, xx.class.__exportables)
- assert_equal(__values, ss)
- end
- end
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/tc_template.rb b/ruwiki/tags/release-0.8.0-fixes/tests/tc_template.rb
deleted file mode 100644
index 3a7f0ab..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/tc_template.rb
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'test/unit'
-require 'harness-cgi'
-
- class TestTemplates < Test::Unit::TestCase
- def test_include
- a = "a!INCLUDE!c"
- b = "b"
- t = Ruwiki::TemplatePage.new(a, b)
- assert_equal(["abc"], t.lines.lines)
- end
-
- def test_variables
- a = "a%b%c"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.process("", v))
- end
-
- def test_optional_variables
- a = "a%b%%?c%d"
- v = { "b" => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.process("", v))
-
- v["c"] = "c"
- assert_equal("abcd", t.process("", v))
- end
-
- def test_labels
- a = "a#b#c"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abc", t.process("", v, m))
- end
-
- def test_optional_labels
- a = "a#b##?c#d"
- v = {}
- m = { :b => "b" }
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("abd", t.process("", v, m))
-
- m[:c] = "c"
- assert_equal("abcd", t.process("", v, m))
- end
-
- def test_hrefs
- a = "HREF:a:b:"
- t = Ruwiki::TemplatePage.new(a)
- v = { "b" => "b" }
-
- assert_equal("b", t.process("", v))
-
- s = ""
- v["a"] = "link"
- assert_equal(%Q(<a href="link">b</a>), t.process("", v))
- end
-
- def test_repeat_subst
- v1 = { "a" => 3 }
- v2 = { "a" => 2...4 }
- v3 = { "a" => -4...-2 }
- v4 = { "a" => [3, 1, 4, 1, 5, 9] }
- v5 = { "a" => [{ "a" => 3 }, { "a" => 1 }, { "a" => 4 }, { "a" => 1 }, { "a" => 5 }, { "a" => 9 }] }
-
- a = "[:a|xy:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("xyxyxy", t.process("", v1))
- assert_equal("xyxy", t.process("", v2))
- assert_equal("xyxy", t.process("", v3))
- assert_equal("xyxyxyxyxyxy", t.process("", v4))
- assert_equal("xyxyxyxyxyxy", t.process("", v5))
-
- a = "[:a|%a%:]"
- t = Ruwiki::TemplatePage.new(a)
- assert_equal("123", t.process("", v1))
- assert_equal("23", t.process("", v2))
- assert_equal("-4-3", t.process("", v3))
- assert_equal("314159", t.process("", v4))
- assert_equal("314159", t.process("", v5))
- end
-
- def test_optional_subst
- v1 = { "a" => "a" }
- v2 = { "a" => nil }
- a1 = "[?a|xy?]"
- a2 = "[!a|xy?]"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
-
- assert_equal("xy", t1.process("", v1))
- assert_equal("", t1.process("", v2))
- assert_equal("", t2.process("", v1))
- assert_equal("xy", t2.process("", v2))
- end
-
- def test_repeat_block
- a1 = "START:a\nxy\nEND:a"
- a2 = "START:a\nx%b%y\nEND:a"
- a3 = "START:\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- v = { "a" => [{ "b" => 3 }, { "b" => 1 }, { "b" => 4 }, { "b" => 1 }, { "b" => 5 }, { "b" => 9 }] }
-
- assert_equal("xy\nxy\nxy\nxy\nxy\nxy\n", t1.process("", v))
- assert_equal("x3y\nx1y\nx4y\nx1y\nx5y\nx9y\n", t2.process("", v))
- assert_raises(RuntimeError) { t3.process("", v) }
- end
-
- def test_optional_block
- a1 = "IF:a\nxy\nENDIF:a"
- a2 = "IF:\nxy\nEND:"
- a3 = "IFNOT:a\nxy\nENDIF:a"
- a4 = "IFNOT:\nxy\nEND:"
- t1 = Ruwiki::TemplatePage.new(a1)
- t2 = Ruwiki::TemplatePage.new(a2)
- t3 = Ruwiki::TemplatePage.new(a3)
- t4 = Ruwiki::TemplatePage.new(a4)
- v1 = { "a" => true }
- v2 = { "a" => nil }
-
- assert_equal("xy", t1.process("", v1))
- assert_equal("", t1.process("", v2))
- assert_raises(RuntimeError) { t2.process("", v1) }
- assert_equal("", t3.process("", v1))
- assert_equal("xy", t3.process("", v2))
- assert_raises(RuntimeError) { t4.process("", v1) }
- end
- end
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/tc_tokens.rb b/ruwiki/tags/release-0.8.0-fixes/tests/tc_tokens.rb
deleted file mode 100644
index a8639b5..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/tc_tokens.rb
+++ /dev/null
@@ -1,327 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.6.1
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-require 'test/unit'
-require 'harness-cgi'
-
-class TokenTestCases < Test::Unit::TestCase
- def setup
- @mrw = MockRuwiki.new
- end
-
- class MockRuwiki
- def initialize
- @project = "Default"
- @tokens = []
- @script = "<uri>"
- @message = Hash.new { |h, k| h[k] = "#{k.inspect}" }
- @title = "Ruwiki"
- end
-
- def __tokenize(content, token)
- content.gsub!(token.regexp) do |m|
- match = Regexp.last_match
- tc = token.new(match, @project, $wiki.backend, @script, @message, @title)
- @tokens << tc
- if m[0, 1] == '\\'
- "\\TOKEN_#{@tokens.size - 1}"
- else
- "TOKEN_#{@tokens.size - 1}"
- end
- end
- content
- end
-
- def __replace(content)
- replaced = []
- s = true
- loop do
- break if replaced.size >= @tokens.size
- break if s.nil?
- s = content.gsub!(/\\TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].restore
- end
-
- s = content.gsub!(/TOKEN_(\d+)/) do |m|
- match = Regexp.last_match
- i = match.captures[0].to_i
- replaced << i
- @tokens[i].replace
- end
- end
- content
- end
-
- def __post_replace(content)
- token_classes = @tokens.map { |token| token.class }.sort_by { |token| token.rank }
- token_classes.uniq.each { |tc| tc.post_replace(content) }
- content
- end
-
- end
-
- def __process(token, content, tokenized, replaced, result)
- assert_equal(tokenized, content = @mrw.__tokenize(content, token), "Tokenization failure.")
- assert_equal(replaced, content = @mrw.__replace(content), "Replacement failure.")
- assert_equal(result, content = @mrw.__post_replace(content), "Post-replace failure.")
- end
-
- def __display(token, content)
- p tokenized = @mrw.__tokenize(content.dup, token)
- p replaced = @mrw.__replace(tokenized.dup)
- p result = @mrw.__post_replace(replaced.dup)
- end
-
- def test_Paragraph
- token = Ruwiki::Wiki::Paragraph
- content = "\nABC\n\nabc\n"
- tkv = "TOKEN_0\nABC\nTOKEN_1\nabc\n"
- rpv = %Q(</p><p class="rwtk_Paragraph">\nABC\n</p><p class="rwtk_Paragraph">\nabc\n)
- res = %Q(<p class="rwtk_Paragraph">ABC</p>\n<p class="rwtk_Paragraph">abc</p>)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Image
- token = Ruwiki::Wiki::Image
- content = "[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_0"
- rpv = %Q(<img class="rwtk_Image" alt="http://www.halostatue.ca/graphics/maple_leaf.gif" src="http://www.halostatue.ca/graphics/maple_leaf.gif" title="http://www.halostatue.ca/graphics/maple_leaf.gif" />)
- res = rpv
-
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_1"
- content = %Q([image : http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" title="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="Maple Leaf" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_2"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true])
- rpv = %Q(<img class="rwtk_Image" alt="[1]" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[1]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- tkv = "TOKEN_3"
- content = %Q([image: http://www.halostatue.ca/graphics/maple_leaf.gif style="border: 1px solid black" numbered=true alt="Maple Leaf"])
- rpv = %Q(<img class="rwtk_Image" alt="Maple Leaf" src="http://www.halostatue.ca/graphics/maple_leaf.gif" style="border: 1px solid black" title="[2]" />)
- res = rpv
- __process(token, content, tkv, rpv, res)
-
- content = "\[image:http://www.halostatue.ca/graphics/maple_leaf.gif]"
- tkv = "TOKEN_4"
- rpv = content
- res = content
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Code
- content = " line 1\n line 2\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_0TOKEN_1line 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2</pre>\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
-
- content = " line 1\n line 2\n \n\nline 3\n"
- token = Ruwiki::Wiki::Code
- tkv = "TOKEN_2TOKEN_3TOKEN_4\nline 3\n"
- rpv = %Q(</p><pre class="rwtk_Code"> line 1</pre>\n</p><pre class="rwtk_Code"> line 2</pre>\n</p><pre class="rwtk_Code"> </pre>\n\nline 3\n)
- res = %Q(</p><pre class="rwtk_Code"> line 1\n line 2\n </pre>\n\nline 3\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NumberedLinks
- token = Ruwiki::Wiki::NumberedLinks
- Ruwiki::Wiki::NumberedLinks.reset
- content = "[http://www.ruby-lang.org] \\[http://www.rubyforge.org]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
- res = %Q{<a class="rwtk_NumberedLinks" href="http://www.ruby-lang.org">[1]</a> [http://www.rubyforge.org]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_NamedLinks
- token = Ruwiki::Wiki::NamedLinks
- content = "[http://www.ruby-lang.org Ruby] \\[http://www.rubyforge.org RubyForge]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
- res = %Q{<a class="rwtk_NamedLinks" href="http://www.ruby-lang.org">Ruby</a> [http://www.rubyforge.org RubyForge]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ExternalLinks
- token = Ruwiki::Wiki::ExternalLinks
- content = "http://www.ruby-lang.org \\http://www.rubyforge.org"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q{<a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
- res = %Q{<a class="rwtk_ExternalLinks" href="http://www.ruby-lang.org">http://www.ruby-lang.org</a> http://www.rubyforge.org}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_HRule
- token = Ruwiki::Wiki::HRule
- content = "----\n\\----"
- tkv = "TOKEN_0\n\\TOKEN_1"
- rpv = %Q(<hr class="rwtk_HRule" />\n----)
- res = %Q(<hr class="rwtk_HRule" />\n----)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLink
- token = Ruwiki::Wiki::ProjectCrossLink
- content = "Ruwiki::ChangeLog \\Ruwiki::To_Do Ruwiki::NotExist \\Ruwiki::NotExist"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::To_Do <span class="rwtk_EditWikiLink">Ruwiki::NotExist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/NotExist/_edit">?</a> Ruwiki::NotExist}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectCrossLinkWikipedia
- token = Ruwiki::Wiki::ProjectCrossLinkWikipedia
- content = "Ruwiki::[[ChangeLog]] \\Ruwiki::[[To_Do]] Ruwiki::[[Does Not Exist]] \\Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 Ruwiki::[[_invalid]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ChangeLog">Ruwiki::ChangeLog</a> Ruwiki::[[To_Do]] <span class="rwtk_EditWikiLink">Ruwiki::Does Not Exist</span><a class="rwtk_WikiLink" href="<uri>/Ruwiki/Does+Not+Exist/_edit">?</a> Ruwiki::[[Does Not Exist]] Ruwiki::[[_invalid]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_ProjectIndex
- token = Ruwiki::Wiki::ProjectIndex
- content = "::Ruwiki \\::Ruwiki ::Newproject \\::Newproject"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Ruwiki/ProjectIndex">Ruwiki</a> ::Ruwiki <span class="rwtk_EditWikiLink">Newproject</span><a class="rwtk_WikiLink" href="<uri>/Newproject/_create">?</a> ::Newproject}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikiLinks
- token = Ruwiki::Wiki::WikiLinks
- content = "ProjectIndex \\ProjectIndex AustinZiegler \\AustinZiegler Alan_Chen \\Alan_Chen"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> ProjectIndex <span class="rwtk_EditWikiLink">AustinZiegler</span><a class="rwtk_WikiLink" href="<uri>/Default/AustinZiegler/_edit">?</a> AustinZiegler <span class="rwtk_EditWikiLink">Alan Chen</span><a class="rwtk_WikiLink" href="<uri>/Default/Alan_Chen/_edit">?</a> Alan_Chen}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_WikipediaLinks
- token = Ruwiki::Wiki::WikipediaLinks
- content = "[[ProjectIndex]] \\[[ProjectIndex]] [[Austin Ziegler]] \\[[Austin Ziegler]] [[_Alan Chen]]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 [[_Alan Chen]]"
- rpv = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
- res = %Q{<a class="rwtk_WikiLink" href="<uri>/Default/ProjectIndex">ProjectIndex</a> [[ProjectIndex]] <span class="rwtk_EditWikiLink">Austin Ziegler</span><a class="rwtk_WikiLink" href="<uri>/Default/Austin+Ziegler/_edit">?</a> [[Austin Ziegler]] [[_Alan Chen]]}
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Abbreviations
- token = Ruwiki::Wiki::Abbreviations
- content = "@{matz}\n@{}\n\\@{matz}"
- tkv = "TOKEN_0\nTOKEN_1\n\\TOKEN_2"
- rpv = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
- res = %Q(Yukihiro Matsumoto\n<dl class="rwtk_Abbreviations"><dt class="rwtk_Abbreviations">matz</dt><dd class="rwtk_Abbreviations">Yukihiro Matsumoto</dd></dl>\n@{matz})
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Headings
- token = Ruwiki::Wiki::Headings
- content = "= header 1\n== header 2\n=== header 3\n==== header 4\n===== header 5\n====== header 6\n======= header 7->6\n\\== noheader 2\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\nTOKEN_6\n\\TOKEN_7\n"
- rpv = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n== noheader 2\n)
- res = %Q(<h1 class="rwtk_Headings">header 1</h1>\n<h2 class="rwtk_Headings">header 2</h2>\n<h3 class="rwtk_Headings">header 3</h3>\n<h4 class="rwtk_Headings">header 4</h4>\n<h5 class="rwtk_Headings">header 5</h5>\n<h6 class="rwtk_Headings">header 6</h6>\n<h6 class="rwtk_Headings">header 7->6</h6>\n<p class="rwtk_Paragraph">== noheader 2\n)
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Blockquotes
- token = Ruwiki::Wiki::Blockquotes
- content = ": level 1\n:: level 2\n::: level 3\n: level 1, para 2\n\\: not a blockquote\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<blockquote class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"><blockquote class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n: not a blockquote\n)
- res = %Q(<blockquote class="rwtk_Blockquotes">level 1<blockquote class="rwtk_Blockquotes">level 2<blockquote class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n: not a blockquote\n)
- __process(token, content, tkv, rpv, res)
-
- content = "> level 1\n>> level 2\n>>> level 3\n> level 1, para 2\n\\> not a blockquote\n"
- tkv = "TOKEN_5\nTOKEN_6\nTOKEN_7\nTOKEN_8\n\\TOKEN_9\n"
- rpv = %Q(<blockquote type="cite" class="rwtk_Blockquotes"> level 1</blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 2</blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"><blockquote type="cite" class="rwtk_Blockquotes"> level 3</blockquote></blockquote></blockquote>\n<blockquote type="cite" class="rwtk_Blockquotes"> level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- res = %Q(<blockquote type="cite" class="rwtk_Blockquotes">level 1<blockquote type="cite" class="rwtk_Blockquotes">level 2<blockquote type="cite" class="rwtk_Blockquotes">level 3</blockquote></blockquote>level 1, para 2</blockquote>\n&gt; not a blockquote\n)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Definitions
- token = Ruwiki::Wiki::Definitions
- content = "; word1 : val1\n;; word2 : val2\n;;; word3 : val3\n; word1/2 : val1/2\n\\; not-a-word : not-a-val\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\n\\TOKEN_4\n"
- rpv = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd></dl></dl>\n<dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl></dl>\n<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
- res = %Q(<dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word1</dt><dd class="rwtk_Definitions">val1</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word2</dt><dd class="rwtk_Definitions">val2</dd><dl class="rwtk_Definitions"><dt class="rwtk_Definitions">word3</dt><dd class="rwtk_Definitions">val3</dd></dl></dl><dt class="rwtk_Definitions">word1/2</dt><dd class="rwtk_Definitions">val1/2</dd></dl>\n; not-a-word : not-a-val\n)
-
-# __display(token, content)
- __process(token, content, tkv, rpv, res)
- end
-
- def test_Lists
- token = Ruwiki::Wiki::Lists
- content = "* level 1\n** level 2\n*** level 3\n*** level 3, item 2\n** level 2, item 2\n* level 1, item 2\n\\* not an item\n"
- tkv = "TOKEN_0\nTOKEN_1\nTOKEN_2\nTOKEN_3\nTOKEN_4\nTOKEN_5\n\\TOKEN_6\n"
- rpv = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ul></ul>\n<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- res = %Q(<ul class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ul><li class="rwtk_Lists">level 1, item 2</li></ul>\n* not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n## level 2\n### level 3\n### level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_7\nTOKEN_8\nTOKEN_9\nTOKEN_10\nTOKEN_11\nTOKEN_12\n\\TOKEN_13\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ol></ol></ol>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ol><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
-
- content = "# level 1\n*# level 2\n*** level 3\n*#* level 3, item 2\n## level 2, item 2\n# level 1, item 2\n\\# not an item\n"
- tkv = "TOKEN_14\nTOKEN_15\nTOKEN_16\nTOKEN_17\nTOKEN_18\nTOKEN_19\n\\TOKEN_20\n"
- rpv = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li></ol>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li></ol></ul>\n<ul class="rwtk_Lists"><ul class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li></ul></ul></ul>\n<ul class="rwtk_Lists"><ol class="rwtk_Lists"><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3, item 2</li></ul></ol></ul>\n<ol class="rwtk_Lists"><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2, item 2</li></ol></ol>\n<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- res = %Q(<ol class="rwtk_Lists"><li class="rwtk_Lists">level 1</li><ol class="rwtk_Lists"><li class="rwtk_Lists">level 2</li><ul class="rwtk_Lists"><li class="rwtk_Lists">level 3</li><li class="rwtk_Lists">level 3, item 2</li></ul><li class="rwtk_Lists">level 2, item 2</li></ol><li class="rwtk_Lists">level 1, item 2</li></ol>\n# not an item\n)
- __process(token, content, tkv, rpv, res)
- end
-
-
- def test_RubyTalkLinks
- token = Ruwiki::Wiki::RubyTalkLinks
- content = "[ruby-talk:12345] \\[ruby-talk:12345]"
- tkv = "TOKEN_0 \\TOKEN_1"
- rpv = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
- res = %Q(<a class="rwtk_RubyTalkLinks" href="http://www.ruby-talk.org/12345">[ruby-talk:12345]</a> [ruby-talk:12345])
-
- __process(token, content, tkv, rpv, res)
- end
-
- def test_OtherRubyLinks
- token = Ruwiki::Wiki::OtherRubyLinks
- content = "[ruby-list:123] \\[ruby-list:123] [ruby-doc:123] \\[ruby-doc:123] [ruby-core:123] \\[ruby-core:123] [ruby-dev:123] \\[ruby-dev:123] [ruby-ext:123] \\[ruby-ext:123] [ruby-math:123] \\[ruby-math:123]"
- tkv = "TOKEN_0 \\TOKEN_1 TOKEN_2 \\TOKEN_3 TOKEN_4 \\TOKEN_5 TOKEN_6 \\TOKEN_7 TOKEN_8 \\TOKEN_9 TOKEN_10 \\TOKEN_11"
- rpv = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
- res = %Q(<a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/123">[ruby-list:123]</a> [ruby-list:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-doc/123">[ruby-doc:123]</a> [ruby-doc:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/123">[ruby-core:123]</a> [ruby-core:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/123">[ruby-dev:123]</a> [ruby-dev:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-ext/123">[ruby-ext:123]</a> [ruby-ext:123] <a class="rwtk_OtherRubyLinks" href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/123">[ruby-math:123]</a> [ruby-math:123])
-
- __process(token, content, tkv, rpv, res)
- end
-end
diff --git a/ruwiki/tags/release-0.8.0-fixes/tests/testall.rb b/ruwiki/tags/release-0.8.0-fixes/tests/testall.rb
deleted file mode 100755
index 35bb8c9..0000000
--- a/ruwiki/tags/release-0.8.0-fixes/tests/testall.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env ruby
-#--
-# Ruwiki version 0.8.0
-# Copyright © 2002 - 2003, Digikata and HaloStatue
-# Alan Chen (alan@digikata.com)
-# Austin Ziegler (ruwiki@halostatue.ca)
-#
-# Licensed under the same terms as Ruby.
-#
-# $Id$
-#++
-
-puts "Checking for test cases:"
-Dir['tc*.rb'].each do |testcase|
- puts "\t#{testcase}"
- require testcase
-end
-puts " "