Ruby Methodfinder Is Still Alive

- ruby

One thing I always liked about Smalltalk was the “Method Finder” available in several of its dialects. The following screenshot shows the version included in Pharo as an example:

Pharo Method Finder

Essentially, this offers two different featues:

  1. Search for a method by (partial) name.
  2. Search for a method by example. By inputting a receiver, arguments (optional) and the expected result, one could find all methods that provide this functionality.

In early 2009 I had started teaching courses at RubyLearning, and in 2011 it dawned on me that a Ruby version of Method Finder would not only be useful to our students, but also rather easy to implement. So I got hacking, and about an hour later I had a first working prototype which I eventually released as a gem (source). Feedback was enthusiastic, here are some of my favorite tweets from back then:

Over the years I and various contributors added some more features (like method blacklists, playing nicely with Pry, debugging etc.), but there was very little active development.

However, this past weekend I had the opportunity to speak at Ruby X Elixir Conf Taiwan, where I had a very engaging discussion about using Ruby in teaching after my talk. This rekindled my interest in MethodFinder and in the past 3 days the following happened:

  1. A major code cleanup which was long overdue (not quite done, but it was a good start).
  2. A new debugging implementation, which is not only more intuitive to use (IMHO of course), but also fixes a bug with hash arguments.

Gem version 2.2.1 was released today (I had to yank 2.2.0, don’t ask), and I have several more ideas for future improvements. I’d eventually also like to add some sort of UI, contact me if you are interested in helping out with that!

tl;dr: Conferences and FOSS are great, do more of both of them if you can :)