Closed dewyatt closed 5 years ago
@ronaldtse @ribose-jeffreylau Any opinions on whether I should get rid of Generate#options=
(and similar)? I expected codeclimate to object to it but included it as a shortcut because we have similar shortcuts for Sign
, etc.
They just let you do something like:
op.options = {
bits: 2048,
hash: :sm3,
usage: :sign,
s2k_cipher: :sm4,
preferences: {
hashes: %i[sm3 sha512 sha256],
ciphers: %i[sm4 cast5],
key_server: 'hkp://pgp.mit.edu',
}
}
Rather than:
op.bits = 2048
op.hash = :sm3
op.usage = :sign
op.s2k_hash = :sm3
op.preferences = {
hashes: %i[sha512 sha256],
ciphers: %i[sm4 cast5],
key_server: 'hkp://pgp.mit.edu'
}
However, the user can always achieve something similar with:
{
bits: 2048,
hash: :sm3,
usage: :sign,
s2k_cipher: :sm4,
preferences: {
hashes: %i[sm3 sha512 sha256],
ciphers: %i[sm4 cast5],
key_server: 'hkp://pgp.mit.edu',
}
}.each do |key, value|
op.send("#{key}=", value)
end
So I'm not sure if it's worth it. What do you guys think?
@dewyatt I think being able to set parameters via hash has its benefits, I wouldn't worry so much about CodeClimate. :wink:
@ronaldtse Roger that, thanks!
Codecov Report
100% <ø> (ø)
99.24% <ø> (ø)
100% <100%> (ø)
100% <100%> (ø)
100% <100%> (ø)
100% <100%> (ø)
100% <100%> (ø)
100% <100%> (ø)
98.33% <100%> (+0.34%)
100% <100%> (ø)
Continue to review full report at Codecov.