kamisaku 0.3.2 → 0.3.4

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: 3c2b9b3a11f581cc1ee84330c7813cfc6e2875616de64d41fde78ad710891916
4
- data.tar.gz: a54225bf6e5851ead275215047393339cbca5bd8834d9a2030fb4a121b0aded2
3
+ metadata.gz: 1bfceaef01ef3c1d4a92122575d3a8a1eaca248166559c1703b325f5cd5c78ce
4
+ data.tar.gz: 740b3acfe49425ca0e41ddeab7b026b880524cbbe06ee40799197d1039fd043d
5
5
  SHA512:
6
- metadata.gz: ba93279fffb6b6f6af37123a580d6084bd3d570870167c7eb912ce3950b18d8affa157eb1adbc253f463bf293803270ef17c4b66eec26b444b4f3c7754005eda
7
- data.tar.gz: b097d987aa90f78b613738e096e8ffb4218dba1de43e5ff796d3092e21a6a07ed47d803b126baab0f3bc8aebc01326254adac3a1dfafab4f8d6c830bca1396c4
6
+ metadata.gz: 8345ffa22c0407fcb09dca29ee3dd0d44add12e38e73f4dcb9732d576367333533ee19a05fee4aabf936e62628989f78f3ce71452e03ae5c196c6cc6746ac7f3
7
+ data.tar.gz: 3aab44e96289cae64acfd4530f92b570e26f4d010a5b639e4f21b6240e2cd4b667d1370426cbf0917a8c31d4fb0adbaabb66613cad48e05c4bbfe0bfd2dcb93d
data/CHANGELOG.md CHANGED
@@ -13,6 +13,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
 
14
14
  ### Removed
15
15
 
16
+ ## [0.3.4] - 2025.06.06
17
+
18
+ ### Added
19
+ - Add new templates `chromatic`, `gradient`, `meridian`, `prism`, and `zenith`
20
+
21
+ ### Changed
22
+ - Update paper template
23
+
24
+
25
+ ## [0.3.3] - 2025.06.01
26
+
27
+ ### Changed
28
+ - Update validations to allow empty `contact` section
29
+
16
30
  ## [0.3.2] - 2025.06.01
17
31
 
18
32
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kamisaku (0.3.2)
4
+ kamisaku (0.3.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  *Build a CV PDF from a yaml text file.*
4
4
 
5
- 🚀 See it in action at [https://kamisaku.sinaru.com/](https://kamisaku.sinaru.com/).
5
+ 🚀 See it in action at [https://kamisaku.sinaru.com/](https://kamisaku.sinaru.com/?utm_source=github).
6
6
 
7
7
  [![Gem Version](https://badge.fury.io/rb/kamisaku.svg)](https://badge.fury.io/rb/kamisaku)
8
8
 
@@ -108,7 +108,7 @@ education:
108
108
  Once you have the YAML text file, feed it into the `bin/console` and specify the output location.
109
109
 
110
110
  ```bash
111
- bin/console -c examples/paper/john_doe.yml -o examples/paper/john_doe.pdf -t paper
111
+ bin/console -c examples/john_doe.yml -o examples/paper/john_doe.pdf -t paper
112
112
  ```
113
113
 
114
114
  #### Bash options
@@ -136,7 +136,25 @@ pdf.write_to('/path/to/generated_file.pdf')
136
136
 
137
137
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
138
138
 
139
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
139
+ To install this gem onto your local machine, run `bundle exec rake install`.
140
+
141
+ ### Create or Update a template
142
+
143
+ To a new template, create a folder with template name at `lib/templates`. Additionally add the template name to `Kamisaku::TemplateHelpers::TEMPLATES` list.
144
+
145
+ Inside this folder, create `template.html.erb`.
146
+
147
+ The template will be exposed to a Ruby hash variable called `data`. This data represent the data in the YAML file as a hash.
148
+ So you can use the Ruby hash methods to access and render the values.
149
+
150
+ In addition, the template helper methods defined at `lib/kamisaku/template_helpers.rb` will also be available to use directly.
151
+
152
+ To test and build the template, you can run `scripts/rebuild_examples.rb -t <name of new template>`. This will create the PDF using the `lib/schema/example.yml`
153
+ and place it in `examples/` folder.
154
+
155
+ ### Releasing a new gem version
156
+
157
+ To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
140
158
 
141
159
  ## Contributing
142
160
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -8,7 +8,7 @@ module Kamisaku
8
8
  yaml_string = File.read(yaml_file)
9
9
  pdf = PDF.new(content_hash: Helpers.yaml_str_to_content_hash(yaml_string), template: options[:template])
10
10
  pdf.write_to(options[:pdf_file])
11
- pdf.generate_html(options[:html_output]) if options[:html_output]
11
+ pdf.write_to_html_file(options[:html_output]) if options[:html_output]
12
12
  end
13
13
  end
14
14
  end
@@ -25,14 +25,15 @@ module Kamisaku
25
25
  raise Error, "Missing profile" unless data[:profile]
26
26
  raise Error, "Profile must be a hash" unless data[:profile].is_a?(Hash)
27
27
 
28
- allowed_fields = %i[name title about]
28
+ allowed_fields = %i[name title about photo_url]
29
+ required_fields = %i[name title about]
29
30
  profile_fields = data[:profile].keys
30
31
 
31
32
  unless profile_fields.all? { |field| allowed_fields.include?(field) }
32
33
  raise Error, "Profile contains invalid fields"
33
34
  end
34
35
 
35
- unless profile_fields.size == allowed_fields.size
36
+ unless required_fields.all? { |field| profile_fields.include?(field) }
36
37
  raise Error, "Profile must contain exactly the fields: #{allowed_fields.join(", ")}"
37
38
  end
38
39
 
@@ -41,6 +42,19 @@ module Kamisaku
41
42
  raise Error, "Profile field '#{field}' must be a string"
42
43
  end
43
44
  end
45
+
46
+ if data[:profile][:photo_url]
47
+ validate_photo_url(data[:profile][:photo_url])
48
+ end
49
+ end
50
+
51
+ def validate_photo_url(photo_url)
52
+ raise Error, "Profile field '#{field}' must be a string" unless photo_url.is_a?(String)
53
+
54
+ valid_url_regex = /\Ahttps?:\/\/.+\.(jpg|jpeg)\z/i
55
+ unless valid_url_regex.match?(photo_url)
56
+ raise Error, "Invalid photo_url. It must be an HTTP/HTTPS URL ending with .jpg or .jpeg"
57
+ end
44
58
  end
45
59
 
46
60
  def validate_contact
@@ -54,10 +68,6 @@ module Kamisaku
54
68
  raise Error, "Contact contains invalid fields"
55
69
  end
56
70
 
57
- allowed_fields.each do |field|
58
- raise Error, "Contact missing required field '#{field}'" unless contact_fields.include?(field)
59
- end
60
-
61
71
  data[:contact].each do |field, value|
62
72
  if field == :location
63
73
  validate_location(value, "Contact section")
@@ -91,7 +101,7 @@ module Kamisaku
91
101
  data[:skills].each do |skill|
92
102
  raise Error, "Each skill must be a hash" unless skill.is_a?(Hash)
93
103
 
94
- allowed_fields = %i[area items]
104
+ allowed_fields = %i[name items]
95
105
  skill_fields = skill.keys
96
106
 
97
107
  unless skill_fields.all? { |field| allowed_fields.include?(field) }
@@ -102,7 +112,7 @@ module Kamisaku
102
112
  raise Error, "Skills section: Skill missing required field '#{field}'" unless skill_fields.include?(field)
103
113
  end
104
114
 
105
- raise Error, "Skills section: Skill field 'area' must be a string" unless skill[:area].is_a?(String)
115
+ raise Error, "Skills section: Skill field 'name' must be a string" unless skill[:name].is_a?(String)
106
116
  raise Error, "Skills section: Skill field 'items' must be an array" unless skill[:items].is_a?(Array)
107
117
 
108
118
  skill[:items].each do |item|
data/lib/kamisaku/pdf.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require "tempfile"
2
+
1
3
  module Kamisaku
2
4
  class PDF
3
5
  attr_reader :content_hash, :template
@@ -17,7 +19,7 @@ module Kamisaku
17
19
  end
18
20
  end
19
21
 
20
- def generate_html(html_location)
22
+ def write_to_html_file(html_location)
21
23
  html_file { |file_path| FileUtils.cp(file_path, html_location) }
22
24
  end
23
25
 
@@ -2,7 +2,15 @@ require "date"
2
2
 
3
3
  module Kamisaku
4
4
  module TemplateHelpers
5
- TEMPLATES = %w[paper sleek].freeze
5
+ TEMPLATES = %w[
6
+ paper
7
+ sleek
8
+ zenith
9
+ meridian
10
+ prism
11
+ gradient
12
+ chromatic
13
+ ].freeze
6
14
 
7
15
  def month_name(month_int)
8
16
  return "" if month_int.nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kamisaku
4
- VERSION = "0.3.2"
4
+ VERSION = "0.3.4"
5
5
  end
@@ -0,0 +1,274 @@
1
+ version: 1
2
+
3
+ profile:
4
+ name: John Doe
5
+ title: Senior Software Engineer
6
+ about: >
7
+ Seasoned software engineer with more than a decade of experience
8
+ in designing and developing scalable web applications. Passionate
9
+ about building clean, maintainable code and driving best practices
10
+ in software development. Experienced in leading teams, mentoring
11
+ developers, and collaborating with cross-functional teams to deliver
12
+ high-quality solutions.
13
+
14
+ contact:
15
+ github: johndoe
16
+ mobile: +44 7912345678
17
+ website: https://johndoe.dev
18
+ email: john.doe@example.com
19
+ linkedin: john-doe
20
+ location:
21
+ country: United Kingdom
22
+ city: London
23
+
24
+ skills:
25
+ - name: Development
26
+ items:
27
+ - Python
28
+ - Django
29
+ - ReactJS
30
+ - TypeScript
31
+ - Node.js
32
+ - name: Database
33
+ items:
34
+ - PostgreSQL
35
+ - MySQL
36
+ - Redis
37
+ - name: Testing
38
+ items:
39
+ - PyTest
40
+ - Jest
41
+ - Cypress
42
+ - Selenium
43
+ - name: Version Control
44
+ items:
45
+ - Git
46
+ - GitHub
47
+ - GitLab
48
+ - name: Platforms/OS
49
+ items:
50
+ - AWS
51
+ - Google Cloud
52
+ - Linux
53
+
54
+ interests:
55
+ - name: Yoga
56
+ - name: Travelling
57
+ - name: Photography
58
+ - name: Hiking
59
+ - name: Chess
60
+ - name: Reading
61
+ - name: Cooking
62
+ - name: Gardening
63
+ - name: Running
64
+ - name: Fitness
65
+ - name: Volunteering
66
+
67
+ experiences:
68
+ - title: Senior Software Engineer
69
+ organisation: CloudCore Solutions
70
+ location:
71
+ city: London
72
+ country: United Kingdom
73
+ from:
74
+ month: 3
75
+ year: 2021
76
+ skills:
77
+ - Django
78
+ - React
79
+ - GraphQL
80
+ - AWS Lambda
81
+ - PostgreSQL
82
+ - Docker
83
+ - Terraform
84
+ achievements:
85
+ - >
86
+ Led the migration from a monolithic system to a microservices
87
+ architecture, significantly improving scalability and performance.
88
+ - >
89
+ Designed and implemented a serverless data processing pipeline
90
+ using AWS Lambda and S3, reducing operational costs by 30%.
91
+ - Established CI/CD workflows for automated deployments and testing.
92
+
93
+ - title: Lead Backend Engineer
94
+ organisation: FinEdge Technologies
95
+ location:
96
+ city: Manchester
97
+ country: United Kingdom
98
+ from:
99
+ month: 5
100
+ year: 2018
101
+ to:
102
+ month: 2
103
+ year: 2021
104
+ skills:
105
+ - Python
106
+ - FastAPI
107
+ - PostgreSQL
108
+ - Redis
109
+ - Kafka
110
+ - Kubernetes
111
+ - Jenkins
112
+ achievements:
113
+ - >
114
+ Spearheaded the development of a real-time financial analytics
115
+ platform, handling millions of transactions per second.
116
+ - >
117
+ Improved API response times by optimizing database queries and
118
+ implementing Redis caching.
119
+ - Led a team of backend engineers, conducting code reviews and
120
+ mentoring junior developers.
121
+
122
+ - title: Software Engineer
123
+ organisation: NextGen Media
124
+ location:
125
+ city: Birmingham
126
+ country: United Kingdom
127
+ from:
128
+ month: 7
129
+ year: 2015
130
+ to:
131
+ month: 4
132
+ year: 2018
133
+ skills:
134
+ - Node.js
135
+ - Express.js
136
+ - MongoDB
137
+ - WebSockets
138
+ - AWS
139
+ achievements:
140
+ - Developed a high-traffic video streaming platform, implementing
141
+ WebSockets for real-time interactions.
142
+ - Built a recommendation engine using machine learning models to
143
+ personalize user content.
144
+ - Automated deployment processes with AWS CodePipeline and Docker.
145
+
146
+ education:
147
+ - institute: Brighton Institute of Technology
148
+ location:
149
+ city: Brighton
150
+ country: United Kingdom
151
+ qualification: Bachelor of Science in Computer Science
152
+ field: Software Engineering
153
+ to:
154
+ month: 5
155
+ year: 2013
156
+ achievements:
157
+ - Awarded a scholarship for outstanding academic performance.
158
+
159
+ projects:
160
+ - name: E-commerce Analytics Platform
161
+ description: >
162
+ Developed a comprehensive full-stack web application for real-time sales analytics and inventory management.
163
+ The platform features interactive dashboards, automated reporting, real-time inventory tracking, predictive
164
+ analytics for sales forecasting, and integration with multiple payment gateways.
165
+ technologies:
166
+ - React
167
+ - Python
168
+ - PostgreSQL
169
+ - Redis
170
+ - Docker
171
+ link: https://github.com/johndoe/ecommerce-analytics
172
+
173
+ - name: Open Source Task Scheduler
174
+ description: >
175
+ Created a distributed task scheduling library with Redis backend that supports job queuing, task
176
+ prioritization, retry mechanisms, and dead letter queues. Features include task dependencies,
177
+ scheduling with cron expressions, real-time monitoring dashboard, horizontal scaling capabilities,
178
+ and fault tolerance with automatic task recovery.
179
+ technologies:
180
+ - Python
181
+ - Redis
182
+ - Celery
183
+ - Docker
184
+ link: https://github.com/johndoe/task-scheduler
185
+
186
+ certifications:
187
+ - name: AWS Certified Solutions Architect
188
+ issuer: Amazon Web Services
189
+ date:
190
+ day: 15
191
+ month: 8
192
+ year: 2022
193
+ credential_url: https://aws.amazon.com/verification/ABCD1234EFGH5678
194
+
195
+ - name: Certified Kubernetes Administrator
196
+ issuer: Cloud Native Computing Foundation
197
+ date:
198
+ day: 20
199
+ month: 11
200
+ year: 2021
201
+ credential_url: https://training.linuxfoundation.org/certification/verify
202
+
203
+ awards:
204
+ - title: Employee of the Year
205
+ issuer: CloudCore Solutions
206
+ date:
207
+ day: 1
208
+ month: 12
209
+ year: 2023
210
+ description: Recognized for outstanding contribution to team performance and technical innovation
211
+
212
+ - title: Best Final Year Project
213
+ issuer: Brighton Institute of Technology
214
+ date:
215
+ day: 15
216
+ month: 5
217
+ year: 2013
218
+ description: Awarded for developing an innovative machine learning algorithm for image recognition
219
+
220
+ languages:
221
+ - name: English
222
+ - name: Spanish
223
+ - name: French
224
+
225
+ publications:
226
+ - title: "Microservices Architecture Patterns for Scalable Web Applications"
227
+ publisher: Tech Journal Quarterly
228
+ date:
229
+ day: 15
230
+ month: 3
231
+ year: 2023
232
+ link: https://techjournal.com/articles/microservices-patterns
233
+
234
+ - title: "Optimizing Database Performance in High-Traffic Applications"
235
+ publisher: Software Engineering Today
236
+ date:
237
+ day: 10
238
+ month: 9
239
+ year: 2022
240
+ link: https://se-today.com/db-optimization
241
+
242
+ conferences:
243
+ - name: AWS re:Invent 2023
244
+ role: Attendee
245
+ date:
246
+ day: 27
247
+ month: 11
248
+ year: 2023
249
+ description: Attended sessions on serverless architecture and machine learning
250
+
251
+ - name: PyCon UK 2022
252
+ role: Speaker
253
+ date:
254
+ day: 16
255
+ month: 9
256
+ year: 2022
257
+ description: Presented on "Building Scalable APIs with FastAPI and PostgreSQL"
258
+
259
+ volunteering:
260
+ - organization: Code for Good
261
+ role: Technical Mentor
262
+ description: Mentoring young developers and contributing to open-source projects for non-profits
263
+ date:
264
+ day: 1
265
+ month: 6
266
+ year: 2020
267
+
268
+ - organization: Local Food Bank
269
+ role: Technology Volunteer
270
+ description: Developed a volunteer scheduling system to improve operational efficiency
271
+ date:
272
+ day: 15
273
+ month: 3
274
+ year: 2019
@@ -0,0 +1,112 @@
1
+ # Template schema structure for resume
2
+
3
+ version: 1
4
+ profile: # required
5
+ name: # required: the name
6
+ title: # optional: job title if applicable
7
+ about: # optional: A short summary of the experience and person
8
+
9
+ contact: # optional
10
+ github: # optional: GitHub username
11
+ mobile: # optional: mobile or phone number
12
+ email: # optional: email address
13
+ linkedin: # optional: LinkedIn username
14
+ location: #
15
+ country: # optional: country name you are based at
16
+ city: # optional: city name you are based at
17
+
18
+ skills: # optional
19
+ - name: # required: specific skill name you are specialized in
20
+ items: # optional
21
+ - # subitem such as a technology you have the skill in under the specialized area
22
+
23
+ experiences: # optional
24
+ - title: # required: job title
25
+ organisation: # required: Name of the place you worked
26
+ location: # optional
27
+ city: # optional: city name
28
+ country: # optional: country name
29
+ from: # required
30
+ month: # required: month integer number that you started
31
+ year: # required: year integer number that you started
32
+ to: # optional: if the section not given, it is assumed you are still working
33
+ month: # required: month integer number that you stopped
34
+ year: # required: year integer number that you stopped
35
+ skills: # optional
36
+ - # a short name for a specialized skill you gained at the organization
37
+ achievements: # optional
38
+ - # A short sentence of things you have achieved. Consider reflecting the impact it made.
39
+
40
+ education: # optional
41
+ - institute: # required: name of the place you studied
42
+ location: # optional
43
+ city: # optional: city name
44
+ country: # optional: country name
45
+ qualification: # required: name of the degree, diploma, or certificate qualification
46
+ field: # optional: name of the field such as Computer Science
47
+ from: # optional
48
+ month: # required: month integer number that you started
49
+ year: # required: year integer number that you started
50
+ to: # optional: if you have finished studying at the institute, provide this section. Otherwise, do not provide
51
+ month: # required: month integer number that you stopped
52
+ year: # required: year integer number that you stopped
53
+ achievements: # optional
54
+ - # A list of things you have achieved or did at the institute.
55
+
56
+ projects: # optional: Showcase notable personal or professional projects
57
+ - name: # required: Project title
58
+ description: # optional: Short summary of the project
59
+ technologies: # optional: Tools or stack used
60
+ - # required: technology/stack name
61
+ link: # optional: URL to the project or code
62
+
63
+ certifications: # optional: Any licenses, exams, or certifications earned
64
+ - name: # required: Name of the certification
65
+ issuer: # optional: Organization that issued it
66
+ date: # optional: Date earned or issued
67
+ day: # required: day of month between 1 and 31
68
+ month: # required: month integer number
69
+ year: # required: year integer number
70
+ credential_url: # optional: Verification or badge link
71
+
72
+ awards: # optional: Any recognition, awards, or honors received
73
+ - title: # required: Name of the award
74
+ issuer: # optional: Organization or context in which it was awarded
75
+ date: # optional: When it was awarded
76
+ day: # required: day of month between 1 and 31
77
+ month: # required: month integer number
78
+ year: # required: year integer number
79
+ description: # optional: Brief explanation or context
80
+
81
+ languages: # optional: Languages you speak and your proficiency level
82
+ - name: # required: Language (e.g., English, Spanish)
83
+
84
+ interests: # optional: Hobbies or areas of personal interest
85
+ - name: # required: Interest or activity name
86
+
87
+ publications: # optional: For academic or research roles
88
+ - title: # required
89
+ publisher: # optional
90
+ date: # optional:
91
+ day: # required: day of month between 1 and 31
92
+ month: # required: month integer number
93
+ year: # required: year integer number
94
+ link: # optional
95
+
96
+ conferences: # optional: Attended or spoken at industry events
97
+ - name: # required
98
+ role: # optional: (e.g., Speaker, Attendee)
99
+ date: # optional:
100
+ day: # required: day of month between 1 and 31
101
+ month: # required: month integer number
102
+ year: # required: year integer number
103
+ description: # optional
104
+
105
+ volunteering: # optional: Especially useful for non-profit or early-career roles
106
+ - organization: # required
107
+ role: # optional
108
+ description: # optional
109
+ date: # optional:
110
+ day: # required: day of month between 1 and 31
111
+ month: # required: month integer number
112
+ year: # required: year integer number