Set public key in ruby block