Project

ennui

0.0
No commit activity in last 3 years
No release in over 3 years
Ennui provides a library of predicates which return true at various frequencies.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

Ennui

Build Status Code Climate

A gem for when you just don't care what gets executed

Ennui provides a library of predicates which return true at various frequencies. These predicates are useful when you wish to introduce a bit of randomness or apathy to your view elements, for example.

Installing

[sudo] gem install ennui

Usage

Ennui has both predicate methods and block methods to support just the unpredictable DSL you're looking for

require 'ennui'
include Ennui

sometimes do
  redirect_user_to_nsfw_site
end

Ennui works great as a mixin, too

class Account
  def withdraw(dollar_amount)
    ...
    apply_mysterious_surcharge if sometimes?
    ...  
  end
end

Contributing

If you'd like to contribute to this project, fork this repo, make your changes, fixes, or additions, then send a pull request.