kamisaku 0.4.2 → 0.4.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: 4292c2079171e643c3b2cbc54a57710c23e5b2abcc8689b03dcb25ecef691af2
4
- data.tar.gz: f101f3fae445b34b437612c29bb64e067c27d4f46e036d0c3e4d2d1d32019ddc
3
+ metadata.gz: ae6dcfe51810b9a986f61743a22d04c210ec80567f13e53cd7461322d2290cc6
4
+ data.tar.gz: fd0c2eb3f21d73945441e73f20c4df546139705ea86f8fca0f2f915651a65662
5
5
  SHA512:
6
- metadata.gz: 281c18ed0c9ab2d7131c11cda21ba48be132fb5e09ac0aac738bb6e4f53644b767778dc2cd08c622f4e9a597aeaa2c7a28b15f6752beb8e778711bd331e805c7
7
- data.tar.gz: 8f07ab76298f53cd2d75790797d4a5823850ad5108f23dfcb9cdcf8e393b18417d8e525bbde89aa837831480b2a7392074826bddbc53bda285b0d618df6f7db3
6
+ metadata.gz: e8017948750e46d8e03b3f117f773adf57372fab04ee0832fb2749791ef0639abc1ab4cfa59b4b657d234b796a2e087f31a3ebd2666d7d8b414743a7ecb4f516
7
+ data.tar.gz: 7bd63162c94f5d6dd7f282b894229447214462d4c4ceed734c386376203831a5b0932c066ad89101b8f4aced9ed505543c9e31a9f3b1de73175625ddea00f63f
data/CHANGELOG.md CHANGED
@@ -7,11 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ### Added
11
-
12
10
  ### Changed
11
+ - Improve error handling in `yaml_str_to_content_hash` and `BaseContentValidator`
13
12
 
14
- ### Removed
13
+ ## [0.4.3] - 2026.01.01
14
+
15
+ ### Changed
16
+ - Update YAML parsing error messages
15
17
 
16
18
  ## [0.4.2] - 2025.12.31
17
19
 
data/Gemfile.lock CHANGED
@@ -1,25 +1,25 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kamisaku (0.4.2)
4
+ kamisaku (0.4.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.3)
10
- json (2.12.0)
10
+ json (2.18.0)
11
11
  language_server-protocol (3.17.0.5)
12
- minitest (5.25.5)
12
+ minitest (5.27.0)
13
13
  parallel (1.27.0)
14
- parser (3.3.8.0)
14
+ parser (3.3.10.0)
15
15
  ast (~> 2.4.1)
16
16
  racc
17
- prism (1.4.0)
17
+ prism (1.7.0)
18
18
  racc (1.8.1)
19
19
  rainbow (3.1.1)
20
- rake (13.2.1)
21
- regexp_parser (2.10.0)
22
- rexml (3.4.1)
20
+ rake (13.3.1)
21
+ regexp_parser (2.11.3)
22
+ rexml (3.4.4)
23
23
  rubocop (1.57.2)
24
24
  json (~> 2.3)
25
25
  language_server-protocol (>= 3.17.0)
@@ -31,9 +31,9 @@ GEM
31
31
  rubocop-ast (>= 1.28.1, < 2.0)
32
32
  ruby-progressbar (~> 1.7)
33
33
  unicode-display_width (>= 2.4.0, < 3.0)
34
- rubocop-ast (1.44.1)
34
+ rubocop-ast (1.49.0)
35
35
  parser (>= 3.3.7.2)
36
- prism (~> 1.4)
36
+ prism (~> 1.7)
37
37
  rubocop-minitest (0.33.0)
38
38
  rubocop (>= 1.39, < 2.0)
39
39
  rubocop-rake (0.6.0)
data/README.md CHANGED
@@ -111,7 +111,11 @@ and place it in `examples/` folder.
111
111
 
112
112
  ### Releasing a new gem version
113
113
 
114
- To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`,
114
+ To release a new version;
115
+ 1. update the version number in `version.rb`
116
+ 2. run `bundle update`
117
+ 3. commit the changes
118
+ 2. then run `bundle exec rake release`
115
119
  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).
116
120
 
117
121
  ## Contributing
@@ -4,6 +4,7 @@ module Kamisaku
4
4
  alias_method :data, :content_hash
5
5
 
6
6
  def initialize(content_hash:)
7
+ raise Kamisaku::Error, "content is not a Hash" unless content_hash.is_a? Hash
7
8
  @content_hash = content_hash
8
9
  end
9
10
 
@@ -3,9 +3,15 @@ require "psych"
3
3
  module Kamisaku
4
4
  module Helpers
5
5
  def self.yaml_str_to_content_hash(yaml_str)
6
- Psych.safe_load(yaml_str, symbolize_names: true, aliases: false, freeze: true)
7
- rescue Psych::SyntaxError, Psych::DisallowedClass, Psych::AliasesNotEnabled => error
8
- raise Kamisaku::Error.new error.message
6
+ result = Psych.safe_load(yaml_str, symbolize_names: true, aliases: false, freeze: true)
7
+ raise Kamisaku::Error, "Unable to parse yaml content" unless result.is_a?(Hash)
8
+ result
9
+ rescue Psych::SyntaxError => error
10
+ raise Kamisaku::Error, "Syntax error at line #{error.line}"
11
+ rescue Psych::AliasesNotEnabled => _error
12
+ raise Kamisaku::Error, "Aliases are not enabled in yaml text"
13
+ rescue Psych::DisallowedClass
14
+ raise Kamisaku::Error, error.message
9
15
  end
10
16
 
11
17
  def self.remove_metadata_from_pdf_file(file_path)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kamisaku
4
- VERSION = "0.4.2"
4
+ VERSION = "0.4.4"
5
5
  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.2
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sinaru Gunawardena