Permalink
Browse files

Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki

  • Loading branch information...
distler committed Jun 15, 2011
2 parents 088b535 + 9e909d5 commit fc8be60634b638c78de42370d027945b1753de3b
Showing 1,332 changed files with 85,308 additions and 75,697 deletions.
View
@@ -1,7 +1,7 @@
N.B.: You *must* run
ruby bundle
rake upgrade_instiki
ruby bundle exec rake upgrade_instiki
after installing the new software, to enjoy the benefits of this new version.
View
@@ -7,5 +7,7 @@ gem "rubyzip"
gem "RedCloth", ">=4.0.0"
gem "erubis"
gem "nokogiri"
gem "rake", "~>0.8.7"
gem "rake"
gem "rdoc"
gem "json"
#gem "themes_for_rails"
View
@@ -11,7 +11,7 @@ At a minimum, you need to backup your database.
After installing the new software and restoring your database, you need to run
ruby bundle
rake upgrade_instiki
ruby bundle exec rake upgrade_instiki
from the commandline, to complete the upgrade. Doing a
View
@@ -48,11 +48,14 @@ def initialize(match_data, content)
# chunk for it, and replace the occurance of the chunk
# in this content with its mask.
def self.apply_to(content)
content.gsub!( self.pattern ) do |match|
text = content.to_str
text.gsub!( self.pattern ) do |match|
# content.replace text
new_chunk = self.new($~, content)
content.add_chunk(new_chunk)
new_chunk.mask
end
end
content.replace text
end
# should contain only [a-z0-9]
@@ -61,7 +64,7 @@ def mask
end
def unmask
@content.sub!(mask){|s| s.replace @unmask_text}
@content.replace @content.sub(mask){|s| s.replace @unmask_text}
end
def rendered?
@@ -73,7 +76,7 @@ def escaped?
end
def revert
@content.sub!(mask){|s| s.replace @text}
@content.replace @content.sub(mask){|s| s.replace @text}
# unregister
@content.delete_chunk(self)
end
View
@@ -114,7 +114,7 @@ def mask
class Mixed < AbstractEngine
def mask
@content.as_utf8
redcloth = OldRedCloth.new(@content, @content.options[:engine_opts])
redcloth = OldRedCloth.new(@content.to_str, @content.options[:engine_opts])
redcloth.filter_html = false
redcloth.no_span_caps = false
html = redcloth.to_html
@@ -123,8 +123,7 @@ def mask
class RDoc < AbstractEngine
def mask
@content.as_utf8
html = RDocSupport::RDocFormatter.new(@content).to_html
html = RDocSupport::RDocFormatter.new(@content.as_utf8.to_str).to_html
end
end
View
@@ -30,9 +30,9 @@ def self.pattern() TAGS_PATTERN end
# A literal chunk that protects equations from wiki rendering.
class Math < AbstractLiteral
MATH_START = '(\${1,2}|' + Regexp.escape('\[') + '|\\begin\{equation\})'
MATH_END = '(\${1,2}|' + Regexp.escape('\]') + '|\\end\{equation\})'
MATH_PATTERN = Regexp.new(MATH_START + '([^$]|\\\$)+?' + MATH_END, Regexp::MULTILINE)
MATH_START = "(?:\\\\\\[|\\${1,2}|\\\\begin\\{equation\\})"
MATH_END = "(?:\\\\\\]|\\${1,2}|\\\\end\\{equation\\})"
MATH_PATTERN = Regexp.new( '(' + MATH_START + "(?:\\\\\\$|(?!\\$|\\\\\\]|\\\\end\\{equation\\}).)+?" + MATH_END + ')', Regexp::MULTILINE)
def self.pattern() MATH_PATTERN end
end
View
@@ -34,7 +34,8 @@ def initialize(match_data, content)
end
def self.apply_to(content)
content.as_utf8.gsub!( self.pattern ) do |matched_text|
text = content.as_utf8.to_str
text.gsub!( self.pattern ) do |matched_text|
chunk = self.new($~, content)
if chunk.textile_url?
# do not substitute
@@ -44,6 +45,7 @@ def self.apply_to(content)
chunk.mask
end
end
content.replace text
end
def textile_url?
View
@@ -39,7 +39,7 @@ def initialize
end
def convert(text, handler)
super.sub(/^<p>\n/, '').sub(/<\/p>$/, '')
super.sub(/^\n{0,1}<p>\n{0,1}/, '').sub(/\n{0,1}<\/p>\n{0,1}$/, '')
end
end
@@ -31,4 +31,4 @@ class InstikiUpgrade
end
end
end
end
View
@@ -208,7 +208,8 @@ def render!
@options[:engine].apply_to(self)
as_utf8
# unmask in one go. $~[1] is the chunk id
gsub!(MASK_RE[ACTIVE_CHUNKS]) do
text = self.to_str
text.gsub!(MASK_RE[ACTIVE_CHUNKS]) do
chunk = @chunks_by_id[$~[1].to_i]
if chunk.nil?
# if we match a chunkmask that existed in the original content string
@@ -218,7 +219,7 @@ def render!
chunk.unmask_text
end
end
self.replace xhtml_sanitize(self)
self.replace xhtml_sanitize(text)
self.html_safe
end
View
@@ -1,10 +1,17 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/switchtower.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require File.join(File.dirname(__FILE__), 'config', 'boot')
require 'rake'
class Rails::Application
include Rake::DSL if defined?(Rake::DSL)
end
require 'rake/testtask'
require 'rake/rdoctask'
begin
require 'rdoc/task'
rescue LoadError
require 'rake/rdoctask'
end
require 'tasks/rails'
require 'tasks/rails'
@@ -123,7 +123,7 @@ def test_edit_page_with_special_symbols
r = process 'edit', 'web' => 'wiki1', 'id' => 'With : Special /> symbols'
assert_response(:success)
xml = REXML::Document.new(r.body)
xml = REXML::Document.new(r.body.to_str)
form = REXML::XPath.first(xml, '//form')
assert_equal '/wiki1/save/With+%3A+Special+%2F%3E+symbols', form.attributes['action']
end
@@ -414,7 +414,7 @@ def test_rdoc
:author => Author.new('DavidHeinemeierHansson'))
assert_equal "<tt>hello</tt> that <span class='newWikiWord'>Smart Engine GUI" +
"<a href='../show/SmartEngineGUI'>?</a></span>\n\n",
"<a href='../show/SmartEngineGUI'>?</a></span>",
x_test_renderer(@revision).display_content
end
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
#
# This file was generated by RubyGems.
#
@@ -7,8 +7,6 @@
#
require 'rubygems'
Gem.use_paths File.join(File.dirname(File.dirname(__FILE__))), Gem.path
Gem.refresh
version = ">= 0"
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit fc8be60

Please sign in to comment.