# frozen_string_literal: true # Display package version data acording to PyPI # Simple API: https://warehouse.pypa.io/api-reference/legacy/#simple-project-api module Packages module Pypi class SimplePresenterBase include API::Helpers::RelatedResourcesHelpers def initialize(packages, project_or_group) @packages = packages @project_or_group = project_or_group end def body <<-HTML Links for #{escape(body_name)}

Links for #{escape(body_name)}

#{links} HTML end private def package_link(url, required_python, name) "#{name}" end def escape(str) ERB::Util.html_escape(str) end def project? @project_or_group.is_a?(::Project) end def group? @project_or_group.is_a?(::Group) end def available_packages @packages.not_pending_destruction end end end end