lib/dry/validation/message_compiler.rb in dry-validation-0.13.2 vs lib/dry/validation/message_compiler.rb in dry-validation-0.13.3
- old
+ new
@@ -158,21 +158,17 @@
val_type: input.class
)
end
def message_text(rule, template, tokens, opts)
- original_verbosity = $VERBOSE
- $VERBOSE = nil
- text = template % tokens
+ text = template[template.data(tokens)]
if full?
rule_name = messages.rule(rule, opts) || rule
"#{rule_name} #{text}"
else
text
end
- ensure
- $VERBOSE = original_verbosity
end
def message_tokens(args)
args.each_with_object({}) { |arg, hash|
case arg[1]