This commit is contained in:
bootstraponline
2012-08-06 13:16:31 -06:00
parent c789dd5067
commit c72e91ddaf
+7 -4
View File
@@ -90,12 +90,15 @@ module Precious
show_page_or_file('Home')
end
# if path is omitted then extraction is necessary
# name, path, version
def wiki_page( name, path = nil, version = nil)
path = name if path.nil?
if path.nil?
path = name
name = extract_name(name)
path = extract_path(path)
end
name = extract_name(name)
path = extract_path(path)
wiki = wiki_new
OpenStruct.new(:wiki => wiki, :page => wiki.paged(name, path, version),
@@ -169,7 +172,7 @@ module Precious
get '/create/*' do
splat = params[:splat].first
wikip = wiki_page(extract_name(splat).to_url, splat)
wikip = wiki_page(extract_name(splat).to_url, extract_path(splat))
@name = wikip.name
@path = wikip.path