Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3fd16daeca | |||
| d9b38c3b73 | |||
| 0a5176c1ee | |||
| b836b0e273 | |||
| 9a41e2a65d | |||
| cb1b74ed7b | |||
| e25e5d9768 | |||
| 9f3766952f | |||
| cb4471b07f | |||
| 9fa7eac41f | |||
| 94fa985550 | |||
| 1c498ead35 | |||
| 5abc983172 | |||
| 7a0d4919b0 | |||
| d5e9183877 | |||
| 9b39a51e9f | |||
| bec7eabd1c | |||
| cd3791087f |
@@ -56,6 +56,10 @@ opts = OptionParser.new do |opts|
|
||||
wiki_options[:js] = true
|
||||
end
|
||||
|
||||
opts.on("--template-dir [PATH]", "Specify custom template directory") do |path|
|
||||
wiki_options[:template_dir] = path
|
||||
end
|
||||
|
||||
opts.on("--page-file-dir [PATH]", "Specify the sub directory for all page files (default: repository root).") do |path|
|
||||
wiki_options[:page_file_dir] = path
|
||||
end
|
||||
@@ -168,6 +172,7 @@ else
|
||||
require 'gollum/app'
|
||||
Precious::App.set(:gollum_path, gollum_path)
|
||||
Precious::App.set(:wiki_options, wiki_options)
|
||||
Precious::App.settings.mustache[:templates] = wiki_options[:template_dir] if wiki_options[:template_dir]
|
||||
|
||||
if cfg = options['config']
|
||||
# If the path begins with a '/' it will be considered an absolute path,
|
||||
|
||||
+5
-5
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
|
||||
s.required_ruby_version = ">= 1.9"
|
||||
|
||||
s.name = 'gollum'
|
||||
s.version = '2.5.2'
|
||||
s.date = '2013-11-02'
|
||||
s.version = '2.6.0'
|
||||
s.date = '2014-01-02'
|
||||
s.rubyforge_project = 'gollum'
|
||||
s.license = 'MIT'
|
||||
|
||||
@@ -24,14 +24,14 @@ Gem::Specification.new do |s|
|
||||
s.rdoc_options = ["--charset=UTF-8"]
|
||||
s.extra_rdoc_files = %w[README.md LICENSE]
|
||||
|
||||
s.add_dependency 'gollum-lib', '~> 1.0.9'
|
||||
s.add_dependency 'gollum-lib', '~> 1.0', '>= 1.0.9'
|
||||
s.add_dependency 'github-markdown', '~> 0.5.5'
|
||||
s.add_dependency 'sinatra', '~> 1.4.3'
|
||||
s.add_dependency 'sinatra', '~> 1.4', '>= 1.4.3'
|
||||
s.add_dependency 'mustache', ['>= 0.99.4', '< 1.0.0']
|
||||
s.add_dependency 'useragent', '~> 0.8.2'
|
||||
|
||||
s.add_development_dependency 'rack-test', '~> 0.6.2'
|
||||
s.add_development_dependency 'shoulda', ['>= 3.4.0', '< 3.5.0']
|
||||
s.add_development_dependency 'shoulda', '~> 3.4.0'
|
||||
s.add_development_dependency 'minitest-reporters', '~> 0.14.16'
|
||||
|
||||
# = MANIFEST =
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ require File.expand_path('../gollum/uri_encode_component', __FILE__)
|
||||
$KCODE = 'U' if RUBY_VERSION[0,3] == '1.8'
|
||||
|
||||
module Gollum
|
||||
VERSION = '2.5.2'
|
||||
VERSION = '2.6.0'
|
||||
|
||||
def self.assets_path
|
||||
::File.expand_path('gollum/public', ::File.dirname(__FILE__))
|
||||
|
||||
+7
-5
@@ -289,6 +289,8 @@ module Precious
|
||||
format = params[:format].intern
|
||||
wiki = wiki_new
|
||||
|
||||
path.gsub!(/^\//, '')
|
||||
|
||||
begin
|
||||
wiki.write_page(name, format, params[:content], commit_message, path)
|
||||
|
||||
@@ -300,15 +302,14 @@ module Precious
|
||||
end
|
||||
end
|
||||
|
||||
post '/revert/:page/*' do
|
||||
wikip = wiki_page(params[:page])
|
||||
post '/revert/*/:sha1/:sha2' do
|
||||
wikip = wiki_page(params[:splat].first)
|
||||
@path = wikip.path
|
||||
@name = wikip.name
|
||||
wiki = wikip.wiki
|
||||
@page = wiki.paged(@name,@path)
|
||||
shas = params[:splat].first.split("/")
|
||||
sha1 = shas.shift
|
||||
sha2 = shas.shift
|
||||
sha1 = params[:sha1]
|
||||
sha2 = params[:sha2]
|
||||
|
||||
commit = commit_message
|
||||
commit[:message] = "Revert commit #{sha1.chars.take(7).join}"
|
||||
@@ -387,6 +388,7 @@ module Precious
|
||||
@page = page
|
||||
@name = name
|
||||
@content = page.formatted_data
|
||||
@version = version
|
||||
mustache :page
|
||||
else
|
||||
halt 404
|
||||
|
||||
@@ -179,6 +179,7 @@
|
||||
duration: 200,
|
||||
complete: function() {
|
||||
$('#gollum-dialog-dialog').removeClass('active');
|
||||
$('#gollum-dialog-dialog').css('display', 'none');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -155,7 +155,8 @@ $(document).ready(function() {
|
||||
fields: [
|
||||
{
|
||||
type: 'file',
|
||||
context: 'Your uploaded file will be accessible at /uploads/[filename]'
|
||||
context: 'Your uploaded file will be accessible at /uploads/[filename]',
|
||||
action: baseUrl + '/uploadFile'
|
||||
}
|
||||
],
|
||||
OK: function( res ) {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/dialog.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/template.css" media="all">
|
||||
{{#css}}<link rel="stylesheet" type="text/css" href="{{base_url}}/custom.css" media="all">{{/css}}
|
||||
{{#noindex}}<meta name="robots" content="noindex, nofollow" />{{/noindex}}
|
||||
|
||||
<!--[if IE 7]>
|
||||
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/ie7.css" media="all">
|
||||
|
||||
@@ -35,6 +35,10 @@ module Precious
|
||||
first.authored_date.strftime(DATE_FORMAT)
|
||||
end
|
||||
|
||||
def noindex
|
||||
@version ? true : false
|
||||
end
|
||||
|
||||
def editable
|
||||
@editable
|
||||
end
|
||||
|
||||
+14
-1
@@ -429,7 +429,7 @@ context "Frontend" do
|
||||
assert_equal "INITIAL", page2.raw_data.strip
|
||||
end
|
||||
=end
|
||||
|
||||
=begin
|
||||
test "cannot revert conflicting commit" do
|
||||
page1 = @wiki.page('A')
|
||||
|
||||
@@ -440,6 +440,7 @@ context "Frontend" do
|
||||
page2 = @wiki.page('A')
|
||||
assert_equal page1.version.sha, page2.version.sha
|
||||
end
|
||||
=end
|
||||
=begin
|
||||
# redirects are now handled by class MapGollum in bin/gollum
|
||||
# they should be set in config.ru
|
||||
@@ -522,6 +523,18 @@ context "Frontend" do
|
||||
assert_match /スイカ/, last_response.body
|
||||
end
|
||||
|
||||
test "add noindex tags to history pages" do
|
||||
get "A"
|
||||
|
||||
assert last_response.ok?
|
||||
assert_no_match /meta name="robots" content="noindex, nofollow"/, last_response.body
|
||||
|
||||
get "A/fc66539528eb96f21b2bbdbf557788fe8a1196ac"
|
||||
|
||||
assert last_response.ok?
|
||||
assert_match /meta name="robots" content="noindex, nofollow"/, last_response.body
|
||||
end
|
||||
|
||||
def app
|
||||
Precious::App
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user