IDE vs. editor

Interesting thread.

Naive idea: Maybe add a hook into eval that will
warn about a failed refactoring before calling a
method. And/or modify method_missing.

Wow, couldn’t that get hairy?

Probably the best way is to document the RenameMethod
by saying: This may fail if your code ever builds the
method name and calls it.

Hal

···

----- Original Message -----
From: “Ryan King” rking@panoptic.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Monday, August 19, 2002 1:40 PM
Subject: RenameMethod refactoring (Was: Re: IDE vs. editor)

On 2002.08.20, Mauricio Fern?ndez batsman.geo@yahoo.com wrote:

[regarding a mechanical “RenameMethod” refactoring for ruby]:
I believe a parser wouldn’t be enough:

Agreed: a simple parser wouldn’t be enough. “eval” is one of
many examples where it’s non-trivial to discover the correct type
of a Ruby object from source.

The original Smalltalkers dealt with this problem in a simple
way: Just substitute textually, prompting the user with the list
of effected lines.

To my knowledge, no one has ever written a more effective
RenameMethod for a dynamically typed language. Probably the
80/20 rule in effect.

Way kewl that will come in handy. And thanks for the sources.

Carl P.

See VimExtensions on the Ruby Garden wiki (if you don’t know where that is, me
neither; I use rubycentral.com as a link repository).

You’ll find a few tricks there. Also search for “ruby” at www.vim.org.

Finally, put this in your {.vim/vimfiles}/ftplugin/ruby:

imap end-cc

Then type
def fun(x) ( is shift-carriage_return)

and you’ll see

def fun(x)
[cursor]
end

That of course can be used with for, if, class, begin, …

If you don’t understand any of this or the above trick doesn’t seem to work,
drop me an email.

Cheers,
Gavin
'd be more than

···

On Sun, 2002-08-18 at 17:14, Gavin Sinclair wrote:

willing to create it. The only problem is I don’t know it already.;

Carl P.

^^^^^^^^^^^^^^^^
It’s IMHO the only affordable way to do it: having method_missing check
if a method of the corresponding class has been renamed, call it by its
new name and annotate the place in the source code where this happened.

···

On Tue, Aug 20, 2002 at 03:45:47AM +0900, Hal E. Fulton wrote:

Naive idea: Maybe add a hook into eval that will
warn about a failed refactoring before calling a
method. And/or modify method_missing.
–
_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

The only other people who might benefit from Linux8086 would be owners
of PDP/11’s and other roomsized computers from the same era.
– Alan Cox