Sha256: bd79b8debdb982712c231954efa854285fe8228ff03cbca7fac2de361916c135
Contents?: true
Size: 1.27 KB
Versions: 1
Compression:
Stored size: 1.27 KB
Contents
## v0.9 - MAJOR fix in pattern-matching: If the return contract for a pattern-matched function fails, it should NOT try the next pattern-match function. Pattern-matching is only for params, not return values. - raise an error if multiple defns have the same contract for pattern matching. - New syntax for functions with no input params (the old style still works) Old way: ```ruby Contract nil => 1 def one ``` New way: ``` Contract 1 def one ``` - Prettier HashOf contract can now be written like this: `HashOf[Num => String]` - Add `SetOf` contract - various small fixes ## v0.8 - code refactored (very slight loss of performance, big increase in readability) - fail when defining a contract on a module without `include Contracts::Modules` - fixed several bugs in argument parsing, functions with complex params get contracts applied correctly now. - added rubocop to ci. - if a contract is set on a protected method, it should not become public. - fixed pattern matching when the multiple definitions of functions have different arities. - couple of new built-in contracts: Nat, Eq. - changed `Invariant` to `invariant`: `invariant(:day) { 1 <= day && day <= 31 }` - prettier error messages (`Contracts::Num` is now just `Num`, for example) - support for yard-contracts
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
contracts-0.10 | CHANGELOG.markdown |