debian-mirror-gitlab/app/finders/packages/nuget/package_finder.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
560 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
2021-03-08 18:12:59 +05:30
2020-07-28 23:09:34 +05:30
module Packages
module Nuget
2021-06-08 01:23:25 +05:30
class PackageFinder < ::Packages::GroupOrProjectPackageFinder
2021-03-11 19:13:27 +05:30
MAX_PACKAGES_COUNT = 300
2020-07-28 23:09:34 +05:30
def execute
2021-06-08 01:23:25 +05:30
packages.limit_recent(@params[:limit] || MAX_PACKAGES_COUNT)
2020-07-28 23:09:34 +05:30
end
private
def packages
2021-03-08 18:12:59 +05:30
result = base.nuget
.has_version
2021-06-08 01:23:25 +05:30
.with_name_like(@params[:package_name])
result = result.with_version(@params[:package_version]) if @params[:package_version].present?
2020-07-28 23:09:34 +05:30
result
end
end
end
end