Module: AsdfDiscover

Defined in:
lib/asdf_discover.rb,
lib/asdf_discover/result.rb,
lib/asdf_discover/version.rb,
lib/asdf_discover/searcher.rb,
lib/asdf_discover/search_result.rb,
lib/asdf_discover/searchers/nvmrc.rb,
lib/asdf_discover/searchers/go_mod.rb,
lib/asdf_discover/searchers/gemfile.rb,
lib/asdf_discover/searchers/dot_node_version.rb,
lib/asdf_discover/searchers/dot_ruby_version.rb

Overview

Namespace for the gem

Defined Under Namespace

Modules: Searchers Classes: Found, NotFound, SearchResult, Searcher

Constant Summary collapse

TOOL_VERSIONS =
".tool-versions".freeze
VERSION =
"1.0.0".freeze

Class Method Summary collapse

Class Method Details

.add_searcher(*searchers) ⇒ Object



14
15
16
17
# File 'lib/asdf_discover.rb', line 14

def self.add_searcher(*searchers)
  @searchers ||= []
  @searchers.concat(searchers)
end

.searchObject



19
20
21
22
23
24
25
26
# File 'lib/asdf_discover.rb', line 19

def self.search
  found = @searchers
    .map(&:new)
    .map(&:call)
    .select(&:found?)

  SearchResult.new(found)
end