Ruby includes a huge amount of default awesomeness that tackles most common development challenges. But every now and then, you find yourself performing contortions to achieve results that, honestly, should feel more natural given the language's design elegance. Finishing Moves is a collection of methods designed to assist in those "why is this awkward?" scenarios.
In the right situation, they kick serious cyclomatic butt.
Gemfile
gem 'finishing_moves'
Command line
gem install 'finishing_moves'
Not sure if this gem is for you? Check out the methods marked with a 💥 first.
Array#to_hash_values💥Array#to_indexed_hashArray#to_hash_keysArray#to_sym_strictArray#to_sym_looseEnumerable#key_map💥Enumerable#key_map_reduceHash#delete!Hash#delete_eachHash#delete_each!Integer#lengthKernel#nil_chain💥💥Kernel#bool_chainKernel#silentlyKernel#cascadeKernel#class_exists?Numeric#add_percentNumeric#subtract_percentObject#same_asObject#not_nil?Object#numeric?💥Object#is_an?Object#is_not_a?Object#is_one_of?💥Object#true?Object#false?Object#bool?Object#true_?Object#false_?String#dedupeString#keyifyString#slugifyString#nl2brString#newline_toString#remove_whitespaceString#replace_whitespaceString#strip_all💥String#to_uuid- Boolean Typecasting (multi-class enhancement)
Tested against all supported versions of official RVM, currently 3.1 and above.
- Never override default Ruby behavior, only add functionality.
- Follow the Unix philosophy of "Do one job really well."
- Minimize assumptions, e.g. avoid formatting output, mutating values, and conditional logic flows.
- Play nice with major Ruby players like Rake, Rails, and Sinatra.
- Test all the things.
Drop us a line in the issues section.
Be sure to include sample code that reproduces the problem.
- Fork this repo
- Write your tests
- Add your finisher
- Repeat steps 2 and 3 until you see a brilliant luster
- Submit a pull request