Class: Chirp::PathProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/chirp/application.rb

Instance Method Summary collapse

Constructor Details

#initialize(context, options = {}, &block) ⇒ PathProcessor

Returns a new instance of PathProcessor.



55
56
57
58
59
# File 'lib/chirp/application.rb', line 55

def initialize(context, options={}, &block)
  @context = context
  @filter = PathFilter.new(options)
  @block = block
end

Instance Method Details

#executeObject



61
62
63
64
65
66
67
68
69
# File 'lib/chirp/application.rb', line 61

def execute
  @context.debug("PathProcessor execute for #{@context.path}")
  if @filter.passes?(@context.path)
    @context.execute(@block)
  else
    @context.debug("Filter blocked #{@context.path}")
    @context.debug("Filter: #{@filter}")
  end
end