Sha256: 9dd7302898a1820e74d6899ae8340a0907c6bd321b7cc94be9c7fa7c71a0f355

Contents?: true

Size: 455 Bytes

Versions: 6

Compression:

Stored size: 455 Bytes

Contents

module Rack::App::File::Parser::Factory

  def use_file_parser(parser_class, *extensions)
    extensions.each do |extension|
      file_parser_classes[extension.to_s]= parser_class
    end
    nil
  end

  def find_file_parser_class_for(extension)
    file_parser_classes[extension.to_s] || Rack::App::File::Parser
  end

  protected

  def file_parser_classes
    @file_parser_classes ||= {
        '.erb' => Rack::App::File::Parser::ERB
    }
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rack-app-0.10.1 lib/rack/app/file/parser/factory.rb
rack-app-0.9.2 lib/rack/app/file/parser/factory.rb
rack-app-0.9.1 lib/rack/app/file/parser/factory.rb
rack-app-0.9.0 lib/rack/app/file/parser/factory.rb
rack-app-0.8.2 lib/rack/app/file/parser/factory.rb
rack-app-0.8.1 lib/rack/app/file/parser/factory.rb