This repository has been archived by the owner on Jan 25, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from robb/string-support
[WIP] String support
- Loading branch information
Showing
10 changed files
with
729 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# OS X | ||
.DS_Store | ||
|
||
# Xcode | ||
build/ | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata | ||
*.xccheckout | ||
profile | ||
*.moved-aside | ||
DerivedData | ||
*.hmap | ||
*.xccheckout | ||
|
||
# CocoaPods | ||
Pods | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
target :UnderscoreTests, :exclusive => true do | ||
pod 'Specta', '0.1.11' | ||
pod 'Expecta', '0.2.2' | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
PODS: | ||
- Expecta (0.2.2) | ||
- Specta (0.1.11) | ||
|
||
DEPENDENCIES: | ||
- Expecta (= 0.2.2) | ||
- Specta (= 0.1.11) | ||
|
||
SPEC CHECKSUMS: | ||
Expecta: 99adbb2e366a02796477523bfd426143350d9caf | ||
Specta: 82746c6fd70b104c5d37cfbadb7bf15a2cbc4da0 | ||
|
||
COCOAPODS: 0.28.0 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// | ||
// USStringWrapper.h | ||
// Underscore | ||
// | ||
// Created by Vasco d'Orey on 16/11/13. | ||
// Copyright (c) 2013 Robert Böhnke. All rights reserved. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to | ||
// deal in the Software without restriction, including without limitation the | ||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
// sell copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
// IN THE SOFTWARE. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "Underscore+Functional.h" | ||
#import "USArrayWrapper.h" | ||
|
||
@interface USStringWrapper : NSObject | ||
|
||
+(instancetype) wrap:(NSString *)string; | ||
|
||
-(id) init __deprecated_msg("You should use Underscore.string() instead."); | ||
|
||
@property (readonly) NSString *unwrap; | ||
|
||
/** | ||
* Removes any leading and trailing whitespace character. | ||
*/ | ||
@property (readonly) USStringWrapper *trim; | ||
|
||
/** | ||
* Capitalizes the first character in every word, all other characters are lowercase'd | ||
*/ | ||
@property (readonly) USStringWrapper *capitalize; | ||
|
||
/** | ||
* Lowercases all characters. | ||
*/ | ||
@property (readonly) USStringWrapper *lowercase; | ||
|
||
/** | ||
* Uppercases all characters. | ||
*/ | ||
@property (readonly) USStringWrapper *uppercase; | ||
|
||
/** | ||
* Removes occurences of the given string. | ||
*/ | ||
@property (readonly) USStringWrapper *(^strip)(NSString *strip); | ||
|
||
/** | ||
* Splits the string at the given separator. Returns a nil array if the separator is nil. | ||
*/ | ||
@property (readonly) USArrayWrapper *(^split)(NSString *separator); | ||
|
||
@end | ||
|
||
@interface USArrayWrapper (USStrings) | ||
|
||
/** | ||
* Joins the elements in the array. | ||
*/ | ||
@property (readonly) USStringWrapper *(^join)(NSString *joiner); | ||
|
||
@end |
Oops, something went wrong.