Skip to content

Commit bf9ca19

Browse files
committed
Update README and CHANGELOG
[ci skip]
1 parent 47ff2b3 commit bf9ca19

File tree

2 files changed

+52
-25
lines changed

2 files changed

+52
-25
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Features
6+
7+
* Allow users to customize colors. ([#107], [042e8ec])
8+
9+
### Bug fixes
10+
11+
* Resolve compatibility issues with RSpec 3.10. ([#114])
12+
* Fix diffs involving `contain_exactly` and `a_collection_containing_exactly`
13+
so that if there are extra items in the actual value,
14+
they are shown with `+`s. ([#106])
15+
* Fix reliability issues with CI.
16+
* Fix `rake spec` so that it works when run locally again.
17+
18+
[#107]: https://github.com/mcmire/super_diff/pull/107
19+
[042e8ec]: https://github.com/mcmire/super_diff/commit/042e8ecda282cd8a3d436b3bf2c0aded76187db2
20+
[#114]: https://github.com/mcmire/super_diff/pull/114
21+
[#106]: https://github.com/mcmire/super_diff/pull/106
22+
323
## 0.5.3 - 2020-12-21
424

525
### Bug fixes

README.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -155,34 +155,47 @@ require "super_diff/rspec"
155155

156156
## Configuration
157157

158-
### Custom colors
158+
You can customize the behavior of the gem
159+
by adding a configuration block
160+
to your test helper file
161+
(`rails_helper` or `spec_helper`)
162+
which looks something like this:
159163

160-
If you want to use something other than the default colors, you can
161-
configure them by adding them to your test helper file
162-
(`rails_helper` or `spec_helper`):
164+
``` ruby
165+
SuperDiff.configure do |config|
166+
# ...
167+
end
168+
```
169+
170+
### Customizing colors
171+
172+
If you don't like the colors that SuperDiff uses,
173+
you can change them like this:
163174

164175
``` ruby
165176
SuperDiff.configure do |config|
166-
config.set_actual_color(:green)
167-
config.set_expected_color(:red)
168-
config.set_border_color(:yellow)
169-
config.set_header_color(:yellow)
177+
config.actual_color = :green
178+
config.expected_color = :red
179+
config.border_color = :yellow
180+
config.header_color = :yellow
170181
end
171182
```
172183

173-
See [eight_bit_color.rb](lib/super_diff/csi/eight_bit_color.rb) for the list
174-
of available colors.
184+
See [eight_bit_color.rb](lib/super_diff/csi/eight_bit_color.rb)
185+
for the list of available colors.
175186

176187
### Diffing custom objects
177188

178-
As capable as this library is,
179-
it doesn't know how to deal with every kind of object out there.
180-
If you have a custom class,
181-
and instances of your class aren't appearing in diffs like you like,
182-
you might find it necessary to instruct the gem on how to handle them.
183-
In that case
184-
you would add something like this to your test helper file
185-
(`rails_helper` or `spec_helper`):
189+
If you are comparing two data structures
190+
that involve a class that is specific to your project,
191+
the resulting diff may not look as good as diffs involving native or primitive objects.
192+
This happens because if SuperDiff doesn't recognize a class,
193+
it will fall back to a generic representation when diffing instances of that class.
194+
Fortunately, the gem has a pluggable interface
195+
that allows you to insert your own implementations
196+
of key pieces involved in the diffing process.
197+
I'll have more about how that works soon,
198+
but here is what such a configuration would look like:
186199

187200
``` ruby
188201
SuperDiff.configure do |config|
@@ -193,12 +206,6 @@ SuperDiff.configure do |config|
193206
end
194207
```
195208

196-
*(More info here in the future on adding a custom differ,
197-
operation tree builder,
198-
operation tree,
199-
and diff formatter.
200-
Also explanations on what these are.)*
201-
202209
## Support
203210

204211
My goal for this library is to improve your development experience.
@@ -252,5 +259,5 @@ Thank you to the authors of these libraries!
252259

253260
## Author/License
254261

255-
`super_diff` was created and is maintained by Elliot Winkler.
262+
SuperDiff was created and is maintained by Elliot Winkler.
256263
It is released under the [MIT license](LICENSE).

0 commit comments

Comments
 (0)