pry/pry — pull request #358 by KL-7 (2011-11-30 00:14:39+00:00)
Title: Fix for #357. The easy way.

There first problem here is that sinatra generates horrible method names like `'GET /'` for its routes. When pry tries to use it as symbol [here](https://github.com/pry/pry/blob/28560c0d73461f783405c33ae0f17462d2e2e28a/lib/pry/method.rb#L52) it fails.

Passing method name as `String` instead of `Symbol` doesn't solve the problem and leads to another exception. The reason is that sinatra uses unbounded methods that are removed from class right after being defined. You can see it in [`Sinatra::Base#generate_method`](https://github.com/sinatra/sinatra/blob/master/lib/sinatra/base.rb#L1186) or in [this gist](https://gist.github.com/1407204) that does pretty much the same stuff. And for that kind of methods `binding.eval("method('some_method')")` raises `NameError` exception.

Bypassing method lookup and fetching only method name in `whereami` command makes `binding.pry` working fine inside sinatra route methods, but I think it'd better to update `Pry::Method.from_binding` in order to support that kind of methods as well. I spent some time trying to get method object from corresponding `Binding` object, but without any luck. May be someone can help me with that?