Skip to content

Commit 5da1895

Browse files
committed
Update docs
* Update README for consistency across all shoulda-* gems * Add MAINTAINING * Drop CONTRIBUTING document since this gem is more or less deprecated [ci skip]
1 parent eff9fdd commit 5da1895

4 files changed

Lines changed: 133 additions & 63 deletions

File tree

CONTRIBUTING.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

MIT-LICENSE renamed to LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2006-2020, Tammer Saleh and thoughtbot, inc.
1+
Copyright (c) 2006-2020 Tammer Saleh and thoughtbot, inc.
22

33
Permission is hereby granted, free of charge, to any person
44
obtaining a copy of this software and associated documentation

MAINTAINING.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Maintaining Shoulda Context
2+
3+
Although Shoulda Context doesn't receive feature updates these days, you may
4+
need to update the gem for new versions of Ruby or Rails. Here's what you need
5+
to know in order to do that.
6+
7+
## Getting started
8+
9+
First, run the setup script:
10+
11+
bin/setup
12+
13+
Then run all the tests to make sure everything is green:
14+
15+
bundle exec rake
16+
17+
## Running tests
18+
19+
This project uses Minitest for tests and Appraisal to create environments
20+
attuned for different versions of Rails. To run a single test in a single test
21+
file, you will need to use a combination of Appraisal and the [`m`][m] gem. For
22+
instance:
23+
24+
[m]: https://github.com/qrush/m
25+
26+
bundle exec appraisal rails_6_0 m test/shoulda/context_test.rb:39
27+
28+
## Updating the changelog
29+
30+
After every user-facing change makes it into master, we make a note of it in the
31+
changelog, kept in `CHANGELOG.md`. The changelog is sorted in reverse order by
32+
release version, with the topmost version as the next release (tagged as
33+
"(Unreleased)").
34+
35+
Within each version, there are five available categories you can divide changes
36+
into. They are all optional but they should appear in this order:
37+
38+
1. Backward-compatible changes
39+
1. Deprecations
40+
1. Bug fixes
41+
1. Features
42+
1. Improvements
43+
44+
Within each category section, the changes relevant to that category are listed
45+
in chronological order.
46+
47+
For each change, provide a human-readable description of the change as well as a
48+
linked reference to the PR where that change emerged (or the commit ID if no
49+
such PR is available). This helps users cross-reference changes if they need to.
50+
51+
## Versioning
52+
53+
### Naming a new version
54+
55+
As designated in the README, we follow [SemVer 2.0][semver]. This offers a
56+
meaningful baseline for deciding how to name versions. Generally speaking:
57+
58+
[semver]: https://semver.org/spec/v2.0.0.html
59+
60+
* We bump the "major" part of the version if we're introducing
61+
backward-incompatible changes (e.g. changing the API or core behavior,
62+
removing parts of the API, or dropping support for a version of Ruby).
63+
* We bump the "minor" part if we're adding a new feature (e.g. adding a new
64+
matcher or adding a new qualifier to a matcher).
65+
* We bump the "patch" part if we're merely including bugfixes.
66+
67+
In addition to major, minor, and patch levels, you can also append a
68+
suffix to the version for pre-release versions. We usually use this to issue
69+
release candidates prior to an actual release. A version number in this case
70+
might look like `4.0.0.rc1`.
71+
72+
### Preparing and releasing a new version
73+
74+
In order to release any versions at all, you will need to have been added as
75+
an owner of the Ruby gem. If you want to give someone else these permissions,
76+
then run:
77+
78+
```bash
79+
gem owner shoulda-context -a <email address>
80+
```
81+
82+
Assuming you have permission to publish a new version to RubyGems, then this is
83+
how you release a version:
84+
85+
1. First, you'll want to [make sure that the changelog is up to
86+
date](#updating-the-changelog).
87+
88+
2. Next, you'll want to update the `VERSION` constant in
89+
`lib/shoulda/context/version.rb`. This constant is referenced in the
90+
gemspec and is used in the Rake tasks to publish the gem on RubyGems.
91+
92+
3. Assuming that everything looks good, place your changes to the changelog,
93+
`version.rb`, and README in their own commit titled "Bump version to
94+
*X.Y.Z*". Push this to GitHub (you can use `[ci skip]`) in the body of the
95+
commit message to skip CI for this commit if you so choose). **There is no
96+
going back after this point!**
97+
98+
6. Once GitHub has the version-change commit, you will run:
99+
100+
```bash
101+
rake release
102+
```
103+
104+
This will push the gem to RubyGems and make it available for download.

README.md

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ fully compatible with your existing tests and requires no retooling to use.
2020
[rubydocs]: http://rubydoc.info/github/thoughtbot/shoulda-context/master/frames
2121
[changelog]: CHANGELOG.md
2222

23-
## Usage
23+
[shoulda-matchers]: https://github.com/thoughtbot/shoulda-matchers
24+
[minitest_matchers-vaccine]: https://github.com/rmm5t/minitest-matchers_vaccine
25+
26+
## Overview
2427

2528
Instead of writing Ruby methods with `lots_of_underscores`, Shoulda Context lets
2629
you name your tests and group them together using English.
@@ -138,41 +141,42 @@ may be of use:
138141
* `assert_reject` — what `should_not` uses internally; asserts that a matcher
139142
object does not match against a value
140143

141-
## Note on running tests
144+
## Compatibility
142145

143-
Normally, you will run a single test like this:
146+
Shoulda Context is [tested][travis] and supported against Ruby 2.4+, Rails 4.2+,
147+
Minitest 4.x, and Test::Unit 3.x.
144148

145-
ruby -I lib -I test path_to_test.rb -n name_of_test_method
149+
## Versioning
146150

147-
When using Shoulda Context, however, you'll need to put a space after the test
148-
name:
151+
Shoulda Context follows Semantic Versioning 2.0 as defined at
152+
<http://semver.org>.
149153

150-
ruby -I lib -I test path_to_test.rb -n "test_: a calculator should add two numbers for the sum. "
154+
## Team
151155

152-
If this is too cumbersome, consider using the [m] gem to run tests instead:
156+
Shoulda Context is maintained by [Elliot Winkler][mcmire]. It was previously
157+
maintained by [Travis Jeffery][travisjeffery].
153158

154-
m path_to_test.rb:39
159+
[mcmire]: https://github.com/mcmire
160+
[travisjeffery]: https://github.com/travisjeffery
155161

156-
[m]: https://github.com/qrush/m
162+
## Copyright/License
157163

158-
## Compatibility
164+
Shoulda Context is copyright © 2006-2020 Tammer Saleh and [thoughtbot,
165+
inc][thoughtbot-website]. It is free and opensource software and may be
166+
redistributed under the terms specified in the [LICENSE](LICENSE) file.
159167

160-
Shoulda Context is tested and supported against Rails 4.x+, Minitest 4.x,
161-
Test::Unit 3.x, and Ruby 2.4+.
168+
[thoughtbot-website]: https://thoughtbot.com
162169

163-
## Credits
170+
## About thoughtbot
164171

165-
Shoulda Context is maintained by [Elliot Winkler][elliot-winkler], [Travis
166-
Jeffery][travis-jeffery], and thoughtbot. Thank you to all the [contributors].
172+
![thoughtbot][thoughtbot-logo]
167173

168-
[elliot-winkler]: https://github.com/mcmire
169-
[travis-jeffery]: https://github.com/travisjeffery
170-
[contributors]: https://github.com/thoughtbot/shoulda-context/contributors
174+
[thoughtbot-logo]: https://presskit.thoughtbot.com/images/thoughtbot-logo-for-readmes.svg
171175

172-
## License
176+
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
173177

174-
Shoulda Context is copyright © 2006-2020 [thoughtbot, inc][thoughtbot-website].
175-
It is free software, and may be redistributed under the terms specified in the
176-
[MIT-LICENSE](MIT-LICENSE) file.
178+
We are passionate about open source software. See [our other
179+
projects][community]. We are [available for hire][hire].
177180

178-
[thoughtbot-website]: https://thoughtbot.com
181+
[community]: https://thoughtbot.com/community?utm_source=github
182+
[hire]: https://thoughtbot.com?utm_source=github

0 commit comments

Comments
 (0)