Sha256: 3f0bf9a2cf29c070134a9699c3b226eca3431ef3cf98ec0a2b410c9956361d10

Contents?: true

Size: 574 Bytes

Versions: 7

Compression:

Stored size: 574 Bytes

Contents

# require "#{$script_dir}/configurable"

class Filter
  
  @@filters= []
  def self.inherited(subclass)
    @@filters << subclass.new
  end

  def self.abstract
    false
  end
  
  def self.each
    @@filters.each { |f|
      yield f
    }
  end
  
  def self.defined
    @@filters
  end
  
  def handles_file(file)
    false
  end

  def preprocess_content(file, content)
    content
  end
  
  def filter_content(file, content, options={})
    content
  end
  
end

# load all the other file types
Dir.glob("#{$script_dir}/filters/*-filter.rb") { |file|
  require file
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
distil-0.10.4 lib/filter.rb
distil-0.10.3 lib/filter.rb
distil-0.10.1 lib/filter.rb
distil-0.10.0 lib/filter.rb
distil-0.8.4 lib/filter.rb
distil-0.8.2 lib/filter.rb
distil-0.8.1 lib/filter.rb