Sha256: 717631d33fabd4b655cb5d80874742179f0a87e6fab30ab724fef1c5ab739819

Contents?: true

Size: 394 Bytes

Versions: 26

Compression:

Stored size: 394 Bytes

Contents

# frozen_string_literal: true

require "uri"

module Git
  module Lint
    module Validators
      # Validates the format of email addresses.
      class Email
        def initialize pattern: URI::MailTo::EMAIL_REGEXP
          @pattern = pattern
        end

        def call(content) = String(content).match? pattern

        private

        attr_reader :pattern
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
git-lint-8.8.0 lib/git/lint/validators/email.rb
git-lint-8.7.0 lib/git/lint/validators/email.rb
git-lint-8.6.0 lib/git/lint/validators/email.rb
git-lint-8.5.0 lib/git/lint/validators/email.rb
git-lint-8.4.0 lib/git/lint/validators/email.rb
git-lint-8.3.0 lib/git/lint/validators/email.rb
git-lint-8.2.0 lib/git/lint/validators/email.rb
git-lint-8.1.0 lib/git/lint/validators/email.rb
git-lint-8.0.0 lib/git/lint/validators/email.rb
git-lint-7.5.0 lib/git/lint/validators/email.rb
git-lint-7.3.0 lib/git/lint/validators/email.rb
git-lint-7.2.0 lib/git/lint/validators/email.rb
git-lint-7.1.0 lib/git/lint/validators/email.rb
git-lint-7.0.0 lib/git/lint/validators/email.rb
git-lint-6.2.1 lib/git/lint/validators/email.rb
git-lint-6.2.0 lib/git/lint/validators/email.rb
git-lint-6.1.0 lib/git/lint/validators/email.rb
git-lint-6.0.2 lib/git/lint/validators/email.rb
git-lint-6.0.1 lib/git/lint/validators/email.rb
git-lint-6.0.0 lib/git/lint/validators/email.rb