sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

Range#include_with_range?

Extends the default Range#include? to support range comparisons.
 (1..5).include?(1..5) # => true
 (1..5).include?(2..3) # => true
 (1..5).include?(2..6) # => false

The native Range#include? behavior is untouched.
 ('a'..'f').include?('c') # => true
 (5..9).include?(11) # => false

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/activesupport/lib/active_support/core_ext/range/include_range.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Range-include_with_range--for-pr


# Commit to git

git add app/server/ruby/vendor/activesupport/lib/active_support/core_ext/range/include_range.rbgit commit -m "better docs for Range#include_with_range?"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Range-include_with_range--for-pr

hub pull-request


# Celebrate!