aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compat/gpg.rb
diff options
context:
space:
mode:
authorMike McQuaid2018-01-09 19:52:34 +0000
committerMike McQuaid2018-01-09 19:52:34 +0000
commit2cbce1fbf0a7a361f2be8b3545998f1a36ab3588 (patch)
tree709d8f4543cd2b94da42fb1ca37c7ab3f6a3d57e /Library/Homebrew/compat/gpg.rb
parent9ed1ed3c0577a20b0144cb83501838b2b8c681ae (diff)
downloadbrew-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.rb36
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