Class: Apogee::Builder
- Inherits:
-
Object
- Object
- Apogee::Builder
- Defined in:
- lib/apogee/builder.rb
Overview
Builds site for distribution using the specified processors
Instance Attribute Summary collapse
-
#processors ⇒ Object
readonly
Returns the value of attribute processors.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(processors: [ ImageProcessor.new, CSSProcessor.new, JSProcessor.new, PageProcessor.new ]) ⇒ Builder
constructor
A new instance of Builder.
- #prepare_dist_dir ⇒ Object
Constructor Details
#initialize(processors: [ ImageProcessor.new, CSSProcessor.new, JSProcessor.new, PageProcessor.new ]) ⇒ Builder
Returns a new instance of Builder.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/apogee/builder.rb', line 10 def initialize( processors: [ ImageProcessor.new, CSSProcessor.new, JSProcessor.new, PageProcessor.new ] ) @processors = processors end |
Instance Attribute Details
#processors ⇒ Object (readonly)
Returns the value of attribute processors.
8 9 10 |
# File 'lib/apogee/builder.rb', line 8 def processors @processors end |
Instance Method Details
#build ⇒ Object
21 22 23 24 |
# File 'lib/apogee/builder.rb', line 21 def build prepare_dist_dir processors.each(&:process) end |
#prepare_dist_dir ⇒ Object
26 27 28 29 |
# File 'lib/apogee/builder.rb', line 26 def prepare_dist_dir FileUtils.rm_rf('dist') FileUtils.mkdir('dist') end |