gpg: add version method to retrieve current version in path
This commit is contained in:
parent
14a7ef591b
commit
889d61660a
@ -6,6 +6,7 @@ class Gpg
|
||||
gpg_short_version = Utils.popen_read(gpg, "--version")[/\d\.\d/, 0]
|
||||
next unless gpg_short_version
|
||||
gpg_version = Version.create(gpg_short_version.to_s)
|
||||
@version = gpg_version
|
||||
gpg_version == Version.create("2.0") ||
|
||||
gpg_version == Version.create("2.1")
|
||||
end
|
||||
@ -25,6 +26,10 @@ class Gpg
|
||||
File.executable?(GPG_EXECUTABLE.to_s)
|
||||
end
|
||||
|
||||
def self.version
|
||||
@version if available?
|
||||
end
|
||||
|
||||
def self.create_test_key(path)
|
||||
odie "No GPG present to test against!" unless available?
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user