diff options
author | Loic Nageleisen <loic.nageleisen@gmail.com> | 2014-03-29 00:15:25 +0400 |
---|---|---|
committer | Loic Nageleisen <loic.nageleisen@gmail.com> | 2014-06-07 13:14:33 +0400 |
commit | c1ccc3a57b8e335c014e3176f3255ed74703572f (patch) | |
tree | 66eeeffeb0bb55d60eefde0d441001d63875098c /app/models/project_wiki.rb | |
parent | ab094e67eed54f5c29a33d2114cc91908e543972 (diff) |
Added ability to serve files in wiki repository
From #6168.
Diffstat (limited to 'app/models/project_wiki.rb')
-rw-r--r-- | app/models/project_wiki.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb index 08a52782475..a8ba5efcc7c 100644 --- a/app/models/project_wiki.rb +++ b/app/models/project_wiki.rb @@ -72,6 +72,15 @@ class ProjectWiki end end + def find_file(name, version = nil, try_on_disk = true) + version = wiki.ref if version.nil? # Gollum::Wiki#file ? + if wiki_file = wiki.file(name, version, try_on_disk) + wiki_file + else + nil + end + end + def create_page(title, content, format = :markdown, message = nil) commit = commit_details(:created, message, title) |