2020-07-10 15:09:07 +00:00
|
|
|
# frozen_string_literal: true
|
2021-01-12 03:10:47 +00:00
|
|
|
|
2020-07-10 15:09:07 +00:00
|
|
|
module Packages
|
|
|
|
module Maven
|
2021-05-14 12:10:58 +00:00
|
|
|
class PackageFinder < ::Packages::GroupOrProjectPackageFinder
|
2020-07-10 15:09:07 +00:00
|
|
|
def execute
|
2021-05-14 12:10:58 +00:00
|
|
|
packages.last
|
2020-07-10 15:09:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def execute!
|
2021-05-14 12:10:58 +00:00
|
|
|
packages.last!
|
2020-07-10 15:09:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2021-05-14 12:10:58 +00:00
|
|
|
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-01-12 03:10:47 +00:00
|
|
|
|
|
|
|
matching_packages
|
|
|
|
end
|
2020-07-10 15:09:07 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|