Class: Litbuild::Section
Instance Attribute Summary
Attributes inherited from Blueprint
#active_phase, #base_grafs, #logfile_namer
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Blueprint
#[], #deduped_dependency_names, descendants, #directives, #file_name, #for_phase, #full_name, #header_text, #header_text_with_phase, #initialize, #logfile, #name, #name_with_phase, #parameter_defaults, #phase_grafs, #phases, #phases?, #prepare, #target_name, #value
Class Method Details
.directory_name ⇒ Object
9
10
11
|
# File 'lib/litbuild/section.rb', line 9
def self.directory_name
'sections'
end
|
Instance Method Details
#accept(visitor:) ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/litbuild/section.rb', line 13
def accept(visitor:)
super
visitor.in_subdirectory(name) do
components.each do |bp|
bp.accept(visitor: visitor)
end
end
visitor.visit_section(section: self)
return unless visitor.is_a?(MultiPartVisitor)
self['other-parts']&.each do |part|
part_bp = @bp_library.blueprint_for(target: part)
visitor.visit_part(part_bp)
end
self['appendices']&.each do |app|
app_bp = @bp_library.blueprint_for(target: app)
visitor.visit_appendix(app_bp)
end
end
|
#automatic_inclusions ⇒ Object
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/litbuild/section.rb', line 49
def automatic_inclusions
auto_adds = []
@bp_library.blueprints.each_value do |bp|
if bp.phases.include?(name)
auto_adds << "#{bp.name}::#{name}"
elsif bp['in-section']&.include?(name)
auto_adds << bp.name
end
end
if $DEBUG
warn("Automatically-added blueprints for section #{name}:" \
" #{auto_adds.sort.join(', ')}")
end
auto_adds.sort
end
|
#components ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/litbuild/section.rb', line 33
def components
return @components if @components
blueprints = self['blueprints'].clone || []
if $DEBUG
warn("Explicit blueprints for section #{name}:" \
" #{blueprints.join(', ')}")
end
blueprints << automatic_inclusions
deduped = blueprints.flatten.uniq
@components = deduped.map do |bp|
@bp_library.blueprint_for(target: bp)
end
@components
end
|
#failure_line ⇒ Object
69
70
71
|
# File 'lib/litbuild/section.rb', line 69
def failure_line
'DISMAL FAILURE'
end
|
#success_line ⇒ Object
65
66
67
|
# File 'lib/litbuild/section.rb', line 65
def success_line
'HUGE SUCCESS'
end
|