-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor/extract builtin contracts #199
Refactor/extract builtin contracts #199
Conversation
You can include Builtin into Contracts directly at a module level. Then you This way you can still refer them as Contracts::Maybe anywhere. Then I would add to tutorial example what happens if including
|
So the desired objectives are the following?:
|
@PikachuEXE Exactly! |
6912420
to
c32cc41
Compare
Updated & squashed In the next major bump (breaking), |
No, we want to always have Extraction to Just |
@@ -17,7 +17,7 @@ contracts.ruby brings code contracts to the Ruby language. Code contracts allow | |||
A simple example: | |||
|
|||
```ruby | |||
Contract Contracts::Num, Contracts::Num => Contracts::Num | |||
Contract Contracts::Builtin::Num, Contracts::Builtin::Num => Contracts::Builtin::Num |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, we don't want to expose this information to users. We want them to still either:
- include
Contracts::Core
and useContracts::Maybe
(orC::Maybe
) - include
Contracts::Core
,Contracts::Builtin
and useMaybe
So in TUTORIAL.md
good changes are only for error messages and validator
list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I think about validator
list, it does not need to have Builtin::
in it too.
@PikachuEXE Looks very good so far. Left some comments around Ideally, since |
* Include the new module into `Contracts`
c32cc41
to
cd8ea54
Compare
Most changes reverted except a few places |
LGTM |
…racts Refactor/extract builtin contracts
@PikachuEXE Thanks! |
@waterlink Do you know when will this & #198 be released? |
I will create a PR later today with changelog update and version bump. Then it is up to @egonSchiele to merge & release it to rubygems. BTW, there is still need to add info on |
I will add this info later, no need to bother :) |
created |
This is for a comment in another PR
Changes
Builtin
as suggestedBuiltin
when moduleContracts
included(but not when extended, since I am not sure)
Missing stuff
Contracts
included