Sha256: a1753afecac5f3669a91557a9b6940246223cb2c9df04e6f512e6addee1c8333
Contents?: true
Size: 414 Bytes
Versions: 9
Compression:
Stored size: 414 Bytes
Contents
require 'uri' module CLIUtils # A Validator to verify whether a Pref answer # is a valid URL. class UrlValidator < PrefValidator # Runs the Validator against the answer. # @param [Object] text The "text" to evaluate # @return [String] def validate(text) @is_valid = text.to_s =~ URI::DEFAULT_PARSER.regexp[:ABS_URI] @message = "Response is not a url: #{ text }" end end end
Version data entries
9 entries across 9 versions & 1 rubygems