Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/packages/pypi/packages_finder.rb')
-rw-r--r--app/finders/packages/pypi/packages_finder.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/finders/packages/pypi/packages_finder.rb b/app/finders/packages/pypi/packages_finder.rb
new file mode 100644
index 00000000000..642ca2cf2e6
--- /dev/null
+++ b/app/finders/packages/pypi/packages_finder.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+module Packages
+ module Pypi
+ class PackagesFinder < ::Packages::GroupOrProjectPackageFinder
+ def execute!
+ results = packages.with_normalized_pypi_name(@params[:package_name])
+ raise ActiveRecord::RecordNotFound if results.empty?
+
+ results
+ end
+
+ private
+
+ def packages
+ base.pypi.has_version
+ end
+ end
+ end
+end