Module: Forspell::Loaders

Defined in:
lib/forspell/loaders.rb,
lib/forspell/loaders/c.rb,
lib/forspell/loaders/base.rb,
lib/forspell/loaders/ruby.rb,
lib/forspell/loaders/source.rb,
lib/forspell/loaders/markdown.rb

Defined Under Namespace

Classes: Base, C, Markdown, ParsingError, Ruby, Source, Word

Constant Summary collapse

EXT_TO_PARSER_CLASS =
{
  '.rb' => Loaders::Ruby,
  '.c' => Loaders::C,
  '.cpp' => Loaders::C,
  '.cxx' => Loaders::C,
  '.md' => Loaders::Markdown
}.freeze

Class Method Summary collapse

Class Method Details

.for(path) ⇒ Object



19
20
21
# File 'lib/forspell/loaders.rb', line 19

def self.for(path)
  EXT_TO_PARSER_CLASS[File.extname(path)].new(file: path)
end