Sha256: 2804117f5abaa4e50cb222056b77ca6f8f23f66823b5a4c76f467b8766ba35a0

Contents?: true

Size: 336 Bytes

Versions: 6

Compression:

Stored size: 336 Bytes

Contents

module CopyleaksApi
  module Validators
    class UrlValidator
      class << self
        # raises error if given url for callback is invalid
        def validate!(url)
          raise BadUrlError.new(url) unless url =~ %r(^(https?://)?([\da-z\.-]+)\.([a-z\.]{2,6})([/\w \.-]*)*/?$)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
plagiarism-checker-2.1.2 lib/copyleaks_api/validators/url_validator.rb
plagiarism-checker-2.1.1 lib/copyleaks_api/validators/url_validator.rb
plagiarism-checker-2.1.0 lib/copyleaks_api/validators/url_validator.rb
plagiarism-checker-2.0.0 lib/copyleaks_api/validators/url_validator.rb
plagiarism-checker-1.0.0 lib/copyleaks_api/validators/url_validator.rb
mkisilenko-test-0.1.0 lib/copyleaks_api/validators/url_validator.rb