New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

exercise_options

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exercise_options

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

ExerciseOptions

An experimental gem for making amendments to upstream dependencies.

This project came about when I was working with Samvera's Actor Stack and needed to add additional variables to a few different classes.

Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add exercise_options

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install exercise_options

Usage

class MyObject
  def initialize(name:)
    self.name = name
  end
  attr_accessor :name
end

MyObject.prepend(
  ExerciseOptions.for(
    default_is_true: true,
    conditionally_true_with_receiver: ->(obj) { obj.name == "Hello World" },
  )
)

obj = MyObject.new(name: "Nobody")
expect(obj.default_is_true).to be_truthy
expect(obj.conditionally_true_with_receiver).to be_falsey


next_object = MyObject.new(name: "Hello World", default_is_true: false)
expect(next_object.default_is_true).to be_falsey
expect(next_object.conditionally_true_with_receiver).to be_truthy

Development

Let's see if this thing make sense?

FAQs

Package last updated on 21 Sep 2022

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc