Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Remove unnecessary empty lines in the generated files. #184

merged 1 commit into from

2 participants

Stephan Michels Jonathan 'Wolf' Rentzsch
Stephan Michels

No description provided.

Jonathan 'Wolf' Rentzsch rentzsch merged commit 928b835 into from
Jonathan 'Wolf' Rentzsch

Huh, I thought I already commented on this one but some how I haven't.

Stephan, I like your technique. I thought you were just going to strip out lines from the templates so the output would be nicer and I was prepared to reject that (I think template readability trounces generated output beauty). But I like this dynamic approach. Kudos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 20, 2013
  1. Stephan Michels
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 0 deletions.
  1. +6 −0 mogenerator.m
6 mogenerator.m
@@ -929,6 +929,12 @@ - (int)application:(DDCliApplication*)app runWithArguments:(NSArray*)arguments {
NSString *generatedHumanH = [humanH executeWithObject:entity sender:nil];
NSString *generatedHumanM = [humanM executeWithObject:entity sender:nil];
+ // remove unnecessary empty lines
+ generatedMachineH = [generatedMachineH stringByReplacingOccurrencesOfRegex:@"([ \t]*(\n|\r|\r\n)){2,}" withString:@"\n\n"];
+ generatedMachineM = [generatedMachineM stringByReplacingOccurrencesOfRegex:@"([ \t]*(\n|\r|\r\n)){2,}" withString:@"\n\n"];
+ generatedHumanH = [generatedHumanH stringByReplacingOccurrencesOfRegex:@"([ \t]*(\n|\r|\r\n)){2,}" withString:@"\n\n"];
+ generatedHumanM = [generatedHumanM stringByReplacingOccurrencesOfRegex:@"([ \t]*(\n|\r|\r\n)){2,}" withString:@"\n\n"];
NSString *entityClassName = [entity managedObjectClassName];
BOOL machineDirtied = NO;
Something went wrong with that request. Please try again.