Releases: dry-rb/dry-types
Releases · dry-rb/dry-types
v1.9.1
v1.9.0
Added
-
params.*with.optionalcan now handle empty strings consistently withoptional.params.*by returningnilinstead of raising an error. (@baweaver in #487, @flash-gordon in #490)This behavior is not enabled by default because it's a breaking change. Set
Dry::Types.use_namespaced_optionals(true)to enable it.Dry::Types["params.integer"].optional.("") # => CoercionError # Activate namespaced optionals Dry::Types.use_namespaced_optionals true Dry::Types["params.integer"].optional.("") # => nil
Changed
- Require Ruby 3.2 or later.
- Support bigdecimal version 4.0 as well as 3.0, improving compatibility with other gems that require 4.0 only. (@rus-max in #492)
- Improve sum type error handling documentation. (@baweaver in #486)
Fixed
-
Fix
Constructor#primitive?delegation for sum types. (@baweaver in #484)This now works without error:
a = Types::String.constrained(size: 2) | Types::Hash b = Types::String.constrained(size: 1) | Types::Hash c = (a.constructor { |x| x.is_a?(Hash) ? x : x.downcase }) | (b.constructor { |x| x.is_a?(Hash) ? x : x.upcase })
-
Fix Sum type
to_swith Dry::Struct types. (@baweaver in #485)This now works without error:
class A < Dry::Struct; end class B < Dry::Struct; end (A | B).to_s
v1.8.3
Fixed
- Raise error on passing a non-module object to Instance (ref #480) (@flash-gordon)
v1.8.2
v1.8.1
v1.8.0
Added
- Added
Enum#each_valueto iterate over enum values (@CharlieWWW94 in #471)
Fixed
- Fixed
Default#tryto return correct result (@elcuervo + @flash-gordon in #475)
Changed
- Set min Ruby version to 3.1 (@flash-gordon)
- Better representation of Enum types (@flash-gordon, see #460)
v1.7.2
Fixed
- Fixed BigDecimal warning due to not being required in gemspec (@bkuhlmann in #464)
v1.7.1
Fixed
- Warning from jruby about overwritten keyword (@flash-gordon + @klobuczek in #454)
v1.7.0
Changed
- This version is compatible with recently released dry-rb dependencies (@flash-gordon)
- Updated to dry-core 1.0 (@flash-gordon + @solnic)
- Dependency on dry-container was dropped (@flash-gordon)
v1.6.1
Changed
- Fix issues with internal const_missing and Inflector/Module constants (@flash-gordon + @solnic)