resme 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,495 @@
1
+ <%
2
+ email = (data["contacts"] || []).select { |x| x.label == "email" }.first
3
+ phones = (data["contacts"] || []).select { |x|
4
+ ["phone", "mobile", "cell"].include?(x.label)
5
+ }
6
+ messaging = (data["contacts"] || []).select { |x|
7
+ ["skype", "gtalk", "telegram", "whatsup"].include?(x.label)
8
+ }
9
+ address = (data["addresses"] || []).select { |x| x.label == "home" }.first || {}
10
+
11
+ # make a period (2015, 2015-10, 2015-01-01 into the xml attributes day, month, year for a date tag
12
+ def self.period_tod period
13
+ el = period.to_s.split("-")
14
+ fields = ["year=\"%d\"", "month=\"--%02d\"", "day=\"---%02d\""]
15
+ el.each_with_index.map { |x, i| fields[i] % x.to_i }.join(" ")
16
+ end
17
+
18
+
19
+ -%>
20
+ <?xml version="1.0" encoding="UTF-8"?>
21
+ <SkillsPassport xmlns="http://europass.cedefop.europa.eu/Europass" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://europass.cedefop.europa.eu/Europass http://europass.cedefop.europa.eu/xml/v3.3.0/EuropassSchema.xsd" locale="en">
22
+ <DocumentInfo>
23
+ <DocumentType>ECV</DocumentType>
24
+ <Bundle></Bundle>
25
+ <CreationDate><%= DateTime.now.iso8601 %></CreationDate>
26
+ <LastUpdateDate><%= DateTime.now.iso8601 %></LastUpdateDate>
27
+ <XSDVersion>V3.3</XSDVersion>
28
+ <Generator>resume.rb</Generator>
29
+ <Comment></Comment>
30
+ <Copyright>© European Communities | http://europass.cedefop.europa.eu</Copyright>
31
+ <EuropassLogo>false</EuropassLogo>
32
+ </DocumentInfo>
33
+ <!-- <PrintingPreferences> </PrintingPreferences> -->
34
+ <LearnerInfo>
35
+ <Identification>
36
+ <PersonName>
37
+ <Title>
38
+ <Code>dr</Code>
39
+ <Label><%= data.basics&.title %></Label>
40
+ </Title>
41
+ <FirstName><%= data.basics.first_name %></FirstName>
42
+ <Surname><%= data.basics.last_name %></Surname>
43
+ </PersonName>
44
+ <ContactInfo>
45
+ <Address>
46
+ <Contact>
47
+ <AddressLine><%= address.street %></AddressLine>
48
+ <PostalCode><%= address.zip_code %></PostalCode>
49
+ <Municipality><%= address.city %></Municipality>
50
+ <Country>
51
+ <Code><%= address.country[0..1]&.upcase %></Code>
52
+ <Label><%= address.country %></Label>
53
+ </Country>
54
+ </Contact>
55
+ </Address>
56
+ <Email>
57
+ <Contact><%= email&.value %></Contact>
58
+ </Email>
59
+ <% if phones %>
60
+ <TelephoneList>
61
+ <% phones.each do |phone| %>
62
+ <Telephone>
63
+ <Contact><%= phone.value %></Contact>
64
+ <Use>
65
+ <Code><%= phone.label %></Code>
66
+ <Label><%= phone.value %></Label>
67
+ </Use>
68
+ </Telephone>
69
+ <% end %>
70
+ </TelephoneList>
71
+ <% end %>
72
+ <% if data.web_presence and not data.web_presence.empty? %>
73
+ <WebsiteList>
74
+ <% data.web_presence.each do |web| %>
75
+ <Website>
76
+ <Contact><%= web.value %></Contact>
77
+ <Use>
78
+ <!-- <Code><%= web.label %></Code> -->
79
+ <Label><%= web.label.capitalize %></Label>
80
+ </Use>
81
+ </Website>
82
+ <% end %>
83
+ </WebsiteList>
84
+ <% end %>
85
+ <% if messaging and not messaging.empty? %>
86
+ <InstantMessagingList>
87
+ <% messaging.each do |im| %>
88
+ <InstantMessaging>
89
+ <Contact><%= im.value %></Contact>
90
+ <Use>
91
+ <!-- <Code><%= im.label %></Code> -->
92
+ <Label><%= im.label.capitalize %></Label>
93
+ </Use>
94
+ </InstantMessaging>
95
+ <% end %>
96
+ </InstantMessagingList>
97
+ <% end %>
98
+ <ContactMethodList>
99
+ <!-- other contacts not defined above -->
100
+ </ContactMethodList>
101
+ </ContactInfo>
102
+ <Demographics>
103
+ <% if data.basics.birthdate %>
104
+ <Birthdate day="---<%= "%02d" % data.basics.birthdate.day %>"
105
+ month="--<%= "%02d" % data.basics.birthdate.month %>"
106
+ year="<%= data.basics.birthdate.year %>" />
107
+ <% end %>
108
+ <%# ["gender"] in place of .gender, so that the code does not complain about gender not being defined (being nil) %>
109
+ <% if data.basics["gender"] == "M" or data.basics["gender"] == "F" %>
110
+ <Gender>
111
+ <Code><%= data.basics.gender %></Code>
112
+ <Label><%= data.basics.gender == "M" ? "Male" : "Female" %></Label>
113
+ </Gender>
114
+ <% end %>
115
+ <NationalityList>
116
+ <Nationality>
117
+ <Label><%= data.basics&.nationality %></Label>
118
+ </Nationality>
119
+ </NationalityList>
120
+ <!--
121
+ <Photo>
122
+ <MimeType>image/jpeg</MimeType>
123
+ <Data></Data>
124
+ <MetadataList>
125
+ <Metadata key="photo-dimensions" value="100x110"/>
126
+ </MetadataList>
127
+ </Photo>
128
+ <Signature>
129
+ <MimeType>image/jpeg</MimeType>
130
+ <Data></Data>
131
+ <MetadataList>
132
+ <Metadata key="signature-dimensions" value="250x150" />
133
+ </MetadataList>
134
+ </Signature>
135
+ -->
136
+ </Demographics>
137
+ </Identification>
138
+ <Headline>
139
+ <Description><Label><%= data["summary"] %></Label></Description>
140
+ </Headline>
141
+ <WorkExperienceList>
142
+ <% (data["work"] || []).each do |pos| %>
143
+ <WorkExperience>
144
+ <Period>
145
+ <From <%= self.period_tod pos.from %>/>
146
+ <% if pos.till and pos.till != "" %>
147
+ <To <%= self.period_tod pos.till %>/>
148
+ <% else %>
149
+ <Current>true</Current>
150
+ <% end %>
151
+ </Period>
152
+ <!--
153
+ <Documentation>
154
+ <ReferenceTo idref="ATT_1"/>
155
+ </Documentation>
156
+ -->
157
+ <Position>
158
+ <Label><%= pos.role %></Label>
159
+ </Position>
160
+ <Activities>
161
+ <%= pos.summary %>
162
+ </Activities>
163
+ <Employer>
164
+ <Name><%= pos["who"] ? pos.who : "" %></Name>
165
+ <% if pos["address"] %>
166
+ <ContactInfo>
167
+ <Address>
168
+ <Contact>
169
+ <AddressLine><%= pos.address %></AddressLine>
170
+ <!-- <Country>
171
+ <Code></Code>
172
+ <Label></Label>
173
+ </Country> -->
174
+ </Contact>
175
+ </Address>
176
+ <Website>
177
+ <Contact><%= pos.website %></Contact>
178
+ </Website>
179
+ </ContactInfo>
180
+ <!--
181
+ <Sector>
182
+ <Code></Code>
183
+ <Label></Label>
184
+ </Sector>
185
+ -->
186
+ <% end %>
187
+ </Employer>
188
+ </WorkExperience>
189
+ <% end %>
190
+ <% if data["teaching"] and not data.teaching.empty? %>
191
+ <% data.teaching.each do |pos| %>
192
+ <WorkExperience>
193
+ <Period>
194
+ <% if pos.from and pos.from != "" %>
195
+ <From <%= self.period_tod pos.from %>/>
196
+ <% end %>
197
+ <% if pos.till and pos.till != "" %>
198
+ <To <%= self.period_tod pos.till %>/>
199
+ <% else %>
200
+ <Current>true</Current>
201
+ <% end %>
202
+ </Period>
203
+ <!--
204
+ <nation>
205
+ <ReferenceTo idref="ATT_1"/>
206
+ </Documentation>
207
+ -->
208
+ <Position>
209
+ <Label><%= pos.role %></Label>
210
+ </Position>
211
+ <Activities>
212
+ <%= pos.summary %>
213
+ </Activities>
214
+ <Employer>
215
+ <Name><%= "#{pos.who} #{pos['school'] ? pos.school : ''}" %></Name>
216
+ <% if pos["address"] %>
217
+ <ContactInfo>
218
+ <Address>
219
+ <Contact>
220
+ <AddressLine><%= pos.address %></AddressLine>
221
+ <!-- <Country>
222
+ <Code></Code>
223
+ <Label></Label>
224
+ </Country> -->
225
+ </Contact>
226
+ </Address>
227
+ <Website>
228
+ <Contact><%= pos["website"] %></Contact>
229
+ </Website>
230
+ </ContactInfo>
231
+ <!--
232
+ <Sector>
233
+ <Code></Code>
234
+ <Label></Label>
235
+ </Sector>
236
+ -->
237
+ <% end %>
238
+ </Employer>
239
+ </WorkExperience>
240
+ <% end %>
241
+ <% end %>
242
+ <% if data["volunteer"] and not data.volunteer.empty? %>
243
+ <% data.volunteer.each do |pos| %>
244
+ <WorkExperience>
245
+ <% if pos["date"] %>
246
+ <Period>
247
+ <From <%= self.period_tod pos.date.strftime("%Y-%m-%d") %>/>
248
+ <To <%= self.period_tod pos.date.strftime("%Y-%m-%d") %>/>
249
+ </Period>
250
+ <% elsif pos.from or (pos.till and pos.till != "") %>
251
+ <Period>
252
+ <% if pos.from %>
253
+ <From <%= self.period_tod pos.from %>/>
254
+ <% end %>
255
+ <% if pos.till and pos.till != "" %>
256
+ <To <%= self.period_tod pos.till %>/>
257
+ <% else %>
258
+ <Current>true</Current>
259
+ <% end %>
260
+ </Period>
261
+ <% end %>
262
+ <!--
263
+ <ntation>
264
+ <ReferenceTo idref="ATT_1"/>
265
+ </Documentation>
266
+ -->
267
+ <Position>
268
+ <Label><%= pos.role %></Label>
269
+ </Position>
270
+ <Activities>
271
+ <%= pos.summary %>
272
+ </Activities>
273
+ <Employer>
274
+ <Name><%= pos.who %></Name>
275
+ <% if pos["address"] %>
276
+ <ContactInfo>
277
+ <Address>
278
+ <Contact>
279
+ <AddressLine><%= pos.address %></AddressLine>
280
+ <!-- <Country>
281
+ <Code></Code>
282
+ <Label></Label>
283
+ </Country> -->
284
+ </Contact>
285
+ </Address>
286
+ <Website>
287
+ <Contact><%= pos["website"] %></Contact>
288
+ </Website>
289
+ </ContactInfo>
290
+ <!--
291
+ <Sector>
292
+ <Code></Code>
293
+ <Label></Label>
294
+ </Sector>
295
+ -->
296
+ <% end %>
297
+ </Employer>
298
+ </WorkExperience>
299
+ <% end %>
300
+ <% end %>
301
+ </WorkExperienceList>
302
+ <% if data["education"] and not data.education.empty? %>
303
+ <EducationList>
304
+ <% data.education.select { |x| x.publish }.each do |edu| %>
305
+ <Education>
306
+ <Period>
307
+ <% if edu.from and not edu.from == "" %>
308
+ <From <%= self.period_tod edu.from %>/>
309
+ <% end %>
310
+ <% if edu.till and not edu.till == "" %>
311
+ <To <%= self.period_tod edu.till %>/>
312
+ <% end %>
313
+ </Period>
314
+ <!--
315
+ <Documentation>
316
+ <ReferenceTo idref="ATT_1"/>
317
+ <ReferenceTo idref="ATT_2"/>
318
+ </Documentation>
319
+ -->
320
+ <Title><%= edu.degree %></Title>
321
+ <Activities></Activities>
322
+ <Organisation>
323
+ <Name><%= edu["school"] %></Name>
324
+ <ContactInfo>
325
+ <Address>
326
+ <Contact>
327
+ <AddressLine><%= edu.address %></AddressLine>
328
+ <!-- <Country>
329
+ <Code>US</Code>
330
+ <Label>United States</Label>
331
+ </Country>
332
+ -->
333
+ </Contact>
334
+ </Address>
335
+ </ContactInfo>
336
+ </Organisation>
337
+ </Education>
338
+ <% end %>
339
+ </EducationList>
340
+ <% end %>
341
+ <Skills>
342
+ <% if data["languages"] %>
343
+ <Linguistic>
344
+ <% if data.languages.mother_tongues and not data.languages.mother_tongues.empty? %>
345
+ <MotherTongueList>
346
+ <% data.languages.mother_tongues.each do |mt| %>
347
+ <MotherTongue>
348
+ <Description>
349
+ <Code><%= mt.code %></Code>
350
+ <Label><% mt.language %></Label>
351
+ </Description>
352
+ </MotherTongue>
353
+ <% end %>
354
+ </MotherTongueList>
355
+ <% end %>
356
+ <% if data.languages.foreign and not data.languages.foreign.empty? %>
357
+ <ForeignLanguageList>
358
+ <% data.languages.foreign.each do |language| %>
359
+ <ForeignLanguage>
360
+ <Description>
361
+ <Code><%= language.code %></Code>
362
+ <Label><%= language.language %></Label>
363
+ </Description>
364
+ <ProficiencyLevel>
365
+ <Listening>
366
+ <%= language.listening.upcase %>
367
+ </Listening>
368
+ <Reading>
369
+ <%= language.reading.upcase %>
370
+ </Reading>
371
+ <SpokenInteraction>
372
+ <%= language.spoken_interaction.upcase %>
373
+ </SpokenInteraction>
374
+ <SpokenProduction>
375
+ <%= language.spoken_production.upcase %>
376
+ </SpokenProduction>
377
+ <Writing>
378
+ <%= language.writing.upcase %>
379
+ </Writing>
380
+ </ProficiencyLevel>
381
+ </ForeignLanguage>
382
+ <% end %>
383
+ </ForeignLanguageList>
384
+ <% end %>
385
+ </Linguistic>
386
+ <% end %>
387
+ <!--
388
+ <Communication>
389
+ <Description></Description>
390
+ <Documentation></Documentation>
391
+ </Communication>
392
+ <Organisational>
393
+ <Description></Description>
394
+ <Documentation></Documentation>
395
+ </Organisational>
396
+ <JobRelated>
397
+ <Description></Description>
398
+ <Documentation></Documentation>
399
+ </JobRelated>
400
+ <Computer>
401
+ <Description></Description>
402
+ <ProficiencyLevel></ProficiencyLevel>
403
+ <VerifiedBy>
404
+ <Certificate><Title></Title></Certificate>
405
+ </VerifiedBy>
406
+ <Documentation></Documentation>
407
+ </Computer>
408
+ -->
409
+ <% if data["driving"] and not data.driving.empty? %>
410
+ <Driving>
411
+ <Description>
412
+ <% data.driving.each do |license| %>
413
+ <Licence><%= license.license %></Licence>
414
+ <% end %>
415
+ </Description>
416
+ </Driving>
417
+ <% end %>
418
+ <Other>
419
+ <Description>
420
+ <% if data["interests"] and not data.interests.empty? %>
421
+ &lt;ul&gt;
422
+ <% data.interests do |x| %>
423
+ &lt;li&gt;<%= "#{x.name || ""}: #{x.level || ""}, #{x.summary || ""}; " %>&lt;/li&gt;
424
+ <% end %>
425
+ &lt;/ul&gt;
426
+ <% end %>
427
+ </Description>
428
+ </Other>
429
+ </Skills>
430
+ <AchievementList>
431
+ <% if data["awards"] and not data.awards.empty? %>
432
+ <% data.awards.each do |award| %>
433
+ <Achievement>
434
+ <Title>
435
+ <Label><%= award.title %></Label>
436
+ </Title>
437
+ <Description>
438
+ <%= award.summary %>
439
+ (<%= achievement.who %>, <%= achievement.where %>, <%= achievement.date %>)
440
+ </Description>
441
+ </Achievement>
442
+ <% end %>
443
+ <% end %>
444
+ <% if data["achievements"] and not data.achievements.empty? %>
445
+ <% data.achievements.each do |achievement| %>
446
+ <Achievement>
447
+ <Title>
448
+ <Label><%= achievement.title %></Label>
449
+ </Title>
450
+ <Description>
451
+ <%= achievement.summary %>
452
+ (<%= achievement.who %>, <%= achievement.where %>, <%= achievement.date %>)
453
+ </Description>
454
+ </Achievement>
455
+ <% end %>
456
+ <% end %>
457
+ <% if data["projects"] and not data.projects.empty? %>
458
+ <Achievement>
459
+ <Title>
460
+ <Code>projects</Code>
461
+ <Label>Projects</Label>
462
+ </Title>
463
+ <Description>
464
+ &lt;ul&gt;
465
+ <% data.projects.each do |x| %>
466
+ &lt;/li&gt; <%= "#{x.name} (#{x.who}): #{x.role} (#{x.from}--#{x.till})" %> &lt;/li&gt;
467
+ <% end %>
468
+ &lt;/ul&gt;
469
+ </Description>
470
+ </Achievement>
471
+ <% end %>
472
+ <% if data["publications"] and not data.publications.empty? %>
473
+ <Achievement>
474
+ <Title>
475
+ <Code>publications</Code>
476
+ <Label>Publications</Label>
477
+ </Title>
478
+ <Description>
479
+ &lt;ul&gt;
480
+ <% data.publications.each do |x| %>
481
+ &lt;li&gt; <%= "#{x.title}, #{x.authors}, #{x.publisher}, #{x.date}" %> &lt;/li&gt;
482
+ <% end %>
483
+ &lt;/ul&gt;
484
+ </Description>
485
+ </Achievement>
486
+ <% end %>
487
+ </AchievementList>
488
+ <Documentation>
489
+ </Documentation>
490
+ </LearnerInfo>
491
+ <!--
492
+ <AttachmentList>
493
+ </AttachmentList>
494
+ -->
495
+ </SkillsPassport>
data/lib/resme/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Resme
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.0"
3
3
  end
data/resme.gemspec CHANGED
@@ -1,4 +1,4 @@
1
- require_relative 'lib/resme/version'
1
+ require_relative "lib/resme/version"
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "resme"
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.email = ["adolfo.villafiorita@ict4g.net"]
8
8
 
9
9
  spec.summary = %q{Write a resume in YML and export to various formats, including json and europass XML.}
10
- spec.description = %q{This gem allows you to manage your resume in yaml, while providing different backends for publishings. Supported backends: markdown, json resume, and Europass XML. Custom templates can be defined using ERB.}
10
+ spec.description = %q{This gem allows you to manage your resume in yaml, while providing different backends for publishings. Supported backends: Org Mode, Markdown, JSON resume, and Europass XML. Custom templates can be defined using ERB.}
11
11
  spec.homepage = "http://github.io/avillafiorita/resme"
12
12
  spec.license = "MIT"
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
@@ -30,6 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "bundler", "~> 2.1.4"
31
31
  spec.add_development_dependency "rake", "~> 13.0.1"
32
32
 
33
- spec.add_dependency "slop", "~> 4.8.1"
34
33
  spec.add_dependency "kwalify", "~> 0.7.2"
35
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adolfo Villafiorita
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-10 00:00:00.000000000 Z
11
+ date: 2022-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 13.0.1
41
- - !ruby/object:Gem::Dependency
42
- name: slop
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: 4.8.1
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 4.8.1
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: kwalify
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -67,8 +53,8 @@ dependencies:
67
53
  - !ruby/object:Gem::Version
68
54
  version: 0.7.2
69
55
  description: 'This gem allows you to manage your resume in yaml, while providing different
70
- backends for publishings. Supported backends: markdown, json resume, and Europass
71
- XML. Custom templates can be defined using ERB.'
56
+ backends for publishings. Supported backends: Org Mode, Markdown, JSON resume,
57
+ and Europass XML. Custom templates can be defined using ERB.'
72
58
  email:
73
59
  - adolfo.villafiorita@ict4g.net
74
60
  executables:
@@ -88,7 +74,6 @@ files:
88
74
  - lib/resme/cli/command_semantics.rb
89
75
  - lib/resme/cli/command_syntax.rb
90
76
  - lib/resme/renderer/renderer.rb
91
- - lib/resme/templates/europass/eu.xml.erb
92
77
  - lib/resme/templates/europass/europass-xml-schema-definition-v3.3.0/Achievement.xsd
93
78
  - lib/resme/templates/europass/europass-xml-schema-definition-v3.3.0/Certificate.xsd
94
79
  - lib/resme/templates/europass/europass-xml-schema-definition-v3.3.0/CommonTypes.xsd
@@ -128,6 +113,7 @@ files:
128
113
  - lib/resme/templates/resume.json.erb
129
114
  - lib/resme/templates/resume.md.erb
130
115
  - lib/resme/templates/resume.org.erb
116
+ - lib/resme/templates/resume.xml.erb
131
117
  - lib/resme/templates/resume.yml
132
118
  - lib/resme/templates/schema.yml
133
119
  - lib/resme/version.rb
@@ -155,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
141
  - !ruby/object:Gem::Version
156
142
  version: '0'
157
143
  requirements: []
158
- rubygems_version: 3.1.2
144
+ rubygems_version: 3.3.7
159
145
  signing_key:
160
146
  specification_version: 4
161
147
  summary: Write a resume in YML and export to various formats, including json and europass