Module: Librarian::Source::Local

Includes:
Librarian::Support::AbstractMethod
Included in:
Git, Path
Defined in:
lib/librarian/source/local.rb

Overview

Requires that the including source class have methods:

#path
#environment

Instance Method Summary collapse

Methods included from Librarian::Support::AbstractMethod

included

Instance Method Details

#found_path(name) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/librarian/source/local.rb', line 28

def found_path(name)
  @_found_paths ||= { }
  @_found_paths[name] ||= begin
    paths = manifest_search_paths(name)
    paths.find{|p| manifest?(name, p)}
  end
end

#manifest_search_paths(name) ⇒ Object



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

def manifest_search_paths(name)
  @manifest_search_paths ||= { }
  @manifest_search_paths[name] ||= begin
    cache!
    paths = [filesystem_path, filesystem_path.join(name)]
    paths.select{|s| s.exist?}
  end
end

#manifests(name) ⇒ Object



14
15
16
17
# File 'lib/librarian/source/local.rb', line 14

def manifests(name)
  manifest = Manifest.new(self, name)
  [manifest].compact
end