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

25 lines
520 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 Maven
2021-06-08 01:23:25 +05:30
class PackageFinder < ::Packages::GroupOrProjectPackageFinder
2020-07-28 23:09:34 +05:30
def execute
2021-06-08 01:23:25 +05:30
packages.last
2020-07-28 23:09:34 +05:30
end
def execute!
2021-06-08 01:23:25 +05:30
packages.last!
2020-07-28 23:09:34 +05:30
end
private
2021-06-08 01:23:25 +05:30
def packages
matching_packages = base.only_maven_packages_with_path(@params[:path], use_cte: group?)
matching_packages = matching_packages.order_by_package_file if @params[:order_by_package_file]
2021-03-08 18:12:59 +05:30
matching_packages
2020-07-28 23:09:34 +05:30
end
end
end
end