prevent Gollum::Wiki instances from creating new pages that overwrite pages with the same name.
This commit is contained in:
@@ -58,5 +58,19 @@ module Gollum
|
||||
'img' => {'href' => ['http', 'https', :relative]}
|
||||
}
|
||||
}
|
||||
|
||||
class Error < StandardError; end
|
||||
class DuplicatePageError < Error
|
||||
attr_accessor :dir
|
||||
attr_accessor :existing_path
|
||||
attr_accessor :attempted_path
|
||||
|
||||
def initialize(dir, existing, attempted, message = nil)
|
||||
@dir = dir
|
||||
@existing_path = existing
|
||||
@attempted_path = attempted
|
||||
super(message || "Cannot write #{@dir}/#{@attempted_path}, found #{@dir}/#{@existing_path}.")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user