Sha256: c17eb834e71d676b84d764550c553d53a269144ae14824e15d4adcb63be4b10c
Contents?: true
Size: 933 Bytes
Versions: 8
Compression:
Stored size: 933 Bytes
Contents
module Awestruct module Extensions class Pipeline attr_reader :before_extensions attr_reader :extensions attr_reader :after_extensions attr_reader :helpers attr_reader :transformers def initialize(&block) @extensions = [] @helpers = [] @transformers = [] instance_eval &block if block end def extension(ext) @extensions << ext ext.transform(@transformers) if ext.respond_to?('transform') end def helper(helper) @helpers << helper end def transformer(transformer) @transformers << transformer end def execute(site) extensions.each do |ext| ext.execute( site ) end end def watch(watched_dirs) extensions.each do |ext| ext.watch( watched_dirs ) if ext.respond_to?('watch') end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems