SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

 
 
Changelog for ruby2.7-rubygem-dry-types-1.5.1-4.5.x86_64.rpm :

* Thu Jun 24 2021 cooloAATTsuse.comupdated to version 1.5.1 see installed CHANGELOG.md [#]# 1.5.1 2021-02-16 [#]## Fixed - Add missing requires for internal usage of `Dry::Equalizer` (AATTtimriley in #418) [Compare v1.5.0...v1.5.1](https://github.com/dry-rb/dry-types/compare/v1.5.0...v1.5.1) [#]# 1.5.0 2021-01-21 [#]## Added - Wrapping constructor types :tada: (AATTflash-gordon) Constructor blocks can have a second argument. The second argument is the underlying type itself: ```ruby age_from_year = Dry::Types[\'coercible.integer\'].constructor do |input, type| Date.today.year - type.(input) end age_from_year.(\'2000\') # => 21 ``` With wrapping constructors you have control over \"type application\". You can even run it more than once: ```ruby inc = Dry::Types[\'integer\'].constructor(&:succ) inc2x = inc.constructor { _2.(_2.(_2.(_1))) } inc2x.(10) # => 13 ``` - Fallbacks :tada: (AATTflash-gordon) ```ruby age = Dry::Types[\'coercible.ineger\'].fallback(18) age.(\'10\') # => 10 age.(\'20\') # => 20 age.(\'abc\') # => 18 ``` Fallbacks are different from default values: the later will be evaluated only when
*no input
* provided. Under the hood, `.fallback` creates a wrapping constructor. - `params.string` as an alias for `strict.string`. This addition should be non-breaking (AATTflash-gordon) - API for defining custom type builders similar to `.default`, `.constructor`, or `.optional` (AATTflash-gordon) ```ruby [#] Making an alias for `.fallback` Dry::Types.define_builder(:or) { |type, v| type.fallback(v) } [#] Using new builder type = Dry::Types[\'integer\'].or(-273) type.(:invalid) # => -273 ``` [#]## Changed - Inferring predicates from class names is deprecated. It\'s very unlikely your code depends on it, however, if it does, you\'ll get an exception with instructions. (AATTflash-gordon) If you don\'t rely on inferring, just disable it with: ```ruby Dry::Types::PredicateInferrer::Compiler.infer_predicate_by_class_name false ``` Otherwise, enable it explicitly: ```ruby Dry::Types::PredicateInferrer::Compiler.infer_predicate_by_class_name true ``` [Compare v1.4.0...v1.5.0](https://github.com/dry-rb/dry-types/compare/v1.4.0...v1.5.0)
* Mon Mar 23 2020 cooloAATTsuse.com- initial package (version 1.4.0)
 
ICM