Refactoring tool for Ruby... 
Author Message
 Refactoring tool for Ruby...

Just being curious if someone has worked on a refactoring tool for
(and/or 'in') Ruby?

Anyway would anybody be interested (except me) in such a tool?

Stephan



Sat, 01 May 2004 02:21:06 GMT  
 Refactoring tool for Ruby...

Quote:
>Just being curious if someone has worked on a refactoring tool for
>(and/or 'in') Ruby?

>Anyway would anybody be interested (except me) in such a tool?

Seems to me that once these Ruby-in-Ruby projects become usable, especially
the ones that generate ASTs, like Rockit, this won't be very difficult.

Jimmy



Sat, 01 May 2004 03:20:30 GMT  
 Refactoring tool for Ruby...

Quote:

> Seems to me that once these Ruby-in-Ruby projects become usable,
> especially the ones that generate ASTs, like Rockit, this won't be very
> difficult.

...although this will allow implementing nice refactoring methods, we
are still far from a Ruyb refactoring tool. IMHO a refactoring tool only
makes sense in an IDE. Therefore "WE" need to
a) agree on a platform independent GUI-framework (FX,...)
b) build a userfriendly IDE
c) add the follwing features to the IDE:
   - code-browser
   - de{*filter*}
   - refactoring

Have we got a) done?
;-)

Clemens



Mon, 03 May 2004 15:58:45 GMT  
 Refactoring tool for Ruby...

Quote:
> > Seems to me that once these Ruby-in-Ruby projects become usable,
> > especially the ones that generate ASTs, like Rockit, this won't be
very
> > difficult.

> ...although this will allow implementing nice refactoring methods, we
> are still far from a Ruyb refactoring tool. IMHO a refactoring tool
only
> makes sense in an IDE. Therefore "WE" need to
> a) agree on a platform independent GUI-framework (FX,...)

Not simple ...

Quote:
> b) build a userfriendly IDE

There is some stuff which can help on sourceforge :
http://www.*-*-*.com/
http://www.*-*-*.com/
and my own project :
http://www.*-*-*.com/

Quote:
> c) add the follwing features to the IDE:
>    - code-browser
>    - de{*filter*}
>    - refactoring

> Have we got a) done?

Tk will be simpliest choice, but IMHO Gtk would be better.

mips



Mon, 03 May 2004 16:38:56 GMT  
 Refactoring tool for Ruby...

Quote:
> > a) agree on a platform independent GUI-framework (FX,...)

> Not simple ...

> > b) build a userfriendly IDE

> There is some stuff which can help on sourceforge :
> http://www.*-*-*.com/
> http://www.*-*-*.com/
> and my own project :
> http://www.*-*-*.com/

> > c) add the follwing features to the IDE:
> >    - code-browser
> >    - de{*filter*}
> >    - refactoring

> > Have we got a) done?
> Tk will be simpliest choice, but IMHO Gtk would be better.

Why not just build a Ruby plugin for Eclipse (www.eclipse.org)?  You'll get
a lot of stuff for free that way...

David



Tue, 04 May 2004 00:58:05 GMT  
 Refactoring tool for Ruby...


Hi!

Quote:
> Why not just build a Ruby plugin for Eclipse (www.eclipse.org)?  You'll
> get a lot of stuff for free that way...

I will start to write such a plugin this weekend.

Regards
        Jan Arne Petersen

--
JRuby - The Ruby interpreter written in pure Java http://jruby.sf.net



Tue, 04 May 2004 01:49:18 GMT  
 Refactoring tool for Ruby...

Quote:


> > Seems to me that once these Ruby-in-Ruby projects become usable,
> > especially the ones that generate ASTs, like Rockit, this won't be very
> > difficult.

> ....although this will allow implementing nice refactoring methods, we
> are still far from a Ruyb refactoring tool. IMHO a refactoring tool only
> makes sense in an IDE. Therefore "WE" need to
> a) agree on a platform independent GUI-framework (FX,...)
> b) build a userfriendly IDE
> c) add the follwing features to the IDE:
>    - code-browser
>    - de{*filter*}
>    - refactoring

> Have we got a) done?
> ;-)

> Clemens

Is that really true?  The core refactoring capability doesn't have
to have anything to do with an IDE. It could easily be a libray which
is capable of being used on the command line or from a ruby script.
Hmm, maybe we have different ideas re: what  a refactoring tool does.

--
Alan Chen
Digikata LLC

http://www.*-*-*.com/



Tue, 04 May 2004 06:17:44 GMT  
 Refactoring tool for Ruby...

Quote:
>Is [needing an IDE] really true?  The core refactoring capability doesn't have
>to have anything to do with an IDE. It could easily be a libray which
>is capable of being used on the command line or from a ruby script.
>Hmm, maybe we have different ideas re: what  a refactoring tool does

I agree, except that it might be hard to API-ify it.

Perhaps:

class RefactorTool
   def extractMethod(ast, astPath) #astPath is like X-Path?
   end

   def getPossibleRefactorings(ast, astPath)
   end
end

?

Jimmy



Tue, 04 May 2004 22:09:03 GMT  
 Refactoring tool for Ruby...

Quote:


>> Is [needing an IDE] really true?  The core refactoring capability
>> doesn't have
>> to have anything to do with an IDE.

I agree if we (only) talk about the idea of refactoring

Quote:
>> Hmm, maybe we have different ideas re: what  a refactoring tool does

Not so sure, BUT

Quote:

> except that it might be hard to API-ify it.

I would double this...

Quote:

> Perhaps:

> class RefactorTool
>   def extractMethod(ast, astPath) #astPath is like X-Path?
>   end

>   def getPossibleRefactorings(ast, astPath)
>   end
> end

this definitely looks like a pain and I can't imagine it can get any better.
;-)

IMHO it would serve Ruby's popularity if we had an easy-to-use IDE which
runs on any platform.
This would also allow adding nice commandline-features to the ONE IDE.
Features such as
- RDTool
- ri
- RAA-handling or its successor...

Have a nice weekend
Clemens



Tue, 04 May 2004 22:38:20 GMT  
 Refactoring tool for Ruby...

Quote:


>>Is [needing an IDE] really true?  The core refactoring capability doesn't
>>have to have anything to do with an IDE. It could easily be a libray which
>>is capable of being used on the command line or from a ruby script.
>>Hmm, maybe we have different ideas re: what  a refactoring tool does

> I agree, except that it might be hard to API-ify it.

Things written test-first are easy to API-ify.

Quote:
> Perhaps:

> class RefactorTool
>    def extractMethod(ast, astPath) #astPath is like X-Path?
>    end

>    def getPossibleRefactorings(ast, astPath)
>    end
> end

def test_extractMethod
        source = 'bla bla bla x += 2 bla bla bla'
        begin = 12
        end = 18
        newMethodName = 'incXbyTwo'
        source = refactory.extractMethod source, begin, end, newMethodName
        assert source = 'def incXbyTwo; x += 2; end bla bla bla incXbyTwo'
end

Observe that the 'begin end' pair simulate a text selection in an editor,
but without coupling to any editor.

--
Phlip

http://www.greencheese.org/HatTrick



Tue, 04 May 2004 22:54:20 GMT  
 Refactoring tool for Ruby...
Quote:
> ...although this will allow implementing nice refactoring methods, we
> are still far from a Ruyb refactoring tool. IMHO a refactoring tool only
> makes sense in an IDE.

I disagree, specifically since I found several such tools in java for ide I
do not use, it may be nice if such a tool can be integrated in an ide but it
would be a lot better if it can be used from the command line.  What I would
have like for the java tool (and it would be nice for ruby too) is a command
line interface which I could have used from vim.  The idea would have been
to
call the tool from a vim script.  With ruby I could use an internal api
since
vim can be scripted in ruby.
Benoit


Thu, 06 May 2004 23:09:42 GMT  
 Refactoring tool for Ruby...


Quote:

> >Is [needing an IDE] really true?  The core refactoring capability doesn't
have
> >to have anything to do with an IDE. It could easily be a libray which
> >is capable of being used on the command line or from a ruby script.
> >Hmm, maybe we have different ideas re: what  a refactoring tool does

> I agree, except that it might be hard to API-ify it.

> Perhaps:

> class RefactorTool
>    def extractMethod(ast, astPath) #astPath is like X-Path?
>    end

>    def getPossibleRefactorings(ast, astPath)
>    end
> end

Would be nice.  You'd also need to be able to convert text coordinates
(line, col)
to astPath.  Also some of the refactorings like extractMethod will need a
range
instead of a path to a point in the tree.
If one of you has access to eclipse with the java dev tools (I don't here
and at work
I have IBM's internal version with the enterprise plugins) you can check
there refactoring
interface, it is really nice, especially the extract method one.
Benoit
Benoit


Thu, 06 May 2004 23:17:35 GMT  
 Refactoring tool for Ruby...

Quote:


>> Seems to me that once these Ruby-in-Ruby projects become usable,
>> especially the ones that generate ASTs, like Rockit, this won't be
>> very difficult.

> ....although this will allow implementing nice refactoring methods, we
> are still far from a Ruyb refactoring tool. IMHO a refactoring tool
> only makes sense in an IDE. Therefore "WE" need to
> a) agree on a platform independent GUI-framework (FX,...)
> b) build a userfriendly IDE
> c) add the follwing features to the IDE:
>    - code-browser
>    - de{*filter*}
>    - refactoring

> Have we got a) done?

The approach I've taken with preface, the Perl REFACtoring Engine is
to seperate the refactoring engine from whatever does the GUI. For
instance, now I have extract_method working I can write a bunch of
emacs lisp (my editor of choice) which calls that code, et voila,
instant interface.

And if someone wants to go and plug it into the IDE of their choice,
they can make use of the refactoring engine; I only have to worry
about the engine's basic API.

--
Piers

   "It is a truth universally acknowledged that a language in
    possession of a rich syntax must be in need of a rewrite."
         -- Jane Austen?



Tue, 11 May 2004 18:27:05 GMT  
 Refactoring tool for Ruby...

Quote:

> >Is [needing an IDE] really true?  The core refactoring capability doesn't
> > have to have anything to do with an IDE. It could easily be a libray
> > which is capable of being used on the command line or from a ruby script.
> > Hmm, maybe we have different ideas re: what  a refactoring tool does

> I agree, except that it might be hard to API-ify it.

Take a look at the Smalltalk Refactoring Browser; they have completely
separated the refactoring from the IDE. Each refactoring is a separate class.

And there is an adapter layer that provides an API for the metamodel:
RBClass, RBMethod, etc.

The parse tree matching and rewrite rules are also separate classes.

Here are the Squeak categories and classes:

Refactory-Change Objects
        AddClassChange
        AddClassVariableChange
        AddInstanceVariableChange
        AddMethodChange
        AddPoolVariableChange
        CompositeRefactoryChange
        InteractiveAddClassChange
        InteractiveAddMethodChange
        RefactoryChange
        RefactoryChangeManager
        RefactoryClassChange
        RefactoryVariableChange
        RemoveClassChange
        RemoveClassVariableChange
        RemoveInstanceVariableChange
        RemoveMethodChange
        RemovePoolVariableChange
        RenameClassChange
        RenameClassVariableChange
        RenameInstanceVariableChange
        RenameVariableChange
Refactory-Support
        RBMethodName
        RefactoringError
        RefactoringWarning
        RefactoryTyper
SqueakRB-Tests
        SentNotImplementedTestCase
SqueakRB-UserInterface
        ChooserMorph
        ClassEnvironmentBrowser
        FinderTool
        MethodNameEditor
        RefactoringBrowser
        SelectorEnvironmentBrowser
        VariableEnvironmentBrowser
Refactory-Parser
        RBAssignmentNode
        RBBlockNode
        RBCascadeNode
        RBFormatter
        RBLiteralNode
        RBMessageNode
        RBMethodNode
        RBOptimizedNode
        RBParser
        RBPatternMessageNode
        RBPatternMethodNode
        RBPatternVariableNode
        RBProgramNode
        RBReturnNode
        RBSequenceNode
        RBValueNode
        RBVariableNode
Refactory-Scanner
        RBAssignmentToken
        RBBinarySelectorToken
        RBIdentifierToken
        RBKeywordToken
        RBLiteralToken
        RBOptimizedToken
        RBPatternBlockToken
        RBScanner
        RBSpecialCharacterToken
        RBToken
        RBValueToken
Refactory-Conditions
        RBAbstractCondition
        RBCondition
        RBConjunctiveCondition
        RBNegationCondition
Refactory-Browser
        ReferenceFinder
Refactory-Model
        RBAbstractClass
        RBClass
        RBMetaclass
        RBMethod
        RBNamespace
Refactory-Lint
        BasicLintRule
        BlockLintRule
        CompositeLintRule
        LintDialog
        LintRule
        ParseTreeEnvironment
        ParseTreeLintRule
        SmalllintChecker
        SmalllintContext
        SmalllintResultEditor
        TransformationRule
Refactory-Refactorings
        AbstractClassVariableRefactoring
        AbstractInstanceVariableRefactoring
        AbstractVariablesRefactoring
        AddClassRefactoring
        AddClassVariableRefactoring
        AddInstanceVariableRefactoring
        AddMethodRefactoring
        AddParameterRefactoring
        ChangeMethodNameRefactoring
        ChildrenToSiblingsRefactoring
        ClassRefactoring
        CreateAccessorsForVariableRefactoring
        ExpandReferencedPoolsRefactoring
        ExtractMethodRefactoring
        ExtractMethodToComponentRefactoring
        ExtractToTemporaryRefactoring
        InlineAllSendersRefactoring
        InlineMethodFromComponentRefactoring
        InlineMethodRefactoring
        InlineParameterRefactoring
        InlineTemporaryRefactoring
        MethodRefactoring
        MoveMethodRefactoring
        MoveVariableDefinitionRefactoring
        ProtectInstanceVariableRefactoring
        PullUpClassVariableRefactoring
        PullUpInstanceVariableRefactoring
        PushDownClassVariableRefactoring
        PushDownInstanceVariableRefactoring
        PushDownMethodRefactoring
        PushUpMethodRefactoring
        ReceiverAndSelector
        Refactoring
        RefactoringManager
        RemoveClassRefactoring
        RemoveClassVariableRefactoring
        RemoveInstanceVariableRefactoring
        RemoveMethodRefactoring
        RemoveParameterRefactoring
        RenameClassRefactoring
        RenameClassVariableRefactoring
        RenameInstanceVariableRefactoring
        RenameMethodRefactoring
        RenameTemporaryRefactoring
        SplitClassRefactoring
        TemporaryToInstanceVariableRefactoring
        VariableRefactoring
Refactory-Testing
        AbstractClassVariableTest
        AbstractInstanceVariableTest
        AddClassTest
        AddClassVariableTest
        AddInstanceVariableTest
        AddMethodTest
        AddParameterTest
        BrowserEnvironmentTest
        ChildrenToSiblingsTest
        CreateAccessorsForVariableTest
        ExtraParsingAndFormattingTests
        ExtractMethodTest
        ExtractMethodToComponentTest
        ExtractToTemporaryTest
        InlineAllMethodTest
        InlineMethodFromComponentTest
        InlineMethodTest
        InlineParameterTest
        InlineTemporaryTest
        MoveMethodTest
        MoveVariableDefinitionTest
        ParserTest
        ProtectInstanceVariableTest
        PullUpClassVariableTest
        PushDownClassVariableTest
        PushDownInstanceVariableTest
        PushDownMethodTest
        PushUpInstanceVariableTest
        PushUpMethodTest
        RBClassTest
        RBNamespaceTest
        RefactoringBrowserTest
        RefactoringTest
        ReferenceFinderTest
        RemoveClassTest
        RemoveClassVariableTest
        RemoveInstanceVariableTest
        RemoveMethodTest
        RemoveParameterTest
        RenameClassTest
        RenameClassVariableTest
        RenameInstanceVariableTest
        RenameMethodTest
        RenameTemporaryTest
        SmalllintTest
        TemporaryToInstanceVariableTest
        VariableEnvironmentTest
        VariableTypeTest
Refactory-Environments
        AndEnvironment
        BrowserEnvironment
        BrowserEnvironmentWrapper
        CategoryEnvironment
        ClassEnvironment
        MultiEnvironment
        NotEnvironment
        ProtocolEnvironment
        SelectorEnvironment
        VariableEnvironment
Refactory-Test data
        BasicLintRuleTest
        ClassToRename
        CompositeLintRuleTest
        FooLintRuleTest
        LintRuleTest
        RefactoryTestDataApp
        SubclassOfClassToRename
        TransformationRuleTest
Refactory-ParseTree Matching
        ParseTreeRewriter
        ParseTreeSearcher
        RBBlockReplaceRule
        RBParseTreeRule
        RBPatternBlockNode
        RBProgramNodeVisitor
        RBReadBeforeWrittenTester
        RBReplaceRule
        RBSearchRule
        RBSmallDictionary
        RBStringReplaceRule
SqueakRB-ParserExtensions
        RBArrayNode
        RBShortAssignmentToken

--
Ned Konz
currently: Stanwood, WA

homepage:  http://bike-nomad.com



Wed, 12 May 2004 03:14:54 GMT  
 
 [ 14 post ] 

 Relevant Pages 

1. Application Facade Example in ruby (was: refactoring ruby code)

2. ruby refactoring

3. Refactoring Ruby

4. refactoring ruby code

5. Smalltalk like browsers, refactoring tools for C#/.NET?

6. refactoring tools for eiffel

7. Refactoring Tool for Tcl

8. Tools for refactoring code

9. ANNOUNCE: Smalltalk Refactoring Tool

10. Refactoring Browser. VSE Refactoring Browser

11. FW: [ANN] New release of Ruby Development Tools plugin for Eclipse

12. ANN: rdep (Ruby Dependency Tool)

 

 
Powered by phpBB® Forum Software