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
Léo-Paul Géneau
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
Gitlab
module
DependencyLinker
module
DependencyLinker
class
BaseLinker
class
BaseLinker
def
self
.
link
(
plain_text
,
highlighted_text
)
class_attribute
:file_type
new
(
plain_text
,
highlighted_text
).
link
def
self
.
support?
(
blob_name
)
Gitlab
::
FileDetector
.
type_of
(
blob_name
)
==
file_type
end
def
self
.
link
(
*
args
)
new
(
*
args
).
link
end
end
attr_accessor
:plain_text
,
:highlighted_text
attr_accessor
:plain_text
,
:highlighted_text
...
...
lib/gitlab/dependency_linker/gemfile_linker.rb
View file @
38d84f83
module
Gitlab
module
Gitlab
module
DependencyLinker
module
DependencyLinker
class
GemfileLinker
<
BaseLinker
class
GemfileLinker
<
BaseLinker
def
self
.
support?
(
blob_name
)
self
.
file_type
=
:gemfile
blob_name
==
'Gemfile'
||
blob_name
==
'gems.rb'
end
private
private
...
...
lib/gitlab/file_detector.rb
View file @
38d84f83
...
@@ -12,6 +12,7 @@ module Gitlab
...
@@ -12,6 +12,7 @@ module Gitlab
version:
'version'
,
version:
'version'
,
gitignore:
'.gitignore'
,
gitignore:
'.gitignore'
,
koding:
'.koding.yml'
,
koding:
'.koding.yml'
,
gemfile:
/\A(Gemfile|gems\.rb)\z/
,
gitlab_ci:
'.gitlab-ci.yml'
,
gitlab_ci:
'.gitlab-ci.yml'
,
avatar:
/\Alogo\.(png|jpg|gif)\z/
,
avatar:
/\Alogo\.(png|jpg|gif)\z/
,
route_map:
'route-map.yml'
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