Skip to content

Instantly share code, notes, and snippets.

@tschneidereit
Created February 27, 2012 11:36
Show Gist options
  • Save tschneidereit/1923178 to your computer and use it in GitHub Desktop.
Save tschneidereit/1923178 to your computer and use it in GitHub Desktop.
Regular Expressions for porting Robotlegs 1 to Robotlegs 2
Converting Injector mappings:
mapValue\((\w+)\s*,\s*(.+?)(,\s*['"]\w+['"]|)\); -> map($1$3).toValue($2);
mapClass\((\w+)\s*,\s*(.+?)(,\s*['"]\w+['"]|)\); -> map($1$3).toType($2);
mapSingleton\((\w+)\s*(,\s*['"]\w+['"]|)\); -> map($1$2).asSingleton();
mapSingletonOf\((\w+)\s*,\s*(.+?)(,\s*['"]\w+['"]|)\); -> map($1$3).toSingleton($2);
// will be extended for Command- and MediatorMap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment