class Packwerk::Parsers::Factory

Constants

ERB_REGEX
RUBY_REGEX

Public Instance Methods

erb_parser_class() click to toggle source
# File lib/packwerk/parsers/factory.rb, line 31
def erb_parser_class
  @erb_parser_class ||= Erb
end
erb_parser_class=(klass) click to toggle source
# File lib/packwerk/parsers/factory.rb, line 35
def erb_parser_class=(klass)
  @erb_parser_class = klass
  @erb_parser = nil
end
for_path(path) click to toggle source
# File lib/packwerk/parsers/factory.rb, line 22
def for_path(path)
  case path
  when RUBY_REGEX
    @ruby_parser ||= Ruby.new
  when ERB_REGEX
    @erb_parser ||= erb_parser_class.new
  end
end