From: David Chelimsky Date: 2008-07-23T14:30:01+09:00 Subject: Re: Is there a simple way to find a method definition? If you're on a mac and using TextMate, you can use http://gerd.knops.org/files/CTags.tmbundle.zip - it's pretty sweet - once installed you can type a command to index a project and then another command to search for the definition of any method the cursor is on. HTH, David On Tue, Jul 22, 2008 at 11:59 PM, Ruby Freak wrote: > Hi, > This example is specific to rspec and rails, but the question is > generic to ruby. > How do I find a method definition short of grep "def > some_method_name"? > > Here is an example. I did a simple script/generate rspec_scaffold page > title:string body:text > and got a bunch of pre-generated specs. Very nice, now I am going > through this to try and understand the code. I need to find mock_model > so I can look at it (just an example) > > def mock_page(stubs={}) > @mock_page ||= mock_model(Page, stubs) > end > > Is there a simple tool/procedure to find def mock_model ? (or def > some_method_name) > > Thanks in advance > >