Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
daa09250
Commit
daa09250
authored
May 13, 2015
by
Jakub Jirutka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename MarkdownHelper to MarkupHelper
parent
b61a44fe
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
15 deletions
+15
-15
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+3
-3
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+1
-1
app/models/tree.rb
app/models/tree.rb
+3
-3
lib/gitlab/markup_helper.rb
lib/gitlab/markup_helper.rb
+1
-1
spec/lib/gitlab/markup_helper_spec.rb
spec/lib/gitlab/markup_helper_spec.rb
+7
-7
No files found.
app/helpers/application_helper.rb
View file @
daa09250
...
@@ -233,15 +233,15 @@ module ApplicationHelper
...
@@ -233,15 +233,15 @@ module ApplicationHelper
end
end
def
markup?
(
filename
)
def
markup?
(
filename
)
Gitlab
::
Mark
down
Helper
.
markup?
(
filename
)
Gitlab
::
Mark
up
Helper
.
markup?
(
filename
)
end
end
def
gitlab_markdown?
(
filename
)
def
gitlab_markdown?
(
filename
)
Gitlab
::
Mark
down
Helper
.
gitlab_markdown?
(
filename
)
Gitlab
::
Mark
up
Helper
.
gitlab_markdown?
(
filename
)
end
end
def
asciidoc?
(
filename
)
def
asciidoc?
(
filename
)
Gitlab
::
Mark
down
Helper
.
asciidoc?
(
filename
)
Gitlab
::
Mark
up
Helper
.
asciidoc?
(
filename
)
end
end
# Overrides ActionView::Helpers::UrlHelper#link_to to add `rel="nofollow"` to
# Overrides ActionView::Helpers::UrlHelper#link_to to add `rel="nofollow"` to
...
...
app/helpers/blob_helper.rb
View file @
daa09250
...
@@ -55,7 +55,7 @@ module BlobHelper
...
@@ -55,7 +55,7 @@ module BlobHelper
end
end
def
editing_preview_title
(
filename
)
def
editing_preview_title
(
filename
)
if
Gitlab
::
Mark
down
Helper
.
previewable?
(
filename
)
if
Gitlab
::
Mark
up
Helper
.
previewable?
(
filename
)
'Preview'
'Preview'
else
else
'Preview changes'
'Preview changes'
...
...
app/models/tree.rb
View file @
daa09250
class
Tree
class
Tree
include
Gitlab
::
Mark
down
Helper
include
Gitlab
::
Mark
up
Helper
attr_accessor
:repository
,
:sha
,
:path
,
:entries
attr_accessor
:repository
,
:sha
,
:path
,
:entries
...
...
lib/gitlab/mark
down
_helper.rb
→
lib/gitlab/mark
up
_helper.rb
View file @
daa09250
module
Gitlab
module
Gitlab
module
Mark
down
Helper
module
Mark
up
Helper
module_function
module_function
# Public: Determines if a given filename is compatible with GitHub::Markup.
# Public: Determines if a given filename is compatible with GitHub::Markup.
...
...
spec/lib/gitlab/
gitlab_markdown
_helper_spec.rb
→
spec/lib/gitlab/
markup
_helper_spec.rb
View file @
daa09250
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Mark
down
Helper
do
describe
Gitlab
::
Mark
up
Helper
do
describe
'#markup?'
do
describe
'#markup?'
do
%w(textile rdoc org creole wiki
%w(textile rdoc org creole wiki
mediawiki rst adoc ad asciidoc)
.
each
do
|
type
|
mediawiki rst adoc ad asciidoc)
.
each
do
|
type
|
it
"returns true for
#{
type
}
files"
do
it
"returns true for
#{
type
}
files"
do
expect
(
Gitlab
::
Mark
down
Helper
.
markup?
(
"README.
#{
type
}
"
)).
to
be_truthy
expect
(
Gitlab
::
Mark
up
Helper
.
markup?
(
"README.
#{
type
}
"
)).
to
be_truthy
end
end
end
end
it
'returns false when given a non-markup filename'
do
it
'returns false when given a non-markup filename'
do
expect
(
Gitlab
::
Mark
down
Helper
.
markup?
(
'README.rb'
)).
not_to
be_truthy
expect
(
Gitlab
::
Mark
up
Helper
.
markup?
(
'README.rb'
)).
not_to
be_truthy
end
end
end
end
describe
'#gitlab_markdown?'
do
describe
'#gitlab_markdown?'
do
%w(mdown md markdown)
.
each
do
|
type
|
%w(mdown md markdown)
.
each
do
|
type
|
it
"returns true for
#{
type
}
files"
do
it
"returns true for
#{
type
}
files"
do
expect
(
Gitlab
::
Mark
down
Helper
.
gitlab_markdown?
(
"README.
#{
type
}
"
)).
to
be_truthy
expect
(
Gitlab
::
Mark
up
Helper
.
gitlab_markdown?
(
"README.
#{
type
}
"
)).
to
be_truthy
end
end
end
end
it
'returns false when given a non-markdown filename'
do
it
'returns false when given a non-markdown filename'
do
expect
(
Gitlab
::
Mark
down
Helper
.
gitlab_markdown?
(
'README.rb'
)).
not_to
be_truthy
expect
(
Gitlab
::
Mark
up
Helper
.
gitlab_markdown?
(
'README.rb'
)).
not_to
be_truthy
end
end
end
end
describe
'#asciidoc?'
do
describe
'#asciidoc?'
do
%w(adoc ad asciidoc ADOC)
.
each
do
|
type
|
%w(adoc ad asciidoc ADOC)
.
each
do
|
type
|
it
"returns true for
#{
type
}
files"
do
it
"returns true for
#{
type
}
files"
do
expect
(
Gitlab
::
Mark
down
Helper
.
asciidoc?
(
"README.
#{
type
}
"
)).
to
be_truthy
expect
(
Gitlab
::
Mark
up
Helper
.
asciidoc?
(
"README.
#{
type
}
"
)).
to
be_truthy
end
end
end
end
it
'returns false when given a non-asciidoc filename'
do
it
'returns false when given a non-asciidoc filename'
do
expect
(
Gitlab
::
Mark
down
Helper
.
asciidoc?
(
'README.rb'
)).
not_to
be_truthy
expect
(
Gitlab
::
Mark
up
Helper
.
asciidoc?
(
'README.rb'
)).
not_to
be_truthy
end
end
end
end
end
end
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