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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
38d84f83
Commit
38d84f83
authored
May 12, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Select dependency linker based on file type
parent
040fc991
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
lib/gitlab/dependency_linker/base_linker.rb
lib/gitlab/dependency_linker/base_linker.rb
+8
-2
lib/gitlab/dependency_linker/gemfile_linker.rb
lib/gitlab/dependency_linker/gemfile_linker.rb
+1
-3
lib/gitlab/file_detector.rb
lib/gitlab/file_detector.rb
+1
-0
No files found.
lib/gitlab/dependency_linker/base_linker.rb
View file @
38d84f83
module
Gitlab
module
DependencyLinker
class
BaseLinker
def
self
.
link
(
plain_text
,
highlighted_text
)
new
(
plain_text
,
highlighted_text
).
link
class_attribute
:file_type
def
self
.
support?
(
blob_name
)
Gitlab
::
FileDetector
.
type_of
(
blob_name
)
==
file_type
end
def
self
.
link
(
*
args
)
new
(
*
args
).
link
end
attr_accessor
:plain_text
,
:highlighted_text
...
...
lib/gitlab/dependency_linker/gemfile_linker.rb
View file @
38d84f83
module
Gitlab
module
DependencyLinker
class
GemfileLinker
<
BaseLinker
def
self
.
support?
(
blob_name
)
blob_name
==
'Gemfile'
||
blob_name
==
'gems.rb'
end
self
.
file_type
=
:gemfile
private
...
...
lib/gitlab/file_detector.rb
View file @
38d84f83
...
...
@@ -12,6 +12,7 @@ module Gitlab
version:
'version'
,
gitignore:
'.gitignore'
,
koding:
'.koding.yml'
,
gemfile:
/\A(Gemfile|gems\.rb)\z/
,
gitlab_ci:
'.gitlab-ci.yml'
,
avatar:
/\Alogo\.(png|jpg|gif)\z/
,
route_map:
'route-map.yml'
...
...
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