- New
:case?
predicate matches a value against the given object with#===
(flash-gordon) - New
:is?
predicate checks objects identity (using#equal?
) (flash-gordon)
- A bug with using custom predicates within a standalone module in
dry-validation
(flash-gordon)
[Compare v0.4.1...v0.4.2(https://github.com/dry-rb/dry-logic/compare/v0.4.1...v0.4.2)
- Predicates simply reuse other predicate methods instead of referring to them via
#[]
(georgemillo)
- Warnings on MRI 2.4.0 are gone (jtippett)
This is a partial rewrite focused on internal clean up and major performance improvements. This is also the beginning of the work to make this library first-class rather than "just" a rule backend for dry-validation and dry-types.
Rule#[]
which applies a rule and always returnstrue
orfalse
(solnic)Rule#bind
which returns a rule with its predicate bound to a given object (solnic)Rule#eval_args
which evaluates unbound-methods-args in the context of a given object (solnic)Logic.Rule
builder function (solnic)- Nice
#inspect
on rules and operation objects (solnic)
- [BRAEKING] New result API (solnic)
- [BREAKING]
Predicate
is nowRule::Predicate
(solnic) - [BREAKING]
Rule::Conjunction
is nowOperation::And
(solnic) - [BREAKING]
Rule::Disjunction
is nowOperation::Or
(solnic) - [BREAKING]
Rule::ExlusiveDisjunction
is nowOperation::Xor
(solnic) - [BREAKING]
Rule::Implication
is nowOperation::Implication
(solnic) - [BREAKING]
Rule::Set
is nowOperation::Set
(solnic) - [BREAKING]
Rule::Each
is nowOperation::Each
(solnic) - [BREAKING]
Rule.new
accepts a predicate function as its first arg now (solnic) - [BREAKING]
Rule#name
is nowRule#id
(solnic) Rule#parameters
is public now (solnic)
:type?
predicate imported from dry-types (solnic)Rule#curry
interface (solnic)
- Predicates AST now includes information about args (names & possible values) (fran-worley + solnic)
- Predicates raise errors when they are called with invalid arity (fran-worley + solnic)
- Rules no longer evaluate input twice when building result objects (solnic)
not_eql?
,includes?
,excludes?
predicates (fran-worley)
- Renamed
inclusion?
toincluded_in?
and deprecatedinclusion?
(fran-worley) - Renamed
exclusion?
toexcluded_from?
and deprecatedexclusion?
(fran-worley)
number?
,odd?
,even?
predicates (fran-worley)
- Result AST for
Rule::Each
correctly maps elements with eql inputs (solnic)
- Entire AST has been redefined (solnic)
- Support for hash-names in
Check
andResult
which can properly resolve input from nested results (solnic)
- Support for resolving input from
Rule::Result
(solnic)
Check
andResult
carry original input(s) (solnic)
xor
returns wrapped results when used against another result-rule (solnic)
Rule::Attr
which can be applied to a data object with attr readers (SunnyMagadan)Rule::Result
which can be applied to a result object (solnic)true?
andfalse?
predicates (solnic)
Code extracted from dry-validation 0.4.1