summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2014-08-11 08:50:56 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2014-08-11 08:50:56 +0200
commit99eb283101108f1f95e95ade8c1352f547578b26 (patch)
treeed682bc2303d6862af4f2dbd5dd764d7c1e36f31 /lib
parent0e3f8ea2ef2a7d6cc51ccb5d7ae854c6244b40eb (diff)
downloadgitlab-ce-99eb283101108f1f95e95ade8c1352f547578b26.tar.gz
Use readme we support to render if there are multiple readmes
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/markdown_helper.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/gitlab/markdown_helper.rb b/lib/gitlab/markdown_helper.rb
new file mode 100644
index 00000000000..abed12fe570
--- /dev/null
+++ b/lib/gitlab/markdown_helper.rb
@@ -0,0 +1,25 @@
+module Gitlab
+ module MarkdownHelper
+ module_function
+
+ # Public: Determines if a given filename is compatible with GitHub::Markup.
+ #
+ # filename - Filename string to check
+ #
+ # Returns boolean
+ def markup?(filename)
+ filename.downcase.end_with?(*%w(.textile .rdoc .org .creole .wiki
+ .mediawiki .rst .adoc .asciidoc .asc))
+ end
+
+ # Public: Determines if a given filename is compatible with
+ # GitLab-flavored Markdown.
+ #
+ # filename - Filename string to check
+ #
+ # Returns boolean
+ def gitlab_markdown?(filename)
+ filename.downcase.end_with?(*%w(.mdown .md .markdown))
+ end
+ end
+end