debian-mirror-gitlab/app/finders/packages/nuget/package_finder.rb
2021-06-08 01:23:25 +05:30

23 lines
560 B
Ruby

# frozen_string_literal: true
module Packages
module Nuget
class PackageFinder < ::Packages::GroupOrProjectPackageFinder
MAX_PACKAGES_COUNT = 300
def execute
packages.limit_recent(@params[:limit] || MAX_PACKAGES_COUNT)
end
private
def packages
result = base.nuget
.has_version
.with_name_like(@params[:package_name])
result = result.with_version(@params[:package_version]) if @params[:package_version].present?
result
end
end
end
end