- Fix NoMethodError when trying to get AST of a Builder's result. (via #107) (@estum)
uri_rfc3986?
predicate that uses a better regexp thanuri?
(see #94 for more details) (@hieuk09)
- Made
Predicates.respond_to?
compatible withObject#respond_to?
(via #105) (@solnic) - Made
Predicates.eql?
compatible withObject#eql?
(via #106) (@solnic)
- Updated to dry-core 1.0 (@flash-gordon + @solnic)
- Use zeitwerk for auto-loading (@solnic + @flash-gordon)
- Add predicate and operation builder DSL (@oleander)
- Fixed a crash under jruby caused by arg splatting in Binary operations (@flash-gordon)
- Nested
Check
operations no longer crash under MRI 3.0 (@oleander)
- Switched to equalizer from dry-core (@solnic)
- Better Ruby 3 support with fixed specialization for rules of negative arity (@flash-gordon)
- A new
uri?
predicate that you can use to verifyURI
strings, ieuri?("https", "https://dry-rb.org")
(@nerburish) - New predicates:
uuid_v1?
,uuid_v2?
,uuid_v3?
anduuid_v5?
(via #75) (@jamesbrauman)
- Made the regexp used by
uuid_v4?
more secure (@kml)
- Make
format?
tolerant tonil
values. It already worked like that before, but starting Ruby 2.7 it would produce warnings. Now it won't. Don't rely on this behavior, it's only added to make tests pass in dry-schema. Use explicit type checks instead (@flash-gordon)
- Fix keyword warnings (@flash-gordon)
bytesize?
predicate (@bmalinconico)min_bytesize?
predicate (@bmalinconico)- `max_bytesize? predicate (@bmalinconico)
- Min ruby version was set to
>= 2.4.0
(@flash-gordon)
Re-pushed 1.0.1 after dry-schema 1.2.0 release.
This release was removed from rubygems because it broke dry-schema.
uuid_v4?
predicate (radar)respond_to?
predicate (waiting-for-dev)
- Version bump to
1.0.0
(flash-gordon)
- Fix a regression in dry-validation 0.x for argument-less predicates (flash-gordon)
- Generating hints can be disabled by building
Operations::And
withhints: false
option set (solnic)
Rule
construction has been optimized so that currying and application is multiple-times faster (flash-gordon)
:nil?
predicate (none?
is now an alias) (solnic)
Operation::Key#ast
will now return a correct AST with non-Undefined inputs (solnic)
- 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)
- Warnings on MRI 2.4.0 are gone (jtippett)
- Predicates simply reuse other predicate methods instead of referring to them via
#[]
(georgemillo)
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