shale-builder 0.6.3 → 0.6.5

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: 8390e896860a9ae2aedb9e0c27166f2988a680f03dc78cfd30d0b58154ffd32f
4
- data.tar.gz: a911f2ccd9ea7d8b233420135d0c27d65ec721c169d7cde490ffd59fcb42f7e7
3
+ metadata.gz: c1880d034ce6c63d442b30d8e32e6f4bd45fd7013e4d97e8c2659c3a82f1bc69
4
+ data.tar.gz: 41016cd336e6ff741b569e08a2068da6447cd2c2a93aadb8b116c589d85b9164
5
5
  SHA512:
6
- metadata.gz: 4c102d77a38b6d1331bf5b5087cf812adf1c16f2aa3a092f9c1ada4b342a85925ea21eebed95156a6e586cd2cbbbe240c0cbe6c6d858f9e266bd26a99db2e9fc
7
- data.tar.gz: 70b49b02528f27f284106e9ce12df12aa12e3f76940e8aa93fa37af7cf3f1dd0d4c434c7583d3e727109188ece728b7a91a3e7deebf41979fc1b9fda3ed7fc93
6
+ metadata.gz: '088bc9b1de2492906791470ca83abd6ba56b0f2bbbeba87d816acb03b70a400b2ae56cb72b2a8bbb7f3dd42897856cf714a46ac835674a4c077cbb0ded4d77ef'
7
+ data.tar.gz: 0c61bc12a78e9306b8cc815020d11049272a49dd17b0b8900a059f5daada80a79164b3f08be18950025b95c59f135fc769138ac753ef87fc0abd63d300ba01e3
data/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ 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.4] - 2025-10-16
9
+
10
+ [Diff](https://github.com/Verseth/ruby-shale-builder/compare/v0.6.3...v0.6.4)
11
+
12
+ ### Changes
13
+ - Fix `Shale::Builder::AssignedAttributes` and add additional tests
14
+
8
15
  ## [0.6.3] - 2025-10-16
9
16
 
10
17
  [Diff](https://github.com/Verseth/ruby-shale-builder/compare/v0.6.2...v0.6.3)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shale-builder (0.6.3)
4
+ shale-builder (0.6.5)
5
5
  booleans (>= 0.1)
6
6
  shale (< 2.0)
7
7
  sorbet-runtime (> 0.5)
@@ -14,8 +14,6 @@ module Shale
14
14
  extend T::Sig
15
15
  extend T::Helpers
16
16
 
17
- DEFAULT = Object.new
18
-
19
17
  class << self
20
18
  extend T::Sig
21
19
 
@@ -40,6 +38,12 @@ module Shale
40
38
  module ClassMethods
41
39
  extend T::Sig
42
40
 
41
+ #: (Class subclass) -> void
42
+ def inherited(subclass)
43
+ super
44
+ Builder.prepare_mod(subclass)
45
+ end
46
+
43
47
  # Contains overridden getter methods for attributes
44
48
  # with complex types (so that they accept a block for building)
45
49
  #: Module
@@ -56,16 +60,16 @@ module Shale
56
60
  name,
57
61
  shale_mapper,
58
62
  collection: false,
59
- default: -> { DEFAULT },
63
+ default: nil,
60
64
  **kwargs,
61
65
  &block
62
66
  )
63
- super(name, shale_mapper, collection:, default:, **kwargs, &block) # rubocop:disable Style/SuperArguments
67
+ super
64
68
 
65
69
  @assigned_attributes_methods_module.class_eval <<~RUBY, __FILE__, __LINE__ + 1
66
70
  def #{name}=(val)
67
- return if val.equal?(::Shale::Builder::AssignedAttributes::DEFAULT)
68
71
  super
72
+ return unless @__initialized
69
73
 
70
74
  self.assigned_attribute_names << #{name.to_sym.inspect}
71
75
  end
@@ -74,6 +78,14 @@ module Shale
74
78
  end
75
79
  mixes_in_class_methods ClassMethods
76
80
 
81
+ def initialize(*args, **kwargs, &block)
82
+ super
83
+ @__initialized = true
84
+ end
85
+
86
+ #: bool?
87
+ attr_reader :__initialized
88
+
77
89
  # Returns a set of names of assigned shale attributes.
78
90
  #
79
91
  #: -> Set[Symbol]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Shale
4
4
  module Builder
5
- VERSION = '0.6.3'
5
+ VERSION = '0.6.5'
6
6
  end
7
7
  end
data/lib/shale/builder.rb CHANGED
@@ -237,7 +237,7 @@ module Shale
237
237
  val = public_send(name)
238
238
  next unless val
239
239
 
240
- val.inject_context(**context)
240
+ val.inject_context(**context) if respond_to?(:inject_context)
241
241
  end
242
242
  end
243
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.3
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Drewniak