diff options
| author | Mike McQuaid | 2018-01-09 19:52:34 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2018-01-09 19:52:34 +0000 |
| commit | 2cbce1fbf0a7a361f2be8b3545998f1a36ab3588 (patch) | |
| tree | 709d8f4543cd2b94da42fb1ca37c7ab3f6a3d57e /Library/Homebrew/compat/gpg.rb | |
| parent | 9ed1ed3c0577a20b0144cb83501838b2b8c681ae (diff) | |
| download | brew-2cbce1fbf0a7a361f2be8b3545998f1a36ab3588.tar.bz2 | |
Add more deprecations, disable some existing ones.
Add more `odeprecated` calls to places that have been deprecated for a
while in the wild and move some of the existing `odeprecated` calls to
be `odisabled` to allow deleting the compatibility code.
Diffstat (limited to 'Library/Homebrew/compat/gpg.rb')
| -rw-r--r-- | Library/Homebrew/compat/gpg.rb | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/Library/Homebrew/compat/gpg.rb b/Library/Homebrew/compat/gpg.rb index 01880f71e..e802d939c 100644 --- a/Library/Homebrew/compat/gpg.rb +++ b/Library/Homebrew/compat/gpg.rb @@ -4,46 +4,24 @@ module Gpg module_function def executable + odeprecated "Gpg.executable", 'which "gpg"' which "gpg" end def available? + odeprecated "Gpg.available?", 'which "gpg"' File.executable?(executable.to_s) end - def create_test_key(path) - odie "No GPG present to test against!" unless available? - - (path/"batch.gpg").write <<~EOS - Key-Type: RSA - Key-Length: 2048 - Subkey-Type: RSA - Subkey-Length: 2048 - Name-Real: Testing - Name-Email: testing@foo.bar - Expire-Date: 1d - %no-protection - %commit - EOS - system executable, "--batch", "--gen-key", "batch.gpg" + def create_test_key(_) + odeprecated "Gpg.create_test_key" end def cleanup_test_processes! - odie "No GPG present to test against!" unless available? - - gpgconf = Pathname.new(executable).parent/"gpgconf" - - system gpgconf, "--kill", "gpg-agent" - system gpgconf, "--homedir", "keyrings/live", "--kill", - "gpg-agent" + odeprecated "Gpg.cleanup_test_processes!" end - def test(path) - create_test_key(path) - begin - yield - ensure - cleanup_test_processes! - end + def test(_) + odeprecated "Gpg.test" end end |
