From 4bbf120630f02b421aed3d9ef7be64cb9b387c94 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 2 May 2023 22:20:27 +0200 Subject: [PATCH] Add note about `Version` constructor. --- Library/Homebrew/os/mac/version.rb | 1 + Library/Homebrew/version.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/Library/Homebrew/os/mac/version.rb b/Library/Homebrew/os/mac/version.rb index 37681b4d2b..57d0df7e87 100644 --- a/Library/Homebrew/os/mac/version.rb +++ b/Library/Homebrew/os/mac/version.rb @@ -117,6 +117,7 @@ module OS alias requires_popcnt? requires_nehalem_cpu? # Represents the absence of a version. + # NOTE: Constructor needs to called with an arbitrary macOS-like version which is then set to `nil`. NULL = Version.new("10.0").tap { |v| v.instance_variable_set(:@version, nil) }.freeze end end diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index a8f6f9fd3b..741a57f5de 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -736,5 +736,6 @@ class Version end # Represents the absence of a version. + # NOTE: Constructor needs to called with an arbitrary non-empty version which is then set to `nil`. NULL = Version.new("NULL").tap { |v| v.instance_variable_set(:@version, nil) }.freeze end