Class: CertWatch::CertbotClient
- Defined in:
- lib/cert_watch/certbot_client.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ CertbotClient
constructor
A new instance of CertbotClient.
- #renew(domain) ⇒ Object
Constructor Details
#initialize(options) ⇒ CertbotClient
Returns a new instance of CertbotClient.
3 4 5 6 7 |
# File 'lib/cert_watch/certbot_client.rb', line 3 def initialize() @executable = .fetch(:executable) @port = .fetch(:port) @shell = .fetch(:shell, Shell) end |
Instance Method Details
#renew(domain) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/cert_watch/certbot_client.rb', line 9 def renew(domain) if Rails.env.development? Rails.logger.info("[CertWatch] Skipping certificate renewal for #{domain} in development.") return end @shell.sudo(renew_command(domain)) rescue Shell::CommandFailed => e fail(RenewError, e.) end |