Compare commits

...

3 Commits

Author SHA1 Message Date
bootstraponline 9057ec82d8 Release 2.4.2 2012-11-29 19:49:15 -07:00
bootstraponline 1b53e36666 Fix UTF-8 2012-11-29 16:58:47 -07:00
bootstraponline 10fa5c7bd2 Upgrade to stringex 1.5 2012-11-29 16:50:52 -07:00
4 changed files with 35 additions and 6 deletions
+3 -3
View File
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
s.required_ruby_version = ">= 1.8.7"
s.name = 'gollum'
s.version = '2.4.1'
s.date = '2012-11-19'
s.version = '2.4.2'
s.date = '2012-11-29'
s.rubyforge_project = 'gollum'
s.summary = "A simple, Git-powered wiki."
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
s.add_dependency('sanitize', '~> 2.0.3')
s.add_dependency('nokogiri', '~> 1.5.5')
s.add_dependency('useragent', '~> 0.4.13')
s.add_dependency('stringex', '~> 1.4.0')
s.add_dependency('stringex', '~> 1.5.0')
s.add_development_dependency('RedCloth', '~> 4.2.9')
s.add_development_dependency('mocha', '~> 0.13.0')
+4 -1
View File
@@ -23,8 +23,11 @@ require File.expand_path('../gollum/sanitization', __FILE__)
require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
# Set ruby to UTF-8 mode
$KCODE = 'U'
module Gollum
VERSION = '2.4.1'
VERSION = '2.4.2'
def self.assets_path
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
+1 -2
View File
@@ -18,8 +18,7 @@ class String
# _Header => header which causes errors
def to_url
return nil if self.nil?
return self if ['_Header', '_Footer', '_Sidebar'].include? self
upstream_to_url
upstream_to_url :exclude => ['_Header', '_Footer', '_Sidebar']
end
end
+27
View File
@@ -15,6 +15,33 @@ context "Frontend" do
FileUtils.rm_rf(@path)
end
test "urls transform unicode" do
header = '_Header'
footer = '_Footer'
sidebar = '_Sidebar'
# header, footer, and sidebar must be preserved
# or gollum will not recognize them
assert_equal header, header.to_url
assert_equal footer, footer.to_url
assert_equal sidebar, sidebar.to_url
# spaces are converted to dashes in URLs
# and in file names saved to disk
# urls are not case sensitive
assert_equal 'title-space', 'Title Space'.to_url
# ascii only file names prevent UTF8 issues
# when using git repos across operating systems
# as this test demonstrates, translation is not
# great
assert_equal 'm-plus-f', 'μ†ℱ'.to_url
end
test 'utf-8 kcode' do
assert_equal 'μ†ℱ'.scan(/./), ["μ", "", ""]
end
test "retain edit information" do
page1 = 'page1'
user1 = 'user1'