shale-builder 0.6.1 → 0.6.3

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: deda7a499a25b163757c80e48d20b064347d1060e2ddf572a3d0870887c4010a
4
- data.tar.gz: f1832b6e591d22a5af55d77c97d7460098e970c298ed50d6479eb038b044ba74
3
+ metadata.gz: 8390e896860a9ae2aedb9e0c27166f2988a680f03dc78cfd30d0b58154ffd32f
4
+ data.tar.gz: a911f2ccd9ea7d8b233420135d0c27d65ec721c169d7cde490ffd59fcb42f7e7
5
5
  SHA512:
6
- metadata.gz: 4fd7a5e43321bd1eea34faf4ddc8bdbd7c053338186f14fb65cf12d0358bb6cc775c10469ebe3cf1284db5144e3b8bd992e5c0ccd8fe7fee5bc29be146909e7c
7
- data.tar.gz: 742ee5d778cb343050c0aa06e6896ca03ee1d355c3cd325aa81308e1d70e987c399a97fcb0e204105c30c6fc50ec9a7f0c5946d65af8799fc22b3b6943a70f3f
6
+ metadata.gz: 4c102d77a38b6d1331bf5b5087cf812adf1c16f2aa3a092f9c1ada4b342a85925ea21eebed95156a6e586cd2cbbbe240c0cbe6c6d858f9e266bd26a99db2e9fc
7
+ data.tar.gz: 70b49b02528f27f284106e9ce12df12aa12e3f76940e8aa93fa37af7cf3f1dd0d4c434c7583d3e727109188ece728b7a91a3e7deebf41979fc1b9fda3ed7fc93
data/CHANGELOG.md CHANGED
@@ -5,6 +5,21 @@ 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.6.3] - 2025-10-16
9
+
10
+ [Diff](https://github.com/Verseth/ruby-shale-builder/compare/v0.6.2...v0.6.3)
11
+
12
+ ### Changes
13
+ - Improve `Shale::Builder::AssignedAttributes` to handle assignment in methods like `from_hash`
14
+
15
+ ## [0.6.2] - 2025-10-16
16
+
17
+ [Diff](https://github.com/Verseth/ruby-shale-builder/compare/v0.6.0...v0.6.2)
18
+
19
+ ### Changes
20
+ - Fix `Shale::Builder#inject_context`
21
+ - Add `Shale::Builder::S` alias to `Shale::Type`
22
+
8
23
  ## [0.6.0] - 2025-10-16
9
24
 
10
25
  [Diff](https://github.com/Verseth/ruby-shale-builder/compare/v0.5.1...v0.6.0)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shale-builder (0.6.1)
4
+ shale-builder (0.6.3)
5
5
  booleans (>= 0.1)
6
6
  shale (< 2.0)
7
7
  sorbet-runtime (> 0.5)
@@ -14,6 +14,8 @@ module Shale
14
14
  extend T::Sig
15
15
  extend T::Helpers
16
16
 
17
+ DEFAULT = Object.new
18
+
17
19
  class << self
18
20
  extend T::Sig
19
21
 
@@ -43,14 +45,27 @@ module Shale
43
45
  #: Module
44
46
  attr_reader :assigned_attributes_methods_module
45
47
 
46
- #: (String | Symbol name, Class type, ?collection: bool, ?default: Proc?, ?doc: String?, **untyped kwargs) ?{ -> void } -> void
47
- def attribute(name, type, collection: false, default: nil, doc: nil, **kwargs, &block)
48
- super
48
+ #: (
49
+ #| String | Symbol name,
50
+ #| Class shale_mapper,
51
+ #| ?collection: bool,
52
+ #| ?default: Proc?,
53
+ #| **Object kwargs
54
+ #| ) ?{ -> void } -> void
55
+ def attribute(
56
+ name,
57
+ shale_mapper,
58
+ collection: false,
59
+ default: -> { DEFAULT },
60
+ **kwargs,
61
+ &block
62
+ )
63
+ super(name, shale_mapper, collection:, default:, **kwargs, &block) # rubocop:disable Style/SuperArguments
49
64
 
50
65
  @assigned_attributes_methods_module.class_eval <<~RUBY, __FILE__, __LINE__ + 1
51
66
  def #{name}=(val)
67
+ return if val.equal?(::Shale::Builder::AssignedAttributes::DEFAULT)
52
68
  super
53
- return unless @__initialized
54
69
 
55
70
  self.assigned_attribute_names << #{name.to_sym.inspect}
56
71
  end
@@ -59,14 +74,6 @@ module Shale
59
74
  end
60
75
  mixes_in_class_methods ClassMethods
61
76
 
62
- def initialize(*args, **kwargs, &block)
63
- super
64
- @__initialized = true
65
- end
66
-
67
- #: bool?
68
- attr_reader :__initialized
69
-
70
77
  # Returns a set of names of assigned shale attributes.
71
78
  #
72
79
  #: -> Set[Symbol]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Shale
4
4
  module Builder
5
- VERSION = '0.6.1'
5
+ VERSION = '0.6.3'
6
6
  end
7
7
  end
data/lib/shale/builder.rb CHANGED
@@ -44,6 +44,8 @@ module Shale
44
44
  extend T::Sig
45
45
  extend T::Helpers
46
46
 
47
+ S = ::Shale::Type
48
+
47
49
  class << self
48
50
  extend T::Sig
49
51
 
@@ -235,7 +237,7 @@ module Shale
235
237
  val = public_send(name)
236
238
  next unless val
237
239
 
238
- val.inject_context(context)
240
+ val.inject_context(**context)
239
241
  end
240
242
  end
241
243
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shale-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Drewniak