Sha256: c474d608e51c910be564621d41836d9f76c45238878119c57883eec74ebf2ad5

Contents?: true

Size: 1010 Bytes

Versions: 10

Compression:

Stored size: 1010 Bytes

Contents

require_relative '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.key?(name.to_s)
        compilers[name].new
      else
        raise NotFound.new(name)
      end
    end
  end
end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
faml-0.6.0 lib/faml/filter_compilers.rb
faml-0.5.1 lib/faml/filter_compilers.rb
faml-0.5.0 lib/faml/filter_compilers.rb
faml-0.4.2 lib/faml/filter_compilers.rb
faml-0.4.1 lib/faml/filter_compilers.rb
faml-0.4.0 lib/faml/filter_compilers.rb
faml-0.3.6 lib/faml/filter_compilers.rb
faml-0.3.5 lib/faml/filter_compilers.rb
faml-0.3.4 lib/faml/filter_compilers.rb
faml-0.3.3 lib/faml/filter_compilers.rb