Module: LatexCurriculumVitae::GetConfig

Defined in:
lib/latex_curriculum_vitae/get-config.rb

Overview

Module for creating the GetConfig

Class Method Summary collapse

Class Method Details

.get(sysconf_dir) ⇒ Array

This method gets the configs from the config file bit_ly_user, bit_ly_apikey

Parameters:

  • sysconf_dir (String)

Returns:

  • (Array)

    name_of_pdf, name_of_cover, name_of_resume, name_of_letter, pdf_reader, shorten_url,



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/latex_curriculum_vitae/get-config.rb', line 27

def self.get(sysconf_dir)
  config = ParseConfig.new("#{sysconf_dir}/latex_curriculum_vitae.cfg")
  name_of_pdf = config['name_of_pdf']
  name_of_cover = config['name_of_cover']
  name_of_resume = config['name_of_resume']
  name_of_letter = config['name_of_letter']
  pdf_reader = config['pdf_reader']
  shorten_url = config['shorten_url']
  bit_ly_user = config['bitly_user']
  bit_ly_apikey = config['bitly_apikey']
  mail_backend = config['mail_backend']

  [name_of_pdf, name_of_cover, name_of_resume, name_of_letter, pdf_reader, shorten_url, bit_ly_user, bit_ly_apikey,
   mail_backend]
end

.get_smtp(sysconf_dir) ⇒ Array

Method for getting smtp configuration

Parameters:

  • sysconf_dir (String)

Returns:

  • (Array)

    own_name, own_email_address, own_smtp, own_username, own_password, own_port, own_domain



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/latex_curriculum_vitae/get-config.rb', line 46

def self.get_smtp(sysconf_dir)
  config = ParseConfig.new("#{sysconf_dir}/latex_curriculum_vitae.cfg")
  # own_name = config['own_name']
  own_email_address = config['own_email_address']
  own_smtp = config['own_smtp']
  own_username = config['own_username']
  own_password = config['own_password']
  own_port = config['own_port'].to_i

  [own_email_address, own_smtp, own_username, own_password, own_port]
end