Sha256: 9a20f8929a421240a06039d3ce54e9c5c90473841596a2e5f5ca19a718796d10

Contents?: true

Size: 966 Bytes

Versions: 12

Compression:

Stored size: 966 Bytes

Contents

require 'faml/error'

module Faml
  module FilterCompilers
    class NotFound < Error
      def initialize(name)
        super("Unable to find compiler for #{name}", nil)
        @name = name
      end
    end

    def self.compilers
      @compilers ||= {}
    end

    def self.register(name, compiler)
      compilers[name.to_s] = compiler
    end

    def self.find(name)
      name = name.to_s
      if compilers.has_key?(name.to_s)
        compilers[name].new
      else
        raise NotFound.new(name)
      end
    end
  end
end

require 'faml/filter_compilers/cdata'
require 'faml/filter_compilers/coffee'
require 'faml/filter_compilers/css'
require 'faml/filter_compilers/escaped'
require 'faml/filter_compilers/javascript'
require 'faml/filter_compilers/markdown'
require 'faml/filter_compilers/plain'
require 'faml/filter_compilers/preserve'
require 'faml/filter_compilers/ruby'
require 'faml/filter_compilers/sass'
require 'faml/filter_compilers/scss'

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
faml-0.3.1 lib/faml/filter_compilers.rb
faml-0.3.0 lib/faml/filter_compilers.rb
faml-0.2.16 lib/faml/filter_compilers.rb
faml-0.2.15 lib/faml/filter_compilers.rb
faml-0.2.14 lib/faml/filter_compilers.rb
faml-0.2.13 lib/faml/filter_compilers.rb
faml-0.2.12 lib/faml/filter_compilers.rb
faml-0.2.11 lib/faml/filter_compilers.rb
faml-0.2.10 lib/faml/filter_compilers.rb
faml-0.2.9 lib/faml/filter_compilers.rb
faml-0.2.8 lib/faml/filter_compilers.rb
faml-0.2.7 lib/faml/filter_compilers.rb