Logo-small

6.7.1 Programmatically Refactor Method Example

Although this may not be the best method, here is an idea of what you can do with RB. It replaces all calls to #deprecate: with #deprecate:on:in:, programmatically creating arguments:

RBParseTreeRewriter new 
	replace: '``@object deprecated: ``@arg1 ' 
	with: '``@object deprecated: ``@arg1 on:(''', dateString,  ''') in:(''Pharo', versionNumber asString, ''')'.

See the discussion at http://forum.world.st/RB-API-td3781019.html

Add a Note

Licensed under Creative Commons BY-NC-SA | Published using Pier |