Class: Librarian::Puppet::Dsl
- Inherits:
-
Dsl
- Object
- Dsl
- Librarian::Puppet::Dsl
show all
- Defined in:
- lib/librarian/puppet/dsl.rb
Defined Under Namespace
Classes: Receiver, Target
Constant Summary
collapse
- FORGE_URL =
"https://forgeapi.puppetlabs.com"
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.dependency_type ⇒ Object
Instance Method Details
#default_specfile ⇒ Object
19
20
21
22
23
24
|
# File 'lib/librarian/puppet/dsl.rb', line 19
def default_specfile
Proc.new do
forge FORGE_URL
metadata
end
end
|
#post_process_target(target) ⇒ Object
#receiver(target) ⇒ Object
36
37
38
|
# File 'lib/librarian/puppet/dsl.rb', line 36
def receiver(target)
Receiver.new(target)
end
|
#run(specfile = nil, sources = []) ⇒ Object
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/librarian/puppet/dsl.rb', line 40
def run(specfile = nil, sources = [])
specfile, sources = nil, specfile if specfile.kind_of?(Array) && sources.empty?
Target.new(self).tap do |target|
target.precache_sources(sources)
debug_named_source_cache("Pre-Cached Sources", target)
specfile ||= Proc.new if block_given?
if specfile.kind_of?(Pathname) and !File.exists?(specfile)
debug { "Specfile #{specfile} not found, using defaults" } unless specfile.nil?
receiver(target).run(specfile, &default_specfile)
else
receiver(target).run(specfile)
end
post_process_target(target)
debug_named_source_cache("Post-Cached Sources", target)
end.to_spec
end
|