Project

trinkets

0.0
There's a lot of open issues
Truly outrageous bootleg facets in your trinkets box.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.0
~> 0.22.0
 Project Readme

Trinkets

It's the bootleg facets.

Installation

RubyGems

gem install trinkets

Bundler

gem 'trinkets', require: false

Usage

The 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 explicit extend or include;
  • patch : As implicit include or extend, a.k.a. monkey-patching.

Refinement

require 'trinkets/class/init'

using ::Trinkets::Class::Init

The refine subdirectory is the default, and it can be omitted from require. The above is the same as:

require 'trinkets/refine/class/init'

Extend / Include

require 'trinkets/extend/class/init'

class Test
  extend ::Trinkets::Class::Init
end
require 'trinkets/include/enumerable/each_with_hash'

class Test
  include Enumerable
  include ::Trinkets::Enumerable::WithHash
end

Mokey Patching

require 'trinkets/patch/class/init'

Available modules

Trinket
class/init
enumerable/each_with_hash

Versioning

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.

Contributing

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.

License

The gem is available as open source under the terms of the MIT License.