Compare commits

...

6 Commits

Author SHA1 Message Date
bootstraponline 58bb340c33 Release 2.2.3 2012-10-10 19:43:30 -06:00
bootstraponline ee790a9b7c Add rake bump to readme 2012-10-10 19:38:53 -06:00
bootstraponline ac432aad78 Add bump task to Rakefile 2012-10-10 19:35:04 -06:00
bootstraponline 30207e0a39 Merge pull request #533 from wrs/wrs_syntaxfixes
Two little syntax highlighting fixes
2012-10-10 16:56:37 -07:00
Walter Smith d98547a33c Fix lack of CoffeeScript livepreview
Pygments calls it coffeescript, but Ace calls it coffee.
2012-10-10 14:20:50 -07:00
Walter Smith b7cdeabbf6 Catch all Pygments errors
An unrecognized language was generating a MentosError rather than a
PythonError. Just catch anything that goes wrong in Pygments.
2012-10-10 14:20:50 -07:00
7 changed files with 60 additions and 12 deletions
+5
View File
@@ -547,8 +547,13 @@ your changes merged back into core is as follows:
1. Send a pull request to the github/gollum project.
## RELEASING
For x.y releases:
Update VERSION in lib/gollum.rb
$ rake gemspec
For z releases:
$ rake bump
$ git tag vX.Y.Z
$ git push origin vX.Y.Z
$ gem build gollum.gemspec
+29 -1
View File
@@ -17,6 +17,27 @@ def version
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
end
# assumes x.y.z all digit version
def next_version
# x.y.z
v = version.split '.'
# bump z
v[-1] = v[-1].to_i + 1
v.join '.'
end
def bump_version
old_file = File.read("lib/#{name}.rb")
old_version_line = old_file[/^\s*VERSION\s*=\s*.*/]
new_version = next_version
# replace first match of old vesion with new version
old_file.sub!(old_version_line, " VERSION = '#{new_version}'")
File.write("lib/#{name}.rb", old_file)
new_version
end
def date
Date.today.to_s
end
@@ -71,7 +92,14 @@ end
#
#############################################################################
desc "Update version number and gemspec"
task :bump do
puts "Updated version to #{bump_version}"
# Execute does not invoke dependencies.
# Manually invoke gemspec then validate.
Rake::Task[:gemspec].execute
Rake::Task[:validate].execute
end
#############################################################################
#
+2 -2
View File
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
s.required_ruby_version = ">= 1.8.7"
s.name = 'gollum'
s.version = '2.2.2'
s.date = '2012-10-04'
s.version = '2.2.3'
s.date = '2012-10-10'
s.rubyforge_project = 'gollum'
s.summary = "A simple, Git-powered wiki."
+1 -1
View File
@@ -23,7 +23,7 @@ require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
module Gollum
VERSION = '2.2.2'
VERSION = '2.2.3'
def self.assets_path
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
@@ -195,12 +195,13 @@ var previewSet = function( text ) {
};
// 'c', 'c++', 'cpp' are github specific and transformed to c_cpp for Ace.
var languages = [ 'c', 'c++', 'cpp', 'clojure', 'coffee', 'coldfusion',
'csharp', 'css', 'diff', 'golang', 'groovy', 'haxe', 'html',
'java', 'javascript', 'json', 'latex', 'less', 'liquid',
'lua', 'markdown', 'ocaml', 'perl', 'pgsql', 'php', 'powershell',
'python', 'ruby', 'scad', 'scala', 'scss', 'sh', 'sql', 'svg',
'textile', 'text', 'xml', 'xquery', 'yaml' ];
// 'coffeescript' is transformed to 'coffee' for Ace.
var languages = [ 'c', 'c++', 'cpp', 'clojure', 'coffee',
'coffeescript', 'coldfusion', 'csharp', 'css', 'diff', 'golang',
'groovy', 'haxe', 'html', 'java', 'javascript', 'json', 'latex',
'less', 'liquid', 'lua', 'markdown', 'ocaml', 'perl', 'pgsql', 'php',
'powershell', 'python', 'ruby', 'scad', 'scala', 'scss', 'sh', 'sql',
'svg', 'textile', 'text', 'xml', 'xquery', 'yaml' ];
var staticHighlight = require( 'ace/ext/static_highlight' );
var githubTheme = require( 'ace/theme/github' );
@@ -303,6 +304,12 @@ var makePreviewHtml = function () {
aceMode = 'c_cpp';
}
// Pygments's name for CoffeeScript is 'coffeescript', but Ace
// calls it 'coffee'.
if ( declaredLanguage === 'coffeescript' ) {
aceMode = 'coffee';
}
if ( $.inArray( declaredLanguage, languages ) === -1 ) {
// Unsupported language.
skipped++;
+2 -2
View File
@@ -558,12 +558,12 @@ module Gollum
encoding ||= 'utf-8'
begin
hl_code = Pygments.highlight(code, :lexer => lang, :options => {:encoding => encoding.to_s})
rescue ::RubyPython::PythonError
rescue
hl_code = code
end
highlighted << hl_code
end
@codemap.each do |id, spec|
body = spec[:output] || begin
if (body = highlighted.shift.to_s).size > 0
+8
View File
@@ -534,6 +534,14 @@ np.array([[2,2],[1,3]],np.float)
assert_equal %Q{<p>a\n</p><div class=\"highlight\"><pre><span class=\"nt\">&lt;p&gt;</span>a\n!rel<span class=\"nt\">&lt;/p&gt;</span>\n</pre></div>\n}, output
end
test "code block in unsupported language" do
@wiki.write_page("a", :markdown, "a\n```nonexistent\ncode\n```\nb", commit_details)
page = @wiki.page("a")
output = page.formatted_data
assert_equal %Q{<p>a\ncode\nb</p>}, output
end
#########################################################################
#
# Web Sequence Diagrams