Class: Benoit::Filters::MetadataCleaner

Inherits:
Rake::Pipeline::Filter
  • Object
show all
Includes:
Benoit
Defined in:
lib/benoit/filters/metadata_cleaner.rb

Direct Known Subclasses

PaginationFilter

Constant Summary

Constants included from Benoit

VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Configuration

#config, #configure

Instance Attribute Details

#current_siteObject

Returns the value of attribute current_site.



6
7
8
# File 'lib/benoit/filters/metadata_cleaner.rb', line 6

def current_site
  @current_site
end

Instance Method Details

#generate_output(inputs, output) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/benoit/filters/metadata_cleaner.rb', line 8

def generate_output(inputs, output)
  inputs.each do |input|
     = current_site[input.path]
    if  and .key?("content")
      output.write ["content"]
    else
      output.write input.read
    end
  end
end

#super_pipeline(descendent = self.pipeline) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/benoit/filters/metadata_cleaner.rb', line 20

def super_pipeline(descendent=self.pipeline)
    if descendent.respond_to? :pipeline
        super_pipeline(descendent.pipeline)
    else
        descendent
    end
end