Class: Spek::Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/spek/finder.rb

Overview

Finds multiple versions of an installed gem (if any) and answers found specifications.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client: ::Gem::Specification, presenter: Presenter) ⇒ Finder



8
9
10
11
# File 'lib/spek/finder.rb', line 8

def initialize client: ::Gem::Specification, presenter: Presenter
  @client = client
  @presenter = presenter
end

Class Method Details

.call(path) ⇒ Object



6
# File 'lib/spek/finder.rb', line 6

def self.call(path, ...) = new(...).call path

Instance Method Details

#call(name) ⇒ Object



13
# File 'lib/spek/finder.rb', line 13

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