lib/dokkit/environment/basic.rb in dokkit-0.4.0 vs lib/dokkit/environment/basic.rb in dokkit-0.4.1

- old
+ new

@@ -5,11 +5,10 @@ # # (C)2006-2008 Andrea Fazzi <andrea.fazzi@alca.le.it> (and contributors). # require 'ostruct' -require 'rake' require 'dokkit' require 'dokkit/environment' require 'dokkit/logging' require 'dokkit/factory' require 'dokkit/resource' @@ -96,10 +95,12 @@ end # Construct a filter factory and register filters. def filter_factory @filter_factory ||= Dokkit::Factory.new do |factory| + factory.add('erb' => lambda { |binding| Dokkit::Filter::ERB.new(binding) } ) + factory.add('tidy' => lambda { Dokkit::Filter::Tidy.new } ) factory.add('maruku-html' => lambda { Dokkit::Filter::MarukuHTML.new } ) factory.add('deplate-latex' => lambda { Dokkit::Filter::DeplateLatex.new } ) factory.add('deplate-html' => lambda { Dokkit::Filter::DeplateHTML.new } ) factory.add('deplate-text' => lambda { Dokkit::Filter::DeplateText.new } ) end @@ -112,10 +113,11 @@ @resource_factory ||= Factory.new do |factory| factory.add(:document => document_factory_block) factory.add(:data => data_factory_block) end end + # Return a block that is able to construct a Document instance. def document_factory_block lambda do |source_fn| Resource::Document.new(source_fn, configuration.marshal_dump, @@ -124,33 +126,39 @@ resource_factory, filter_factory, &extmap[source_fn]) end end + # Return a block that is able to construct a Data instance. def data_factory_block lambda do |source_fn| Resource::Data.new(source_fn, configuration.marshal_dump) end end + # Define render tasklib. def render TaskLib::Render.new(logger, resource_factory, documents.files, data.files) end + # Define clean tasklib. def clean TaskLib::Clean.new(logger, configuration.marshal_dump) end + end end end module Dokkit module Environment module Basic + # Define a setup container. class Container include Dokkit::Environment::Basic end + end end end