resme 1.0.0 → 2.0.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: 66f3a4918e997473187573c54c2b20296068013f716dd7892eaa76e1ba817cbb
4
- data.tar.gz: 75355b94617c3ff3f4f5ee60caa82d59208b9179eb5af018041eec222e7d9442
3
+ metadata.gz: fc8089fb6322bfe0ad1563829fc2561a2bdb764efe06915ff5a3778b765d24fd
4
+ data.tar.gz: 8a9555ec7df7bd51b12ff20fd826b5c2e75fd83f36f33fcb61163d17a324424e
5
5
  SHA512:
6
- metadata.gz: 4e2ff1e179c492a07a140c1027a320131da9de9018d135ac3517c25b686e3d2a68d48d9157789e536e0f4bd965b7515494762290cd82cf49a5ecea0fd6f00222
7
- data.tar.gz: 7db312c08533de4e73ce8a630c9eb3a3256ebb386312e5c142bec59a333c2263db25e9802ae960c57e19f8274676bc52232b4436e3697d12a119de788acbfffa
6
+ metadata.gz: 60d455fbb2943111933b3ace506bd01e2beb1a594dd0095098250b8ff010be69ab07b8233a9c7c96d635bc96c3ea8779a80280922f5b2db8ddcf4149651b0547
7
+ data.tar.gz: 16f09e4d698179c59a25acc5e6894bd6632a431dfd46d84516455142f5ddf149ced3ef0cc22cf12303f1659532e5cc340d1f513eb287e3db1787fcf19fb54790
data/CHANGELOG.org CHANGED
@@ -1,6 +1,33 @@
1
1
  #+TITLE: CHANGELOG
2
2
  #+AUTHOR: Adolfo Villafiorita
3
3
 
4
+ * Version 2.0.0
5
+
6
+ - Fully rewritten code
7
+ - Removed export to Markdown (which can be gotten from Org Mode)
8
+ - Fixed JSON Resume export
9
+ - Added new keys and renamed some existing keys to make them closer to JSON Resume.
10
+ - added url in education section
11
+ - added country_code and region to addresses
12
+ - renamed who -> name (in projects: stakeholder)
13
+ - renamed role -> position
14
+ - renamed from -> start_date
15
+ - renamed to -> end_date
16
+ - renamed website -> url
17
+
18
+
19
+ * Version 1.0.1
20
+
21
+ - Documentation updated
22
+
23
+ * Version 1.0.0
24
+
25
+ - Dropped support for the Europass XML format. The version currently generated
26
+ by resme (corresponding to the 3.3.0 version of the Europass schema) is no
27
+ longer supported by the Europass website. Information about the required
28
+ changes to make to the format is difficult to retrieve.
29
+ - Bug fixes
30
+
4
31
  * Version 0.5.1
5
32
 
6
33
  A bug-fixing release.
@@ -0,0 +1,16 @@
1
+ #+TITLE: Code of Conduct
2
+
3
+ "resme" follows [[https://www.ruby-lang.org/en/conduct][The Ruby Community
4
+ Conduct Guideline]] in all "collaborative space", which is defined as community
5
+ communications channels (such as mailing lists, submitted patches, commit
6
+ comments, etc.):
7
+
8
+ - Participants will be tolerant of opposing views.
9
+ - Participants must ensure that their language and actions are free of personal
10
+ attacks and disparaging personal remarks.
11
+ - When interpreting the words and actions of others, participants should always
12
+ assume good intentions.
13
+ - Behaviour which can be reasonably considered harassment will not be tolerated.
14
+
15
+ If you have any concerns about behaviour within this project, please contact us
16
+ at [[mailto:"adolfo@shair.tech"][adolfo@shair.tech]].
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 Adolfo Villafiorita
3
+ Copyright (c) 2026 Adolfo Villafiorita
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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 in various formats, including
7
- Org Mode, Markdown, JSON, and the Europass XML format.
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.
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
@@ -52,44 +52,31 @@ are not relevant for your resume.
52
52
  You can now generate a resume using one of the existing formats:
53
53
 
54
54
  #+begin_example sh
55
- resme --to org resume.yml
55
+ resme --format org --build resume.yml
56
56
  #+end_example
57
57
 
58
- Supported formats include:
59
-
60
- - =org=: Org Mode format
61
- - =md=: Markdown format
62
- - =europass=: Europass format
63
- (http://interop.europass.cedefop.europa.eu/web-services/remote-upload/)
64
- - =json=: JSON format (https://jsonresume.org/)
65
-
66
- If you are not satisfied with the provided templates, you can write
67
- your own (see below).
68
-
69
- Notice that you can specify more than one YML file in input. This allows you to
70
- store data about your resume in different files, if you like to do so
71
- (e.g., work experiences could be in one file and talks in another).
72
- The YML files are merged before processing them.
58
+ If you are not satisfied with the provided templates, you can write your own
59
+ (see below).
73
60
 
74
61
  Full syntax:
75
62
 
76
- #+begin_src shell :results raw output :wrap example
77
- resme help
63
+ #+begin_src sh :results raw output :wrap example
64
+ resme --help
78
65
  #+end_src
79
66
 
80
67
  #+RESULTS:
81
68
  #+begin_example
82
- resme command [options] [args]
83
- Available commands:
84
- check resume.yml # Check syntax of resume.yml
85
- list resume.yml # List main sections in resume.yml
86
- version # print version information
87
- view --template FORMAT # Print template used for format
88
- generate [options] resume.yml ... # output resume
89
- console # enter the console
90
- man # print resme manual page
91
- help [command] # print command usage
92
- init [options] # generate an empty resume.yml file
69
+ resme [options] - Format and manage a resume in YAML
70
+ --format FORMAT Output format
71
+ --init Init a new resume
72
+ --validate FILENAME Validate the resume
73
+ --build FILENAME Build the resume in FILENAME
74
+ --sections FILENAME List sections in FILENAME
75
+ --list List available templates
76
+ --except x,y,z Excluded section
77
+ --cat TEMPLATE View a template
78
+ --version
79
+ -h, --help Print this help
93
80
  #+end_example
94
81
 
95
82
  ** Checking validity
@@ -97,11 +84,11 @@ Available commands:
97
84
  :CUSTOM_ID: checking-validity
98
85
  :END:
99
86
 
100
- Use the =check= command to verify whether your YAML file conforms with
87
+ Use the =--validate= option to verify whether your YAML file conforms with
101
88
  the intended syntax.
102
89
 
103
90
  #+begin_example sh
104
- resme check resume.yaml
91
+ resme --validate resume.yaml
105
92
  #+end_example
106
93
 
107
94
  ** Dates in the resume
@@ -119,79 +106,6 @@ Enter dates in the resume in one of the following formats:
119
106
  The third and the forth format allows you to enter "partial" dates
120
107
  (e.g., when the month or the day have been forgotten or are irrelevant).
121
108
 
122
- ** Creating your own templates
123
- :PROPERTIES:
124
- :CUSTOM_ID: creating-your-own-templates
125
- :END:
126
-
127
- The resumes are generated from the YML matter using ERB templates. The
128
- provided output formats should support different back ends. Org Mode
129
- and Markdown, for instance, easily allow for generation of PDFs, HTML,
130
- and ODT, to mention a few.
131
-
132
- However, if you want, you can define your own templates.
133
-
134
- Use the command =view= to print one of the templates used by =resme=
135
- and build from that.
136
-
137
- #+begin_example sh
138
- resme view --template md
139
- #+end_example
140
-
141
- Notice that all the data in the resume is made available in the =data=
142
- variable. Thus, for instance, the following code snippets generates a
143
- list of all the work experiences:
144
-
145
- #+begin_example xml
146
- <% data["work"] each do |exp| %>
147
- - <%= exp["who"] %>
148
- From: <%= exp["from"] %> till: <%= exp["till"] %>
149
- <% end %>
150
- #+end_example
151
-
152
- To specify your own ERB template to build your resume use the option
153
- =-e= (=--erb=). Thus, for instance:
154
-
155
- #+begin_example sh
156
- resme render -e template.md.erb [-o output_filename] file.yaml ...
157
- #+end_example
158
-
159
- uses =template.md.erb= to generate the resume.
160
-
161
- Some functions can be used in the templates to better control the
162
- output.
163
-
164
- String manipulation functions:
165
-
166
- - =clean string= removes any space at the beginning of =string=
167
- - =reflow string, n= makes =string= into an array of strings of length
168
- lower or equal to =n= (useful if you are outputting a textual format,
169
- for instance.
170
-
171
- Dates manipulation functions:
172
-
173
- - =period= generates a string recapping a period. The function abstracts
174
- different syntax you can use for entries (i.e., =date= or =from= and
175
- =till=) and different values for the entries (e.g., a missing value
176
- for =till=)
177
- - =year string=, =month string=, =day string= return, respectively the
178
- year, month and day from strings in the format =YYYY-MM-DD=s
179
- - =has_month input= returns true if =input= has a month, that is, it is
180
- a date or it is in the form =YYYY-MM=
181
- - =has_day input= returns true if =input= has a day, that is, it is a
182
- date or it is in the form =YYYY-MM-DD=
183
-
184
- You can find the templates in =lib/resme/templates=. These might be good
185
- starting points if you want to develop your own.
186
-
187
- ** Contributing your templates
188
- :PROPERTIES:
189
- :CUSTOM_ID: contributing-your-templates
190
- :END:
191
-
192
- If you develop an output template and want to make it available, please
193
- let me know, so that I can include it in future releases of this gem.
194
-
195
109
  ** Development
196
110
  :PROPERTIES:
197
111
  :CUSTOM_ID: development
@@ -220,39 +134,16 @@ https://github.com/avillafiorita/resme.
220
134
  :CUSTOM_ID: license
221
135
  :END:
222
136
 
223
- The gem is available as open source under the terms of the
224
- [[http://opensource.org/licenses/MIT][MIT License]].
137
+ The gem is available as open source under the terms of the [[http://opensource.org/licenses/MIT.txt][MIT License]].
225
138
 
226
139
  ** Change Log
227
140
 
228
141
  In [[file:./CHANGELOG.org][CHANGELOG.org]]
229
142
 
230
- ** Roadmap
231
- :PROPERTIES:
232
- :CUSTOM_ID: roadmap
233
- :END:
234
-
235
- In [[file:./doc/todo.org][todo.org]] ... guess what is my preferred editor!
236
-
237
143
  ** Bugs
238
144
  :PROPERTIES:
239
145
  :CUSTOM_ID: bugs
240
146
  :END:
241
147
 
242
- There are still slight differences in the syntax of entries and in the
243
- way in which the information is formatted in various output formats. For
244
- instance, gender and birthdate are used in the Europass format, but not
245
- in the Markdown format. This is in part due to the different standards
246
- and in part due to personal preferences.
247
-
248
- *Entries are not sorted by date before outputting them. Make sure you
249
- put them in the order you want them to appear in your resume.*
250
-
251
- Unknown number of unknown bugs.
252
-
253
- ** Release History
254
- :PROPERTIES:
255
- :CUSTOM_ID: release-history
256
- :END:
148
+ An unknown number of unknown bugs.
257
149
 
258
- Moved to [[file:./CHANGELOG.org][CHANGELOG.org]].
data/Rakefile CHANGED
@@ -1,2 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
- task :default => :spec
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[test rubocop]
data/TAGS ADDED
@@ -0,0 +1,83 @@
1
+
2
+ /home/adolfo/Sources/ruby/resme/lib/resme/document.rb,292
3
+ module ResmeResme3,31
4
+ class DocumentDocument7,88
5
+ attr_reader :filename, :datafilename8,105
6
+ attr_reader :filename, :datadata8,105
7
+ def initialize(filename)initialize10,139
8
+ def dig(*keys)dig16,292
9
+ def fetch(*keys, default)fetch21,422
10
+ def loadload27,502
11
+
12
+ /home/adolfo/Sources/ruby/resme/test/test_helper.rb,0
13
+
14
+ /home/adolfo/Sources/ruby/resme/test/test_resme.rb,200
15
+ class TestResme < Minitest::TestTestResme5,54
16
+ def test_that_it_has_a_version_numbertest_that_it_has_a_version_number6,87
17
+ def test_it_does_something_usefultest_it_does_something_useful10,166
18
+
19
+ /home/adolfo/Sources/ruby/resme/templates/org.erb,0
20
+
21
+ /home/adolfo/Sources/ruby/resme/lib/resme.rb,0
22
+
23
+ /home/adolfo/Sources/ruby/resme/templates/json.erb,0
24
+
25
+ /home/adolfo/Sources/ruby/resme/lib/resme/document_validator.rb,421
26
+ module ResmeResme3,31
27
+ class DocumentValidatorDocumentValidator7,76
28
+ def initialize(document)initialize8,102
29
+ def validatevalidate12,167
30
+ OPTIONAL_STRING = [:optional, String, NilClass]OPTIONAL_STRING32,626
31
+ OPTIONAL_PARTIAL_DATE = [:optional, Date, String, Integer, NilClass]OPTIONAL_PARTIAL_DATE33,678
32
+ PARTIAL_DATE = [Date, String, Integer]PARTIAL_DATE34,751
33
+ SCHEMA = {SCHEMA40,891
34
+
35
+ /home/adolfo/Sources/ruby/resme/lib/resme/helper.rb,990
36
+ module ResmeResme3,31
37
+ module HelperHelper7,87
38
+ def clean(string)clean9,178
39
+ def full_name(data)full_name13,250
40
+ def reflow_a(string, line_break: 78)reflow_a33,855
41
+ def blank?(char)blank?68,2023
42
+ def reflow_s(string, line_break: 75, delimiter: "\n", indent: 3)reflow_s75,2256
43
+ def period(entry, date: :date, from: :start_date, to: :end_date, separator: "--")period100,3229
44
+ def itemize(entry, header: %i[role who address], summary_key: :summary)itemize125,3984
45
+ def propertify(entry, except: %i[summary details], indent: 3)propertify136,4430
46
+ def select(contacts, label: :email)select146,4731
47
+ def format_date(date, format: "%Y-%m-%d")format_date162,5262
48
+ def complete_date(incomplete_date, format: "%Y-%m-%d")complete_date166,5376
49
+ def year(input)year181,5784
50
+ def month(input)month186,5902
51
+ def day(input)day191,6019
52
+ def y?(input)y?196,6161
53
+ def ym?(input)ym?201,6280
54
+ def ymd?(input)ymd?206,6398
55
+
56
+ /home/adolfo/Sources/ruby/resme/lib/resme/json_resume.rb,196
57
+ module ResmeResme3,31
58
+ class JsonResumeJsonResume7,78
59
+ def initialize(document)initialize10,121
60
+ def buildbuild15,214
61
+ def split_highlights(highlights)split_highlights150,4552
62
+
63
+ /home/adolfo/Sources/ruby/resme/lib/resme/version.rb,57
64
+ module ResmeResme3,31
65
+ VERSION = "2.0.0"VERSION4,44
66
+
67
+ /home/adolfo/Sources/ruby/resme/lib/resme/cli.rb,218
68
+ module ResmeResme3,31
69
+ class CliCli7,75
70
+ attr_reader :optionsoptions8,87
71
+ def initialize(arguments)initialize10,113
72
+ def parseparse15,257
73
+ def commandcommand20,332
74
+ def parserparser26,391
75
+
76
+ /home/adolfo/Sources/ruby/resme/lib/resme/executor.rb,294
77
+ module ResmeResme3,31
78
+ class ExecutorExecutor4,44
79
+ def initialize(input)initialize8,124
80
+ def executeexecute14,234
81
+ def output_filename(format)output_filename76,2176
82
+ def backup(filename)backup80,2264
83
+ def backup_and_write(filename, content)backup_and_write85,2405
data/exe/resme CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  require "resme"
4
4
 
5
- # read-eval-print-step passing all commands and the argument
6
- Resme::CommandSemantics.execute Resme::CommandSyntax.commands, ARGV
5
+ e = Resme::Executor.new(ARGV)
6
+ e.execute
data/lib/resme/cli.rb ADDED
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Resme
4
+ #
5
+ # Parse command line
6
+ #
7
+ class Cli
8
+ attr_reader :options
9
+
10
+ def initialize(arguments)
11
+ # no arguments is equivalent to --help
12
+ @arguments = arguments == [] ? ["--help"] : arguments
13
+ end
14
+
15
+ def parse
16
+ @options = {}
17
+ parser.parse!(@arguments)
18
+ end
19
+
20
+ def command
21
+ @options[:cmd]
22
+ end
23
+
24
+ private
25
+
26
+ def parser
27
+ OptionParser.new do |parser|
28
+ parser.banner = "resme [options] - Format and manage a resume in YAML"
29
+
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|
35
+ @options[:format] = v
36
+ end
37
+
38
+ parser.on("--init", "Init a new resume") do |v|
39
+ @options[:cmd] = :init
40
+ end
41
+
42
+ parser.on("--validate FILENAME", "Validate the resume") do |v|
43
+ @options[:cmd] = :validate
44
+ @options[:filename] = v
45
+ end
46
+
47
+ parser.on("--build FILENAME", "Build the resume in FILENAME") do |v|
48
+ @options[:cmd] = :build
49
+ @options[:filename] = v
50
+ end
51
+
52
+ parser.on("--sections FILENAME", "List sections in FILENAME") do |v|
53
+ @options[:cmd] = :sections
54
+ @options[:filename] = v
55
+ end
56
+
57
+ parser.on("--list", "List available templates") do |v|
58
+ @options[:cmd] = :list
59
+ end
60
+
61
+ parser.on("--except x,y,z", Array, "Excluded section") do |v|
62
+ @options[:except] = v.map { |x| x.to_sym }
63
+ end
64
+
65
+ parser.on("--cat TEMPLATE", "View a template") do |v|
66
+ @options[:cmd] = :cat
67
+ @options[:template] = v
68
+ end
69
+
70
+ parser.on("--version") do |_|
71
+ @options[:cmd] = :version
72
+ end
73
+
74
+ parser.on("-h", "--help", "Print this help") do
75
+ puts parser
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Resme
4
+ #
5
+ # Wrap the YAML data into a class
6
+ #
7
+ class Document
8
+ attr_reader :filename, :data
9
+
10
+ def initialize(filename)
11
+ @filename = filename
12
+ @data = load
13
+ end
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
+ private
26
+
27
+ 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
35
+ end
36
+ end
37
+ end