Jannik: yes, I talk with Stef before sending this email and he told me it
was old. In addition, I know RB code to do that was better.

Now, I put Lukas' help here:

http://code.google.com/p/pharo/wiki/CodeSnippets

Cheers

Mariano

On Fri, Mar 19, 2010 at 9:33 AM, Lukas Renggli <[email protected]> wrote:

> Since the refactoring engine and OmniBrowser has no overrides and
> cleanly loads into Pharo 1.0 and 1.1 images this can conveniently be
> done from the GUI.
>
> Alternatively the following script works without GUI:
>
> 1. Load the code:
>
>    Gofer new
>        squeaksource: 'rb';
>        package: 'AST-Core';
>        package: 'Refactoring-Core';
>        load.
>
> 2. Select the code (packages) you want to fix:
>
>    environment := BrowserEnvironment new
>        forPackageNames: #('PackageName1' 'PackageName2').
>
> 3. Create the transformation rule:
>
>    rule := RBUnderscoreAssignmentRule new.
>
> 4. Perform the search:
>
>    SmalllintChecker runRule: rule onEnvironment: environment.
>
> 5. Perform the transformation:
>
>    change := CompositeRefactoryChange new
>    change changes: rule changes.
>    change execute
>
> Details on running lint rules from a script on my blog post on that
> subject: <http://www.lukas-renggli.ch/blog/programmatically-run-lint>.
>
> Lukas
>
> On 19 March 2010 09:03, Stéphane Ducasse <[email protected]>
> wrote:
> > lukas could you publish somewhere (soon on the lint chapter)
> > the gofer and rb expression to fix all the _
> >
> > Stef
> >
> > On Mar 19, 2010, at 8:18 AM, Lukas Renggli wrote:
> >
> >>> I am not sure, but I think FixUnderscores should be useful for old
> packages
> >>> loaded in pharo.
> >>
> >> The problem with the FixUnderscores package is that it does a string
> >> replacement and thus might perform incorrect transformations. You need
> >> to manually visit each change to be sure that it did correctly. The RB
> >> engine does a tree based transformation, which is always correct.
> >>
> >> I am all for kicking this package. It also contains old code that
> >> changes font glyphs, that's not needed any longer.
> >>
> >> Lukas
> >>
> >>
> >>> For example, some projects still use _, so we need FixUnderscore to fix
> them
> >>> automatically.
> >>> Personally, I use it on the whole Pharo 3 months ago.
> >>> Cheers,
> >>> Jannik
> >>>
> >>> On Mar 18, 2010, at 23:37 , Mariano Martinez Peck wrote:
> >>>
> >>> http://code.google.com/p/pharo/issues/detail?id=2165
> >>>
> >>> There are some packages that has to be removed. For example:
> >>> - PinesoftEnhancementsForFreeType:  This package is empty
> >>> - FixUnderscores:  This package is old, is not needed any more and has
> no
> >>> references
> >>>
> >>> The fix is to evaluate:
> >>>
> >>> (MCPackage named: 'PinesoftEnhancementsForFreeType') unload.
> >>> (MCPackage named: 'FixUnderscores') unload.
> >>>
> >>> Cheers
> >>>
> >>> Mariano
> >>> _______________________________________________
> >>> Pharo-project mailing list
> >>> [email protected]
> >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >>>
> >>>
> >>> _______________________________________________
> >>> Pharo-project mailing list
> >>> [email protected]
> >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >>>
> >>
> >>
> >>
> >> --
> >> Lukas Renggli
> >> http://www.lukas-renggli.ch
> >>
> >> _______________________________________________
> >> Pharo-project mailing list
> >> [email protected]
> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
> >
> > _______________________________________________
> > Pharo-project mailing list
> > [email protected]
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
>
>
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to