Created
August 12, 2010 06:09
-
-
Save perlDreamer/520426 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -lp | |
##Copy and paste property block to the top of the file. | |
##Select the properties, and run this filter on it to | |
##handle bulk reformatting and changes. | |
##Breaks on options entry. | |
##Does not handle conditional properties, or builder and lazy methods. | |
##Only translates i18n for assetName, label, hoverHelp and subtext | |
BEGIN { $name = shift; } | |
s/^\s+(\w+)\s*=>\s*{/property $1 => (/; | |
s/^\s+},?/ );/; | |
s/\t/ /g; | |
s/defaultValue/default /; | |
if (/i18n->get/ && /(?:assetName|label|hoverHelp|subtext)\s*=>/ ) { | |
s/\$.+\(/[/; | |
s/\)/, '$name']/; | |
} | |
s/^(aspect.+?),\s*$/$1;/; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment