BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
43f0bca6
Commit
43f0bca6
authored
Oct 26, 2017
by
Ahmad Sherif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid using Rugged in Gitlab::Git::Wiki#preview_slug
parent
b3ba3996
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
wiki.rb
lib/gitlab/git/wiki.rb
+10
-1
No files found.
lib/gitlab/git/wiki.rb
View file @
43f0bca6
...
...
@@ -8,6 +8,7 @@ module Gitlab
{
name:
name
,
email:
email
,
message:
message
}
end
end
PageBlob
=
Struct
.
new
(
:name
)
def
self
.
default_ref
'master'
...
...
@@ -80,7 +81,15 @@ module Gitlab
end
def
preview_slug
(
title
,
format
)
gollum_wiki
.
preview_page
(
title
,
''
,
format
).
url_path
# Adapted from gollum gem (Gollum::Wiki#preview_page) to avoid
# using Rugged through a Gollum::Wiki instance
page_class
=
Gollum
::
Page
page
=
page_class
.
new
(
nil
)
ext
=
page_class
.
format_to_ext
(
format
.
to_sym
)
name
=
page_class
.
cname
(
title
)
+
'.'
+
ext
blob
=
PageBlob
.
new
(
name
)
page
.
populate
(
blob
)
page
.
url_path
end
private
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment