Sha256: 22dc2692ffd3857cb01443dafbc6d60a63f31ad40e8631286683076f035fc256

Contents?: true

Size: 391 Bytes

Versions: 11

Compression:

Stored size: 391 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
        end

        private

        attr_reader :text, :pattern
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
git-lint-2.2.1 lib/git/lint/validators/email.rb
git-lint-2.2.0 lib/git/lint/validators/email.rb
git-lint-2.1.0 lib/git/lint/validators/email.rb
git-lint-2.0.0 lib/git/lint/validators/email.rb
git-lint-1.4.0 lib/git/lint/validators/email.rb
git-lint-1.3.0 lib/git/lint/validators/email.rb
git-lint-1.2.0 lib/git/lint/validators/email.rb
git-lint-1.1.1 lib/git/lint/validators/email.rb
git-lint-1.1.0 lib/git/lint/validators/email.rb
git-lint-1.0.1 lib/git/lint/validators/email.rb
git-lint-1.0.0 lib/git/lint/validators/email.rb