latex_curriculum_vitae 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +2 -16
- data/Gemfile +2 -2
- data/Gemfile.lock +146 -144
- data/History.rdoc +139 -133
- data/Manifest.txt +68 -69
- data/README.rdoc +83 -84
- data/Rakefile +119 -119
- data/bin/latexcv.rb +19 -19
- data/data/latex_curriculum_vitae/Cover/Cover.tex +141 -141
- data/data/latex_curriculum_vitae/Motivational_Letter/bwanschreiben.tex +204 -204
- data/data/latex_curriculum_vitae/Resume/cv_10.tex +440 -440
- data/data/latex_curriculum_vitae/Resume/friggeri-cv.cls +349 -349
- data/etc/latex_curriculum_vitae.cfg +15 -15
- data/etc/personal_data.tex +10 -10
- data/lib/latex_curriculum_vitae.rb +112 -112
- data/lib/latex_curriculum_vitae/cover.rb +32 -32
- data/lib/latex_curriculum_vitae/cv.rb +103 -103
- data/lib/latex_curriculum_vitae/email.rb +245 -245
- data/lib/latex_curriculum_vitae/entityfile.rb +186 -186
- data/lib/latex_curriculum_vitae/get-config.rb +58 -58
- data/lib/latex_curriculum_vitae/letter.rb +35 -35
- data/lib/latex_curriculum_vitae/notifier.rb +36 -36
- data/lib/latex_curriculum_vitae/outfile.rb +54 -54
- metadata +7 -8
- data/NEWS +0 -128
@@ -1,16 +1,16 @@
|
|
1
|
-
# Read the documentation at: https://
|
2
|
-
name_of_pdf = "Bewerbungsunterlagen_Manns"
|
3
|
-
name_of_cover = "Cover"
|
4
|
-
name_of_resume = "cv_10"
|
5
|
-
name_of_letter = "bwanschreiben"
|
6
|
-
mail_backend = "Pony" # Pony or Evolution
|
7
|
-
own_name = "Sascha Manns"
|
8
|
-
own_email_address = "Sascha.Manns@
|
9
|
-
own_smtp = "smtp.my.com"
|
10
|
-
own_port = "587"
|
11
|
-
own_username = "myusername"
|
12
|
-
own_password = "mypassword"
|
13
|
-
pdf_reader = "/home/sascha/FoxitSoftware/FoxitReader/FoxitReader.sh"
|
14
|
-
shorten_url = "no" # currently it doesn't work
|
15
|
-
bitly_user = "test"
|
1
|
+
# Read the documentation at: https://docs.saigkills-backtrace.de/latex_curriculum_vitae/
|
2
|
+
name_of_pdf = "Bewerbungsunterlagen_Manns"
|
3
|
+
name_of_cover = "Cover"
|
4
|
+
name_of_resume = "cv_10"
|
5
|
+
name_of_letter = "bwanschreiben"
|
6
|
+
mail_backend = "Pony" # Pony or Evolution
|
7
|
+
own_name = "Sascha Manns"
|
8
|
+
own_email_address = "Sascha.Manns@outlook.de"
|
9
|
+
own_smtp = "smtp.my.com"
|
10
|
+
own_port = "587"
|
11
|
+
own_username = "myusername"
|
12
|
+
own_password = "mypassword"
|
13
|
+
pdf_reader = "/home/sascha/FoxitSoftware/FoxitReader/FoxitReader.sh"
|
14
|
+
shorten_url = "no" # currently it doesn't work
|
15
|
+
bitly_user = "test"
|
16
16
|
bitly_apikey = "0815"
|
data/etc/personal_data.tex
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
% Read the documentation at: https://
|
2
|
-
\def\firstname{Sascha}
|
3
|
-
\def\familyname{Manns}
|
4
|
-
\def\mystreet{Maifeldstraße 10}
|
5
|
-
\def\mycity{56727 Mayen}
|
6
|
-
\def\myphone{+49-1573-924~27~30}
|
7
|
-
\def\myemail{Sascha.Manns@
|
8
|
-
\def\myblog{
|
9
|
-
\def\mybank{Kto. DE88\ 5765\ 0010\ 0198\ 2426\ 20 \\
|
10
|
-
BIC: MALADE51MYN \\
|
1
|
+
% Read the documentation at: https://docs.saigkills-backtrace.de/latex_curriculum_vitae/
|
2
|
+
\def\firstname{Sascha}
|
3
|
+
\def\familyname{Manns}
|
4
|
+
\def\mystreet{Maifeldstraße 10}
|
5
|
+
\def\mycity{56727 Mayen}
|
6
|
+
\def\myphone{+49-1573-924~27~30}
|
7
|
+
\def\myemail{Sascha.Manns@outlook.de}
|
8
|
+
\def\myblog{https://saigkills-backtrace.de}
|
9
|
+
\def\mybank{Kto. DE88\ 5765\ 0010\ 0198\ 2426\ 20 \\
|
10
|
+
BIC: MALADE51MYN \\
|
11
11
|
Kreissparkasse Mayen}
|
@@ -1,112 +1,112 @@
|
|
1
|
-
# Copyright (C) 2015-2018 Sascha Manns <Sascha.Manns@
|
2
|
-
#
|
3
|
-
# This program is free software: you can redistribute it and/or modify
|
4
|
-
# it under the terms of the GNU General Public License as published by
|
5
|
-
# the Free Software Foundation, either version 3 of the License, or
|
6
|
-
# (at your option) any later version.
|
7
|
-
#
|
8
|
-
# This program is distributed in the hope that it will be useful,
|
9
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
-
# GNU General Public License for more details.
|
12
|
-
#
|
13
|
-
# You should have received a copy of the GNU General Public License
|
14
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
|
-
|
16
|
-
# Dependencies
|
17
|
-
require 'fileutils'
|
18
|
-
require 'xdg'
|
19
|
-
require 'tmpdir'
|
20
|
-
|
21
|
-
require_relative 'latex_curriculum_vitae/entityfile'
|
22
|
-
require_relative 'latex_curriculum_vitae/cv'
|
23
|
-
require_relative 'latex_curriculum_vitae/cover'
|
24
|
-
require_relative 'latex_curriculum_vitae/email'
|
25
|
-
require_relative 'latex_curriculum_vitae/outfile'
|
26
|
-
require_relative 'latex_curriculum_vitae/notifier'
|
27
|
-
require_relative 'latex_curriculum_vitae/letter'
|
28
|
-
require_relative 'latex_curriculum_vitae/get-config'
|
29
|
-
|
30
|
-
# Main Class LatexCurriculumVitae
|
31
|
-
module LatexCurriculumVitae
|
32
|
-
# The version information
|
33
|
-
VERSION = '2.1.
|
34
|
-
|
35
|
-
# Variables
|
36
|
-
sys_xdg = XDG['CONFIG_HOME']
|
37
|
-
data_xdg = XDG['DATA_HOME']
|
38
|
-
sysconf_dir = "#{sys_xdg}/latex_curriculum_vitae"
|
39
|
-
data_dir = "#{data_xdg}/latex_curriculum_vitae"
|
40
|
-
entity_tex = "#{sysconf_dir}/entity.tex"
|
41
|
-
csv_out = "#{sysconf_dir}/job-applications.csv"
|
42
|
-
temp_dir = '/tmp/latex_curriculum_vitae'
|
43
|
-
tmp_dir = "#{temp_dir}/build"
|
44
|
-
|
45
|
-
name_of_pdf, name_of_cover, name_of_resume, name_of_letter, pdf_reader, shorten_url, bit_ly_user, bit_ly_apikey,
|
46
|
-
mail_backend = LatexCurriculumVitae::GetConfig.get(sysconf_dir)
|
47
|
-
|
48
|
-
# Get the needed Information for creating the application
|
49
|
-
contact, email_address, job_title, contact_sex, company, letter,
|
50
|
-
proactive, job_url, target = LatexCurriculumVitae::Entityfile.get_information(entity_tex)
|
51
|
-
|
52
|
-
# Shorten shorten_url
|
53
|
-
# TODO: Try to fix this in future
|
54
|
-
# rubocop:disable Style/IfInsideElse
|
55
|
-
if proactive == 'yes'
|
56
|
-
job_url_checked = 'No URL available (Proactive)'
|
57
|
-
else
|
58
|
-
if shorten_url == 'yes'
|
59
|
-
if job_url != ''
|
60
|
-
job_url_checked = LatexCurriculumVitae::Entityfile.shorten_url(job_url, bit_ly_user,
|
61
|
-
bit_ly_apikey)
|
62
|
-
else
|
63
|
-
puts 'No url given'
|
64
|
-
end
|
65
|
-
else
|
66
|
-
job_url_checked = job_url
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
# Remove old tempdir and copy data to tempdir
|
71
|
-
FileUtils.rm_rf(temp_dir) if File.exist?("#{temp_dir}/Resume/cv_10.tex")
|
72
|
-
FileUtils.mkdir(temp_dir)
|
73
|
-
FileUtils.mkdir(tmp_dir)
|
74
|
-
FileUtils.cp_r("#{data_dir}/.", temp_dir)
|
75
|
-
|
76
|
-
# Create Motivational Letter
|
77
|
-
if letter == 'yes'
|
78
|
-
FileUtils.cd("#{temp_dir}/Motivational_Letter") do
|
79
|
-
LatexCurriculumVitae::Letter.create_letter(tmp_dir, name_of_letter)
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
# Create the cover
|
84
|
-
FileUtils.cd("#{temp_dir}/Cover") do
|
85
|
-
LatexCurriculumVitae::Cover.create_cover(name_of_cover, tmp_dir)
|
86
|
-
end
|
87
|
-
|
88
|
-
# Create the Curriculum Vitae
|
89
|
-
FileUtils.cd("#{temp_dir}/Resume") do
|
90
|
-
LatexCurriculumVitae::CV.create_cv(name_of_resume, tmp_dir)
|
91
|
-
end
|
92
|
-
|
93
|
-
# Final create and shrinking
|
94
|
-
FileUtils.cd(tmp_dir) do
|
95
|
-
LatexCurriculumVitae::CV.create_final_cv(letter, name_of_letter, name_of_resume, name_of_pdf, name_of_cover)
|
96
|
-
LatexCurriculumVitae::CV.copy_home(name_of_pdf, data_dir)
|
97
|
-
end
|
98
|
-
|
99
|
-
# Add entry to Outfile
|
100
|
-
CVOutfile.add_to_outfile(job_title, company, contact, email_address, csv_out,
|
101
|
-
job_url_checked)
|
102
|
-
|
103
|
-
# Start evince to check the output file
|
104
|
-
system("#{pdf_reader} #{data_dir}/#{name_of_pdf}.pdf")
|
105
|
-
|
106
|
-
# Ask if result is ok
|
107
|
-
LatexCurriculumVitae::Email.result_ok(contact, email_address, job_title, contact_sex, proactive,
|
108
|
-
letter, name_of_pdf, sysconf_dir, data_dir, mail_backend, target)
|
109
|
-
|
110
|
-
# Inform about creation is done
|
111
|
-
LatexCurriculumVitae::Notify.run(job_title, data_dir)
|
112
|
-
end
|
1
|
+
# Copyright (C) 2015-2018 Sascha Manns <Sascha.Manns@outlook.de>
|
2
|
+
#
|
3
|
+
# This program is free software: you can redistribute it and/or modify
|
4
|
+
# it under the terms of the GNU General Public License as published by
|
5
|
+
# the Free Software Foundation, either version 3 of the License, or
|
6
|
+
# (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
+
# GNU General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU General Public License
|
14
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
|
+
|
16
|
+
# Dependencies
|
17
|
+
require 'fileutils'
|
18
|
+
require 'xdg'
|
19
|
+
require 'tmpdir'
|
20
|
+
|
21
|
+
require_relative 'latex_curriculum_vitae/entityfile'
|
22
|
+
require_relative 'latex_curriculum_vitae/cv'
|
23
|
+
require_relative 'latex_curriculum_vitae/cover'
|
24
|
+
require_relative 'latex_curriculum_vitae/email'
|
25
|
+
require_relative 'latex_curriculum_vitae/outfile'
|
26
|
+
require_relative 'latex_curriculum_vitae/notifier'
|
27
|
+
require_relative 'latex_curriculum_vitae/letter'
|
28
|
+
require_relative 'latex_curriculum_vitae/get-config'
|
29
|
+
|
30
|
+
# Main Class LatexCurriculumVitae
|
31
|
+
module LatexCurriculumVitae
|
32
|
+
# The version information
|
33
|
+
VERSION = '2.1.2'.freeze
|
34
|
+
|
35
|
+
# Variables
|
36
|
+
sys_xdg = XDG['CONFIG_HOME']
|
37
|
+
data_xdg = XDG['DATA_HOME']
|
38
|
+
sysconf_dir = "#{sys_xdg}/latex_curriculum_vitae"
|
39
|
+
data_dir = "#{data_xdg}/latex_curriculum_vitae"
|
40
|
+
entity_tex = "#{sysconf_dir}/entity.tex"
|
41
|
+
csv_out = "#{sysconf_dir}/job-applications.csv"
|
42
|
+
temp_dir = '/tmp/latex_curriculum_vitae'
|
43
|
+
tmp_dir = "#{temp_dir}/build"
|
44
|
+
|
45
|
+
name_of_pdf, name_of_cover, name_of_resume, name_of_letter, pdf_reader, shorten_url, bit_ly_user, bit_ly_apikey,
|
46
|
+
mail_backend = LatexCurriculumVitae::GetConfig.get(sysconf_dir)
|
47
|
+
|
48
|
+
# Get the needed Information for creating the application
|
49
|
+
contact, email_address, job_title, contact_sex, company, letter,
|
50
|
+
proactive, job_url, target = LatexCurriculumVitae::Entityfile.get_information(entity_tex)
|
51
|
+
|
52
|
+
# Shorten shorten_url
|
53
|
+
# TODO: Try to fix this in future
|
54
|
+
# rubocop:disable Style/IfInsideElse
|
55
|
+
if proactive == 'yes'
|
56
|
+
job_url_checked = 'No URL available (Proactive)'
|
57
|
+
else
|
58
|
+
if shorten_url == 'yes'
|
59
|
+
if job_url != ''
|
60
|
+
job_url_checked = LatexCurriculumVitae::Entityfile.shorten_url(job_url, bit_ly_user,
|
61
|
+
bit_ly_apikey)
|
62
|
+
else
|
63
|
+
puts 'No url given'
|
64
|
+
end
|
65
|
+
else
|
66
|
+
job_url_checked = job_url
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# Remove old tempdir and copy data to tempdir
|
71
|
+
FileUtils.rm_rf(temp_dir) if File.exist?("#{temp_dir}/Resume/cv_10.tex")
|
72
|
+
FileUtils.mkdir(temp_dir)
|
73
|
+
FileUtils.mkdir(tmp_dir)
|
74
|
+
FileUtils.cp_r("#{data_dir}/.", temp_dir)
|
75
|
+
|
76
|
+
# Create Motivational Letter
|
77
|
+
if letter == 'yes'
|
78
|
+
FileUtils.cd("#{temp_dir}/Motivational_Letter") do
|
79
|
+
LatexCurriculumVitae::Letter.create_letter(tmp_dir, name_of_letter)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Create the cover
|
84
|
+
FileUtils.cd("#{temp_dir}/Cover") do
|
85
|
+
LatexCurriculumVitae::Cover.create_cover(name_of_cover, tmp_dir)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Create the Curriculum Vitae
|
89
|
+
FileUtils.cd("#{temp_dir}/Resume") do
|
90
|
+
LatexCurriculumVitae::CV.create_cv(name_of_resume, tmp_dir)
|
91
|
+
end
|
92
|
+
|
93
|
+
# Final create and shrinking
|
94
|
+
FileUtils.cd(tmp_dir) do
|
95
|
+
LatexCurriculumVitae::CV.create_final_cv(letter, name_of_letter, name_of_resume, name_of_pdf, name_of_cover)
|
96
|
+
LatexCurriculumVitae::CV.copy_home(name_of_pdf, data_dir)
|
97
|
+
end
|
98
|
+
|
99
|
+
# Add entry to Outfile
|
100
|
+
CVOutfile.add_to_outfile(job_title, company, contact, email_address, csv_out,
|
101
|
+
job_url_checked)
|
102
|
+
|
103
|
+
# Start evince to check the output file
|
104
|
+
system("#{pdf_reader} #{data_dir}/#{name_of_pdf}.pdf")
|
105
|
+
|
106
|
+
# Ask if result is ok
|
107
|
+
LatexCurriculumVitae::Email.result_ok(contact, email_address, job_title, contact_sex, proactive,
|
108
|
+
letter, name_of_pdf, sysconf_dir, data_dir, mail_backend, target)
|
109
|
+
|
110
|
+
# Inform about creation is done
|
111
|
+
LatexCurriculumVitae::Notify.run(job_title, data_dir)
|
112
|
+
end
|
@@ -1,32 +1,32 @@
|
|
1
|
-
# Copyright (C) 2015-2018 Sascha Manns <Sascha.Manns@
|
2
|
-
#
|
3
|
-
# This program is free software: you can redistribute it and/or modify
|
4
|
-
# it under the terms of the GNU General Public License as published by
|
5
|
-
# the Free Software Foundation, either version 3 of the License, or
|
6
|
-
# (at your option) any later version.
|
7
|
-
#
|
8
|
-
# This program is distributed in the hope that it will be useful,
|
9
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
-
# GNU General Public License for more details.
|
12
|
-
#
|
13
|
-
# You should have received a copy of the GNU General Public License
|
14
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
|
-
|
16
|
-
# Dependencies
|
17
|
-
require 'rainbow/ext/string'
|
18
|
-
|
19
|
-
# main module
|
20
|
-
module LatexCurriculumVitae
|
21
|
-
# Cover module
|
22
|
-
module Cover
|
23
|
-
# Create cover method
|
24
|
-
# @param [String] name_of_cover Name of the cover file
|
25
|
-
def self.create_cover(name_of_cover, tmp_dir)
|
26
|
-
puts 'Creating cover'.color(:yellow)
|
27
|
-
system("pdflatex #{name_of_cover}.tex")
|
28
|
-
system("cp #{name_of_cover}.pdf #{tmp_dir}/#{name_of_cover}.pdf")
|
29
|
-
puts 'Creating cover done'.color(:green)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
1
|
+
# Copyright (C) 2015-2018 Sascha Manns <Sascha.Manns@outlook.de>
|
2
|
+
#
|
3
|
+
# This program is free software: you can redistribute it and/or modify
|
4
|
+
# it under the terms of the GNU General Public License as published by
|
5
|
+
# the Free Software Foundation, either version 3 of the License, or
|
6
|
+
# (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
+
# GNU General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU General Public License
|
14
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
|
+
|
16
|
+
# Dependencies
|
17
|
+
require 'rainbow/ext/string'
|
18
|
+
|
19
|
+
# main module
|
20
|
+
module LatexCurriculumVitae
|
21
|
+
# Cover module
|
22
|
+
module Cover
|
23
|
+
# Create cover method
|
24
|
+
# @param [String] name_of_cover Name of the cover file
|
25
|
+
def self.create_cover(name_of_cover, tmp_dir)
|
26
|
+
puts 'Creating cover'.color(:yellow)
|
27
|
+
system("pdflatex #{name_of_cover}.tex")
|
28
|
+
system("cp #{name_of_cover}.pdf #{tmp_dir}/#{name_of_cover}.pdf")
|
29
|
+
puts 'Creating cover done'.color(:green)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -1,103 +1,103 @@
|
|
1
|
-
# Copyright (C) 2015-2018 Sascha Manns <Sascha.Manns@
|
2
|
-
#
|
3
|
-
# This program is free software: you can redistribute it and/or modify
|
4
|
-
# it under the terms of the GNU General Public License as published by
|
5
|
-
# the Free Software Foundation, either version 3 of the License, or
|
6
|
-
# (at your option) any later version.
|
7
|
-
#
|
8
|
-
# This program is distributed in the hope that it will be useful,
|
9
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
-
# GNU General Public License for more details.
|
12
|
-
#
|
13
|
-
# You should have received a copy of the GNU General Public License
|
14
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
|
-
|
16
|
-
# Dependencies
|
17
|
-
require 'rainbow/ext/string'
|
18
|
-
require 'combine_pdf'
|
19
|
-
require 'fileutils'
|
20
|
-
|
21
|
-
# main Module
|
22
|
-
module LatexCurriculumVitae
|
23
|
-
# Module for creating the CV
|
24
|
-
module CV
|
25
|
-
# Create Curriculum Vitae method
|
26
|
-
# TODO: Try to fix this in future
|
27
|
-
# rubocop:disable Metrics/AbcSize
|
28
|
-
# @param [String] name_of_pdf Name of the resulting PDF file
|
29
|
-
# @param [String] name_of_resume Name of the resume file
|
30
|
-
# @param [String] tmp_dir contains the path to the
|
31
|
-
def self.create_cv(name_of_resume, tmp_dir)
|
32
|
-
puts 'First run of xelatex'.color(:yellow)
|
33
|
-
system("xelatex #{name_of_resume}.tex")
|
34
|
-
puts 'First run of xelatex passed'.color(:yellow)
|
35
|
-
puts 'Running biber'.color(:yellow)
|
36
|
-
system("biber #{name_of_resume}.bcf")
|
37
|
-
puts 'Run of biber passed'.color(:yellow)
|
38
|
-
puts 'Second run of xelatex'.color(:yellow)
|
39
|
-
system("xelatex #{name_of_resume}.tex")
|
40
|
-
puts 'Second run of xelatex passed'.color(:yellow)
|
41
|
-
puts 'All done'.color(:green)
|
42
|
-
system("cp #{name_of_resume}.pdf #{tmp_dir}/#{name_of_resume}.pdf")
|
43
|
-
end
|
44
|
-
|
45
|
-
# Create the final cv
|
46
|
-
# @param [String] letter With motivational letter? Can be yes or no
|
47
|
-
# @param [String] name_of_letter Name of the motivational letter file
|
48
|
-
# @param [String] name_of_resume Name of the resume file
|
49
|
-
# @param [String] name_of_pdf Name of the finished pdf
|
50
|
-
# @param [String] name_of_cover Name of the Cover file
|
51
|
-
# TODO: Try to fix this in future
|
52
|
-
# This method smells of :reek:LongParameterList
|
53
|
-
# This method smells of :reek:ControlParameter
|
54
|
-
def self.create_final_cv(letter, name_of_letter, name_of_resume, name_of_pdf, name_of_cover)
|
55
|
-
if letter == 'yes'
|
56
|
-
puts 'Merging the motivational letter with the cv'.color(:yellow)
|
57
|
-
pdf = CombinePDF.new
|
58
|
-
pdf << CombinePDF.load("#{name_of_letter}.pdf")
|
59
|
-
pdf << CombinePDF.load("#{name_of_cover}.pdf")
|
60
|
-
pdf << CombinePDF.load("#{name_of_resume}.pdf")
|
61
|
-
pdf.save 'result.pdf'
|
62
|
-
puts 'Merging done'.color(:green)
|
63
|
-
else
|
64
|
-
puts "Copying #{name_of_resume}.pdf result.pdf".color(:green)
|
65
|
-
pdf = CombinePDF.new
|
66
|
-
pdf << CombinePDF.load("#{name_of_cover}.pdf")
|
67
|
-
pdf << CombinePDF.load("#{name_of_resume}.pdf")
|
68
|
-
pdf.save 'resumenew.pdf'
|
69
|
-
system('cp resumenew.pdf result.pdf')
|
70
|
-
puts 'Done'.color(:green)
|
71
|
-
end
|
72
|
-
appendix(name_of_pdf)
|
73
|
-
end
|
74
|
-
|
75
|
-
# Add additional stuff
|
76
|
-
# @param [String] name_of_pdf Name of the finished pdf
|
77
|
-
def self.appendix(name_of_pdf)
|
78
|
-
puts 'Adding additional stuff'.color(:yellow)
|
79
|
-
pdf = CombinePDF.new
|
80
|
-
pdf << CombinePDF.load('result.pdf')
|
81
|
-
# Put there your own stuff
|
82
|
-
pdf << CombinePDF.load('../Appendix/Employers_Reference/xcom.pdf')
|
83
|
-
pdf << CombinePDF.load('../Appendix/Employers_Reference/hays.pdf')
|
84
|
-
pdf << CombinePDF.load('../Appendix/Certificates/thm-webeng1.pdf')
|
85
|
-
pdf << CombinePDF.load('../Appendix/Certificates/kompetenzpass12013.pdf')
|
86
|
-
pdf << CombinePDF.load('../Appendix/Employers_Reference/openslx.pdf')
|
87
|
-
pdf << CombinePDF.load('../Appendix/Employers_Reference/openslx1.pdf')
|
88
|
-
pdf << CombinePDF.load('../Appendix/Certificates/Zertifikat_Sascha_Manns1.pdf')
|
89
|
-
pdf << CombinePDF.load('../Appendix/First_References/ihk.pdf')
|
90
|
-
pdf.save "#{name_of_pdf}.pdf"
|
91
|
-
puts 'Additional stuff done'.color(:green)
|
92
|
-
end
|
93
|
-
|
94
|
-
# Copy result to .latex_curriculum_vitae
|
95
|
-
# @param [String] name_of_pdf Name of the resulting PDF file
|
96
|
-
# @param [String] data_dir Path to the data dir
|
97
|
-
def self.copy_home(name_of_pdf, data_dir)
|
98
|
-
puts "Copying #{name_of_pdf}.pdf to tmpdir".color(:yellow)
|
99
|
-
system("cp #{name_of_pdf}.pdf #{data_dir}")
|
100
|
-
puts 'Copied to tmpdir'.color(:green)
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|
1
|
+
# Copyright (C) 2015-2018 Sascha Manns <Sascha.Manns@outlook.de>
|
2
|
+
#
|
3
|
+
# This program is free software: you can redistribute it and/or modify
|
4
|
+
# it under the terms of the GNU General Public License as published by
|
5
|
+
# the Free Software Foundation, either version 3 of the License, or
|
6
|
+
# (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This program is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
+
# GNU General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU General Public License
|
14
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
|
+
|
16
|
+
# Dependencies
|
17
|
+
require 'rainbow/ext/string'
|
18
|
+
require 'combine_pdf'
|
19
|
+
require 'fileutils'
|
20
|
+
|
21
|
+
# main Module
|
22
|
+
module LatexCurriculumVitae
|
23
|
+
# Module for creating the CV
|
24
|
+
module CV
|
25
|
+
# Create Curriculum Vitae method
|
26
|
+
# TODO: Try to fix this in future
|
27
|
+
# rubocop:disable Metrics/AbcSize
|
28
|
+
# @param [String] name_of_pdf Name of the resulting PDF file
|
29
|
+
# @param [String] name_of_resume Name of the resume file
|
30
|
+
# @param [String] tmp_dir contains the path to the
|
31
|
+
def self.create_cv(name_of_resume, tmp_dir)
|
32
|
+
puts 'First run of xelatex'.color(:yellow)
|
33
|
+
system("xelatex #{name_of_resume}.tex")
|
34
|
+
puts 'First run of xelatex passed'.color(:yellow)
|
35
|
+
puts 'Running biber'.color(:yellow)
|
36
|
+
system("biber #{name_of_resume}.bcf")
|
37
|
+
puts 'Run of biber passed'.color(:yellow)
|
38
|
+
puts 'Second run of xelatex'.color(:yellow)
|
39
|
+
system("xelatex #{name_of_resume}.tex")
|
40
|
+
puts 'Second run of xelatex passed'.color(:yellow)
|
41
|
+
puts 'All done'.color(:green)
|
42
|
+
system("cp #{name_of_resume}.pdf #{tmp_dir}/#{name_of_resume}.pdf")
|
43
|
+
end
|
44
|
+
|
45
|
+
# Create the final cv
|
46
|
+
# @param [String] letter With motivational letter? Can be yes or no
|
47
|
+
# @param [String] name_of_letter Name of the motivational letter file
|
48
|
+
# @param [String] name_of_resume Name of the resume file
|
49
|
+
# @param [String] name_of_pdf Name of the finished pdf
|
50
|
+
# @param [String] name_of_cover Name of the Cover file
|
51
|
+
# TODO: Try to fix this in future
|
52
|
+
# This method smells of :reek:LongParameterList
|
53
|
+
# This method smells of :reek:ControlParameter
|
54
|
+
def self.create_final_cv(letter, name_of_letter, name_of_resume, name_of_pdf, name_of_cover)
|
55
|
+
if letter == 'yes'
|
56
|
+
puts 'Merging the motivational letter with the cv'.color(:yellow)
|
57
|
+
pdf = CombinePDF.new
|
58
|
+
pdf << CombinePDF.load("#{name_of_letter}.pdf")
|
59
|
+
pdf << CombinePDF.load("#{name_of_cover}.pdf")
|
60
|
+
pdf << CombinePDF.load("#{name_of_resume}.pdf")
|
61
|
+
pdf.save 'result.pdf'
|
62
|
+
puts 'Merging done'.color(:green)
|
63
|
+
else
|
64
|
+
puts "Copying #{name_of_resume}.pdf result.pdf".color(:green)
|
65
|
+
pdf = CombinePDF.new
|
66
|
+
pdf << CombinePDF.load("#{name_of_cover}.pdf")
|
67
|
+
pdf << CombinePDF.load("#{name_of_resume}.pdf")
|
68
|
+
pdf.save 'resumenew.pdf'
|
69
|
+
system('cp resumenew.pdf result.pdf')
|
70
|
+
puts 'Done'.color(:green)
|
71
|
+
end
|
72
|
+
appendix(name_of_pdf)
|
73
|
+
end
|
74
|
+
|
75
|
+
# Add additional stuff
|
76
|
+
# @param [String] name_of_pdf Name of the finished pdf
|
77
|
+
def self.appendix(name_of_pdf)
|
78
|
+
puts 'Adding additional stuff'.color(:yellow)
|
79
|
+
pdf = CombinePDF.new
|
80
|
+
pdf << CombinePDF.load('result.pdf')
|
81
|
+
# Put there your own stuff
|
82
|
+
pdf << CombinePDF.load('../Appendix/Employers_Reference/xcom.pdf')
|
83
|
+
pdf << CombinePDF.load('../Appendix/Employers_Reference/hays.pdf')
|
84
|
+
pdf << CombinePDF.load('../Appendix/Certificates/thm-webeng1.pdf')
|
85
|
+
pdf << CombinePDF.load('../Appendix/Certificates/kompetenzpass12013.pdf')
|
86
|
+
pdf << CombinePDF.load('../Appendix/Employers_Reference/openslx.pdf')
|
87
|
+
pdf << CombinePDF.load('../Appendix/Employers_Reference/openslx1.pdf')
|
88
|
+
pdf << CombinePDF.load('../Appendix/Certificates/Zertifikat_Sascha_Manns1.pdf')
|
89
|
+
pdf << CombinePDF.load('../Appendix/First_References/ihk.pdf')
|
90
|
+
pdf.save "#{name_of_pdf}.pdf"
|
91
|
+
puts 'Additional stuff done'.color(:green)
|
92
|
+
end
|
93
|
+
|
94
|
+
# Copy result to .latex_curriculum_vitae
|
95
|
+
# @param [String] name_of_pdf Name of the resulting PDF file
|
96
|
+
# @param [String] data_dir Path to the data dir
|
97
|
+
def self.copy_home(name_of_pdf, data_dir)
|
98
|
+
puts "Copying #{name_of_pdf}.pdf to tmpdir".color(:yellow)
|
99
|
+
system("cp #{name_of_pdf}.pdf #{data_dir}")
|
100
|
+
puts 'Copied to tmpdir'.color(:green)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|