resme 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc8089fb6322bfe0ad1563829fc2561a2bdb764efe06915ff5a3778b765d24fd
4
- data.tar.gz: 8a9555ec7df7bd51b12ff20fd826b5c2e75fd83f36f33fcb61163d17a324424e
3
+ metadata.gz: 675ed552cd44f44d7d6dd7467393e70cf92481d0945257a5827a11980e60bc14
4
+ data.tar.gz: 994c0d2599cbe669390eae3c1490d185937734d21770606d88ef00596b2d09f1
5
5
  SHA512:
6
- metadata.gz: 60d455fbb2943111933b3ace506bd01e2beb1a594dd0095098250b8ff010be69ab07b8233a9c7c96d635bc96c3ea8779a80280922f5b2db8ddcf4149651b0547
7
- data.tar.gz: 16f09e4d698179c59a25acc5e6894bd6632a431dfd46d84516455142f5ddf149ced3ef0cc22cf12303f1659532e5cc340d1f513eb287e3db1787fcf19fb54790
6
+ metadata.gz: d8ee5198d200f8c03df7691fbec10adef9808f8c001be028f5f94890443e366d0fbf7c1d930d975f9a8879033276fc7c9ad2e09448b35dd19305e9944b87b3c8
7
+ data.tar.gz: 86d4ae8e4df7c7efcd46bbedbf28c26471bb2fd0553427b96628757143ac27d494a4bb0b4f93eb3ba57f3620a309415b05d78daf5f5f140ff893f86be774a886
data/CHANGELOG.org CHANGED
@@ -1,9 +1,14 @@
1
1
  #+TITLE: CHANGELOG
2
2
  #+AUTHOR: Adolfo Villafiorita
3
3
 
4
- * Version 2.0.0
4
+ * Version 2.1.0
5
5
 
6
- - Fully rewritten code
6
+ - Output to HTML
7
+ - Small fixes to documentation
8
+
9
+ * Version 2.0.1 and 2.0.0
10
+
11
+ - Fully rewritten code (and rubocopped for most part)
7
12
  - Removed export to Markdown (which can be gotten from Org Mode)
8
13
  - Fixed JSON Resume export
9
14
  - Added new keys and renamed some existing keys to make them closer to JSON Resume.
data/README.org CHANGED
@@ -3,8 +3,8 @@
3
3
  #+DATE: <2020-07-14 Tue>
4
4
  #+STARTUP: showall
5
5
 
6
- Keep your resume in YAML and output it Org Mode and JSON Resume formats.
7
- Org Mode is flexible enough to export to various other formats.
6
+ Keep your resume in YAML and output it Org Mode and JSON Resume. Org Mode is
7
+ flexible enough to export to various other formats.
8
8
 
9
9
  The rendering engine is based on ERB. This simplifies the creation of
10
10
  new output formats (and extending/modifying the YML structure to one's
data/exe/resme CHANGED
File without changes
data/lib/resme/cli.rb CHANGED
@@ -13,7 +13,7 @@ module Resme
13
13
  end
14
14
 
15
15
  def parse
16
- @options = {}
16
+ @options = default_values
17
17
  parser.parse!(@arguments)
18
18
  end
19
19
 
@@ -23,23 +23,33 @@ module Resme
23
23
 
24
24
  private
25
25
 
26
+ def default_values
27
+ { theme: "default" }
28
+ end
29
+
30
+ # rubocop:disable Metrics
26
31
  def parser
27
32
  OptionParser.new do |parser|
28
- parser.banner = "resme [options] - Format and manage a resume in YAML"
33
+ parser.banner = "resme [options] " \
34
+ "# Keep resume in YML, output Org Mode, HTML, and JSON"
29
35
 
30
- # parser.on("-o", "--output FILENAME", String, "Output filename") do |v|
31
- # @options[:output] = v
32
- # end
33
-
34
- parser.on("--format FORMAT", String, "Output format") do |v|
36
+ parser.on("--format FORMAT", String, "Output format (json, org)") do |v|
35
37
  @options[:format] = v
36
38
  end
37
39
 
38
- parser.on("--init", "Init a new resume") do |v|
40
+ parser.on("--theme THEME", String, "Choose a CSS theme") do |v|
41
+ @options[:theme] = v
42
+ end
43
+
44
+ parser.on("--themes", String, "List all available CSS theme") do |_|
45
+ @options[:cmd] = :themes
46
+ end
47
+
48
+ parser.on("--init", "Init a new resume") do |_|
39
49
  @options[:cmd] = :init
40
50
  end
41
51
 
42
- parser.on("--validate FILENAME", "Validate the resume") do |v|
52
+ parser.on("--validate FILENAME", "Validate the resume in FILENAME") do |v|
43
53
  @options[:cmd] = :validate
44
54
  @options[:filename] = v
45
55
  end
@@ -54,15 +64,15 @@ module Resme
54
64
  @options[:filename] = v
55
65
  end
56
66
 
57
- parser.on("--list", "List available templates") do |v|
67
+ parser.on("--list", "List available templates") do |_|
58
68
  @options[:cmd] = :list
59
69
  end
60
70
 
61
- parser.on("--except x,y,z", Array, "Excluded section") do |v|
62
- @options[:except] = v.map { |x| x.to_sym }
71
+ parser.on("--except x,y,z", Array, "Exclude section x,y,z") do |v|
72
+ @options[:except] = v.map(&:to_sym)
63
73
  end
64
74
 
65
- parser.on("--cat TEMPLATE", "View a template") do |v|
75
+ parser.on("--cat TEMPLATE", "View the YAML of a resume") do |v|
66
76
  @options[:cmd] = :cat
67
77
  @options[:template] = v
68
78
  end
@@ -76,5 +86,6 @@ module Resme
76
86
  end
77
87
  end
78
88
  end
89
+ # rubocop:enable Metrics
79
90
  end
80
91
  end
@@ -12,26 +12,14 @@ module Resme
12
12
  @data = load
13
13
  end
14
14
 
15
- # Access values references by *keys. Keys are Symbols or Strings
16
- def dig(*keys)
17
- @data.dig keys.map { |x| x.to_s }
18
- end
19
-
20
- # Access values references by *keys. Default to "default"
21
- def fetch(*keys, default)
22
- dig(*keys) || default
23
- end
24
-
25
15
  private
26
16
 
27
17
  def load
28
- begin
29
- YAML.load_file @filename, permitted_classes: [Date], symbolize_names: true
30
- rescue Psych::SyntaxError => ex
31
- puts "#{@filename} has an invalid structure."
32
- puts ex.message
33
- exit 1
34
- end
18
+ YAML.load_file @filename, permitted_classes: [Date], symbolize_names: true
19
+ rescue Psych::SyntaxError => e
20
+ puts "#{@filename} has an invalid structure."
21
+ puts e.message
22
+ exit 1
35
23
  end
36
24
  end
37
25
  end
@@ -10,28 +10,26 @@ module Resme
10
10
  end
11
11
 
12
12
  def validate
13
- begin
14
- errors = []
15
- ClassyHash.validate(
16
- @document.data,
17
- SCHEMA,
18
- errors: errors,
19
- strict: true,
20
- raise_errors: true,
21
- full: true
22
- )
23
- errors
24
- rescue Exception => ex
25
- puts "#{@document.filename} does not validate:"
26
- ex.entries.each do |error|
27
- puts "- #{error[:full_path]}: #{error[:message]}"
28
- end
13
+ errors = []
14
+ ClassyHash.validate(
15
+ @document.data,
16
+ SCHEMA,
17
+ errors: errors,
18
+ strict: true,
19
+ raise_errors: true,
20
+ full: true
21
+ )
22
+ errors
23
+ rescue StandardError => e
24
+ puts "#{@document.filename} does not validate:"
25
+ e.entries.each do |error|
26
+ puts "- #{error[:full_path]}: #{error[:message]}"
29
27
  end
30
28
  end
31
29
 
32
- OPTIONAL_STRING = [:optional, String, NilClass]
33
- OPTIONAL_PARTIAL_DATE = [:optional, Date, String, Integer, NilClass]
34
- PARTIAL_DATE = [Date, String, Integer]
30
+ OPTIONAL_STRING = [:optional, String, NilClass].freeze
31
+ OPTIONAL_PARTIAL_DATE = [:optional, Date, String, Integer, NilClass].freeze
32
+ PARTIAL_DATE = [Date, String, Integer].freeze
35
33
 
36
34
  #
37
35
  # This defines the structure of resume.yml
@@ -49,260 +47,219 @@ module Resme
49
47
  marital_status: OPTIONAL_STRING,
50
48
  gender: OPTIONAL_STRING
51
49
  },
52
- contacts: [[ { label: String, value: String } ]],
53
- addresses: [[
54
- {
55
- label: String,
56
- street: OPTIONAL_STRING,
57
- postal_code: [:optional, String, Integer, NilClass],
58
- city: OPTIONAL_STRING,
59
- region: OPTIONAL_STRING,
60
- country_code: OPTIONAL_STRING,
61
- country: OPTIONAL_STRING
62
- }
63
- ]],
50
+ contacts: [[{ label: String, value: String }]],
51
+ addresses: [[{
52
+ label: String,
53
+ street: OPTIONAL_STRING,
54
+ postal_code: [:optional, String, Integer, NilClass],
55
+ city: OPTIONAL_STRING,
56
+ region: OPTIONAL_STRING,
57
+ country_code: OPTIONAL_STRING,
58
+ country: OPTIONAL_STRING
59
+ }]],
64
60
  web_presence: [:optional,
65
- [[
66
- {
67
- label: String,
68
- value: String
69
- },
70
- ]],
61
+ [[{ label: String, value: String }]],
71
62
  NilClass
72
63
  ],
73
64
  summary: OPTIONAL_STRING,
74
65
  work: [:optional,
75
- [[
76
- {
77
- name: OPTIONAL_STRING,
78
- url: OPTIONAL_STRING,
79
- address: OPTIONAL_STRING,
80
- end_date: OPTIONAL_PARTIAL_DATE,
81
- start_date: OPTIONAL_PARTIAL_DATE,
82
- position: String,
83
- summary: String,
84
- details: OPTIONAL_STRING
85
- },
86
- ]],
66
+ [[{
67
+ name: OPTIONAL_STRING,
68
+ url: OPTIONAL_STRING,
69
+ address: OPTIONAL_STRING,
70
+ end_date: OPTIONAL_PARTIAL_DATE,
71
+ start_date: OPTIONAL_PARTIAL_DATE,
72
+ position: String,
73
+ summary: String,
74
+ details: OPTIONAL_STRING
75
+ }]],
87
76
  NilClass
88
77
  ],
89
78
  teaching: [:optional,
90
- [[
91
- {
92
- name: String,
93
- school: OPTIONAL_STRING,
94
- address: OPTIONAL_STRING,
95
- end_date: OPTIONAL_PARTIAL_DATE,
96
- start_date: OPTIONAL_PARTIAL_DATE,
97
- position: String,
98
- subject: String,
99
- summary: OPTIONAL_STRING,
100
- details: OPTIONAL_STRING
101
- }
102
- ]],
79
+ [[{
80
+ name: String,
81
+ school: OPTIONAL_STRING,
82
+ address: OPTIONAL_STRING,
83
+ end_date: OPTIONAL_PARTIAL_DATE,
84
+ start_date: OPTIONAL_PARTIAL_DATE,
85
+ position: String,
86
+ subject: String,
87
+ summary: OPTIONAL_STRING,
88
+ details: OPTIONAL_STRING
89
+ }]],
103
90
  NilClass
104
91
  ],
105
92
  projects: [:optional,
106
- [[
107
- {
108
- name: String,
109
- size: OPTIONAL_STRING,
110
- stakeholder: OPTIONAL_STRING,
111
- end_date: OPTIONAL_PARTIAL_DATE,
112
- start_date: OPTIONAL_PARTIAL_DATE,
113
- position: String,
114
- summary: OPTIONAL_STRING,
115
- }
116
- ]],
93
+ [[{
94
+ name: String,
95
+ size: OPTIONAL_STRING,
96
+ stakeholder: OPTIONAL_STRING,
97
+ end_date: OPTIONAL_PARTIAL_DATE,
98
+ start_date: OPTIONAL_PARTIAL_DATE,
99
+ position: String,
100
+ summary: OPTIONAL_STRING
101
+ }]],
117
102
  NilClass
118
103
  ],
119
104
  other: [:optional,
120
- [[
121
- {
122
- name: OPTIONAL_STRING,
123
- end_date: OPTIONAL_PARTIAL_DATE,
124
- start_date: OPTIONAL_PARTIAL_DATE,
125
- position: String,
126
- summary: OPTIONAL_STRING,
127
- }
128
- ]],
105
+ [[{
106
+ name: OPTIONAL_STRING,
107
+ end_date: OPTIONAL_PARTIAL_DATE,
108
+ start_date: OPTIONAL_PARTIAL_DATE,
109
+ position: String,
110
+ summary: OPTIONAL_STRING
111
+ }]],
129
112
  NilClass
130
113
  ],
131
114
  committees: [:optional,
132
- [[
133
- {
134
- name: String,
135
- position: String,
136
- editions: [String, Integer],
137
- url: OPTIONAL_STRING,
138
- }
139
- ]],
115
+ [[{
116
+ name: String,
117
+ position: String,
118
+ editions: [String, Integer],
119
+ url: OPTIONAL_STRING
120
+ }]],
140
121
  NilClass
141
122
  ],
142
123
  volunteer: [:optional,
143
- [[
144
- {
145
- name: String,
146
- where: OPTIONAL_STRING,
147
- date: OPTIONAL_PARTIAL_DATE,
148
- end_date: OPTIONAL_PARTIAL_DATE,
149
- start_date: OPTIONAL_PARTIAL_DATE,
150
- position: String,
151
- summary: OPTIONAL_STRING,
152
- }
153
- ]],
124
+ [[{
125
+ name: String,
126
+ where: OPTIONAL_STRING,
127
+ date: OPTIONAL_PARTIAL_DATE,
128
+ end_date: OPTIONAL_PARTIAL_DATE,
129
+ start_date: OPTIONAL_PARTIAL_DATE,
130
+ position: String,
131
+ summary: OPTIONAL_STRING
132
+ }]],
154
133
  NilClass
155
134
  ],
156
135
  visits: [:optional,
157
- [[
158
- {
159
- name: String,
160
- address: OPTIONAL_STRING,
161
- end_date: OPTIONAL_PARTIAL_DATE,
162
- start_date: OPTIONAL_PARTIAL_DATE,
163
- position: String,
164
- summary: OPTIONAL_STRING,
165
- }
166
- ]],
136
+ [[{
137
+ name: String,
138
+ address: OPTIONAL_STRING,
139
+ end_date: OPTIONAL_PARTIAL_DATE,
140
+ start_date: OPTIONAL_PARTIAL_DATE,
141
+ position: String,
142
+ summary: OPTIONAL_STRING
143
+ }]],
167
144
  NilClass
168
145
  ],
169
146
  education: [:optional,
170
- [[
171
- {
172
- degree: OPTIONAL_STRING,
173
- topic: OPTIONAL_STRING,
174
- school: String,
175
- address: OPTIONAL_STRING,
176
- date: OPTIONAL_PARTIAL_DATE,
177
- end_date: OPTIONAL_PARTIAL_DATE,
178
- start_date: OPTIONAL_PARTIAL_DATE,
179
- url: OPTIONAL_STRING,
180
- publish: TrueClass,
181
- score: [:optional, String, Integer, NilClass],
182
- }
183
- ]],
147
+ [[{
148
+ degree: OPTIONAL_STRING,
149
+ topic: OPTIONAL_STRING,
150
+ school: String,
151
+ address: OPTIONAL_STRING,
152
+ date: OPTIONAL_PARTIAL_DATE,
153
+ end_date: OPTIONAL_PARTIAL_DATE,
154
+ start_date: OPTIONAL_PARTIAL_DATE,
155
+ url: OPTIONAL_STRING,
156
+ publish: TrueClass,
157
+ score: [:optional, String, Integer, NilClass]
158
+ }]],
184
159
  NilClass
185
160
  ],
186
161
  publications: [:optional,
187
- [[
188
- {
189
- title: String,
190
- authors: String,
191
- publisher: String,
192
- date: PARTIAL_DATE,
193
- url: OPTIONAL_STRING,
194
- }
195
- ]],
162
+ [[{
163
+ title: String,
164
+ authors: String,
165
+ publisher: String,
166
+ date: PARTIAL_DATE,
167
+ url: OPTIONAL_STRING
168
+ }]],
196
169
  NilClass
197
170
  ],
198
171
  talks: [:optional,
199
- [[
200
- {
201
- title: String,
202
- venue: String,
203
- date: PARTIAL_DATE,
204
- url: OPTIONAL_STRING,
205
- }
206
- ]],
172
+ [[{
173
+ title: String,
174
+ venue: String,
175
+ date: PARTIAL_DATE,
176
+ url: OPTIONAL_STRING
177
+ }]],
207
178
  NilClass
208
179
  ],
209
180
  awards: [:optional,
210
- [[
211
- {
212
- name: String,
213
- address: OPTIONAL_STRING,
214
- date: PARTIAL_DATE,
215
- title: String,
216
- summary: OPTIONAL_STRING
217
- }
218
- ]],
181
+ [[{
182
+ name: String,
183
+ address: OPTIONAL_STRING,
184
+ date: PARTIAL_DATE,
185
+ title: String,
186
+ summary: OPTIONAL_STRING
187
+ }]],
219
188
  NilClass
220
189
  ],
221
190
  achievements: [:optional,
222
- [[
223
- {
224
- name: String,
225
- address: OPTIONAL_STRING,
226
- date: OPTIONAL_PARTIAL_DATE,
227
- title: String,
228
- summary: OPTIONAL_STRING
229
- }
230
- ]],
191
+ [[{
192
+ name: String,
193
+ address: OPTIONAL_STRING,
194
+ date: OPTIONAL_PARTIAL_DATE,
195
+ title: String,
196
+ summary: OPTIONAL_STRING
197
+ }]],
231
198
  NilClass
232
199
  ],
233
200
  software: [:optional,
234
- [[
235
- {
236
- title: String,
237
- url: OPTIONAL_STRING,
238
- programming_language: OPTIONAL_STRING,
239
- license: OPTIONAL_STRING,
240
- position: OPTIONAL_STRING,
241
- summary: OPTIONAL_STRING,
242
- }
243
- ]],
201
+ [[{
202
+ title: String,
203
+ url: OPTIONAL_STRING,
204
+ programming_language: OPTIONAL_STRING,
205
+ license: OPTIONAL_STRING,
206
+ position: OPTIONAL_STRING,
207
+ summary: OPTIONAL_STRING
208
+ }]],
244
209
  NilClass
245
210
  ],
246
211
  skills: [:optional,
247
- [[
248
- {
249
- name: String,
250
- level: OPTIONAL_STRING,
251
- summary: OPTIONAL_STRING,
252
- }
253
- ]],
212
+ [[{
213
+ name: String,
214
+ level: OPTIONAL_STRING,
215
+ summary: OPTIONAL_STRING
216
+ }]],
254
217
  NilClass
255
218
  ],
256
219
  driving: [:optional,
257
- [[ { license: String, } ]],
220
+ [[{ license: String }]],
258
221
  NilClass
259
222
  ],
260
223
  languages: [:optional,
261
224
  {
262
- mother_tongues: [[
263
- {
264
- code: OPTIONAL_STRING,
265
- language: String,
225
+ assessment: OPTIONAL_STRING,
226
+ mother_tongues: [[{
227
+ code: OPTIONAL_STRING,
228
+ language: String,
266
229
  }
267
230
  ]],
268
231
  foreign: [:optional,
269
- [[
270
- {
271
- code: OPTIONAL_STRING,
272
- language: String,
273
- level: OPTIONAL_STRING,
274
- listening: OPTIONAL_STRING,
275
- reading: OPTIONAL_STRING,
276
- spoken_interaction: OPTIONAL_STRING,
277
- spoken_production: OPTIONAL_STRING,
278
- writing: OPTIONAL_STRING
279
- }
280
- ]],
232
+ [[{
233
+ code: OPTIONAL_STRING,
234
+ language: String,
235
+ level: OPTIONAL_STRING,
236
+ listening: OPTIONAL_STRING,
237
+ reading: OPTIONAL_STRING,
238
+ spoken_interaction: OPTIONAL_STRING,
239
+ spoken_production: OPTIONAL_STRING,
240
+ writing: OPTIONAL_STRING
241
+ }]],
281
242
  NilClass
282
243
  ]
283
244
  },
284
245
  NilClass
285
246
  ],
286
247
  interests: [:optional,
287
- [[
288
- {
289
- name: String,
290
- level: OPTIONAL_STRING,
291
- summary: OPTIONAL_STRING,
292
- }
293
- ]],
248
+ [[{
249
+ name: String,
250
+ level: OPTIONAL_STRING,
251
+ summary: OPTIONAL_STRING
252
+ }]],
294
253
  NilClass
295
254
  ],
296
255
  references: [:optional,
297
- [[
298
- {
299
- name: String,
300
- reference: String,
301
- contacts: [[ {label: String, value: String} ]]
302
- }
303
- ]],
256
+ [[{
257
+ name: String,
258
+ reference: String,
259
+ contacts: [[{ label: String, value: String }]]
260
+ }]],
304
261
  NilClass
305
262
  ]
306
- }
263
+ }.freeze
307
264
  end
308
265
  end