resme 1.0.1 → 2.0.1

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: c4b83addb2d49ccfb3361db0479f50f43d4df7a9582321d0a44e2593a62ced8c
4
- data.tar.gz: 94b3872e6fcb0761568207338304e2e6e2c360f4657f519a808a3e87777d29e0
3
+ metadata.gz: 75fc73b4333ce4f6b51a02625a846fa6a7bdb16b0c53e0dc97bbcd0a1011f681
4
+ data.tar.gz: 38b29db1c99a03d07d29036985291f5181e4f0e92225824bf131b5e006faaa92
5
5
  SHA512:
6
- metadata.gz: 49e6883df829d23e6b775bc711e9cbf372317bf3deeaed5e6f13b4cd2b22cc3caecef2c08074e5a7fda6b6bb290e234d8f41dcb25b3a724425defbb64688d17b
7
- data.tar.gz: '09089b1eb1a2c7078b20a2b076f19bedbbe7651467937cb8b104395c243a4461029e873c9a3b2d1c959fe811cd5093482cb3b02f6b1686cca42b3a743e5ff89c'
6
+ metadata.gz: 83f7f01cdd3c00932b7cdcb6cbe4e169c8f3a5129c06163582dfe6ecbfdd541b951c6812fa87836b26f30ecd4c8789dcea12f6fa8b212b7ef486b9b95cc1906e
7
+ data.tar.gz: d148e71395e5abf9b3ab39d4770cbed5da1f66a17ec35c061b194ceabce7f94021d8ac37af678394a4c0bad94329147f761d89b1a52409b96a5a77a0ee0c0450
data/CHANGELOG.org CHANGED
@@ -1,6 +1,21 @@
1
1
  #+TITLE: CHANGELOG
2
2
  #+AUTHOR: Adolfo Villafiorita
3
3
 
4
+ * Version 2.0.1 and 2.0.0
5
+
6
+ - Fully rewritten code (and rubocopped for most part)
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
+
4
19
  * Version 1.0.1
5
20
 
6
21
  - Documentation updated
@@ -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,20 +3,13 @@
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, and JSON.
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
11
11
  needs).
12
12
 
13
- #+BEGIN_QUOTE
14
- Support for the Europass XML format has been dropped in version 1.0.0, as the
15
- version generated by resme (Europass schema version 3.3.0) is no longer
16
- supported by the Europasss website and documentation about the changes to make
17
- it working again are kind of difficult to retrieve.
18
- #+END_QUOTE
19
-
20
13
  ** Installation
21
14
  :PROPERTIES:
22
15
  :CUSTOM_ID: installation
@@ -59,42 +52,31 @@ are not relevant for your resume.
59
52
  You can now generate a resume using one of the existing formats:
60
53
 
61
54
  #+begin_example sh
62
- resme --to org resume.yml
55
+ resme --format org --build resume.yml
63
56
  #+end_example
64
57
 
65
- Supported formats include:
66
-
67
- - =org=: Org Mode format
68
- - =md=: Markdown format
69
- - =json=: JSON format (https://jsonresume.org/)
70
-
71
58
  If you are not satisfied with the provided templates, you can write your own
72
59
  (see below).
73
60
 
74
- Notice that you can specify more than one YML file in input. This allows you to
75
- store data about your resume in different files, if you like to do so (e.g.,
76
- work experiences could be in one file and talks in another). The YML files are
77
- merged before processing them.
78
-
79
61
  Full syntax:
80
62
 
81
63
  #+begin_src sh :results raw output :wrap example
82
- resme help
64
+ resme --help
83
65
  #+end_src
84
66
 
85
67
  #+RESULTS:
86
68
  #+begin_example
87
- resme command [options] [args]
88
- Available commands:
89
- check resume.yml # Check syntax of resume.yml
90
- list resume.yml # List main sections in resume.yml
91
- version # print version information
92
- view --template FORMAT # Print template used for format
93
- generate [options] resume.yml ... # output resume
94
- console # enter the console
95
- man # print resme manual page
96
- help [command] # print command usage
97
- 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
98
80
  #+end_example
99
81
 
100
82
  ** Checking validity
@@ -102,11 +84,11 @@ Available commands:
102
84
  :CUSTOM_ID: checking-validity
103
85
  :END:
104
86
 
105
- 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
106
88
  the intended syntax.
107
89
 
108
90
  #+begin_example sh
109
- resme check resume.yaml
91
+ resme --validate resume.yaml
110
92
  #+end_example
111
93
 
112
94
  ** Dates in the resume
@@ -124,79 +106,6 @@ Enter dates in the resume in one of the following formats:
124
106
  The third and the forth format allows you to enter "partial" dates
125
107
  (e.g., when the month or the day have been forgotten or are irrelevant).
126
108
 
127
- ** Creating your own templates
128
- :PROPERTIES:
129
- :CUSTOM_ID: creating-your-own-templates
130
- :END:
131
-
132
- The resumes are generated from the YML matter using ERB templates. The
133
- provided output formats should support different back ends. Org Mode
134
- and Markdown, for instance, easily allow for generation of PDFs, HTML,
135
- and ODT, to mention a few.
136
-
137
- However, if you want, you can define your own templates.
138
-
139
- Use the command =view= to print one of the templates used by =resme=
140
- and build from that.
141
-
142
- #+begin_example sh
143
- resme view --template md
144
- #+end_example
145
-
146
- Notice that all the data in the resume is made available in the =data=
147
- variable. Thus, for instance, the following code snippets generates a
148
- list of all the work experiences:
149
-
150
- #+begin_example xml
151
- <% data["work"] each do |exp| %>
152
- - <%= exp["who"] %>
153
- From: <%= exp["from"] %> till: <%= exp["till"] %>
154
- <% end %>
155
- #+end_example
156
-
157
- To specify your own ERB template to build your resume use the option
158
- =-e= (=--erb=). Thus, for instance:
159
-
160
- #+begin_example sh
161
- resme render -e template.md.erb [-o output_filename] file.yaml ...
162
- #+end_example
163
-
164
- uses =template.md.erb= to generate the resume.
165
-
166
- Some functions can be used in the templates to better control the
167
- output.
168
-
169
- String manipulation functions:
170
-
171
- - =clean string= removes any space at the beginning of =string=
172
- - =reflow string, n= makes =string= into an array of strings of length
173
- lower or equal to =n= (useful if you are outputting a textual format,
174
- for instance.
175
-
176
- Dates manipulation functions:
177
-
178
- - =period= generates a string recapping a period. The function abstracts
179
- different syntax you can use for entries (i.e., =date= or =from= and
180
- =till=) and different values for the entries (e.g., a missing value
181
- for =till=)
182
- - =year string=, =month string=, =day string= return, respectively the
183
- year, month and day from strings in the format =YYYY-MM-DD=s
184
- - =has_month input= returns true if =input= has a month, that is, it is
185
- a date or it is in the form =YYYY-MM=
186
- - =has_day input= returns true if =input= has a day, that is, it is a
187
- date or it is in the form =YYYY-MM-DD=
188
-
189
- You can find the templates in =lib/resme/templates=. These might be good
190
- starting points if you want to develop your own.
191
-
192
- ** Contributing your templates
193
- :PROPERTIES:
194
- :CUSTOM_ID: contributing-your-templates
195
- :END:
196
-
197
- If you develop an output template and want to make it available, please
198
- let me know, so that I can include it in future releases of this gem.
199
-
200
109
  ** Development
201
110
  :PROPERTIES:
202
111
  :CUSTOM_ID: development
@@ -225,35 +134,16 @@ https://github.com/avillafiorita/resme.
225
134
  :CUSTOM_ID: license
226
135
  :END:
227
136
 
228
- The gem is available as open source under the terms of the [[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]].
229
138
 
230
139
  ** Change Log
231
140
 
232
141
  In [[file:./CHANGELOG.org][CHANGELOG.org]]
233
142
 
234
- ** Roadmap
235
- :PROPERTIES:
236
- :CUSTOM_ID: roadmap
237
- :END:
238
-
239
- In [[file:./doc/todo.org][todo.org]] ... guess what is my preferred editor!
240
-
241
143
  ** Bugs
242
144
  :PROPERTIES:
243
145
  :CUSTOM_ID: bugs
244
146
  :END:
245
147
 
246
- There are still slight differences in the syntax of entries and in the
247
- way in which the information is formatted in various output formats.
248
-
249
- *Entries are not sorted by date before outputting them. Make sure you
250
- put them in the order you want them to appear in your resume.*
251
-
252
- Unknown number of unknown bugs.
253
-
254
- ** Release History
255
- :PROPERTIES:
256
- :CUSTOM_ID: release-history
257
- :END:
148
+ An unknown number of unknown bugs.
258
149
 
259
- 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,81 @@
1
+
2
+ /home/adolfo/Sources/ruby/resme/test/test_helper.rb,0
3
+
4
+ /home/adolfo/Sources/ruby/resme/test/test_resme.rb,200
5
+ class TestResme < Minitest::TestTestResme5,54
6
+ def test_that_it_has_a_version_numbertest_that_it_has_a_version_number6,87
7
+ def test_it_does_something_usefultest_it_does_something_useful10,166
8
+
9
+ /home/adolfo/Sources/ruby/resme/templates/org.erb,0
10
+
11
+ /home/adolfo/Sources/ruby/resme/templates/json.erb,0
12
+
13
+ /home/adolfo/Sources/ruby/resme/lib/resme.rb,0
14
+
15
+ /home/adolfo/Sources/ruby/resme/lib/resme/json_resume.rb,196
16
+ module ResmeResme3,31
17
+ class JsonResumeJsonResume7,78
18
+ def initialize(document)initialize10,117
19
+ def buildbuild16,307
20
+ def split_highlights(highlights)split_highlights154,4638
21
+
22
+ /home/adolfo/Sources/ruby/resme/lib/resme/helper.rb,990
23
+ module ResmeResme3,31
24
+ module HelperHelper7,87
25
+ def clean(string)clean9,178
26
+ def full_name(data)full_name13,250
27
+ def reflow_a(string, line_break: 78)reflow_a34,893
28
+ def blank?(char)blank?70,2086
29
+ def reflow_s(string, line_break: 75, delimiter: "\n", indent: 3)reflow_s77,2312
30
+ def period(entry, date: :date, from: :start_date, to: :end_date, separator: "--")period102,3285
31
+ def itemize(entry, header: %i[role who address], summary_key: :summary)itemize127,4040
32
+ def propertify(entry, except: %i[summary details], indent: 3)propertify138,4486
33
+ def select(contacts, label: :email)select148,4787
34
+ def format_date(date, format: "%Y-%m-%d")format_date164,5314
35
+ def complete_date(incomplete_date, format: "%Y-%m-%d")complete_date168,5428
36
+ def year(input)year181,5813
37
+ def month(input)month186,5931
38
+ def day(input)day191,6048
39
+ def y?(input)y?196,6186
40
+ def ym?(input)ym?201,6305
41
+ def ymd?(input)ymd?206,6423
42
+
43
+ /home/adolfo/Sources/ruby/resme/lib/resme/document.rb,219
44
+ module ResmeResme3,31
45
+ class DocumentDocument7,88
46
+ attr_reader :filename, :datafilename8,105
47
+ attr_reader :filename, :datadata8,105
48
+ def initialize(filename)initialize10,139
49
+ def loadload17,236
50
+
51
+ /home/adolfo/Sources/ruby/resme/lib/resme/executor.rb,295
52
+ module ResmeResme3,31
53
+ class ExecutorExecutor7,66
54
+ def initialize(input)initialize11,146
55
+ def executeexecute18,286
56
+ def output_filename(format)output_filename81,2240
57
+ def backup(filename)backup85,2328
58
+ def backup_and_write(filename, content)backup_and_write90,2469
59
+
60
+ /home/adolfo/Sources/ruby/resme/lib/resme/cli.rb,218
61
+ module ResmeResme3,31
62
+ class CliCli7,75
63
+ attr_reader :optionsoptions8,87
64
+ def initialize(arguments)initialize10,113
65
+ def parseparse15,257
66
+ def commandcommand20,332
67
+ def parserparser27,421
68
+
69
+ /home/adolfo/Sources/ruby/resme/lib/resme/document_validator.rb,442
70
+ module ResmeResme3,31
71
+ class DocumentValidatorDocumentValidator7,76
72
+ def initialize(document)initialize8,102
73
+ def validatevalidate12,167
74
+ OPTIONAL_STRING = [:optional, String, NilClass].freezeOPTIONAL_STRING30,576
75
+ OPTIONAL_PARTIAL_DATE = [:optional, Date, String, Integer, NilClass].freezeOPTIONAL_PARTIAL_DATE31,635
76
+ PARTIAL_DATE = [Date, String, Integer].freezePARTIAL_DATE32,715
77
+ SCHEMA = {SCHEMA38,862
78
+
79
+ /home/adolfo/Sources/ruby/resme/lib/resme/version.rb,57
80
+ module ResmeResme3,31
81
+ VERSION = "2.0.1"VERSION4,44
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,78 @@
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
+ # rubocop:disable Metrics
27
+ def parser
28
+ OptionParser.new do |parser|
29
+ parser.banner = "resme [options] - Format and manage a resume in YAML"
30
+
31
+ parser.on("--format FORMAT", String, "Output format") do |v|
32
+ @options[:format] = v
33
+ end
34
+
35
+ parser.on("--init", "Init a new resume") do |_|
36
+ @options[:cmd] = :init
37
+ end
38
+
39
+ parser.on("--validate FILENAME", "Validate the resume") do |v|
40
+ @options[:cmd] = :validate
41
+ @options[:filename] = v
42
+ end
43
+
44
+ parser.on("--build FILENAME", "Build the resume in FILENAME") do |v|
45
+ @options[:cmd] = :build
46
+ @options[:filename] = v
47
+ end
48
+
49
+ parser.on("--sections FILENAME", "List sections in FILENAME") do |v|
50
+ @options[:cmd] = :sections
51
+ @options[:filename] = v
52
+ end
53
+
54
+ parser.on("--list", "List available templates") do |_|
55
+ @options[:cmd] = :list
56
+ end
57
+
58
+ parser.on("--except x,y,z", Array, "Excluded section") do |v|
59
+ @options[:except] = v.map(&:to_sym)
60
+ end
61
+
62
+ parser.on("--cat TEMPLATE", "View a template") do |v|
63
+ @options[:cmd] = :cat
64
+ @options[:template] = v
65
+ end
66
+
67
+ parser.on("--version") do |_|
68
+ @options[:cmd] = :version
69
+ end
70
+
71
+ parser.on("-h", "--help", "Print this help") do
72
+ puts parser
73
+ end
74
+ end
75
+ end
76
+ # rubocop:enable Metrics
77
+ end
78
+ end
@@ -0,0 +1,25 @@
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
+ private
16
+
17
+ def load
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
23
+ end
24
+ end
25
+ end