It's the bootleg facets.
gem install trinkets
gem 'trinkets', require: falseThe trinkets are loaded with the following structure:
require 'trinkets/{how-to-patch}/{class}/{method}'There are 3 ways to load trinkets, which are represented by the {how-to-patch} portion in the requires:
refine: As refinements;extend/include: As explicitextendorinclude;patch: As implicitincludeorextend, a.k.a. monkey-patching.
require 'trinkets/class/init'
using ::Trinkets::Class::InitThe refine subdirectory is the default, and it can be omitted from require. The above is the same as:
require 'trinkets/refine/class/init'require 'trinkets/extend/class/init'
class Test
extend ::Trinkets::Class::Init
endrequire 'trinkets/include/enumerable/each_with_hash'
class Test
include Enumerable
include ::Trinkets::Enumerable::WithHash
endrequire 'trinkets/patch/class/init'| Trinket |
|---|
| class/init |
| enumerable/each_with_hash |
Versions follow semantic versioning: major.minor.patch
major: breaking changes.minor: improvements and new features that are backwards compatible.patch: backwards compatible fixes to existing features, or documentation improvements.
Steps to include when developing the feature/fix:
- Add or change the appropriate RSpec tests.
- Document the feature.
- Might not apply to fixes if the feature didn't change.
- Bump the version.
- Update the Changelog.
The gem is available as open source under the terms of the MIT License.