rezy 0.1.0 → 0.1.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/exe/rezy +1 -1
- data/lib/rezy/cli.rb +15 -15
- data/lib/rezy/generator.rb +10 -10
- data/lib/rezy/version.rb +2 -2
- data/lib/rezy.rb +1 -1
- data/templates/simple/template.html.erb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: edbfd776a3e39544ad6ab9eb98103adb6d341c453aa85aadc4658984d51713e1
|
|
4
|
+
data.tar.gz: 85d0ff7a06d2d9926f9a41866b29102e7a5fad9b8eb2583f163a6b3afd9fbc5e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d7b67cbb0be007c44db4b51dc8279214bda60ea45443bcbc134f13e1da21b46b4b4b2db9cbf71e3f610b4baeaf37baf20452a53883e3e70c0bb8b3f010600d18
|
|
7
|
+
data.tar.gz: 4ccac0d7fe63010af3d939bb1cd25c56611971487a8822e9291c62eed4417b58f654fde03954859a2d1fe77f527469a3f7f1562cedd6f7cc6debcba879612836
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.1] - 2025-06-23
|
|
9
|
+
### Fixed
|
|
10
|
+
- Resume template directory using wrong name after init.
|
|
11
|
+
|
|
8
12
|
## [0.1.0] - 2025-06-21
|
|
9
13
|
### Added
|
|
10
14
|
- Initial release of the rezy gem
|
data/exe/rezy
CHANGED
data/lib/rezy/cli.rb
CHANGED
|
@@ -52,21 +52,21 @@ class Rezy::CLI
|
|
|
52
52
|
template: "simple",
|
|
53
53
|
directory: "."
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
OptionParser.new do |opts|
|
|
57
57
|
opts.banner = "Usage: resume init [options]"
|
|
58
58
|
opts.separator ""
|
|
59
59
|
opts.separator "Initialize a new resume project with sample data and template"
|
|
60
60
|
opts.separator ""
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
opts.on("-t", "--template NAME", "Template to use (default: simple)") do |template|
|
|
63
63
|
init_options[:template] = template
|
|
64
64
|
end
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
opts.on("-d", "--directory DIR", "Directory to create project in (default: current)") do |dir|
|
|
67
67
|
init_options[:directory] = dir
|
|
68
68
|
end
|
|
69
|
-
|
|
69
|
+
|
|
70
70
|
opts.on("-h", "--help", "Show this help") do
|
|
71
71
|
puts opts
|
|
72
72
|
exit
|
|
@@ -82,44 +82,44 @@ class Rezy::CLI
|
|
|
82
82
|
mkdir_p(project_dir) unless Dir.exist?(project_dir)
|
|
83
83
|
|
|
84
84
|
source_template = File.join(Rezy::TEMPLATES_DIR, options[:template])
|
|
85
|
-
dest_templates_path = File.join(project_dir, "
|
|
85
|
+
dest_templates_path = File.join(project_dir, "template")
|
|
86
86
|
FileUtils.cp_r(source_template, dest_templates_path) if Dir.exist?(source_template)
|
|
87
87
|
|
|
88
88
|
source_data_file = File.join(Rezy::GEM_ROOT, "data/resume.yaml")
|
|
89
89
|
FileUtils.cp(source_data_file, project_dir) if File.exist?(source_data_file)
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
puts "Project initialized with template '#{options[:template]}' in directory '#{project_dir}'"
|
|
92
|
-
rescue
|
|
92
|
+
rescue => e
|
|
93
93
|
puts "Error initializing project: #{e.message}"
|
|
94
94
|
exit 1
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
def handle_generate_command
|
|
98
|
-
|
|
98
|
+
# Generate command options (your existing code)
|
|
99
99
|
generate_options = {
|
|
100
100
|
data_file: "resume.yaml",
|
|
101
101
|
output_dir: "output",
|
|
102
102
|
formats: [:html, :pdf]
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
|
|
105
105
|
OptionParser.new do |opts|
|
|
106
106
|
opts.banner = "Usage: rezy generate [options]"
|
|
107
107
|
opts.separator ""
|
|
108
108
|
opts.separator "Generate resume HTML and PDF from YAML data"
|
|
109
109
|
opts.separator ""
|
|
110
|
-
|
|
110
|
+
|
|
111
111
|
opts.on("-d", "--data FILE", "YAML data file (default: resume.yaml)") do |file|
|
|
112
112
|
generate_options[:data_file] = file
|
|
113
113
|
end
|
|
114
|
-
|
|
114
|
+
|
|
115
115
|
opts.on("-o", "--output DIR", "Output directory (default: output)") do |dir|
|
|
116
116
|
generate_options[:output_dir] = dir
|
|
117
117
|
end
|
|
118
|
-
|
|
118
|
+
|
|
119
119
|
opts.on("-f", "--formats FORMATS", Array, "Output formats: html,pdf (default: html,pdf)") do |formats|
|
|
120
120
|
generate_options[:formats] = formats.map(&:to_sym)
|
|
121
121
|
end
|
|
122
|
-
|
|
122
|
+
|
|
123
123
|
opts.on("-h", "--help", "Show this help") do
|
|
124
124
|
puts opts
|
|
125
125
|
exit
|
|
@@ -136,8 +136,8 @@ class Rezy::CLI
|
|
|
136
136
|
formats: options[:formats]
|
|
137
137
|
)
|
|
138
138
|
generator.generate
|
|
139
|
-
rescue
|
|
139
|
+
rescue => e
|
|
140
140
|
puts "Error generating resume: #{e.message}"
|
|
141
141
|
exit 1
|
|
142
142
|
end
|
|
143
|
-
end
|
|
143
|
+
end
|
data/lib/rezy/generator.rb
CHANGED
|
@@ -17,7 +17,7 @@ module Rezy
|
|
|
17
17
|
generate_html if @formats.include?(:html)
|
|
18
18
|
generate_pdf if @formats.include?(:pdf) && playwright_available?
|
|
19
19
|
end
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
def generate_html
|
|
22
22
|
resume_data = load_data
|
|
23
23
|
html_output = render_template(resume_data)
|
|
@@ -27,9 +27,9 @@ module Rezy
|
|
|
27
27
|
|
|
28
28
|
puts "\u2705 HTML generated: #{@output_dir}/resume.html"
|
|
29
29
|
end
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
private
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
def load_data
|
|
34
34
|
if File.exist?(@data_file)
|
|
35
35
|
YAML.load_file(@data_file)
|
|
@@ -37,21 +37,21 @@ module Rezy
|
|
|
37
37
|
raise "Data file not found: #{@data_file}"
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
def render_template(resume_data)
|
|
42
42
|
template_path = File.join(@template_dir, "template.html.erb")
|
|
43
43
|
template = ERB.new(File.read(template_path))
|
|
44
44
|
result = template.result_with_hash(resume_data: resume_data)
|
|
45
45
|
result.gsub(/\n\s*\n/, "\n").strip.squeeze("\n")
|
|
46
46
|
end
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
def generate_pdf
|
|
49
49
|
generate_html unless File.exist?(File.join(@output_dir, "resume.html"))
|
|
50
|
-
|
|
50
|
+
|
|
51
51
|
begin
|
|
52
|
-
html_file = File.absolute_path(File.join(@output_dir,
|
|
53
|
-
pdf_file = File.join(@output_dir,
|
|
54
|
-
|
|
52
|
+
html_file = File.absolute_path(File.join(@output_dir, "resume.html"))
|
|
53
|
+
pdf_file = File.join(@output_dir, "resume.pdf")
|
|
54
|
+
|
|
55
55
|
# Try using Chrome directly (if available)
|
|
56
56
|
chrome_path = `which google-chrome`.strip
|
|
57
57
|
chrome_path = `which chromium-browser`.strip if chrome_path.empty?
|
|
@@ -74,7 +74,7 @@ module Rezy
|
|
|
74
74
|
puts "⚠️ PDF generation failed: #{e.message}"
|
|
75
75
|
end
|
|
76
76
|
end
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
def playwright_available?
|
|
79
79
|
# For now, check if Chrome is available instead
|
|
80
80
|
system("test -f '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'")
|
data/lib/rezy/version.rb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module Rezy
|
|
2
|
-
VERSION = "0.1.
|
|
3
|
-
end
|
|
2
|
+
VERSION = "0.1.1"
|
|
3
|
+
end
|
data/lib/rezy.rb
CHANGED