value_semantics 3.6.0 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d3795e585d271a6b0b784ef28931a16ae7f1846b13f7d307bf97d9d175c5384
4
- data.tar.gz: 8289168c0be7e6cd00e24e59239a9ab8a2026fc42895007f33388d6ffa67add4
3
+ metadata.gz: 2b067417b01eb9706289a6bfa78e45b8eb38f2e08ca02e3d0c8818d34be3dee8
4
+ data.tar.gz: 526e22dc311d0639e0c48e204c967d42e339bd31c0fd3d3f86005c850f44d9f5
5
5
  SHA512:
6
- metadata.gz: 1b2520d80b112810e2b257920d591d4657cd9da26007307492cceac3321149b266bb310fba7c49e957d21a31e92bc041668bd907820b906570efa704d02c7948
7
- data.tar.gz: 9605e0334ff2ff61dbb1925983b44f1275fb3768196bb62dbed6a2ccd9f6590b6e22ff3555101b6283181b18173657d363d397f8f10d329b9e4dea21ef1eb73c
6
+ metadata.gz: 19acb4f70ab18d16f321c1396b8ea38acaca41ec7f3c998394b4c6862ae1a05d8b91bfe788d2904047d128dc297b1a4ec8745481ae7ffd1892f3c6a052c6d6dd
7
+ data.tar.gz: b2432643ae8b58dbf008a8dad4e39db5c3560c91f2c4a110f420f915d6c2a4e5a6244d66737530ef2d68a2a2d22136fa003923739d6214379913c03faba5796f
data/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ 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
+ ## [3.6.1] - 2021-06-20
9
+ ### Fixed
10
+ - Attribute reader methods can be made `protected` or `private` now,
11
+ where previously that would cause various instance methods to raise
12
+ `NoMethodError`.
13
+
8
14
  ## [3.6.0] - 2020-09-01
9
15
  ### Added
10
16
  - `RangeOf` built-in validator, for validating `Range` objects
@@ -8,6 +8,12 @@ module ValueSemantics
8
8
  # @see ValueSemantics.for_attributes
9
9
  #
10
10
  class DSL
11
+ # TODO: this should maybe inherit from BasicObject so that method_missing
12
+ # doesn't find methods on Kernel. This might have undesirable consequences
13
+ # tho, and we will probably need to do some const_missing stuff to get it
14
+ # working smoothly. Evaluate the feasability of this before the next major
15
+ # version bump, because it would be a backwards-incompatible change.
16
+
11
17
  #
12
18
  # Builds a {Recipe} from a DSL block
13
19
  #
@@ -114,7 +114,7 @@ module ValueSemantics
114
114
  #
115
115
  def to_h
116
116
  self.class.value_semantics.attributes
117
- .map { |attr| [attr.name, public_send(attr.name)] }
117
+ .map { |attr| [attr.name, __send__(attr.name)] }
118
118
  .to_h
119
119
  end
120
120
 
@@ -27,6 +27,10 @@ module ValueSemantics
27
27
  NOT_FOUND = Object.new.freeze
28
28
 
29
29
  def coerce_to_attr_hash(obj)
30
+ # TODO: this coerces nil to an empty hash, which is probably not ideal.
31
+ # It should not coerce nil so that Either(X, nil) validator works as
32
+ # expected. This is a backwards-incomptible change, so save it for a
33
+ # major version bump
30
34
  return nil unless obj.respond_to?(:to_h)
31
35
  obj_hash = obj.to_h
32
36
 
@@ -1,3 +1,3 @@
1
1
  module ValueSemantics
2
- VERSION = "3.6.0"
2
+ VERSION = "3.6.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: value_semantics
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.0
4
+ version: 3.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Dalling
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-01 00:00:00.000000000 Z
11
+ date: 2021-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -186,7 +186,7 @@ licenses:
186
186
  metadata:
187
187
  bug_tracker_uri: https://github.com/tomdalling/value_semantics/issues
188
188
  changelog_uri: https://github.com/tomdalling/value_semantics/blob/master/CHANGELOG.md
189
- documentation_uri: https://github.com/tomdalling/value_semantics/blob/v3.6.0/README.md
189
+ documentation_uri: https://github.com/tomdalling/value_semantics/blob/v3.6.1/README.md
190
190
  source_code_uri: https://github.com/tomdalling/value_semantics
191
191
  post_install_message:
192
192
  rdoc_options: []