Class: Awestruct::Extensions::Pipeline
- Inherits:
-
Object
- Object
- Awestruct::Extensions::Pipeline
- Defined in:
- lib/awestruct/extensions/pipeline.rb
Instance Attribute Summary collapse
-
#after_extensions ⇒ Object
readonly
Returns the value of attribute after_extensions.
-
#before_extensions ⇒ Object
readonly
Returns the value of attribute before_extensions.
-
#extensions ⇒ Object
readonly
Returns the value of attribute extensions.
-
#helpers ⇒ Object
readonly
Returns the value of attribute helpers.
-
#transformers ⇒ Object
readonly
Returns the value of attribute transformers.
Instance Method Summary collapse
- #execute(site) ⇒ Object
- #extension(ext) ⇒ Object
- #helper(helper) ⇒ Object
-
#initialize(&block) ⇒ Pipeline
constructor
A new instance of Pipeline.
- #transformer(transformer) ⇒ Object
- #watch(watched_dirs) ⇒ Object
Constructor Details
#initialize(&block) ⇒ Pipeline
Returns a new instance of Pipeline.
11 12 13 14 15 16 |
# File 'lib/awestruct/extensions/pipeline.rb', line 11 def initialize(&block) @extensions = [] @helpers = [] @transformers = [] instance_eval &block if block end |
Instance Attribute Details
#after_extensions ⇒ Object (readonly)
Returns the value of attribute after_extensions.
7 8 9 |
# File 'lib/awestruct/extensions/pipeline.rb', line 7 def after_extensions @after_extensions end |
#before_extensions ⇒ Object (readonly)
Returns the value of attribute before_extensions.
5 6 7 |
# File 'lib/awestruct/extensions/pipeline.rb', line 5 def before_extensions @before_extensions end |
#extensions ⇒ Object (readonly)
Returns the value of attribute extensions.
6 7 8 |
# File 'lib/awestruct/extensions/pipeline.rb', line 6 def extensions @extensions end |
#helpers ⇒ Object (readonly)
Returns the value of attribute helpers.
8 9 10 |
# File 'lib/awestruct/extensions/pipeline.rb', line 8 def helpers @helpers end |
#transformers ⇒ Object (readonly)
Returns the value of attribute transformers.
9 10 11 |
# File 'lib/awestruct/extensions/pipeline.rb', line 9 def transformers @transformers end |
Instance Method Details
#execute(site) ⇒ Object
31 32 33 34 35 |
# File 'lib/awestruct/extensions/pipeline.rb', line 31 def execute(site) extensions.each do |ext| ext.execute( site ) end end |
#extension(ext) ⇒ Object
18 19 20 21 |
# File 'lib/awestruct/extensions/pipeline.rb', line 18 def extension(ext) @extensions << ext ext.transform(@transformers) if ext.respond_to?('transform') end |
#helper(helper) ⇒ Object
23 24 25 |
# File 'lib/awestruct/extensions/pipeline.rb', line 23 def helper(helper) @helpers << helper end |
#transformer(transformer) ⇒ Object
27 28 29 |
# File 'lib/awestruct/extensions/pipeline.rb', line 27 def transformer(transformer) @transformers << transformer end |
#watch(watched_dirs) ⇒ Object
37 38 39 40 41 |
# File 'lib/awestruct/extensions/pipeline.rb', line 37 def watch(watched_dirs) extensions.each do |ext| ext.watch( watched_dirs ) if ext.respond_to?('watch') end end |