latex_curriculum_vitae 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.coveralls.yml +1 -1
- data/.gemnasium.yml +1 -1
- data/.index +2 -2
- data/.travis.yml +2 -0
- data/Gemfile +4 -3
- data/Gemfile.lock +56 -22
- data/History.rdoc +10 -2
- data/Index.yml +0 -1
- data/README.rdoc +10 -7
- data/Rakefile +20 -7
- data/VERSION +1 -1
- data/bin/latexcv.rb +2 -2
- data/data/latex_curriculum_vitae/Appendix/Bibliography/bibliography1.bib +21 -5
- data/data/latex_curriculum_vitae/Motivational_Letter/bwanschreiben.tex +4 -3
- data/data/latex_curriculum_vitae/Resume/cv_10.aux +4 -2
- data/data/latex_curriculum_vitae/Resume/cv_10.bbl +720 -336
- data/data/latex_curriculum_vitae/Resume/cv_10.blg +94 -94
- data/data/latex_curriculum_vitae/Resume/cv_10.pdf +0 -0
- data/data/latex_curriculum_vitae/Resume/cv_10.run.xml +1 -1
- data/data/latex_curriculum_vitae/Resume/cv_10.tex +15 -13
- data/etc/latex_curriculum_vitae.cfg +6 -1
- data/lib/latex_curriculum_vitae.rb +16 -16
- data/lib/latex_curriculum_vitae/cover.rb +11 -7
- data/lib/latex_curriculum_vitae/cv.rb +50 -40
- data/lib/latex_curriculum_vitae/email.rb +111 -49
- data/lib/latex_curriculum_vitae/entityfile.rb +63 -61
- data/lib/latex_curriculum_vitae/get-config.rb +28 -11
- data/lib/latex_curriculum_vitae/letter.rb +10 -8
- data/lib/latex_curriculum_vitae/notifier.rb +15 -13
- data/lib/latex_curriculum_vitae/outfile.rb +21 -19
- metadata +38 -24
- metadata.gz.sig +0 -0
@@ -8,65 +8,127 @@
|
|
8
8
|
|
9
9
|
# Dependencies
|
10
10
|
require 'rainbow/ext/string'
|
11
|
+
require 'pony'
|
12
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'get-config'))
|
11
13
|
|
12
14
|
# rubocop:disable Metrics/LineLength
|
13
15
|
# Module for creating the CV
|
14
|
-
module
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
16
|
+
module LatexCurriculumVitae
|
17
|
+
module Email
|
18
|
+
# Method for creating the email
|
19
|
+
# rubocop:disable Metrics/MethodLength
|
20
|
+
# rubocop:disable Metrics/AbcSize
|
21
|
+
# @param [String] contact Name of the contact
|
22
|
+
# @param [String] emailaddress Email address of the contact
|
23
|
+
# @param [String] jobtitle Title of the target job
|
24
|
+
# @param [String] contact_sex Can be male, female or unknown
|
25
|
+
# @param [String] proactive Can be yes or no
|
26
|
+
def self.create_email(contact, emailaddress, jobtitle, contact_sex, proactive, letter, name_of_pdf)
|
27
|
+
own_name, own_email_address, own_smtp, own_username, own_password = LatexCurriculumVitae::GetConfig.get_smtp
|
28
|
+
introduction = LatexCurriculumVitae::Email.introduction(contact, contact_sex)
|
29
|
+
subject = LatexCurriculumVitae::Email.subject(proactive, jobtitle)
|
30
|
+
body = LatexCurriculumVitae::Email.get_body(introduction, letter)
|
31
|
+
home = Dir.home
|
32
|
+
prefix = "#{home}/.rvm/rubies/default"
|
33
|
+
datadir = "#{prefix}/share"
|
34
|
+
filename = "#{home}/.latex_curriculum_vitae/#{name_of_pdf}.pdf"
|
28
35
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
36
|
+
Pony.mail({
|
37
|
+
:to => emailaddress,
|
38
|
+
:bcc => own_email_address,
|
39
|
+
:from => own_email_address,
|
40
|
+
:subject => subject,
|
41
|
+
:body => body,
|
42
|
+
:attachments => {'Bewerbungsunterlagen_Manns.pdf' => File.read(filename)},
|
43
|
+
:via => :smtp,
|
44
|
+
:via_options => {
|
45
|
+
:address => own_smtp,
|
46
|
+
:port => '25',
|
47
|
+
:user_name => own_username,
|
48
|
+
:password => own_password,
|
49
|
+
:authentication => :plain, # :plain, :login, :cram_md5, no auth by default
|
50
|
+
:domain => 'localhost.localdomain', # the HELO domain provided by the client to the server
|
51
|
+
}
|
52
|
+
})
|
53
|
+
end
|
54
|
+
|
55
|
+
# Method for building the introduction
|
56
|
+
# @param [String] contact Name of the contact
|
57
|
+
# @param [String] contact_sex Can be male, female or unknown
|
58
|
+
def self.introduction(contact, contact_sex)
|
59
|
+
if contact == ''
|
60
|
+
introduction = 'Sehr geehrte Damen und Herren,'
|
35
61
|
else
|
36
|
-
|
62
|
+
if contact_sex == 'male'
|
63
|
+
introduction = "Sehr geehrter Herr #{contact},"
|
64
|
+
else
|
65
|
+
introduction = "Sehr geehrte Frau #{contact},"
|
66
|
+
end
|
37
67
|
end
|
38
68
|
end
|
39
|
-
introduction.gsub!(/ /, "#{space}")
|
40
|
-
|
41
|
-
jobtitle.gsub!('\&', "#{ampersand}")
|
42
|
-
jobtitle.gsub!(/ /, "#{space}")
|
43
69
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
70
|
+
# Method for building the subject
|
71
|
+
# @param [String] proactive Can be yes or no
|
72
|
+
# @param [String] jobtitle Title of the target job
|
73
|
+
def self.subject(proactive, jobtitle)
|
74
|
+
if proactive == 'yes'
|
75
|
+
subject = "Initiativbewerbung um einen Arbeitsplatz als #{jobtitle}"
|
76
|
+
else
|
77
|
+
subject = "Bewerbung um einen Arbeitsplatz als #{jobtitle}"
|
78
|
+
end
|
48
79
|
end
|
49
80
|
|
50
|
-
|
51
|
-
|
52
|
-
#
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
81
|
+
# Method for building the email body
|
82
|
+
# @param [String] introduction EMail introduction
|
83
|
+
# @param [String] letter With motivational letter? Can be yes or no
|
84
|
+
def self.get_body(introduction, letter)
|
85
|
+
# rubocop:disable Style/MultilineOperationIndentation
|
86
|
+
if letter == 'no'
|
87
|
+
body =<<EOF
|
88
|
+
#{introduction}
|
89
|
+
Wie ich Ihrer Anzeige entnommen habe, suchen Sie jemanden für die obige Position, um
|
90
|
+
die ich mich bewerbe. Mit meinen vielfältigen Erfahrungen als Kaufmann, Community Ma-
|
91
|
+
nager, Buchautor und Customer Supporter (Level 1&2), sowie Autor Geschäftsprozess- &
|
92
|
+
Anwendungsdokumentation könnte ich Ihr neuer Mitarbeiter sein.
|
93
|
+
Seit dieser Zeit habe ich an teamgesteuerten Projekten für Kunden mitgearbeitet, wo-
|
94
|
+
bei mein Schwerpunkt im Bereich Kundenpflege via Telefon und Email, Dispatching und
|
95
|
+
Teamcontrolling lag.
|
96
|
+
In für mich fremde Arbeitsgebiete werde ich mich rasch einarbeiten.
|
97
|
+
Meine Kenntnisse in IT und Organisationsfähigkeiten kann ich für Ihr Unternehmen im
|
98
|
+
Bereich des Managements gewinnbringend umsetzen.
|
99
|
+
Persönlich runde ich das Profil mit den Eigenschaften: Teamfähigkeit, Kommunikations-
|
100
|
+
stärke und Leistungsbereitschaft ab.
|
101
|
+
Ich bin mir sicher, die von Ihnen gewünschten Kenntnisse und Fähigkeiten mitzubringen,
|
102
|
+
und würde mich sehr über ein Vorstellungsgespräch freuen.
|
103
|
+
EOF
|
104
|
+
else
|
105
|
+
body =<<EOF
|
106
|
+
#{introduction}
|
107
|
+
gerne möchte ich mich bei Ihnen für die obige Stelle bewerben.
|
108
|
+
Meine Bewerbungsunterlagen samt des offiziellen Anschreibens sind der Mail als Anhang beigefügt.
|
109
|
+
EOF
|
110
|
+
end
|
111
|
+
end
|
64
112
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
113
|
+
# Method for checking the result
|
114
|
+
# @param [String] contact Name of the contact
|
115
|
+
# @param [String] emailaddress Email address from the contact
|
116
|
+
# @param [String] jobtitle The given jobtitle
|
117
|
+
# @param [String] contact_sex Can be male, female or unknown
|
118
|
+
# @param [String] proactive Can be yes or no
|
119
|
+
# @param [String] letter With motivational letter? Can be yes or no
|
120
|
+
# @param [String] name_of_pdf Name of the resulting PDF file
|
121
|
+
def self.resultok(contact, emailaddress, jobtitle, contact_sex, proactive, letter, name_of_pdf)
|
122
|
+
resultfileok = `yad --title="Resulting file" --center --on-top --form \
|
123
|
+
--item-separator=, --separator="|" \
|
124
|
+
--field="Resulting file ok?:CBE" \
|
125
|
+
"yes,no"`
|
126
|
+
ok = resultfileok.chomp.split('|')
|
127
|
+
if ok.include? 'yes'
|
128
|
+
LatexCurriculumVitae::Email.create_email(contact, emailaddress, jobtitle, contact_sex, proactive, letter, name_of_pdf)
|
129
|
+
else
|
130
|
+
abort('Aborted')
|
131
|
+
end
|
132
|
+
end
|
71
133
|
end
|
72
134
|
end
|
@@ -11,13 +11,14 @@ require 'fileutils'
|
|
11
11
|
require 'rainbow/ext/string'
|
12
12
|
|
13
13
|
# Module for creating the entityfile
|
14
|
-
module
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
module LatexCurriculumVitae
|
15
|
+
module Entityfile
|
16
|
+
# rubocop:disable Metrics/LineLength
|
17
|
+
# Method for getting information
|
18
|
+
# @param [String] entitytex Path to the entity.tex
|
19
|
+
# @return [Array] contact, emailaddress, jobtitle, contact_sex, company, proactive:q:q
|
20
|
+
def self.get_information(entitytex)
|
21
|
+
resume = `yad --title="Create application" --center --on-top --form \
|
21
22
|
--item-separator=, --separator="|" \
|
22
23
|
--field="What is the jobtitle of your application? Escape amp with backslash:TEXT" \
|
23
24
|
--field="Is it a proactive application?:CBE" \
|
@@ -29,67 +30,67 @@ module Entityfile
|
|
29
30
|
--field="If you have a contact so give me the name of him/her. Leave blank if unknown contact:TEXT" \
|
30
31
|
--field="Tell me the email address for sending the application:TEXT" \
|
31
32
|
--button="Go!" "" "yes,no" "" "yes,no" "" "" "male,female,unknown" "" ""`
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
jobtitle, proactive, company, letter, street, city, contact_sex, contact, emailaddress = resume.chomp.split('|')
|
34
|
+
[jobtitle, proactive, company, letter, street, city, contact_sex, contact, emailaddress].each do |s|
|
35
|
+
puts s
|
36
|
+
end
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
38
|
+
create_file(jobtitle, company, street, city, contact, entitytex, contact_sex, proactive)
|
39
|
+
[contact, emailaddress, jobtitle, contact_sex, company, letter, proactive]
|
40
|
+
end
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
42
|
+
# # Method for getting information through a real gui
|
43
|
+
# def self.get_information_gui(entitytex)
|
44
|
+
# # TODO: Extend code for using the gtk GUI
|
45
|
+
# require 'gtk2'
|
46
|
+
# require 'libglade2'
|
47
|
+
# @threads = []
|
48
|
+
#
|
49
|
+
# Gtk.init
|
50
|
+
#
|
51
|
+
# @glade = GladeXML.new('glade/latexcv.glade')
|
52
|
+
# @glade.widget_names.each do |name|
|
53
|
+
# instance_variable_set("@#{name}".intern, @glade[name])
|
54
|
+
# end
|
55
|
+
# end
|
55
56
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
else
|
67
|
-
if contact_sex == 'male'
|
68
|
-
introduction = "Sehr geehrter Herr #{contact},"
|
57
|
+
# Method for creating the entity.tex
|
58
|
+
# @param [String] jobtitle Title of the target job
|
59
|
+
# @param [String] company Comanys name
|
60
|
+
# @param [String] street Companies street
|
61
|
+
# @param [String] city City of the company
|
62
|
+
# @param [String] contact Name of the contact
|
63
|
+
# @param [String] entitytex Path to the entity.tex
|
64
|
+
def self.create_file(jobtitle, company, street, city, contact, entitytex, contact_sex, proactive)
|
65
|
+
if contact == ''
|
66
|
+
introduction = 'Sehr geehrte Damen und Herren,'
|
69
67
|
else
|
70
|
-
|
68
|
+
if contact_sex == 'male'
|
69
|
+
introduction = "Sehr geehrter Herr #{contact},"
|
70
|
+
else
|
71
|
+
introduction = "Sehr geehrte Frau #{contact},"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
if proactive == 'yes'
|
75
|
+
subject = "Initiativbewerbung um einen Arbeitsplatz als #{jobtitle}"
|
76
|
+
intro = 'Gerne möchte ich mich bei Ihnen um die obige oder eine vergleichbare Stelle bewerben.'
|
77
|
+
else
|
78
|
+
subject = "Bewerbung um einen Arbeitsplatz als #{jobtitle}"
|
79
|
+
intro = 'Wie ich Ihrer Anzeige entnommen habe, suchen Sie jemanden für die obige Position, um die ich mich bewerbe.'
|
71
80
|
end
|
72
|
-
end
|
73
|
-
if proactive == 'yes'
|
74
|
-
subject = "Initiativbewerbung um einen Arbeitsplatz als #{jobtitle}"
|
75
|
-
intro = 'Gerne möchte ich mich bei Ihnen um die obige oder eine vergleichbare Stelle bewerben.'
|
76
|
-
else
|
77
|
-
subject = "Bewerbung um einen Arbeitsplatz als #{jobtitle}"
|
78
|
-
intro = "Wie ich Ihrer Anzeige entnommen habe, stellen Sie einen #{jobtitle} ein. Um diese Position bewerbe ich mich und übersende Ihnen hiermit meine Unterlagen."
|
79
|
-
end
|
80
81
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
82
|
+
addressstring = "#{company} \\\\"
|
83
|
+
if contact == ''
|
84
|
+
addressstring << 'z.Hd. Personalabteilung \\\\'
|
85
|
+
else
|
86
|
+
addressstring << "z.Hd. #{contact} \\\\"
|
87
|
+
end
|
88
|
+
addressstring << "#{street} \\\\" if street != ''
|
89
|
+
addressstring << "#{city}" if city != ''
|
89
90
|
|
90
|
-
|
91
|
-
|
92
|
-
|
91
|
+
FileUtils.rm(entitytex) if File.exist?(entitytex)
|
92
|
+
FileUtils.touch(entitytex)
|
93
|
+
File.write "#{entitytex}", <<EOF
|
93
94
|
\\def\\jobtitle{#{jobtitle}}
|
94
95
|
\\def\\company{#{company}}
|
95
96
|
\\def\\contact{#{contact}}
|
@@ -100,5 +101,6 @@ module Entityfile
|
|
100
101
|
\\def\\addressstring{#{addressstring}}
|
101
102
|
\\def\\intro{#{intro}}
|
102
103
|
EOF
|
104
|
+
end
|
103
105
|
end
|
104
106
|
end
|
@@ -10,16 +10,33 @@
|
|
10
10
|
require 'parseconfig'
|
11
11
|
|
12
12
|
# Module for creating the GetConfig
|
13
|
-
module
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
13
|
+
module LatexCurriculumVitae
|
14
|
+
module GetConfig
|
15
|
+
# This method gets the configs from the config file
|
16
|
+
# @return [Array] name_of_pdf, name_of_cover, name_of_resume, name_of_letter
|
17
|
+
def self.get
|
18
|
+
home = Dir.home
|
19
|
+
config = ParseConfig.new("#{home}/.latex_curriculum_vitae/latex_curriculum_vitae.cfg")
|
20
|
+
name_of_pdf = config['name_of_pdf']
|
21
|
+
name_of_cover = config['name_of_cover']
|
22
|
+
name_of_resume = config['name_of_resume']
|
23
|
+
name_of_letter = config['name_of_letter']
|
24
|
+
[name_of_pdf, name_of_cover, name_of_resume, name_of_letter]
|
25
|
+
end
|
26
|
+
|
27
|
+
# Method for getting smtp configuration
|
28
|
+
# @return [Array] own_name, own_email_address, own_smtp, own_username, own_password
|
29
|
+
def self.get_smtp
|
30
|
+
home = Dir.home
|
31
|
+
config = ParseConfig.new("#{home}/.latex_curriculum_vitae/latex_curriculum_vitae.cfg")
|
32
|
+
own_name = config['own_name']
|
33
|
+
own_email_address = config['own_email_address']
|
34
|
+
own_smtp = config['own_smtp']
|
35
|
+
own_username = config['own_username']
|
36
|
+
own_password = config['own_password']
|
37
|
+
|
38
|
+
[own_name, own_email_address, own_smtp, own_username, own_password]
|
39
|
+
end
|
40
|
+
|
24
41
|
end
|
25
42
|
end
|
@@ -11,13 +11,15 @@ require 'fileutils'
|
|
11
11
|
require 'rainbow/ext/string'
|
12
12
|
|
13
13
|
# Module for creating the motivational letter
|
14
|
-
module
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
14
|
+
module LatexCurriculumVitae
|
15
|
+
module Letter
|
16
|
+
# Method for creating a pdf from tex
|
17
|
+
def self.create_letter(tmpdir, name_of_letter)
|
18
|
+
puts 'Compiling motivational letter'.colour(:yellow)
|
19
|
+
system("pdflatex #{name_of_letter}.tex")
|
20
|
+
puts 'Done compiling motivational letter'.colour(:green)
|
21
|
+
system("cp #{name_of_letter}.pdf #{tmpdir}")
|
22
|
+
puts 'Copied motivational letter to tmpdir'.colour(:green)
|
23
|
+
end
|
22
24
|
end
|
23
25
|
end
|
@@ -4,23 +4,25 @@
|
|
4
4
|
# @abstract Notifier Module for latex_curriculum_vitae
|
5
5
|
#
|
6
6
|
# Copyright (C) 2015 Sascha Manns <samannsml@directbox.com>
|
7
|
-
# License:
|
7
|
+
# License: MIT
|
8
8
|
|
9
9
|
# Dependencies
|
10
10
|
|
11
11
|
# Module for notify the user
|
12
12
|
require 'notifier'
|
13
13
|
|
14
|
-
module
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
14
|
+
module LatexCurriculumVitae
|
15
|
+
module Notify
|
16
|
+
def self.run(jobtitle)
|
17
|
+
home = Dir.home
|
18
|
+
prefix = "#{home}/.rvm/rubies/default"
|
19
|
+
datadir = "#{prefix}/share"
|
20
|
+
img = "#{datadir}/latex_curriculum_vitae/Pictures/arbeitsagentur.png"
|
21
|
+
Notifier.notify(
|
22
|
+
:image => "#{img}",
|
23
|
+
:title => "Your Job Application",
|
24
|
+
:message => "Your Job Application #{jobtitle} was created now."
|
25
|
+
)
|
26
|
+
end
|
25
27
|
end
|
26
|
-
end
|
28
|
+
end
|
@@ -4,32 +4,34 @@
|
|
4
4
|
# @abstract CV Module for latex_curriculum_vitae
|
5
5
|
#
|
6
6
|
# Copyright (C) 2015 Sascha Manns <samannsml@directbox.com>
|
7
|
-
# License:
|
7
|
+
# License: MIT
|
8
8
|
|
9
9
|
# Dependencies
|
10
10
|
require 'csv'
|
11
11
|
|
12
12
|
# Module for creating and appending the outfile
|
13
|
-
module
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
13
|
+
module LatexCurriculumVitae
|
14
|
+
module CVOutfile
|
15
|
+
# Method to adding the data into the csv file
|
16
|
+
def self.add_to_outfile(jobtitle, company, contact, emailaddress, csvout)
|
17
|
+
home = Dir.home
|
18
|
+
time = Time.new
|
19
|
+
date = time.strftime('%Y-%m-%d')
|
20
|
+
contact.gsub!('%20', ' ')
|
21
|
+
jobtitle.gsub!('%20', ' ')
|
22
|
+
jobtitle.gsub!('%26', '&')
|
23
|
+
if File.exist?(csvout)
|
24
|
+
puts 'do nothing'
|
25
|
+
else
|
26
|
+
FileUtils.touch(csvout)
|
27
|
+
File.write "#{csvout}", <<EOF
|
27
28
|
date,company,job,contact,email,status
|
28
29
|
EOF
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
end
|
31
|
+
CSV.open("#{csvout}", 'a+') do |csv|
|
32
|
+
#datum,firma,stelle,kontakt,email,status
|
33
|
+
csv << ["#{date}", "#{company}", "#{jobtitle}", "#{contact}", "#{emailaddress}", 'Open']
|
34
|
+
end
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|