JEG2/highline — pull request #92 by johnl (2013-07-29 09:33:18+00:00)
Title: Improve performance of StringExtensions

StringExtensions.included checks to see if some methods are defined
in a very inefficient manner.

This commit rewrites it to use method_defined?, avoiding tens of
thousands of calls to Symbol#to_s and String#== when requiring
highline (and fixes #91).

Tbh, the code in StringExtensions does seem a bit crufty overall, but I
didn't want to get bogged down.

The test suite still runs fine, and does seem to test this code, but I
must admit to not being very familar with these methods and haven't done
any manual testing of my own. It'd be good if someone could review this
more closely.