Skip to content

Commit

Permalink
Remove whitespace [Gun.io WhitespaceBot]
Browse files Browse the repository at this point in the history
  • Loading branch information
Gun.io Whitespace Robot committed Oct 28, 2011
1 parent 0dc5c4b commit 8239360
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 188 deletions.
30 changes: 15 additions & 15 deletions NSString+Inflections.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ + (NSArray *)uncountableWords {
// All rules are assumed Global Case Insensitive.
+ (NSArray *)pluralRules {
static NSArray *_pluralRules = nil;
if (_pluralRules == nil)

if (_pluralRules == nil)
_pluralRules = [[NSArray arrayWithObjects:
[NSArray arrayWithObjects:@"(matr|vert|ind)(?:ix|ex)$", @"$1ices", nil],
[NSArray arrayWithObjects:@"(m)an$", @"$1en", nil],
Expand Down Expand Up @@ -72,7 +72,7 @@ + (NSArray *)pluralRules {

+ (NSArray *)singularRules {
static NSArray *_singularRules = nil;

if (_singularRules == nil)
_singularRules = [[NSArray arrayWithObjects:
[NSArray arrayWithObjects:@"(database)s$", @"$1", nil],
Expand Down Expand Up @@ -111,7 +111,7 @@ + (NSArray *)singularRules {

+ (NSArray *)nonTitlecasedWords {
static NSArray *_nonTitlecasedWords = nil;

if (_nonTitlecasedWords == nil)
_nonTitlecasedWords = [[NSArray arrayWithObjects:
@"and",@"or",@"nor",@"a",@"an",@"the",@"so",@"but",@"to",@"of",@"at",
Expand Down Expand Up @@ -190,7 +190,7 @@ - (NSString *)titleize {

str = [str stringByReplacingOccurrencesOfRegex:@"_" withString:@" "];
NSArray *strArr = [str componentsSeparatedByString:@" "];

for (int x = 0; x < [strArr count]; x++) {
NSString *word = [strArr objectAtIndex:x];
NSArray *subArr = [word componentsSeparatedByString:@"-"];
Expand All @@ -203,10 +203,10 @@ - (NSString *)titleize {
[ret appendString:part];
else
[ret appendString:[part capitalize]];

if (i < [subArr count] - 1) [ret appendString:@"-"];
}

if (x < [strArr count] - 1) [ret appendString:@" "];
}

Expand Down Expand Up @@ -234,7 +234,7 @@ - (NSString *)classify {

/**
* Converts an underscored separated string into a CamelCasedString.
*
*
* Changes '/' to '::' to convert paths to namespaces.
*/
- (NSString *)camelize {
Expand All @@ -261,7 +261,7 @@ - (NSString *)camelize {
/**
* Converts an underscored separated string into a camelCasedString with the
* first letter lower case.
*
*
* Changes '/' to '::' to convert paths to namespaces.
*/
- (NSString *)camelizeWithLowerFirstLetter {
Expand All @@ -276,12 +276,12 @@ - (NSString *)camelizeWithLowerFirstLetter {

/**
* Makes an underscored, lowercase form from the expression in the string.
*
*
* Changes '::' to '/' to convert namespaces to paths.
*
*
* As a rule of thumb you can think of +underscore+ as the inverse of +camelize+,
* though there are cases where that does not hold:
*
*
* "SSLError".underscore.camelize # => "SslError"
*/
- (NSString *)underscore {
Expand All @@ -290,7 +290,7 @@ - (NSString *)underscore {
ret = [ret stringByReplacingOccurrencesOfRegex:@"([A-Z]+)([A-Z][a-z])" withString:@"$1_$2"];
ret = [ret stringByReplacingOccurrencesOfRegex:@"([a-z\\d])([A-Z])" withString:@"$1_$2"];
ret = [ret stringByReplacingOccurrencesOfString:@"-" withString:@"_"];

return [ret lowercaseString];
}

Expand All @@ -317,7 +317,7 @@ - (NSString *)foreignKey {
}

/**
* Creates a foreign key name from a class name without the underscore
* Creates a foreign key name from a class name without the underscore
* separating the id part.
*/
- (NSString *)foreignKeyWithoutIdUnderscore {
Expand All @@ -327,7 +327,7 @@ - (NSString *)foreignKeyWithoutIdUnderscore {
/**
* Turns a number into an ordinal string used to denote the position in an
* ordered sequence such as 1st, 2nd, 3rd, 4th.
*
*
* TODO: This should be moved to NSNumber most likely
*/
- (NSString *)ordinalize {
Expand Down
4 changes: 2 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The reverse of +pluralize+, returns the singular form of a word in a string.
`- (NSString *)humanize;`

Capitalizes the first word and turns underscores into spaces and strips a trailing "_id", if any. Like +titleize+, this is meant for creating pretty output.

`- (NSString *)titleize;`

Capitalizes all words that are not part of the nonTitlecasedWords.
Expand Down Expand Up @@ -61,7 +61,7 @@ Creates a foreign key name from a class name.
`- (NSString *)foreignKeyWithoutIdUnderscore;`

Creates a foreign key name from a class name without the underscore separating the id part.

`- (NSString *)ordinalize;`

Turns a number into an ordinal string used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
Expand Down
26 changes: 13 additions & 13 deletions RegexKitLite.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@

/*
Copyright (c) 2008-2010, John Engelhart
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Zang Industries nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Expand Down Expand Up @@ -53,7 +53,7 @@
#ifdef __cplusplus
extern "C" {
#endif

#ifndef REGEXKITLITE_VERSION_DEFINED
#define REGEXKITLITE_VERSION_DEFINED

Expand All @@ -73,7 +73,7 @@ extern "C" {
#if !defined(RKL_BLOCKS) && defined(NS_BLOCKS_AVAILABLE) && (NS_BLOCKS_AVAILABLE == 1)
#define RKL_BLOCKS 1
#endif

#if defined(RKL_BLOCKS) && (RKL_BLOCKS == 1)
#define _RKL_BLOCKS_ENABLED 1
#endif // defined(RKL_BLOCKS) && (RKL_BLOCKS == 1)
Expand Down Expand Up @@ -126,7 +126,7 @@ enum {
RKLRegexEnumerationFastCapturedStringsXXX = 1UL << 11,
};
typedef NSUInteger RKLRegexEnumerationOptions;

#endif // RKLREGEXENUMERATIONOPTIONS_DEFINED

#ifndef _REGEXKITLITE_H_
Expand All @@ -143,17 +143,17 @@ typedef NSUInteger RKLRegexEnumerationOptions;
#else // defined(NS_REQUIRES_NIL_TERMINATION)
#define RKL_REQUIRES_NIL_TERMINATION
#endif // defined(NS_REQUIRES_NIL_TERMINATION)

// This requires a few levels of rewriting to get the desired results.
#define _RKL_CONCAT_2(c,d) c ## d
#define _RKL_CONCAT(a,b) _RKL_CONCAT_2(a,b)

#ifdef RKL_PREPEND_TO_METHODS
#define RKL_METHOD_PREPEND(x) _RKL_CONCAT(RKL_PREPEND_TO_METHODS, x)
#else // RKL_PREPEND_TO_METHODS
#define RKL_METHOD_PREPEND(x) x
#endif // RKL_PREPEND_TO_METHODS

// If it looks like low memory notifications might be available, add code to register and respond to them.
// This is (should be) harmless if it turns out that this isn't the case, since the notification that we register for,
// UIApplicationDidReceiveMemoryWarningNotification, is dynamically looked up via dlsym().
Expand Down Expand Up @@ -183,7 +183,7 @@ extern NSString * const RKLICURegexReplacedStringErrorKey;
extern NSString * const RKLICURegexReplacementStringErrorKey;
extern NSString * const RKLICURegexSubjectRangeErrorKey;
extern NSString * const RKLICURegexSubjectStringErrorKey;

@interface NSString (RegexKitLiteAdditions)

+ (void)RKL_METHOD_PREPEND(clearStringCache);
Expand Down
Loading

0 comments on commit 8239360

Please sign in to comment.