Module: PrismChecker::SitePrismCompat

Defined in:
lib/prism_checker/site_prism_compat.rb

Overview

site_prism 6 nests its errors under SitePrism::Error, while 5 keeps them at the top level. The gem supports both, so the class is resolved on first use rather than at load time: site_prism is required by the host suite, not by prism_checker itself.

Class Method Summary collapse

Class Method Details

.timeout_errorObject



9
10
11
12
13
14
15
# File 'lib/prism_checker/site_prism_compat.rb', line 9

def self.timeout_error
  @timeout_error ||= if SitePrism.const_defined?(:Error, false) && SitePrism::Error.const_defined?(:TimeoutError, false)
                       SitePrism::Error::TimeoutError
                     else
                       SitePrism::TimeoutError
                     end
end