Sha256: e750746881e8c8ee995d8a7ca7593c599c84ed5b84bfdfaa68dd5f5934b58f6d

Contents?: true

Size: 612 Bytes

Versions: 5

Compression:

Stored size: 612 Bytes

Contents

module Stevenson
  module OutputFilter
    class Generator
      attr_reader :options

      def initialize(options)
        @options = options
      end

      def generate!(template)
        filters.inject(template.local_directory) do |rendered, filter|
          OutputFilter.filter_for(filter).new(rendered, options).output
        end
      end

      private

      def filters
        @_filters ||= begin
          filters = [:jekyll]
          filters.concat options[:output] if options[:output]
          filters << :zip if options[:zip]
          filters.uniq
        end
      end

    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
stevenson-2.5.1 lib/stevenson/output_filter/generator.rb
stevenson-2.5.0 lib/stevenson/output_filter/generator.rb
stevenson-2.3.3 lib/stevenson/output_filter/generator.rb
stevenson-2.3.2 lib/stevenson/output_filter/generator.rb
stevenson-2.3.1 lib/stevenson/output_filter/generator.rb