7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/config/dry_validation_requirements.rb', line 7
def self.load_dry_validation!
return if defined?(@load_dry_validation)
begin
require 'dry/validation/version'
version = Gem::Version.new(Dry::Validation::VERSION)
unless VERSIONS.all? { |req| Gem::Requirement.new(req).satisfied_by?(version) }
raise LoadError
end
rescue LoadError
raise ::Config::Error, 'Could not find a dry-validation version' \
' matching requirements' \
" (#{VERSIONS.map(&:inspect) * ','})"
end
require 'dry/validation'
@load_dry_validation = true
nil
end
|