Module: Librarian::Chef::Source::Local

Included in:
Git, Path
Defined in:
lib/librarian/chef/source/local.rb

Instance Method Summary collapse

Instance Method Details

#fetch_dependencies(name, version, extra) ⇒ Object



31
32
33
# File 'lib/librarian/chef/source/local.rb', line 31

def fetch_dependencies(name, version, extra)
  manifest_data(name)["dependencies"]
end

#fetch_version(name, extra) ⇒ Object



27
28
29
# File 'lib/librarian/chef/source/local.rb', line 27

def fetch_version(name, extra)
  manifest_data(name)["version"]
end

#install!(manifest) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/librarian/chef/source/local.rb', line 8

def install!(manifest)
  manifest.source == self or raise ArgumentError

  info { "Installing #{manifest.name} (#{manifest.version})" }

  debug { "Installing #{manifest}" }

  name, version = manifest.name, manifest.version
  found_path = found_path(name)

  install_path = environment.install_path.join(name)
  if install_path.exist?
    debug { "Deleting #{relative_path_to(install_path)}" }
    install_path.rmtree
  end

  install_perform_step_copy!(found_path, install_path)
end