Skip to content

Commit e79b75b

Browse files
committed
Merge pull request #437 from ruby-concurrency/more-top-level-documentation
Added CoC, contributor guidelines, and updated README.
2 parents a5ff9d2 + 6c2b071 commit e79b75b

File tree

4 files changed

+208
-41
lines changed

4 files changed

+208
-41
lines changed

BUILDING.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Building
2+
3+
All published versions of this gem (core, extension, and several platform-specific packages) are compiled,
4+
packaged, tested, and published using an open, automated process.
5+
This process can also be used to create pre-compiled binaries of the extension gem for virtually
6+
any platform. *Documentation is forthcoming...*
7+
8+
```
9+
*MRI only*
10+
bundle exec rake build:native # Build concurrent-ruby-ext-<version>-<platform>.gem into the pkg dir
11+
bundle exec rake compile:extension # Compile extension
12+
13+
*JRuby only*
14+
bundle exec rake build # Build JRuby-specific core gem (alias for `build:core`)
15+
bundle exec rake build:core # Build concurrent-ruby-<version>-java.gem into the pkg directory
16+
17+
*All except JRuby*
18+
bundle exec rake build:core # Build concurrent-ruby-<version>.gem into the pkg directory
19+
bundle exec rake build:ext # Build concurrent-ruby-ext-<version>.gem into the pkg directory
20+
21+
*When Docker IS installed*
22+
bundle exec rake build:windows # Build the windows binary <version> gems per rake-compiler-dock
23+
bundle exec rake build # Build core, extension, and edge gems, including Windows binaries
24+
25+
*When Docker is NOT installed*
26+
bundle exec rake build # Build core, extension, and edge gems (excluding Windows binaries)
27+
28+
*All*
29+
bundle exec rake clean # Remove any temporary products
30+
bundle exec rake clobber # Remove any generated file
31+
bundle exec rake compile # Compile all the extensions
32+
```
33+
34+
## Publishing the Gem
35+
36+
To create the build you'll need to have both MRI and JRuby installed and configured with the appropriate build tools and libraries. To create the Windows build you'll need to install docker. If you are on OS X you'll also need boot2docker. Once you have all that setup, everything if fairly automated:
37+
38+
* Update`version.rb`
39+
* Update the CHANGELOG
40+
* Switch to MRI
41+
- Make sure docker is running (otherwise the windows build task will not be available)
42+
- Run `bundle exec rake clean` to get rid of old artifacts
43+
- Run `bundle exec rake build` to build core, ext, ext-windows, and edge into the *pkg* directory
44+
* Switch to JRuby
45+
- Delete *Gemfile.lock* and run `bundle install` (this isn't always necessary, but our multi-gem setup sometimes confuses bundler)
46+
- Run `bundle exec rake clean` to get rid of old artifacts
47+
- Run `bundle exec rake build` to build core-java into the *pkg* directory
48+
* If everything looks good, update git
49+
- Commit the changes
50+
- Tag the master branch with the version number
51+
- Push to GitHub
52+
* Update the Yard documentation
53+
- Run `bundle exec rake yard` to update the documentation
54+
- Run `bundle exec rake yard:push` to push the docs to GitHub Pages
55+
* For each gem file in *pkg* run `gem push pkg/concurrent-ruby-<...>.gem` to push to Rubygems
56+
* Update the release in GitHub
57+
- Select the `releases` link on the main repo page
58+
- Press the `Edit` button to edit the release
59+
- Name the release based on the version number
60+
- Add a description
61+
- Attach all the `*.gem` file
62+
- Save the updated release
63+
64+
The compiled and build gem packages can be tested using the scripts in the `build-tests` folder. The `runner.rb` script is the main test runner. It will run all tests which are available on the given platform. It will install the various gem packages (core, ext, and edge) as necessary, run the tests, then clean up after itself.

CODE_OF_CONDUCT.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Contributor Code of Conduct
2+
3+
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4+
5+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
6+
7+
Examples of unacceptable behavior by participants include:
8+
9+
* The use of sexualized language or imagery
10+
* Personal attacks
11+
* Trolling or insulting/derogatory comments
12+
* Public or private harassment
13+
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
14+
* Other unethical or unprofessional conduct.
15+
16+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
17+
18+
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
19+
20+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
21+
22+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)

CONTRIBUTING.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Contributing to Concurrent Ruby
2+
3+
You want to contribute? Thank you! Concurrent Ruby is work of [many contributors](https://github.com/ruby-concurrency/concurrent-ruby/graphs/contributors). You're encouraged to submit [pull requests](https://github.com/ruby-concurrency/concurrent-ruby/pulls), [propose features and discuss issues](https://github.com/ruby-concurrency/concurrent-ruby/issues). When in doubt, ask a question in the [Concurrent Ruby gitter.im chatroom](https://gitter.im/ruby-concurrency/concurrent-ruby) or on the [mailing list](https://groups.google.com/forum/#!forum/concurrent-ruby).
4+
5+
#### Find Something to Work on
6+
7+
If you want to contribute but aren't sure what to work on, we keep our list of current todos on our [issues page](https://github.com/ruby-concurrency/concurrent-ruby/issues). Before starting, feel free to chat with us on [gitter](https://gitter.im/ruby-concurrency/concurrent-ruby).
8+
9+
#### Fork the Project
10+
11+
Fork the [project on Github](https://github.com/ruby-concurrency/concurrent-ruby) and check out your copy.
12+
13+
```
14+
git clone https://github.com/contributor/concurrent-ruby.git
15+
cd concurrent-ruby
16+
git remote add upstream https://github.com/ruby-concurrency/concurrent-ruby.git
17+
```
18+
19+
#### Create a Topic Branch
20+
21+
Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
22+
23+
```
24+
git checkout master
25+
git pull upstream master
26+
git checkout -b my-feature-branch
27+
```
28+
29+
#### Bundle Install, Buildn and Test
30+
31+
32+
Ensure that you can build the project and run tests.
33+
34+
Please note that Concurrent Ruby includes native Java and (optional) C extensions. When building you will need the appropriate build tools for your platform. If you don't have the build tools installed that's OK. The tests can still be run. A few tests nay fail, but these are just the tests that verify that the extensions exist. You can usually ignore these locally if you are working on the pure Ruby parts of the library (which is most of the lib).
35+
36+
```
37+
bundle install
38+
bundle exec rake
39+
```
40+
41+
#### Write Tests
42+
43+
Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. Add to [specs](https://github.com/ruby-concurrency/concurrent-ruby/tree/master/spec).
44+
45+
We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.
46+
47+
#### Write Code
48+
49+
Implement your feature or bug fix.
50+
51+
Make sure that `bundle exec rake` completes without errors.
52+
53+
#### Write Documentation
54+
55+
Document any external behavior in the [README](README.md).
56+
57+
#### Commit Changes
58+
59+
Make sure git knows your name and email address:
60+
61+
```
62+
git config --global user.name "Your Name"
63+
git config --global user.email "[email protected]"
64+
```
65+
66+
Writing good commit logs is important. A commit log should describe what changed and why.
67+
68+
```
69+
git add ...
70+
git commit
71+
```
72+
73+
#### Push
74+
75+
```
76+
git push origin my-feature-branch
77+
```
78+
79+
#### Make a Pull Request
80+
81+
Go to https://github.com/contributor/concurrent-ruby and select your feature branch. Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
82+
83+
#### Rebase
84+
85+
If you've been working on a change for a while, rebase with upstream/master.
86+
87+
```
88+
git fetch upstream
89+
git rebase upstream/master
90+
git push origin my-feature-branch -f
91+
```
92+
93+
#### Update CHANGELOG Again
94+
95+
Update the [CHANGELOG](CHANGELOG.md) with a description of what you have changed.
96+
97+
Amend your previous commit and force push the changes.
98+
99+
```
100+
git commit --amend
101+
git push origin my-feature-branch -f
102+
```
103+
104+
#### Check on Your Pull Request
105+
106+
Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI and AppVeyor. Everything should look green, otherwise fix issues and amend your commit as described above.
107+
108+
Please note that testing concurrency is hard. Very hard. We have a few tests that occasionally fail due (mostly) to incorrect synchronization within the test itself. If everything passes locally but you see an error on CI, it's possibly you've become victim to ont of the tests. Don't worry, the Concurrent Ruby team reviews the tests output of all failed CI runs and will let you know if the failing test is unrelated to your commit.
109+
110+
#### Thank You
111+
112+
Please do know that we really appreciate and value your time and work. We love you, really.
113+
114+
And also, a special thank you to the [Volt](https://github.com/voltrb/volt) team for writing an awesome guied for contributers. We have borroed liberally from theirs.

README.md

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ MRI 1.9.3, 2.0, 2.1, 2.2, JRuby (1.9 mode), and Rubinius 2.x are supported.
4949
This gem should be fully compatible with any interpreter that is compliant with Ruby 1.9.3 or newer.
5050
Java 8 is preferred for JRuby but every Java version on which JRuby 9000 runs will be supported.
5151

52+
## Thread Safety
53+
54+
*Concurrent Ruby makes the strongest thread safety guarantees of any Ruby concurrency library. We are the only library with a published [memory model](https://github.com/ruby-concurrency/concurrent-ruby/blob/master/doc/synchronization.md) which provides consistent behavior and guarantees on all three of the main Ruby interpreters (MRI/CRuby, JRuby, and Rubinius).*
55+
56+
Every abstraction in this library is thread safe. Similarly, all are deadlock free and many are fully lock free. Specific thread safety guarantees are documented with each abstraction.
57+
58+
It is critical to remember, however, that Ruby is a language of mutable references. *No* concurrency library for Ruby can ever prevent the user from making thread safety mistakes (such as sharing a mutable object between threads and modifying it on both threads) or from creating deadlocks through incorrect use of locks. All the library can do is provide safe abstractions which encourage safe practices. Concurrent Ruby provides more safe concurrency abstractions than any other Ruby library, many of which support the mantra of ["Do not communicate by sharing memory; instead, share memory by communicating"](https://blog.golang.org/share-memory-by-communicating). Concurrent Ruby is also the only Ruby library which provides a full suite of thread safe and immutable variable types and data structures.
59+
5260
## Features & Documentation
5361

5462
We have a roadmap guiding our work toward the [v1.0.0 release](https://github.com/ruby-concurrency/concurrent-ruby/issues/257).
@@ -229,39 +237,6 @@ and load the appropriate C extensions.
229237
No gems should depend on `concurrent-ruby-ext`. Doing so will force C extensions on your users.
230238
The best practice is to depend on `concurrent-ruby` and let users to decide if they want C extensions.
231239

232-
### Building
233-
234-
All published versions of this gem (core, extension, and several platform-specific packages) are compiled,
235-
packaged, tested, and published using an open, [automated process](https://github.com/ruby-concurrency/rake-compiler-dev-box).
236-
This process can also be used to create pre-compiled binaries of the extension gem for virtually
237-
any platform. *Documentation is forthcoming...*
238-
239-
```
240-
*MRI only*
241-
bundle exec rake build:native # Build concurrent-ruby-ext-<version>-<platform>.gem into the pkg dir
242-
bundle exec rake compile:extension # Compile extension
243-
244-
*JRuby only*
245-
bundle exec rake build # Build JRuby-specific core gem (alias for `build:core`)
246-
bundle exec rake build:core # Build concurrent-ruby-<version>-java.gem into the pkg directory
247-
248-
*All except JRuby*
249-
bundle exec rake build:core # Build concurrent-ruby-<version>.gem into the pkg directory
250-
bundle exec rake build:ext # Build concurrent-ruby-ext-<version>.gem into the pkg directory
251-
252-
*When Docker IS installed*
253-
bundle exec rake build:windows # Build the windows binary <version> gems per rake-compiler-dock
254-
bundle exec rake build # Build core, extension, and edge gems, including Windows binaries
255-
256-
*When Docker is NOT installed*
257-
bundle exec rake build # Build core, extension, and edge gems (excluding Windows binaries)
258-
259-
*All*
260-
bundle exec rake clean # Remove any temporary products
261-
bundle exec rake clobber # Remove any generated file
262-
bundle exec rake compile # Compile all the extensions
263-
```
264-
265240
## Maintainers
266241

267242
* [Jerry D'Antonio](https://github.com/jdantonio) (creator)
@@ -277,14 +252,6 @@ bundle exec rake compile # Compile all the extensions
277252
* [Charles Oliver Nutter](https://github.com/headius) for the `atomic` and `thread_safe` gems
278253
* [thedarkone](https://github.com/thedarkone) for the `thread_safe` gem
279254

280-
## Contributing
281-
282-
1. Fork it
283-
2. Create your feature branch (`git checkout -b my-new-feature`)
284-
3. Commit your changes (`git commit -am 'Add some feature'`)
285-
4. Push to the branch (`git push origin my-new-feature`)
286-
5. Create new Pull Request
287-
288255
## License and Copyright
289256

290257
*Concurrent Ruby* is free software released under the [MIT License](http://www.opensource.org/licenses/MIT).

0 commit comments

Comments
 (0)