From f0f0cac5d7f6023ea1c691e1b44f4fa325b24e06 Mon Sep 17 00:00:00 2001 From: dcrosby Date: Tue, 17 Dec 2024 12:56:22 -0800 Subject: [PATCH] [rubocop] Style/MutableConstant Signed-off-by: David Crosby --- lib/mixlib/versioning/format/git_describe.rb | 2 +- lib/mixlib/versioning/format/opscode_semver.rb | 4 ++-- lib/mixlib/versioning/format/partial_semver.rb | 2 +- lib/mixlib/versioning/format/rubygems.rb | 2 +- lib/mixlib/versioning/format/semver.rb | 2 +- lib/mixlib/versioning/version.rb | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/mixlib/versioning/format/git_describe.rb b/lib/mixlib/versioning/format/git_describe.rb index 79dad05..e97b66a 100644 --- a/lib/mixlib/versioning/format/git_describe.rb +++ b/lib/mixlib/versioning/format/git_describe.rb @@ -44,7 +44,7 @@ class Format # @author Seth Chisamore () # @author Christopher Maier () class GitDescribe < Format - GIT_DESCRIBE_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:\-|\.)?(.+)?\-(\d+)\-g([a-f0-9]{7,40})(?:\-)?(\d+)?$/ + GIT_DESCRIBE_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:\-|\.)?(.+)?\-(\d+)\-g([a-f0-9]{7,40})(?:\-)?(\d+)?$/.freeze attr_reader :commits_since, :commit_sha diff --git a/lib/mixlib/versioning/format/opscode_semver.rb b/lib/mixlib/versioning/format/opscode_semver.rb index 4999cc1..dc61248 100644 --- a/lib/mixlib/versioning/format/opscode_semver.rb +++ b/lib/mixlib/versioning/format/opscode_semver.rb @@ -55,7 +55,7 @@ class Format # @author Christopher Maier () class OpscodeSemVer < SemVer # The pattern is: `YYYYMMDDHHMMSS.git.COMMITS_SINCE.SHA1` - OPSCODE_BUILD_REGEX = /^\d{14}(\.git\.\d+\.[a-f0-9]{7})?$/ + OPSCODE_BUILD_REGEX = /^\d{14}(\.git\.\d+\.[a-f0-9]{7})?$/.freeze # Allows the following: # @@ -65,7 +65,7 @@ class OpscodeSemVer < SemVer # rc, rc.0, rc.1, rc.2, etc. # ``` # - OPSCODE_PRERELEASE_REGEX = /^(alpha|beta|rc)(\.\d+)?$/ + OPSCODE_PRERELEASE_REGEX = /^(alpha|beta|rc)(\.\d+)?$/.freeze # @see SemVer#parse def parse(version_string) diff --git a/lib/mixlib/versioning/format/partial_semver.rb b/lib/mixlib/versioning/format/partial_semver.rb index c48bb71..a34f1aa 100644 --- a/lib/mixlib/versioning/format/partial_semver.rb +++ b/lib/mixlib/versioning/format/partial_semver.rb @@ -40,7 +40,7 @@ class Format # @author Ryan Hass () class PartialSemVer < Format # http://rubular.com/r/NmRSN8vCie - PARTIAL_REGEX = /^(\d+)\.?(?:(\d*))$/ + PARTIAL_REGEX = /^(\d+)\.?(?:(\d*))$/.freeze # @see Format#parse def parse(version_string) match = version_string.match(PARTIAL_REGEX) rescue nil diff --git a/lib/mixlib/versioning/format/rubygems.rb b/lib/mixlib/versioning/format/rubygems.rb index 432bfd5..26bebb2 100644 --- a/lib/mixlib/versioning/format/rubygems.rb +++ b/lib/mixlib/versioning/format/rubygems.rb @@ -42,7 +42,7 @@ class Format # @author Seth Chisamore () # @author Christopher Maier () class Rubygems < Format - RUBYGEMS_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:\.([[:alnum:]]+(?:\.[[:alnum:]]+)?))?(?:\-(\d+))?$/ + RUBYGEMS_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:\.([[:alnum:]]+(?:\.[[:alnum:]]+)?))?(?:\-(\d+))?$/.freeze # @see Format#parse def parse(version_string) diff --git a/lib/mixlib/versioning/format/semver.rb b/lib/mixlib/versioning/format/semver.rb index 7256a15..3a845cd 100644 --- a/lib/mixlib/versioning/format/semver.rb +++ b/lib/mixlib/versioning/format/semver.rb @@ -42,7 +42,7 @@ class Format # @author Seth Chisamore () # @author Christopher Maier () class SemVer < Format - SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][a-zA-Z0-9-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][a-zA-Z0-9-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/ + SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][a-zA-Z0-9-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][a-zA-Z0-9-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/.freeze # @see Format#parse def parse(version_string) diff --git a/lib/mixlib/versioning/version.rb b/lib/mixlib/versioning/version.rb index f6b99fa..e5286e6 100644 --- a/lib/mixlib/versioning/version.rb +++ b/lib/mixlib/versioning/version.rb @@ -18,6 +18,6 @@ module Mixlib class Versioning - VERSION = "1.2.18" + VERSION = "1.2.18".freeze end end