Sha256: 4f8b274ed3c73598ca8d9be7a585d0d32067136616c2aa243ffd33347eb20948
Contents?: true
Size: 443 Bytes
Versions: 44
Compression:
Stored size: 443 Bytes
Contents
module Lookbook class YamlResolver < DataResolver MATCHER = /((?:\{|\[)(.*?)(?:\]|\}))$/m MATCH_INDEX = 1 def self.resolveable?(input) input.to_s.match?(MATCHER) && YamlParser.call(input, fail_silently: true) end protected def resolve(input) YamlParser.call(input) rescue Psych::SyntaxError => exception raise_error "YAML parse error (#{exception}) in '#{file}'", exception end end end
Version data entries
44 entries across 44 versions & 1 rubygems