Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Remove unnecessary empty lines in the generated files. #184

Merged
merged 1 commit into from

2 participants

@smic

No description provided.

@rentzsch rentzsch merged commit 928b835 into from
@rentzsch
Owner

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. @smic
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 0 deletions.
  1. +6 −0 mogenerator.m
View
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.