Sha256: d6fcf8f43696b45f4c95ee91579d95d521dba7643642a372cb73d6edc37d538e

Contents?: true

Size: 372 Bytes

Versions: 5

Compression:

Stored size: 372 Bytes

Contents

# frozen_string_literal: true

require "uri"

module Git
  module Lint
    module Validators
      class Email
        def initialize text, pattern: URI::MailTo::EMAIL_REGEXP
          @text = text
          @pattern = pattern
        end

        def valid? = String(text).match?(pattern)

        private

        attr_reader :text, :pattern
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
git-lint-2.4.0 lib/git/lint/validators/email.rb
git-lint-2.3.3 lib/git/lint/validators/email.rb
git-lint-2.3.2 lib/git/lint/validators/email.rb
git-lint-2.3.1 lib/git/lint/validators/email.rb
git-lint-2.3.0 lib/git/lint/validators/email.rb