kamisaku 0.4.3 → 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: cfdf7ddf6a45f5c5794ad3e1e820b07e38ab7ad24188cca2c9fcf637ccdb0ef1
4
- data.tar.gz: 1cc9d43c15c69a760d22bb78f77b7d8e3e75f38005686f3e38f48f9adfcb16f2
3
+ metadata.gz: ae6dcfe51810b9a986f61743a22d04c210ec80567f13e53cd7461322d2290cc6
4
+ data.tar.gz: fd0c2eb3f21d73945441e73f20c4df546139705ea86f8fca0f2f915651a65662
5
5
  SHA512:
6
- metadata.gz: 9dae789b198dd96799c93261b6351c5f720d45ca3612f8df2fcb46df161b5ccee25b5d9bdf8a9cbaa341e7a5ffaccca0021eedab62ff7c6571f94da388eded5a
7
- data.tar.gz: 2600ff04de0ce42018a5a1148c52d3a0ed9ff9af9ba96a810bc20d4eecfec982abbc32c8a67b0427458b7071bf26e23fbbd7a4994f60c65697ecd1742187fcac
6
+ metadata.gz: e8017948750e46d8e03b3f117f773adf57372fab04ee0832fb2749791ef0639abc1ab4cfa59b4b657d234b796a2e087f31a3ebd2666d7d8b414743a7ecb4f516
7
+ data.tar.gz: 7bd63162c94f5d6dd7f282b894229447214462d4c4ceed734c386376203831a5b0932c066ad89101b8f4aced9ed505543c9e31a9f3b1de73175625ddea00f63f
data/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ 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.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ### Changed
11
+ - Improve error handling in `yaml_str_to_content_hash` and `BaseContentValidator`
12
+
8
13
  ## [0.4.3] - 2026.01.01
9
14
 
10
15
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,25 +1,25 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kamisaku (0.4.3)
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)
@@ -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,7 +3,9 @@ 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)
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
7
9
  rescue Psych::SyntaxError => error
8
10
  raise Kamisaku::Error, "Syntax error at line #{error.line}"
9
11
  rescue Psych::AliasesNotEnabled => _error
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kamisaku
4
- VERSION = "0.4.3"
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.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sinaru Gunawardena