Inspired by https://github.com/jashmenn/boyermoore
BoyerMoore is the fastest substring search strategy.
Add this line to your application's Gemfile:
gem 'boyer_moore'
And then execute:
$ bundle
Or install it yourself as:
$ gem install boyer_moore
BoyerMoore.search("foobar", "bar") # => 3
BoyerMoore.search("foobar", "oof") # => nil
BoyerMoore.search("foobar", "foo") # => 0