Skip to content

Commit

Permalink
[rubocop] Style/MutableConstant
Browse files Browse the repository at this point in the history
Signed-off-by: David Crosby <[email protected]>
  • Loading branch information
dafyddcrosby committed Dec 17, 2024
1 parent ed9334e commit f0f0cac
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/mixlib/versioning/format/git_describe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Format
# @author Seth Chisamore (<[email protected]>)
# @author Christopher Maier (<[email protected]>)
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

Expand Down
4 changes: 2 additions & 2 deletions lib/mixlib/versioning/format/opscode_semver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Format
# @author Christopher Maier (<[email protected]>)
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:
#
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/mixlib/versioning/format/partial_semver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Format
# @author Ryan Hass (<[email protected]>)
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
Expand Down
2 changes: 1 addition & 1 deletion lib/mixlib/versioning/format/rubygems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Format
# @author Seth Chisamore (<[email protected]>)
# @author Christopher Maier (<[email protected]>)
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)
Expand Down
2 changes: 1 addition & 1 deletion lib/mixlib/versioning/format/semver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Format
# @author Seth Chisamore (<[email protected]>)
# @author Christopher Maier (<[email protected]>)
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)
Expand Down
2 changes: 1 addition & 1 deletion lib/mixlib/versioning/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

module Mixlib
class Versioning
VERSION = "1.2.18"
VERSION = "1.2.18".freeze
end
end

0 comments on commit f0f0cac

Please sign in to comment.