Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 58bb340c33 | |||
| ee790a9b7c | |||
| ac432aad78 | |||
| 30207e0a39 | |||
| d98547a33c | |||
| b7cdeabbf6 |
@@ -547,8 +547,13 @@ your changes merged back into core is as follows:
|
|||||||
1. Send a pull request to the github/gollum project.
|
1. Send a pull request to the github/gollum project.
|
||||||
|
|
||||||
## RELEASING
|
## RELEASING
|
||||||
|
For x.y releases:
|
||||||
Update VERSION in lib/gollum.rb
|
Update VERSION in lib/gollum.rb
|
||||||
$ rake gemspec
|
$ rake gemspec
|
||||||
|
|
||||||
|
For z releases:
|
||||||
|
$ rake bump
|
||||||
|
|
||||||
$ git tag vX.Y.Z
|
$ git tag vX.Y.Z
|
||||||
$ git push origin vX.Y.Z
|
$ git push origin vX.Y.Z
|
||||||
$ gem build gollum.gemspec
|
$ gem build gollum.gemspec
|
||||||
|
|||||||
@@ -17,6 +17,27 @@ def version
|
|||||||
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
|
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
|
||||||
end
|
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
|
def date
|
||||||
Date.today.to_s
|
Date.today.to_s
|
||||||
end
|
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
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
|
|||||||
s.required_ruby_version = ">= 1.8.7"
|
s.required_ruby_version = ">= 1.8.7"
|
||||||
|
|
||||||
s.name = 'gollum'
|
s.name = 'gollum'
|
||||||
s.version = '2.2.2'
|
s.version = '2.2.3'
|
||||||
s.date = '2012-10-04'
|
s.date = '2012-10-10'
|
||||||
s.rubyforge_project = 'gollum'
|
s.rubyforge_project = 'gollum'
|
||||||
|
|
||||||
s.summary = "A simple, Git-powered wiki."
|
s.summary = "A simple, Git-powered wiki."
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
|
|||||||
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
|
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
|
||||||
|
|
||||||
module Gollum
|
module Gollum
|
||||||
VERSION = '2.2.2'
|
VERSION = '2.2.3'
|
||||||
|
|
||||||
def self.assets_path
|
def self.assets_path
|
||||||
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
|
::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.
|
// 'c', 'c++', 'cpp' are github specific and transformed to c_cpp for Ace.
|
||||||
var languages = [ 'c', 'c++', 'cpp', 'clojure', 'coffee', 'coldfusion',
|
// 'coffeescript' is transformed to 'coffee' for Ace.
|
||||||
'csharp', 'css', 'diff', 'golang', 'groovy', 'haxe', 'html',
|
var languages = [ 'c', 'c++', 'cpp', 'clojure', 'coffee',
|
||||||
'java', 'javascript', 'json', 'latex', 'less', 'liquid',
|
'coffeescript', 'coldfusion', 'csharp', 'css', 'diff', 'golang',
|
||||||
'lua', 'markdown', 'ocaml', 'perl', 'pgsql', 'php', 'powershell',
|
'groovy', 'haxe', 'html', 'java', 'javascript', 'json', 'latex',
|
||||||
'python', 'ruby', 'scad', 'scala', 'scss', 'sh', 'sql', 'svg',
|
'less', 'liquid', 'lua', 'markdown', 'ocaml', 'perl', 'pgsql', 'php',
|
||||||
'textile', 'text', 'xml', 'xquery', 'yaml' ];
|
'powershell', 'python', 'ruby', 'scad', 'scala', 'scss', 'sh', 'sql',
|
||||||
|
'svg', 'textile', 'text', 'xml', 'xquery', 'yaml' ];
|
||||||
|
|
||||||
var staticHighlight = require( 'ace/ext/static_highlight' );
|
var staticHighlight = require( 'ace/ext/static_highlight' );
|
||||||
var githubTheme = require( 'ace/theme/github' );
|
var githubTheme = require( 'ace/theme/github' );
|
||||||
@@ -303,6 +304,12 @@ var makePreviewHtml = function () {
|
|||||||
aceMode = 'c_cpp';
|
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 ) {
|
if ( $.inArray( declaredLanguage, languages ) === -1 ) {
|
||||||
// Unsupported language.
|
// Unsupported language.
|
||||||
skipped++;
|
skipped++;
|
||||||
|
|||||||
@@ -558,12 +558,12 @@ module Gollum
|
|||||||
encoding ||= 'utf-8'
|
encoding ||= 'utf-8'
|
||||||
begin
|
begin
|
||||||
hl_code = Pygments.highlight(code, :lexer => lang, :options => {:encoding => encoding.to_s})
|
hl_code = Pygments.highlight(code, :lexer => lang, :options => {:encoding => encoding.to_s})
|
||||||
rescue ::RubyPython::PythonError
|
rescue
|
||||||
hl_code = code
|
hl_code = code
|
||||||
end
|
end
|
||||||
highlighted << hl_code
|
highlighted << hl_code
|
||||||
end
|
end
|
||||||
|
|
||||||
@codemap.each do |id, spec|
|
@codemap.each do |id, spec|
|
||||||
body = spec[:output] || begin
|
body = spec[:output] || begin
|
||||||
if (body = highlighted.shift.to_s).size > 0
|
if (body = highlighted.shift.to_s).size > 0
|
||||||
|
|||||||
@@ -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\"><p></span>a\n!rel<span class=\"nt\"></p></span>\n</pre></div>\n}, output
|
assert_equal %Q{<p>a\n</p><div class=\"highlight\"><pre><span class=\"nt\"><p></span>a\n!rel<span class=\"nt\"></p></span>\n</pre></div>\n}, output
|
||||||
end
|
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
|
# Web Sequence Diagrams
|
||||||
|
|||||||
Reference in New Issue
Block a user