Merge branch 'master' of github.com:github/gollum
This commit is contained in:
@@ -2,3 +2,4 @@ coverage
|
||||
pkg
|
||||
.DS_Store
|
||||
.bundle
|
||||
Gemfile.lock
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
gollum (1.1.0)
|
||||
albino (~> 1.0)
|
||||
github-markup (>= 0.4.0, < 1.0.0)
|
||||
grit (~> 2.3)
|
||||
mustache (>= 0.11.2, < 1.0.0)
|
||||
nokogiri (~> 1.4)
|
||||
sanitize (~> 1.1)
|
||||
sinatra (~> 1.0)
|
||||
|
||||
GEM
|
||||
remote: http://rubygems.org/
|
||||
specs:
|
||||
RedCloth (4.2.3)
|
||||
albino (1.0)
|
||||
diff-lcs (1.1.2)
|
||||
github-markup (0.5.0)
|
||||
grit (2.3.0)
|
||||
diff-lcs (~> 1.1)
|
||||
mime-types (~> 1.15)
|
||||
mime-types (1.16)
|
||||
mocha (0.9.9)
|
||||
rake
|
||||
mustache (0.11.2)
|
||||
nokogiri (1.4.3.1)
|
||||
org-ruby (0.5.3)
|
||||
rubypants (>= 0.2.0)
|
||||
rack (1.2.1)
|
||||
rake (0.8.7)
|
||||
rdiscount (1.6.5)
|
||||
rubypants (0.2.0)
|
||||
sanitize (1.2.1)
|
||||
nokogiri (~> 1.4.1)
|
||||
shoulda (2.11.3)
|
||||
sinatra (1.1.0)
|
||||
rack (~> 1.1)
|
||||
tilt (~> 1.1)
|
||||
tilt (1.1)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
RedCloth
|
||||
albino (~> 1.0)
|
||||
github-markup (>= 0.4.0, < 1.0.0)
|
||||
gollum!
|
||||
grit (~> 2.3)
|
||||
mocha
|
||||
mustache (>= 0.11.2, < 1.0.0)
|
||||
nokogiri (~> 1.4)
|
||||
org-ruby
|
||||
rdiscount
|
||||
sanitize (~> 1.1)
|
||||
shoulda
|
||||
sinatra (~> 1.0)
|
||||
@@ -60,12 +60,14 @@ module Gollum
|
||||
# normalize_dir("foo") # => "/foo"
|
||||
# normalize_dir("/foo/") # => "/foo"
|
||||
# normalize_dir("/") # => ""
|
||||
# normalize_dir("c:/") # => ""
|
||||
#
|
||||
# dir - String directory name.
|
||||
#
|
||||
# Returns a normalized String directory name, or nil if no directory
|
||||
# is given.
|
||||
def self.normalize_dir(dir)
|
||||
return '' if dir =~ /^.:\/$/
|
||||
if dir
|
||||
dir = ::File.expand_path(dir, '/')
|
||||
dir = '' if dir == '/'
|
||||
|
||||
+5
-1
@@ -4,7 +4,7 @@ module Gollum
|
||||
|
||||
Wiki.page_class = self
|
||||
|
||||
VALID_PAGE_RE = /^(.+)\.(md|mkdn?|mdown|markdown|textile|rdoc|org|creole|re?st(\.txt)?|asciidoc|pod)$/i
|
||||
VALID_PAGE_RE = /^(.+)\.(md|mkdn?|mdown|markdown|textile|rdoc|org|creole|re?st(\.txt)?|asciidoc|pod|(media)?wiki)$/i
|
||||
FORMAT_NAMES = { :markdown => "Markdown",
|
||||
:textile => "Textile",
|
||||
:rdoc => "RDoc",
|
||||
@@ -12,6 +12,7 @@ module Gollum
|
||||
:creole => "Creole",
|
||||
:rest => "reStructuredText",
|
||||
:asciidoc => "AsciiDoc",
|
||||
:mediawiki => "MediaWiki",
|
||||
:pod => "Pod" }
|
||||
|
||||
# Sets a Boolean determing whether this page is a historical version.
|
||||
@@ -161,6 +162,8 @@ module Gollum
|
||||
:pod
|
||||
when /\.(\d)$/i
|
||||
:roff
|
||||
when /\.(media)?wiki$/i
|
||||
:mediawiki
|
||||
else
|
||||
nil
|
||||
end
|
||||
@@ -252,6 +255,7 @@ module Gollum
|
||||
when :rest then 'rest'
|
||||
when :asciidoc then 'asciidoc'
|
||||
when :pod then 'pod'
|
||||
when :mediawiki then 'mediawiki'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+6
-5
@@ -22,11 +22,12 @@ def testpath(path)
|
||||
end
|
||||
|
||||
def cloned_testpath(path)
|
||||
path = testpath(path)
|
||||
cloned = path.chomp('.git')
|
||||
FileUtils.rm_rf cloned
|
||||
Dir.chdir(File.expand_path(File.dirname(path))) do
|
||||
%x{git clone #{File.basename(path)}}
|
||||
repo = File.expand_path(testpath(path))
|
||||
path = File.dirname(repo)
|
||||
cloned = File.join(path, self.class.name)
|
||||
FileUtils.rm_rf(cloned)
|
||||
Dir.chdir(path) do
|
||||
%x{git clone #{File.basename(repo)} #{self.class.name}}
|
||||
end
|
||||
cloned
|
||||
end
|
||||
|
||||
@@ -134,4 +134,13 @@ context "Page" do
|
||||
assert_equal '', Gollum::Page.cname(nil)
|
||||
assert_equal '', Gollum::Page.cname(3)
|
||||
end
|
||||
|
||||
test "normalize_dir" do
|
||||
assert_equal "", Gollum::BlobEntry.normalize_dir("")
|
||||
assert_equal "", Gollum::BlobEntry.normalize_dir(".")
|
||||
assert_equal "", Gollum::BlobEntry.normalize_dir("/")
|
||||
assert_equal "", Gollum::BlobEntry.normalize_dir("c:/")
|
||||
assert_equal "/foo", Gollum::BlobEntry.normalize_dir("foo")
|
||||
assert_equal "/foo", Gollum::BlobEntry.normalize_dir("/foo")
|
||||
end
|
||||
end
|
||||
@@ -8,7 +8,7 @@ context "Page Reverting" do
|
||||
end
|
||||
|
||||
teardown do
|
||||
FileUtils.rm_rf @path
|
||||
FileUtils.rm_rf(@path)
|
||||
end
|
||||
|
||||
test "reverts single commit" do
|
||||
|
||||
Reference in New Issue
Block a user