Skip to content

Commit be91cbb

Browse files
authored
Merge pull request #9237 from ruby/unify-contribute-docs
Unify RubyGems and Bundler documentation
2 parents 904d734 + 924038e commit be91cbb

30 files changed

Lines changed: 680 additions & 815 deletions

CONTRIBUTING.md

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,71 @@
1-
# How to contribute
1+
# How to Contribute
22

3-
## Contributing to RubyGems
3+
Thank you for your interest in contributing to RubyGems and Bundler! Community involvement is essential to both RubyGems and Bundler. We welcome contributions from everyone, and we want to keep it as easy as possible to contribute changes.
44

5-
Check [RubyGems contribution guidelines](doc/rubygems/CONTRIBUTING.md).
5+
## Code of Conduct
66

7-
## Contributing to Bundler
7+
By participating in this project, you agree to abide by the terms of the [Code of Conduct](CODE_OF_CONDUCT.md).
88

9-
Check [Bundler contribution guidelines](doc/bundler/contributing/README.md).
9+
## Getting Started
10+
11+
Before submitting a contribution:
12+
13+
1. **Set up your development environment** - See [GETTING_STARTED.md](doc/GETTING_STARTED.md) for detailed setup instructions
14+
2. **Understand the repository structure** - This is a monorepo containing both RubyGems and Bundler:
15+
- RubyGems code is in the root `lib/` and `exe/` directories
16+
- Bundler code is in the `bundler/` subdirectory
17+
18+
## Contribution Guidelines
19+
20+
All contributions to this repository should follow these guidelines:
21+
22+
1. **Write tests** - New features must be coupled with tests. Bug fixes should include a test that reproduces the issue.
23+
24+
2. **Code style compliance**:
25+
- No trailing whitespace
26+
- Use two-space indentation
27+
- Run `bin/rake rubocop` to check style compliance
28+
29+
3. **File management** (RubyGems only):
30+
- If you add or remove files in the RubyGems portion of the repo, update `Manifest.txt` by running `bin/rake update_manifest`
31+
32+
4. **Preserve version history**:
33+
- Don't modify version numbers or changelog files directly; maintainers handle these
34+
35+
5. **Ask questions** - Have questions? Feel free to [open an issue](https://github.com/ruby/rubygems/issues)
36+
37+
For more information on contributing to the RubyGems ecosystem, see [guides.rubygems.org/contributing](https://guides.rubygems.org/contributing/).
38+
39+
## First-Time Contributors
40+
41+
We track [good first issues](https://github.com/ruby/rubygems/issues?q=is%3Aissue+is%3Aopen+label%3Abundler+label%3A%22good+first+issue%22) to help new contributors get started. Here are some great ways to begin:
42+
43+
- **Test prerelease versions**: Run `gem install bundler --pre` and report any issues
44+
- **Report bugs or suggest features**: [Open an issue](https://github.com/ruby/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md) (see [new features documentation](doc/NEW_FEATURES.md))
45+
- **Improve documentation**: Contribute to the [Bundler website](https://bundler.io) or [man pages](https://bundler.io/man/bundle.1.html)
46+
- **Triage issues**: [Check issue completeness](doc/ISSUE_TRIAGE.md) and help close incomplete reports
47+
- **Write tests**: Add failing tests for [reported bugs](https://github.com/ruby/rubygems/issues) or backfill missing test coverage
48+
- **Review pull requests**: Provide feedback on [pull requests](https://github.com/ruby/rubygems/pulls)
49+
- **Improve code**: No patch is too small—fix typos, improve code clarity, or clean up whitespace
50+
- **Contribute features**: See [adding new features](doc/NEW_FEATURES.md)
51+
52+
## Pull Request Guidelines
53+
54+
See [doc/PULL_REQUESTS.md](doc/PULL_REQUESTS.md) for detailed guidelines.
55+
56+
## Community and Support
57+
58+
Community involvement is vital to both projects:
59+
60+
- **Answer questions**: Help others on the [issue tracker](https://github.com/ruby/rubygems/issues) or [Stack Overflow](https://stackoverflow.com/questions/tagged/bundler) (questions about RubyGems, Bundler, and Ruby in general are welcome)
61+
- **Share knowledge**: Write blog posts, create examples, make videos, or share your experiences
62+
- **Improve documentation**: Suggest improvements to [bundler.io](https://bundler.io) via issues or pull requests on the [bundler-site](https://github.com/rubygems/bundler-site) repository
63+
64+
## Supporting the Projects
65+
66+
Both RubyGems and Bundler are managed by [Ruby Central](https://rubycentral.org), a non-profit organization supporting the Ruby community through projects like these, as well as [RubyConf](https://rubyconf.org) and [RubyGems.org](https://rubygems.org).
67+
68+
You can support Ruby Central by:
69+
70+
- Attending or [sponsoring](mailto:sponsors@rubycentral.org) a conference
71+
- [Joining as a supporting member](https://rubycentral.org/#/portal/signup)

Manifest.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,8 @@ bundler/lib/bundler/vlad.rb
352352
bundler/lib/bundler/worker.rb
353353
bundler/lib/bundler/yaml_serializer.rb
354354
doc/MAINTAINERS.txt
355+
doc/POLICIES.md
355356
doc/UPGRADING.md
356-
doc/rubygems/CONTRIBUTING.md
357-
doc/rubygems/POLICIES.md
358357
exe/gem
359358
exe/update_rubygems
360359
hide_lib_for_update/note.txt

Rakefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,9 @@ RDoc::Task.new rdoc: "docs", clobber_rdoc: "clobber_docs" do |doc|
9393
doc.title = "RubyGems #{v} API Documentation"
9494

9595
rdoc_files = Rake::FileList.new %w[lib bundler/lib]
96-
rdoc_files.add %w[CHANGELOG.md LICENSE.txt MIT.txt CODE_OF_CONDUCT.md doc/rubygems/CONTRIBUTING.md
97-
doc/MAINTAINERS.txt Manifest.txt doc/rubygems/POLICIES.md README.md doc/UPGRADING.md bundler/CHANGELOG.md
98-
doc/bundler/contributing/README.md bundler/LICENSE.md bundler/README.md
99-
hide_lib_for_update/note.txt].map(&:freeze)
96+
rdoc_files.add %w[CHANGELOG.md LICENSE.txt MIT.txt CODE_OF_CONDUCT.md CONTRIBUTING.md
97+
doc/MAINTAINERS.txt Manifest.txt doc/POLICIES.md README.md doc/UPGRADING.md bundler/CHANGELOG.md
98+
bundler/LICENSE.md bundler/README.md hide_lib_for_update/note.txt].map(&:freeze)
10099

101100
doc.rdoc_files = rdoc_files
102101

@@ -485,8 +484,7 @@ module Rubygems
485484
%w[
486485
doc/MAINTAINERS.txt
487486
doc/UPGRADING.md
488-
doc/rubygems/CONTRIBUTING.md
489-
doc/rubygems/POLICIES.md
487+
doc/POLICIES.md
490488
].each {|f| files << f }
491489

492490
files.sort

bundler/README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,15 @@ bundle exec rspec
2727

2828
See [bundler.io](https://bundler.io) for the full documentation.
2929

30-
## Troubleshooting
30+
## Getting help
3131

32-
For help with common problems, see [TROUBLESHOOTING](../doc/bundler/TROUBLESHOOTING.md).
32+
For help with common problems, see [TROUBLESHOOTING](../doc/TROUBLESHOOTING.md).
3333

3434
Still stuck? Try [filing an issue](https://github.com/ruby/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md).
3535

36-
## Other questions
37-
38-
To see what has changed in recent versions of Bundler, see the [CHANGELOG](CHANGELOG.md).
39-
40-
To get in touch with the Bundler core team and other Bundler users, please join [the Bundler slack](https://join.slack.com/t/bundler/shared_invite/zt-1rrsuuv3m-OmXKWQf8K6iSla4~F1DBjQ).
41-
4236
## Contributing
4337

44-
If you'd like to contribute to Bundler, that's awesome, and we <3 you. We've put together [the Bundler contributor guide](https://github.com/ruby/rubygems/blob/master/doc/bundler/contributing/README.md) with all of the information you need to get started.
45-
46-
If you'd like to request a substantial change to Bundler or its documentation, refer to the [Bundler RFC process](https://github.com/rubygems/rfcs) for more information.
38+
If you'd like to contribute to Bundler, that's awesome, and we <3 you. We've put together [contributor guide](https://github.com/ruby/rubygems/blob/master/CONTRIBUTING.md) with all of the information you need to get started.
4739

4840
## Supporting
4941

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Debugging Bundler can be challenging, don't be discouraged 🤗.
44

5-
Make sure you've followed the [development setup](SETUP.md) docs before trying to debug.
5+
Make sure you've followed the [development setup](GETTING_STARTED.md) docs before trying to debug.
66

77
## Print debugging
88

@@ -50,7 +50,7 @@ RUBYOPT=-rpry-byebug dbundle # for pry-byebug
5050
5151
### Local setup
5252

53-
The easiest way to test locally is to set up a directory with a Gemfile and run your Bundler shell alias (see the [development setup](SETUP.md) docs for instructions on setting up the alias).
53+
The easiest way to test locally is to set up a directory with a Gemfile and run your Bundler shell alias (see the [development setup](GETTING_STARTED.md) docs for instructions on setting up the alias).
5454

5555
We recommend putting this directory inside of `tmp` so that your local tests don't accidentally get committed.
5656

doc/DOCUMENTATION.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Documentation
2+
3+
Code needs explanation, and sometimes those who know the code well have trouble explaining it to someone just getting into it. We welcome documentation suggestions and patches from everyone, especially from those new to RubyGems or Bundler.
4+
5+
This repository contains documentation for both RubyGems and Bundler. We have multiple documentation sources depending on what you're documenting:
6+
7+
## RubyGems Documentation
8+
9+
**RubyGems guides**: https://guides.rubygems.org/
10+
11+
For RubyGems documentation contributions:
12+
- Submit issues or pull requests to the [RubyGems Guides repository](https://github.com/rubygems/guides)
13+
- This covers topics like gem creation, publishing, versioning, and best practices
14+
15+
## Bundler Documentation
16+
17+
**Bundler help & man pages**: Built into the `bundler/` directory
18+
19+
**Bundler documentation site**: https://bundler.io
20+
21+
For Bundler documentation contributions:
22+
- **Command documentation** (ex: `bundle clean`): Contribute to man pages in this repository (`bundler/lib/bundler/man/`)
23+
- **Guides and tutorials** (ex: "Using Bundler with Rails"): Open an issue or pull request in the [bundler-site](https://github.com/rubygems/bundler-site) repository
24+
- **Using Bundler with gems**: Additional documentation on [RubyGems guides](https://guides.rubygems.org/)
25+
26+
## Documentation Vision and Goals
27+
28+
### RubyGems
29+
30+
RubyGems documentation focuses on:
31+
- Gem creation, packaging, and publishing
32+
- Dependency management best practices
33+
- Version constraints and semantic versioning
34+
- Security and trust topics
35+
36+
Goals are to provide guides and tutorials at https://guides.rubygems.org/ that help users understand and effectively use RubyGems.
37+
38+
### Bundler
39+
40+
Bundler documentation is split across multiple places:
41+
42+
1. Built-in `help` (including usage information and man pages)
43+
2. [Bundler documentation site](https://bundler.io)
44+
3. [RubyGems guides](https://guides.rubygems.org/) (for gem publishing topics)
45+
46+
Bundler documentation should provide users with assistance:
47+
48+
1. Installing Bundler
49+
2. Using Bundler to manage an application's dependencies
50+
3. Using Bundler to create, package, and publish gems
51+
52+
Our goal is to provide three types of documentation:
53+
54+
* High-level overviews that provide topical guidance
55+
* Step-by-step tutorials
56+
* Command-specific reference material for the CLI
57+
58+
Additionally, this documentation should be readily available in a logical place and easy to follow.
59+
60+
Someday, we'd like to create deep-dive reference material about the inner workings of Bundler. However, while this is part of our overall vision, it is not the focus of our current work.
61+
62+
## Writing RubyGems Documentation
63+
64+
### Contributing to RubyGems guides
65+
66+
To contribute to RubyGems documentation:
67+
68+
1. Fork and clone the [rubygems/guides](https://github.com/rubygems/guides) repository
69+
2. Add or edit Markdown files in the `_pages/` directory
70+
3. Follow the existing format and style guidelines
71+
4. Submit a pull request with your changes
72+
73+
See the [RubyGems Guides repository](https://github.com/rubygems/guides) for detailed contribution instructions.
74+
75+
## Writing Bundler Documentation
76+
77+
### Writing docs for man pages
78+
79+
*Any commands or file paths in this document assume that you are inside [the bundler/ directory of the ruby/rubygems repository](https://github.com/ruby/rubygems/tree/master/bundler).*
80+
81+
A primary source of help for Bundler users are the man pages: the output printed when you run `bundle help` (or `bundler help`). These pages can be a little tricky to format and preview, but are pretty straightforward once you get the hang of it.
82+
83+
_Note: `bundler` and `bundle` may be used interchangeably in the CLI. This guide uses `bundle` because it's cuter._
84+
85+
### What goes in man pages?
86+
87+
We use man pages for Bundler commands used in the CLI (command line interface). They can vary in length from large (see `bundle install`) to very short (see `bundle clean`).
88+
89+
To see a list of commands available in the Bundler CLI, type:
90+
91+
$ bundle help
92+
93+
Our goal is to have a man page for every command.
94+
95+
Don't see a man page for a command? Make a new page and send us a PR! We also welcome edits to existing pages.
96+
97+
### Creating a new man page
98+
99+
To create a new man page, simply create a new `.ronn` file in the `lib/bundler/man/` directory.
100+
101+
For example: to create a man page for the command `bundle cookies` (not a real command, sadly), I would create a file `lib/bundler/man/bundle-cookies.1.ronn` and add my documentation there.
102+
103+
### Formatting
104+
105+
Our man pages use ronn formatting, a combination of Markdown and standard man page conventions. It can be a little weird getting used to it at first, especially if you've used Markdown a lot.
106+
107+
[The ronn guide formatting guide](https://rtomayko.github.io/ronn/ronn.7.html) provides a good overview of the common types of formatting.
108+
109+
In general, make your page look like the other pages: utilize sections like `##OPTIONS` and formatting like code blocks and definition lists where appropriate.
110+
111+
If you're not sure if the formatting looks right, that's ok! Make a pull request with what you've got and we'll take a peek.
112+
113+
### Previewing
114+
115+
To preview your changes as they will print out for Bundler users, you'll need to run a series of commands:
116+
117+
```
118+
$ bin/rake dev:deps
119+
$ bin/rake man:build
120+
$ man ./lib/bundler/man/bundle-cookies.1
121+
```
122+
123+
If you make more changes to `bundle-cookies.1.ronn`, you'll need to run the `bin/rake man:build` again before previewing.
124+
125+
### Testing
126+
127+
We have tests for our documentation! The most important test file to run before you make your pull request is the one for the `help` command and another for documentation quality.
128+
129+
```
130+
$ bin/rspec ./spec/commands/help_spec.rb
131+
$ bin/rspec ./spec/quality_spec.rb
132+
```
133+
134+
## Writing docs for [the Bundler documentation site](https://bundler.io)
135+
136+
### Primary commands and utilities
137+
138+
If you'd like to submit a pull request for any of the primary commands or utilities on [the Bundler documentation site](https://bundler.io), please follow the instructions above for writing documentation for man pages from the `ruby/rubygems` repository. They are the same in each case.
139+
140+
**Note**: Editing `.ronn` files from the `ruby/rubygems` repository for the primary commands and utilities documentation is all you need 🎉. There is no need to manually change anything in the `rubygems/bundler-site` repository, because the man pages and the docs for primary commands and utilities on [the Bundler documentation site](https://bundler.io) are one in the same. They are generated automatically from the `ruby/rubygems` repository's `.ronn` files when you run `bin/rake man:build`.
141+
142+
### Guides and tutorials
143+
144+
To add a guide or tutorial to the [Bundler documentation site](https://bundler.io):
145+
146+
1. Go to the [bundler-site](https://github.com/rubygems/bundler-site) repository
147+
2. Navigate to `/bundler-site/source/current_version_of_bundler/guides`
148+
3. Add a new [Markdown file](https://guides.github.com/features/mastering-markdown/) (ending in `.md`)
149+
4. Format the title correctly:
150+
```
151+
---
152+
title: Your Guide Title Here
153+
---
154+
```
155+
5. Submit a pull request with your changes

0 commit comments

Comments
 (0)