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
5f5b6bf6
Commit
5f5b6bf6
authored
Feb 10, 2020
by
Giorgenes Gelatti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deduplicate conan package methods
parent
ac6be496
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
ee/lib/api/conan_packages.rb
ee/lib/api/conan_packages.rb
+8
-10
No files found.
ee/lib/api/conan_packages.rb
View file @
5f5b6bf6
...
...
@@ -294,24 +294,22 @@ module API
include
Gitlab
::
Utils
::
StrongMemoize
include
::
API
::
Helpers
::
RelatedResourcesHelpers
def
present_
package_download_urls
def
present_
download_urls
(
entity
)
authorize!
(
:read_package
,
project
)
presenter
=
::
Packages
::
Conan
::
PackagePresenter
.
new
(
recipe
,
current_user
,
project
)
render_api_error!
(
"No recipe manifest found"
,
404
)
if
presenter
.
package_urls
.
empty?
render_api_error!
(
"No recipe manifest found"
,
404
)
if
yield
(
presenter
)
.
empty?
present
presenter
,
with:
EE
::
API
::
Entities
::
ConanPackage
::
ConanPackageManifest
present
presenter
,
with:
entity
end
def
present_recipe_download_urls
authorize!
(
:read_package
,
project
)
presenter
=
::
Packages
::
Conan
::
PackagePresenter
.
new
(
recipe
,
current_user
,
project
)
render_api_error!
(
"No recipe manifest found"
,
404
)
if
presenter
.
recipe_urls
.
empty?
def
present_package_download_urls
present_download_urls
(
EE
::
API
::
Entities
::
ConanPackage
::
ConanPackageManifest
,
&
:package_urls
)
end
present
presenter
,
with:
EE
::
API
::
Entities
::
ConanPackage
::
ConanRecipeManifest
def
present_recipe_download_urls
present_download_urls
(
EE
::
API
::
Entities
::
ConanPackage
::
ConanRecipeManifest
,
&
:recipe_urls
)
end
def
recipe_upload_urls
(
file_names
)
...
...
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