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

30 lines
532 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
module Packages
module Npm
class PackageFinder
attr_reader :project, :package_name
delegate :find_by_version, to: :execute
def initialize(project, package_name)
@project = project
@package_name = package_name
end
def execute
packages
end
private
def packages
project.packages
.npm
.with_name(package_name)
.last_of_each_version
.preload_files
end
end
end
end