sonic-pi
https://github.com/sonic-pi-net/sonic-pi
C++
Code. Music. Live.
Enumerable#index_by
Convert an enumerable to a hash.
people.index_by(&:login)
=> { "nextangle" => <Person ...>, "chade-" => <Person ...>, ...}
people.index_by { |person| "#{person.first_name} #{person.last_name}" }
=> { "Chade- Fowlersburg-e" => <Person ...>, "David Heinemeier Hansson" => <Person ...>, ...}Edit
git clone [email protected]:sonic-pi-net/sonic-pi.git
cd sonic-pi
open app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/core_ext/enumerable.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Enumerable-index_by-for-pr
# Commit to gitgit add app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/core_ext/enumerable.rbgit commit -m "better docs for Enumerable#index_by"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Enumerable-index_by-for-pr
hub pull-request
# Celebrate!