Whynot
Why not?
Installation
Add this line to your application's Gemfile:
gem 'whynot'
And then execute:
$ bundle
Or install it yourself as:
$ gem install whynot
Usage
require 'whynot'
Then you can become less confident about your code working. Whynot adds
Kernel#maybe, which takes a block, like so:
maybe do |x,y|
x,y = 1,2
x+y
end
Sometimes it'll return 3, and sometimes nil. Because, why not?
If you would like your code to mostly or occasionally work, you use
Kernel#mostly and Kernel#occasionally, respectively.
Contributing
- Fork it ( https://github.com/[my-github-username]/whynot/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request