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
Boxiang Sun
gitlab-ce
Commits
34f7c3bd
Commit
34f7c3bd
authored
Jun 27, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix diff of requirements.txt file by not matching newlines as part of package names
parent
585e6aa5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
changelogs/unreleased/dm-dependency-linker-newlines.yml
changelogs/unreleased/dm-dependency-linker-newlines.yml
+5
-0
lib/gitlab/dependency_linker/base_linker.rb
lib/gitlab/dependency_linker/base_linker.rb
+1
-1
spec/lib/gitlab/dependency_linker/requirements_txt_linker_spec.rb
.../gitlab/dependency_linker/requirements_txt_linker_spec.rb
+4
-0
No files found.
changelogs/unreleased/dm-dependency-linker-newlines.yml
0 → 100644
View file @
34f7c3bd
---
title
:
Fix diff of requirements.txt file by not matching newlines as part of package
names
merge_request
:
author
:
lib/gitlab/dependency_linker/base_linker.rb
View file @
34f7c3bd
...
@@ -52,7 +52,7 @@ module Gitlab
...
@@ -52,7 +52,7 @@ module Gitlab
# # Will link `user/repo` in `github: "user/repo"` or `:github => "user/repo"`
# # Will link `user/repo` in `github: "user/repo"` or `:github => "user/repo"`
def
link_regex
(
regex
,
&
url_proc
)
def
link_regex
(
regex
,
&
url_proc
)
highlighted_lines
.
map!
.
with_index
do
|
rich_line
,
i
|
highlighted_lines
.
map!
.
with_index
do
|
rich_line
,
i
|
marker
=
StringRegexMarker
.
new
(
plain_lines
[
i
],
rich_line
.
html_safe
)
marker
=
StringRegexMarker
.
new
(
plain_lines
[
i
]
.
chomp
,
rich_line
.
html_safe
)
marker
.
mark
(
regex
,
group: :name
)
do
|
text
,
left
:,
right
:|
marker
.
mark
(
regex
,
group: :name
)
do
|
text
,
left
:,
right
:|
url
=
yield
(
text
)
url
=
yield
(
text
)
...
...
spec/lib/gitlab/dependency_linker/requirements_txt_linker_spec.rb
View file @
34f7c3bd
...
@@ -87,5 +87,9 @@ describe Gitlab::DependencyLinker::RequirementsTxtLinker, lib: true do
...
@@ -87,5 +87,9 @@ describe Gitlab::DependencyLinker::RequirementsTxtLinker, lib: true do
it
'links URLs'
do
it
'links URLs'
do
expect
(
subject
).
to
include
(
link
(
'http://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev1820+49a8884-cp34-none-win_amd64.whl'
,
'http://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev1820+49a8884-cp34-none-win_amd64.whl'
))
expect
(
subject
).
to
include
(
link
(
'http://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev1820+49a8884-cp34-none-win_amd64.whl'
,
'http://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev1820+49a8884-cp34-none-win_amd64.whl'
))
end
end
it
'does not contain link with a newline as package name'
do
expect
(
subject
).
not_to
include
(
link
(
"
\n
"
,
"https://pypi.python.org/pypi/
\n
"
))
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