Module: Librarian::Puppet::Source::Local
- Includes:
- Util
- Included in:
- Git, Path
- Defined in:
- lib/librarian/puppet/source/local.rb
Instance Method Summary
collapse
Methods included from Util
#clean_uri, #cp_r, #debug, #info, #module_name, #normalize_name, #rsync?, #warn
Instance Method Details
#fetch_dependencies(name, _version, _extra) ⇒ Object
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/librarian/puppet/source/local.rb', line 42
def fetch_dependencies(name, _version, )
dependencies = Set.new
if specfile?
spec = environment.dsl(Pathname(specfile))
dependencies.merge spec.dependencies
end
parsed_metadata['dependencies'].each do |d|
gem_requirement = Librarian::Dependency::Requirement.new(d['version_requirement']).to_gem_requirement
new_dependency = Dependency.new(d['name'], gem_requirement, forge_source, name)
dependencies << new_dependency
end
dependencies
end
|
#fetch_version(name, _extra) ⇒ Object
36
37
38
39
40
|
# File 'lib/librarian/puppet/source/local.rb', line 36
def fetch_version(name, )
cache!
found_path(name)
module_version
end
|
#forge_source ⇒ Object
59
60
61
|
# File 'lib/librarian/puppet/source/local.rb', line 59
def forge_source
Forge.default
end
|
#install!(manifest) ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/librarian/puppet/source/local.rb', line 11
def install!(manifest)
manifest.source == self or raise ArgumentError
debug { "Installing #{manifest}" }
name = manifest.name
_ = manifest.version
found_path = found_path(name)
raise Error, "Path for #{name} doesn't contain a puppet module" if found_path.nil?
unless name.include? '/' or name.include? '-'
warn do
"Invalid module name '#{name}', you should qualify it with 'ORGANIZATION-#{name}' for resolution to work correctly"
end
end
install_path = environment.install_path.join(module_name(name))
if install_path.exist? && rsync? != true
debug { "Deleting #{relative_path_to(install_path)}" }
install_path.rmtree
end
install_perform_step_copy!(found_path, install_path)
end
|