fastruby / dotenv_validator

This gem check if required env variables are present and its format using the .env and .env.sample files from Dotenv.
https://www.fastruby.io/blog/open-source/introducing-dotenv-validator.html
MIT License
50 stars 4 forks source link

[REQUEST] A UUID format #44

Closed PerjuAndrei closed 2 years ago

PerjuAndrei commented 3 years ago

IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.

Before we start...:

Branch/Commit:

v1.1.0

Describe the feature:

Please include a detailed description of the feature you are requesting and any detail on it’s expected behavior.

As a developer I do use UUID env variables And I want to use a UUID format

Problem:

Please include a detailed description of the problem this feature would solve.

As a developer I want to use a UUID format So that I don't have to set a regex format every time I use a UUID

Mockups:

It should support both compact and default UUID formats:

  # It checks the value to check if it is a UUID or not.
  #
  # @param [String] A string
  # @return [Boolean] True if it is a UUID value. False otherwise.
  def self.uuid?(string)
    string.match?(/\A[\da-f]{32}\z/i) ||
      string.match?(/\A[\da-f]{8}-([\da-f]{4}-){3}[\da-f]{12}\z/i)
  end

Resources:

UUID.validate

I will abide by the code of conduct