kamisaku 0.4.0 → 0.4.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 +5 -0
- data/Gemfile.lock +1 -1
- data/examples/birthday_invitation/dino/{invitation.pdf → example.pdf} +0 -0
- data/examples/resume/chromatic/example.pdf +0 -0
- data/examples/resume/gradient/example.pdf +0 -0
- data/examples/resume/meridian/example.pdf +0 -0
- data/examples/resume/paper/example.pdf +0 -0
- data/examples/resume/prism/example.pdf +0 -0
- data/examples/resume/sleek/example.pdf +0 -0
- data/examples/resume/zenith/example.pdf +0 -0
- data/lib/kamisaku/content_validators/birthday_invitation_content_validator.rb +2 -2
- data/lib/kamisaku/version.rb +1 -1
- data/scripts/rebuild_examples.rb +25 -15
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 60a3dc3cc7212e2e7f161aaac32c7ff2ed0480a6e9282d38580a4a179df387d5
|
|
4
|
+
data.tar.gz: 475477cd26f0190e240133ead67e367f1a64539e2bdd21574c76d8e3284b4821
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c376919d7dde1c68506dceb3f9aec9e447edbd4dec8211e0e49fbcea00c809f8752f04ec908a517fec2016c50646a85472d26fe1f5d7c49d80d4f8d948d4e65
|
|
7
|
+
data.tar.gz: efd056f25b356c0cb2ca24a9f75d0c760db7d2d51f9e0d5cf27749e7d144c81f85c17c7e4814f98813781e30b874facff8402f8fbd8ead50cf235f3e83cbc063
|
data/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
13
13
|
|
|
14
14
|
### Removed
|
|
15
15
|
|
|
16
|
+
## [0.4.1] - 2025.06.09
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- Fix `Kamisaku::BirthdayInvitationContentValidator` template listing
|
|
20
|
+
|
|
16
21
|
## [0.4.0] - 2025.06.09
|
|
17
22
|
|
|
18
23
|
### Added
|
data/Gemfile.lock
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/kamisaku/version.rb
CHANGED
data/scripts/rebuild_examples.rb
CHANGED
|
@@ -15,31 +15,41 @@ OptionParser.new do |opts|
|
|
|
15
15
|
options[:write_to_html_file] = true
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
opts.on("-k", "--category") do |category|
|
|
19
|
+
options[:category] = category
|
|
20
|
+
end
|
|
21
|
+
|
|
18
22
|
opts.on("-h", "--help", "Show this help message") do
|
|
19
23
|
puts opts
|
|
20
24
|
exit
|
|
21
25
|
end
|
|
22
26
|
end.parse!
|
|
23
27
|
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
categories = options[:category] ? [options[:category]] : Kamisaku::PDF::CONTENT_VALIDATOR_MAP.keys
|
|
29
|
+
|
|
30
|
+
Kamisaku::PDF::CONTENT_VALIDATOR_MAP.select {|key, value| categories.include? key }.each do | category, klass |
|
|
31
|
+
templates = klass::TEMPLATES
|
|
32
|
+
|
|
33
|
+
# Use specified template or all templates
|
|
34
|
+
templates = options[:template] ? templates.select {|t| t == options[:template] } : templates
|
|
26
35
|
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
templates.each do |template|
|
|
37
|
+
template_dir = File.expand_path("../examples/#{category}/#{template}", __dir__)
|
|
38
|
+
FileUtils.mkdir_p(template_dir)
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
template_dir = File.expand_path("../examples/#{template}", __dir__)
|
|
32
|
-
FileUtils.mkdir_p(template_dir)
|
|
40
|
+
pdf_file_path = File.expand_path("../examples/#{category}/#{template}/example.pdf", __dir__)
|
|
33
41
|
|
|
34
|
-
|
|
42
|
+
example_yaml_fie = File.expand_path("../lib/schema/#{category}/example.yml", __dir__)
|
|
43
|
+
yaml_str = File.read(example_yaml_fie)
|
|
35
44
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
content_hash = Kamisaku::Helpers.yaml_str_to_content_hash(yaml_str)
|
|
46
|
+
pdf = Kamisaku::PDF.new(content_hash:, category:, template:)
|
|
47
|
+
puts "Building template #{template}"
|
|
48
|
+
pdf.write_to(pdf_file_path)
|
|
40
49
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
if options[:write_to_html_file]
|
|
51
|
+
html_location = File.expand_path("../examples/#{category}/#{template}/example.html", __dir__)
|
|
52
|
+
pdf.write_to_html_file(html_location)
|
|
53
|
+
end
|
|
44
54
|
end
|
|
45
55
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kamisaku
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sinaru Gunawardena
|
|
@@ -25,7 +25,7 @@ files:
|
|
|
25
25
|
- LICENSE.txt
|
|
26
26
|
- README.md
|
|
27
27
|
- Rakefile
|
|
28
|
-
- examples/birthday_invitation/dino/
|
|
28
|
+
- examples/birthday_invitation/dino/example.pdf
|
|
29
29
|
- examples/resume/chromatic/example.pdf
|
|
30
30
|
- examples/resume/gradient/example.pdf
|
|
31
31
|
- examples/resume/meridian/example.pdf
|