+2
-2
@@ -146,7 +146,7 @@ if options['irb']
|
|||||||
begin
|
begin
|
||||||
require 'gollum-lib'
|
require 'gollum-lib'
|
||||||
wiki = Gollum::Wiki.new(gollum_path, wiki_options)
|
wiki = Gollum::Wiki.new(gollum_path, wiki_options)
|
||||||
if !wiki.exist? then raise Grit::InvalidGitRepositoryError end
|
if !wiki.exist? then raise Gollum::InvalidGitRepositoryError end
|
||||||
puts "Loaded Gollum wiki at #{File.expand_path(gollum_path).inspect}."
|
puts "Loaded Gollum wiki at #{File.expand_path(gollum_path).inspect}."
|
||||||
puts
|
puts
|
||||||
puts %( page = wiki.page('page-name'))
|
puts %( page = wiki.page('page-name'))
|
||||||
@@ -160,7 +160,7 @@ if options['irb']
|
|||||||
puts
|
puts
|
||||||
puts "Check out the Gollum README for more."
|
puts "Check out the Gollum README for more."
|
||||||
IRB.start_session(binding)
|
IRB.start_session(binding)
|
||||||
rescue Grit::InvalidGitRepositoryError, Grit::NoSuchPathError
|
rescue Gollum::InvalidGitRepositoryError, Gollum::NoSuchPathError
|
||||||
puts "Invalid Gollum wiki at #{File.expand_path(gollum_path).inspect}"
|
puts "Invalid Gollum wiki at #{File.expand_path(gollum_path).inspect}"
|
||||||
exit 0
|
exit 0
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ require 'digest/sha1'
|
|||||||
require 'ostruct'
|
require 'ostruct'
|
||||||
|
|
||||||
# external
|
# external
|
||||||
require 'grit'
|
|
||||||
require 'github/markup'
|
require 'github/markup'
|
||||||
require 'sanitize'
|
require 'sanitize'
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -14,8 +14,8 @@ require 'gollum/views/has_page'
|
|||||||
require File.expand_path '../helpers', __FILE__
|
require File.expand_path '../helpers', __FILE__
|
||||||
|
|
||||||
#required to upload bigger binary files
|
#required to upload bigger binary files
|
||||||
Grit::Git.git_timeout = 120 # timeout in secs
|
Gollum::set_git_timeout(120)
|
||||||
Grit::Git.git_max_size = 190 * 10**6 # size in bytes (10^6=1 MB)
|
Gollum::set_git_max_filesize(190 * 10**6)
|
||||||
|
|
||||||
# Fix to_url
|
# Fix to_url
|
||||||
class String
|
class String
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
class WikiFactory
|
class WikiFactory
|
||||||
def self.create p
|
def self.create p
|
||||||
path = testpath "examples/test.git"
|
examples = testpath "examples"
|
||||||
Grit::Repo.init_bare(@path)
|
path = File.join(examples, "test.git")
|
||||||
|
FileUtils.cp_r File.join(examples, "empty.git"), path, :remove_destination => true
|
||||||
Gollum::Wiki.default_options = {:universal_toc => false}
|
Gollum::Wiki.default_options = {:universal_toc => false}
|
||||||
cleanup = Proc.new { FileUtils.rm_r File.join(File.dirname(__FILE__), *%w[examples test.git]) }
|
cleanup = Proc.new { FileUtils.rm_r File.join(File.dirname(__FILE__), *%w[examples test.git]) }
|
||||||
Gollum::Wiki.new(@path), @path, cleanup
|
Gollum::Wiki.new(@path), @path, cleanup
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ require File.expand_path '../../lib/gollum/views/page', __FILE__
|
|||||||
|
|
||||||
context "Precious::Views::Page" do
|
context "Precious::Views::Page" do
|
||||||
setup do
|
setup do
|
||||||
@path = testpath("examples/test.git")
|
examples = testpath "examples"
|
||||||
FileUtils.rm_rf(@path)
|
@path = File.join(examples, "test.git")
|
||||||
@repo = Grit::Repo.init_bare(@path)
|
FileUtils.cp_r File.join(examples, "empty.git"), @path, :remove_destination => true
|
||||||
@wiki = Gollum::Wiki.new(@path)
|
@wiki = Gollum::Wiki.new(@path)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -43,4 +43,4 @@ context "Precious::Views::Page" do
|
|||||||
actual = @view.title
|
actual = @view.title
|
||||||
assert_equal 'H1', title
|
assert_equal 'H1', title
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user