From 4dcd5ac47f49844476410969aca9296d3523b7a0 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Sun, 19 Mar 2023 17:34:49 -0700 Subject: [PATCH] Remove HashValidator --- .../Homebrew/cask/artifact/abstract_uninstall.rb | 2 -- Library/Homebrew/cask/artifact/artifact.rb | 3 --- Library/Homebrew/cask/artifact/installer.rb | 3 --- Library/Homebrew/cask/artifact/pkg.rb | 3 --- Library/Homebrew/cask/artifact/relocated.rb | 3 --- Library/Homebrew/cask/config.rb | 3 --- Library/Homebrew/cask/dsl/conflicts_with.rb | 3 --- Library/Homebrew/extend/hash_validator.rb | 13 ------------- Library/Homebrew/extend/hash_validator.rbi | 6 ------ Library/Homebrew/system_command.rb | 1 - 10 files changed, 40 deletions(-) delete mode 100644 Library/Homebrew/extend/hash_validator.rb delete mode 100644 Library/Homebrew/extend/hash_validator.rbi diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index aa1261e5ff..7b4d522a7a 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -6,8 +6,6 @@ require "timeout" require "utils/user" require "cask/artifact/abstract_artifact" require "cask/pkg" -require "extend/hash_validator" -using HashValidator module Cask module Artifact diff --git a/Library/Homebrew/cask/artifact/artifact.rb b/Library/Homebrew/cask/artifact/artifact.rb index 705cc4d18a..a3b25a5972 100644 --- a/Library/Homebrew/cask/artifact/artifact.rb +++ b/Library/Homebrew/cask/artifact/artifact.rb @@ -3,9 +3,6 @@ require "cask/artifact/moved" -require "extend/hash_validator" -using HashValidator - module Cask module Artifact # Generic artifact corresponding to the `artifact` stanza. diff --git a/Library/Homebrew/cask/artifact/installer.rb b/Library/Homebrew/cask/artifact/installer.rb index 08b34a46f6..735a74688f 100644 --- a/Library/Homebrew/cask/artifact/installer.rb +++ b/Library/Homebrew/cask/artifact/installer.rb @@ -3,9 +3,6 @@ require "cask/artifact/abstract_artifact" -require "extend/hash_validator" -using HashValidator - module Cask module Artifact # Artifact corresponding to the `installer` stanza. diff --git a/Library/Homebrew/cask/artifact/pkg.rb b/Library/Homebrew/cask/artifact/pkg.rb index 4c79bcb385..7a22057909 100644 --- a/Library/Homebrew/cask/artifact/pkg.rb +++ b/Library/Homebrew/cask/artifact/pkg.rb @@ -6,9 +6,6 @@ require "plist" require "utils/user" require "cask/artifact/abstract_artifact" -require "extend/hash_validator" -using HashValidator - module Cask module Artifact # Artifact corresponding to the `pkg` stanza. diff --git a/Library/Homebrew/cask/artifact/relocated.rb b/Library/Homebrew/cask/artifact/relocated.rb index 3c3aff2950..80d2e727b1 100644 --- a/Library/Homebrew/cask/artifact/relocated.rb +++ b/Library/Homebrew/cask/artifact/relocated.rb @@ -3,9 +3,6 @@ require "cask/artifact/abstract_artifact" -require "extend/hash_validator" -using HashValidator - module Cask module Artifact # Superclass for all artifacts which have a source and a target location. diff --git a/Library/Homebrew/cask/config.rb b/Library/Homebrew/cask/config.rb index f1238a3e10..ad37471258 100644 --- a/Library/Homebrew/cask/config.rb +++ b/Library/Homebrew/cask/config.rb @@ -6,9 +6,6 @@ require "json" require "lazy_object" require "locale" -require "extend/hash_validator" -using HashValidator - module Cask # Configuration for installing casks. # diff --git a/Library/Homebrew/cask/dsl/conflicts_with.rb b/Library/Homebrew/cask/dsl/conflicts_with.rb index 96993ca36b..40b19f6056 100644 --- a/Library/Homebrew/cask/dsl/conflicts_with.rb +++ b/Library/Homebrew/cask/dsl/conflicts_with.rb @@ -3,9 +3,6 @@ require "delegate" -require "extend/hash_validator" -using HashValidator - module Cask class DSL # Class corresponding to the `conflicts_with` stanza. diff --git a/Library/Homebrew/extend/hash_validator.rb b/Library/Homebrew/extend/hash_validator.rb deleted file mode 100644 index 09cfbe68a3..0000000000 --- a/Library/Homebrew/extend/hash_validator.rb +++ /dev/null @@ -1,13 +0,0 @@ -# typed: false -# frozen_string_literal: true - -module HashValidator - refine Hash do - def assert_valid_keys!(*valid_keys) - unknown_keys = keys - valid_keys - return if unknown_keys.empty? - - raise ArgumentError, "invalid keys: #{unknown_keys.map(&:inspect).join(", ")}" - end - end -end diff --git a/Library/Homebrew/extend/hash_validator.rbi b/Library/Homebrew/extend/hash_validator.rbi deleted file mode 100644 index 715b783813..0000000000 --- a/Library/Homebrew/extend/hash_validator.rbi +++ /dev/null @@ -1,6 +0,0 @@ -# typed: strict - -class Hash - sig { params(valid_keys: T.untyped).void } - def assert_valid_keys!(*valid_keys); end -end diff --git a/Library/Homebrew/system_command.rb b/Library/Homebrew/system_command.rb index e069a4e27f..af201706d4 100644 --- a/Library/Homebrew/system_command.rb +++ b/Library/Homebrew/system_command.rb @@ -7,7 +7,6 @@ require "shellwords" require "extend/io" require "extend/predicable" -require "extend/hash_validator" require "extend/time"