Class: LetsencryptWebfaction::Instructions

Inherits:
Object
  • Object
show all
Defined in:
lib/letsencrypt_webfaction/instructions.rb

Instance Method Summary collapse

Constructor Details

#initialize(output_dir, domains) ⇒ Instructions



3
4
5
6
# File 'lib/letsencrypt_webfaction/instructions.rb', line 3

def initialize(output_dir, domains)
  @output_dir = output_dir
  @domains = domains
end

Instance Method Details

#context(support_email: true) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/letsencrypt_webfaction/instructions.rb', line 8

def context(support_email: true)
  out = 'LetsEncrypt Webfaction has generated a new certificate for ' \
    "#{to_sentence @domains}. The certificates have been placed in " \
    "#{@output_dir}. "

  out << if support_email
           'WebFaction support has been contacted with the following message:'
         else
           'Go to https://help.webfaction.com, log in, and paste the ' \
           'following text into a new ticket:'
         end

  out
end

#full_message(support_email: true) ⇒ Object



28
29
30
# File 'lib/letsencrypt_webfaction/instructions.rb', line 28

def full_message(support_email: true)
  context(support_email: support_email) + "\n\n" + instructions
end

#instructionsObject



23
24
25
26
# File 'lib/letsencrypt_webfaction/instructions.rb', line 23

def instructions
  "Please apply the new certificate in #{@output_dir} to " \
  "#{to_sentence @domains}. Thanks!"
end