Class: Certman::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/certman/cli.rb

Instance Method Summary collapse

Instance Method Details

#delete(domain) ⇒ Object



28
29
30
31
32
# File 'lib/certman/cli.rb', line 28

def delete(domain)
  Certman::Client.new(domain, options).delete
  puts 'Done.'
  puts ''
end

#request(domain) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/certman/cli.rb', line 6

def request(domain)
  pastel = Pastel.new
  prompt = TTY::Prompt.new
  return unless prompt.yes?(pastel.red("NOTICE! Your selected region is *#{Aws.config[:region]}*. \
Certman create certificate on *#{Aws.config[:region]}*. OK?"))
  client = Certman::Client.new(domain, options)
  return unless prompt.yes?(pastel.red("NOTICE! Certman use *#{client.region_by_hash}* S3/SES. OK?"))
  return unless prompt.yes?(pastel.red("NOTICE! When requesting, Certman apend Receipt Rule to current Active \
Receipt Rule Set. OK?"))
  Signal.trap(:INT) do
    puts ''
    puts pastel.red('Rollback start.')
    client.rollback
  end
  cert_arn = client.request
  puts 'Done.'
  puts ''
  puts "certificate_arn: #{pastel.cyan(cert_arn)}"
  puts ''
end