Socket
Book a DemoInstallSign in
Socket

trinkets

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trinkets

0.5.0
bundlerRubygems
Version published
Maintainers
2
Created
Source

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.

FAQs

Package last updated on 11 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.