-
Notifications
You must be signed in to change notification settings - Fork 419
Fix mistakes in MVar documentation #1087
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
base: master
Are you sure you want to change the base?
Conversation
.github/CONTRIBUTING.md
Outdated
@@ -66,7 +66,7 @@ There are a few guidelines which we follow when adding features. Consider that s | |||
|
|||
#### Write Documentation | |||
|
|||
Document any external behavior in the [README](README.md). | |||
Document any external behavior in the [README](/README.md). |
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.
Document any external behavior in the [README](/README.md). | |
Document any external behavior in the [README](../README.md). |
/README.md
doesn't seem to work, on GitHub at least, same below of course
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.
Hmm, weird, it did work for me when I viewed CONTRIBUTING.md in the repository.
Fixed.
# be set to limit the time spent blocked, in which case it returns `TIMEOUT` | ||
# if the time is exceeded. | ||
# @return [Object] the transformed value, or `TIMEOUT` | ||
# @return [Object] the pre-transform value, or `TIMEOUT` |
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 wonder if instead the code should return the transformed value.
But looking at
concurrent-ruby/spec/concurrent/mvar_spec.rb
Lines 180 to 183 in c8f0bae
it 'returns the unmodified value' do | |
m = MVar.new(14) | |
expect(m.modify { |v| v + 2 }).to eq 14 | |
end |
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.
Actually, I noticed the problem because the documented behavior seemed weird, as getting previous value would be hard in many cases, and it did not follow the "set and get" pattern.
492a58c
to
a58b093
Compare
a58b093
to
2c815db
Compare
Fixes a couple of mistakes in documentation:
#modify
's documentation very incorrectly said that it returns modified value, when that's not the case;#mutate
instead of#modify
;Additionally, links to README and CHANGELOG are fixed in contributing guidelines, previously they linked to non-existent files.