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
e9d7b6cd
Commit
e9d7b6cd
authored
May 12, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link Gemfile git URLs
parent
02650d97
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
lib/gitlab/dependency_linker/gemfile_linker.rb
lib/gitlab/dependency_linker/gemfile_linker.rb
+3
-0
spec/lib/gitlab/dependency_linker/gemfile_linker_spec.rb
spec/lib/gitlab/dependency_linker/gemfile_linker_spec.rb
+5
-1
No files found.
lib/gitlab/dependency_linker/gemfile_linker.rb
View file @
e9d7b6cd
...
@@ -16,6 +16,9 @@ module Gitlab
...
@@ -16,6 +16,9 @@ module Gitlab
"https://github.com/
#{
name
}
"
"https://github.com/
#{
name
}
"
end
end
# Link `git: "https://gitlab.example.com/user/repo"` to https://gitlab.example.com/user/repo
link_regex
(
%r{(git:|:git
\s
*=>)
\s
*['"](?<name>https?://[^'"]+)['"]}
)
{
|
url
|
url
}
# Link `source "https://rubygems.org"` to https://rubygems.org
# Link `source "https://rubygems.org"` to https://rubygems.org
link_method_call
(
"source"
,
%r{https?://[^'"]+}
)
{
|
url
|
url
}
link_method_call
(
"source"
,
%r{https?://[^'"]+}
)
{
|
url
|
url
}
end
end
...
...
spec/lib/gitlab/dependency_linker/gemfile_linker_spec.rb
View file @
e9d7b6cd
...
@@ -30,7 +30,7 @@ describe Gitlab::DependencyLinker::GemfileLinker, lib: true do
...
@@ -30,7 +30,7 @@ describe Gitlab::DependencyLinker::GemfileLinker, lib: true do
# Specify a sprockets version due to increased performance
# Specify a sprockets version due to increased performance
# See https://gitlab.com/gitlab-org/gitlab-ce/issues/6069
# See https://gitlab.com/gitlab-org/gitlab-ce/issues/6069
gem 'sprockets', '~> 3.6.0'
gem 'sprockets', '~> 3.6.0'
, git: 'https://gitlab.example.com/gems/sprockets'
# Default values for AR models
# Default values for AR models
gem 'default_value_for', '~> 3.0.0'
gem 'default_value_for', '~> 3.0.0'
...
@@ -59,5 +59,9 @@ describe Gitlab::DependencyLinker::GemfileLinker, lib: true do
...
@@ -59,5 +59,9 @@ describe Gitlab::DependencyLinker::GemfileLinker, lib: true do
expect
(
subject
).
to
include
(
link
(
'rails/rails'
,
'https://github.com/rails/rails'
))
expect
(
subject
).
to
include
(
link
(
'rails/rails'
,
'https://github.com/rails/rails'
))
expect
(
subject
).
to
include
(
link
(
'rails/responders'
,
'https://github.com/rails/responders'
))
expect
(
subject
).
to
include
(
link
(
'rails/responders'
,
'https://github.com/rails/responders'
))
end
end
it
'links Git repos'
do
expect
(
subject
).
to
include
(
link
(
'https://gitlab.example.com/gems/sprockets'
,
'https://gitlab.example.com/gems/sprockets'
))
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