Quality Ruby Extensions
- Project site:
- Gem install:
gem install quality_extensions
Tyler Rick <github.com|tylerrick.com> and others
QualityExtensions is a library of general-purpose, reusable methods/classes that are compatible with/built-upon Facets but not (yet) included in Facets… including FileTest.binary_file?, String#digits_only, send_if_not_nil, send_if_true, send_unless, Kernel#capture_output, Kernel#backtrace, Symbol#=~, Hash#hash_select, Hash#delete_unless, Array#expand_ranges, assert_changed, assert_contains, and many more.
It is similar in purpose and layout to Ruby Facets but not intended compete with Facets.
If the code you are needing hasn't already been written by someone else, then you can throw it in this library. Also submit it to an existing extensions project if you think it's any good.
Like Facets, this library contains:
methods that add functionality to existing Ruby classes (String, Array, etc.)
as well as new classes that aren't in core Ruby
gem install quality_extensions -y
And then include as much or as little as you want.
Use the handy all.rb files to load everything in a particular directory (and all subdirectories).
To load everything:
To load everything just for one class:
To load just an individual method:
Tests are self-contained within the file for the code that is under test.
To run the tests directly, you need to use the exrb command that is part of the Ratchets project.
At some point in time, we may extract them into separate files using the Exacto test extractor tool.