Class: PEM::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/pem/manager.rb

Overview

Creates the push profile and stores it in the correct location

Class Method Summary collapse

Class Method Details

.startObject


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

def self.start
  path, rsa_file = PEM::CertManager.new.run

  if path
    file_name = PEM.config[:pem_name] || File.basename(path)
    file_name.concat('.pem') unless file_name =~ /.pem/
    output = "./#{file_name}"
    FileUtils.mv(path, output)
    path = output
    puts output.green
  end
  
  if PEM.config[:save_private_key]
    file_name = File.basename(rsa_file)
    output = "./#{file_name}"
    FileUtils.mv(rsa_file, output)
    puts output.green          
  else
    File.delete(rsa_file) if rsa_file
  end

  return path
end