class Envm::ParserFactory

Public Class Methods

parser(filepath) click to toggle source
# File lib/envm/parser.rb, line 6
def self.parser(filepath)
  unless File.exist?(filepath)
    fail FileNotFoundError, "#{filepath} does not exist."
  end

  if filepath.include?(".yml")
    YamlParser.new(filepath)
  else
    fail FileTypeNotSupportedError, "File type is not supported: #{filepath}."
  end
end