Skip to content

Instantly share code, notes, and snippets.

@gcotelli
Last active September 19, 2019 13:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gcotelli/8a6afbbd04809f79aa6fff25674458db to your computer and use it in GitHub Desktop.
Save gcotelli/8a6afbbd04809f79aa6fff25674458db to your computer and use it in GitHub Desktop.
Rewrite changes
| env rewriter result methods changes |
env := RBBrowserEnvironment default forPackages: (RPackageOrganizer default packages select: [:p | p name beginsWith: 'Z' ]).
rewriter := RBParseTreeRewriter new.
rewriter
replace:'`@class == `@aClass or:[`@class inheritsFrom: `@aClass]' with: '`@class includesBehavior: `@aClass'.
changes := Array with: (RBSmalllintChecker runRule: (RBTransformationRule new
rewriteRule: rewriter;
yourself)
onEnvironment: env ) builder.
(ChangesBrowser changes: changes) open.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment