Sha256: 35dd44ce940af419d645f06c0164e778a46212fd6c932b8f68f359ad7d2187b3

Contents?: true

Size: 607 Bytes

Versions: 2

Compression:

Stored size: 607 Bytes

Contents

# frozen_string_literal: true

module Gemsmith
  module Gems
    # Finds multiple versions of an installed gem (if any) and answers found specifications.
    class Finder
      def self.call(path, ...) = new(...).call path

      def initialize client: ::Gem::Specification, presenter: Gems::Presenter
        warn "[DEPRECATION]: Finder is deprecated, use Spek gem instead."

        @client = client
        @presenter = presenter
      end

      def call(name) = client.find_all_by_name(name).map { |record| presenter.new record }

      private

      attr_reader :client, :presenter
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gemsmith-16.2.0 lib/gemsmith/gems/finder.rb
gemsmith-16.1.0 lib/gemsmith/gems/finder.rb