# encoding: utf-8 module LocalPac class PacFileValidator private attr_reader :pac_engine public def initialize(pac_engine = ProxyPacRb::Parser) @pac_engine = pac_engine end def valid?(file) validate(file) true rescue StandardError false end def errors(file) validate(file) '' rescue StandardError => e e.message end private def validate(file) pac = pac_engine.new.source(file.content) pac.find('http://www.example.com') end end end