Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

reorganized directory structure.

  • Loading branch information...
commit 26d06b91041097f38ab765173ad07b037de05fca 1 parent 0fea538
@petejkim authored
Showing with 779 additions and 136 deletions.
  1. +7 −6 .gitignore
  2. +0 −7 CKAdditions.h
  3. +43 −49 ConciseKitSpecs/ConciseKitSpecs.xcodeproj/project.pbxproj
  4. +7 −0 ConciseKitSpecs/ConciseKitSpecs.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  5. BIN  .../ConciseKitSpecs.xcodeproj/project.xcworkspace/xcuserdata/jihoon.xcuserdatad/UserInterfaceState.xcuserstate
  6. +10 −0 ...cs/ConciseKitSpecs.xcodeproj/project.xcworkspace/xcuserdata/jihoon.xcuserdatad/WorkspaceSettings.xcsettings
  7. +84 −0 ConciseKitSpecs/ConciseKitSpecs.xcodeproj/xcuserdata/jihoon.xcuserdatad/xcschemes/ConciseKitSpecs.xcscheme
  8. +22 −0 ConciseKitSpecs/ConciseKitSpecs.xcodeproj/xcuserdata/jihoon.xcuserdatad/xcschemes/xcschememanagement.plist
  9. +8 −2 README.markdown → ConciseKitSpecs/README.md
  10. +0 −4 ConciseKitSpecs/Spec/ConciseKitSpec.m
  11. +0 −4 ConciseKitSpecs/Spec/Fixtures/CKMocks.h
  12. +0 −4 ConciseKitSpecs/Spec/Fixtures/CKMocks.m
  13. +0 −4 ConciseKitSpecs/Spec/Fixtures/Foo.h
  14. +0 −4 ConciseKitSpecs/Spec/Fixtures/Foo.m
  15. +0 −4 ConciseKitSpecs/Spec/NSArrayConciseKitSpec.m
  16. +0 −4 ConciseKitSpecs/Spec/NSDictionaryConciseKitSpec.m
  17. +0 −4 ConciseKitSpecs/Spec/NSStringConciseKitSpec.m
  18. +3 −0  ConciseKitSpecs/src/CKAdditions.h
  19. +0 −4 { → ConciseKitSpecs/src}/CKMacros.h
  20. +0 −4 { → ConciseKitSpecs/src}/CKSingleton.h
  21. +0 −4 { → ConciseKitSpecs/src}/ConciseKit.h
  22. +0 −4 { → ConciseKitSpecs/src}/ConciseKit.m
  23. +0 −4 { → ConciseKitSpecs/src}/NSArray+ConciseKit.h
  24. +0 −4 { → ConciseKitSpecs/src}/NSArray+ConciseKit.m
  25. +0 −4 { → ConciseKitSpecs/src}/NSDictionary+ConciseKit.h
  26. +0 −4 { → ConciseKitSpecs/src}/NSDictionary+ConciseKit.m
  27. +0 −4 { → ConciseKitSpecs/src}/NSString+ConciseKit.h
  28. +0 −4 { → ConciseKitSpecs/src}/NSString+ConciseKit.m
  29. +175 −0 README.md
  30. +3 −0  src/CKAdditions.h
  31. +45 −0 src/CKMacros.h
  32. +71 −0 src/CKSingleton.h
  33. +26 −0 src/ConciseKit.h
  34. +94 −0 src/ConciseKit.m
  35. +21 −0 src/NSArray+ConciseKit.h
  36. +70 −0 src/NSArray+ConciseKit.m
  37. +13 −0 src/NSDictionary+ConciseKit.h
  38. +18 −0 src/NSDictionary+ConciseKit.m
  39. +18 −0 src/NSString+ConciseKit.h
  40. +41 −0 src/NSString+ConciseKit.m
View
13 .gitignore
@@ -1,8 +1,9 @@
.DS_Store
-*/build/
-*.mode1v3
-*.mode2v3
+*.xcworkspace
+xcuserdata
+.idea
+build/
*.pbxuser
-*.perspectivev3
-*.swp
-*~.nib
+*.mode1v3
+products/*
+
View
7 CKAdditions.h
@@ -1,7 +0,0 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
-#import "NSArray+ConciseKit.h"
-#import "NSString+ConciseKit.h"
-#import "NSDictionary+ConciseKit.h"
View
92 ConciseKitSpecs/ConciseKitSpecs.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 45;
+ objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@@ -17,16 +17,15 @@
E91C43C412985E7D001522E5 /* Cedar.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E92CB4EC1296DF2B00BF1922 /* Cedar.framework */; };
E91C43C512985E7D001522E5 /* OCHamcrest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E92CB4EE1296DF2B00BF1922 /* OCHamcrest.framework */; };
E91C43C612985E7D001522E5 /* OCMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E92CB4F01296DF2B00BF1922 /* OCMock.framework */; };
- E925015312D92D890018D373 /* NSDictionary+ConciseKit.m in Sources */ = {isa = PBXBuildFile; fileRef = E925015212D92D890018D373 /* NSDictionary+ConciseKit.m */; };
E925015812D92E250018D373 /* NSDictionaryConciseKitSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = E925015712D92E250018D373 /* NSDictionaryConciseKitSpec.m */; };
E965CE8C12A17FC400416CDF /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = E965CE8A12A17FC400416CDF /* LICENSE */; };
- E965CE8D12A17FC400416CDF /* README.markdown in Resources */ = {isa = PBXBuildFile; fileRef = E965CE8B12A17FC400416CDF /* README.markdown */; };
E965CE9412A1805800416CDF /* NSArrayConciseKitSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = E965CE9312A1805800416CDF /* NSArrayConciseKitSpec.m */; };
- E965CEA712A1816600416CDF /* NSArray+ConciseKit.m in Sources */ = {isa = PBXBuildFile; fileRef = E965CEA612A1816600416CDF /* NSArray+ConciseKit.m */; };
- E965CFBA12A1893100416CDF /* ConciseKit.m in Sources */ = {isa = PBXBuildFile; fileRef = E965CFB912A1893100416CDF /* ConciseKit.m */; };
E965CFC212A18A5000416CDF /* ConciseKitSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = E965CFC112A18A5000416CDF /* ConciseKitSpec.m */; };
- E9692C2112B4B45400520396 /* NSString+ConciseKit.m in Sources */ = {isa = PBXBuildFile; fileRef = E9692C2012B4B45400520396 /* NSString+ConciseKit.m */; };
E9692C2612B4B4FF00520396 /* NSStringConciseKitSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = E9692C2512B4B4FF00520396 /* NSStringConciseKitSpec.m */; };
+ E9B778E414BA583600D8DC76 /* ConciseKit.m in Sources */ = {isa = PBXBuildFile; fileRef = E9B778DD14BA583600D8DC76 /* ConciseKit.m */; };
+ E9B778E514BA583600D8DC76 /* NSArray+ConciseKit.m in Sources */ = {isa = PBXBuildFile; fileRef = E9B778DF14BA583600D8DC76 /* NSArray+ConciseKit.m */; };
+ E9B778E614BA583600D8DC76 /* NSDictionary+ConciseKit.m in Sources */ = {isa = PBXBuildFile; fileRef = E9B778E114BA583600D8DC76 /* NSDictionary+ConciseKit.m */; };
+ E9B778E714BA583600D8DC76 /* NSString+ConciseKit.m in Sources */ = {isa = PBXBuildFile; fileRef = E9B778E314BA583600D8DC76 /* NSString+ConciseKit.m */; };
E9E4CF061298753B0093F83D /* Cedar.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E92CB4EC1296DF2B00BF1922 /* Cedar.framework */; };
E9E4CF071298753B0093F83D /* OCHamcrest.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E92CB4EE1296DF2B00BF1922 /* OCHamcrest.framework */; };
E9E4CF081298753B0093F83D /* OCMock.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E92CB4F01296DF2B00BF1922 /* OCMock.framework */; };
@@ -56,14 +55,11 @@
E90DAB9C12A66B1D000A36AE /* Foo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Foo.m; sourceTree = "<group>"; };
E90DADE412A6A07A000A36AE /* CKMocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKMocks.h; sourceTree = "<group>"; };
E90DADE512A6A07A000A36AE /* CKMocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CKMocks.m; sourceTree = "<group>"; };
- E90F45F1130431E4008EA62A /* CKSingleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKSingleton.h; sourceTree = "<group>"; };
E91C433212985A68001522E5 /* ConciseKitSpecsAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConciseKitSpecsAppDelegate.m; sourceTree = "<group>"; };
E91C435B12985B77001522E5 /* ConciseKitSpecs-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ConciseKitSpecs-Info.plist"; sourceTree = "<group>"; };
E91C435D12985BD9001522E5 /* Specs.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Specs.xib; sourceTree = "<group>"; };
E91C436912985C8A001522E5 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
E91C437B12985DDD001522E5 /* ConciseKitSpecs.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ConciseKitSpecs.app; sourceTree = BUILT_PRODUCTS_DIR; };
- E925015112D92D890018D373 /* NSDictionary+ConciseKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+ConciseKit.h"; sourceTree = "<group>"; };
- E925015212D92D890018D373 /* NSDictionary+ConciseKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+ConciseKit.m"; sourceTree = "<group>"; };
E925015712D92E250018D373 /* NSDictionaryConciseKitSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSDictionaryConciseKitSpec.m; sourceTree = "<group>"; };
E92CB4EC1296DF2B00BF1922 /* Cedar.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Cedar.framework; sourceTree = "<group>"; };
E92CB4EE1296DF2B00BF1922 /* OCHamcrest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = OCHamcrest.framework; sourceTree = "<group>"; };
@@ -71,19 +67,22 @@
E92CB55C1296E0E600BF1922 /* SpecHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpecHelper.h; sourceTree = "<group>"; };
E92CB57E1296E1D800BF1922 /* CedarAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CedarAdditions.h; sourceTree = "<group>"; };
E92CB57F1296E1D800BF1922 /* CedarAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CedarAdditions.m; sourceTree = "<group>"; };
- E965CE8812A17FC400416CDF /* CKMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKMacros.h; sourceTree = "<group>"; };
- E965CE8912A17FC400416CDF /* ConciseKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConciseKit.h; sourceTree = "<group>"; };
- E965CE8A12A17FC400416CDF /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
- E965CE8B12A17FC400416CDF /* README.markdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.markdown; sourceTree = "<group>"; };
+ E965CE8A12A17FC400416CDF /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
E965CE9312A1805800416CDF /* NSArrayConciseKitSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSArrayConciseKitSpec.m; sourceTree = "<group>"; };
- E965CEA512A1816600416CDF /* NSArray+ConciseKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+ConciseKit.h"; sourceTree = "<group>"; };
- E965CEA612A1816600416CDF /* NSArray+ConciseKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+ConciseKit.m"; sourceTree = "<group>"; };
- E965CFB912A1893100416CDF /* ConciseKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConciseKit.m; sourceTree = "<group>"; };
- E965CFC012A18A1E00416CDF /* CKAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKAdditions.h; sourceTree = "<group>"; };
E965CFC112A18A5000416CDF /* ConciseKitSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConciseKitSpec.m; sourceTree = "<group>"; };
- E9692C1F12B4B45400520396 /* NSString+ConciseKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ConciseKit.h"; sourceTree = "<group>"; };
- E9692C2012B4B45400520396 /* NSString+ConciseKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ConciseKit.m"; sourceTree = "<group>"; };
E9692C2512B4B4FF00520396 /* NSStringConciseKitSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSStringConciseKitSpec.m; sourceTree = "<group>"; };
+ E9B778D914BA583600D8DC76 /* CKAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKAdditions.h; sourceTree = "<group>"; };
+ E9B778DA14BA583600D8DC76 /* CKMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKMacros.h; sourceTree = "<group>"; };
+ E9B778DB14BA583600D8DC76 /* CKSingleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CKSingleton.h; sourceTree = "<group>"; };
+ E9B778DC14BA583600D8DC76 /* ConciseKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConciseKit.h; sourceTree = "<group>"; };
+ E9B778DD14BA583600D8DC76 /* ConciseKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConciseKit.m; sourceTree = "<group>"; };
+ E9B778DE14BA583600D8DC76 /* NSArray+ConciseKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+ConciseKit.h"; sourceTree = "<group>"; };
+ E9B778DF14BA583600D8DC76 /* NSArray+ConciseKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+ConciseKit.m"; sourceTree = "<group>"; };
+ E9B778E014BA583600D8DC76 /* NSDictionary+ConciseKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+ConciseKit.h"; sourceTree = "<group>"; };
+ E9B778E114BA583600D8DC76 /* NSDictionary+ConciseKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+ConciseKit.m"; sourceTree = "<group>"; };
+ E9B778E214BA583600D8DC76 /* NSString+ConciseKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ConciseKit.h"; sourceTree = "<group>"; };
+ E9B778E314BA583600D8DC76 /* NSString+ConciseKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ConciseKit.m"; sourceTree = "<group>"; };
+ E9B778E814BA586F00D8DC76 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; path = README.md; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -112,7 +111,9 @@
29B97314FDCFA39411CA2CEA /* ConciseKit */ = {
isa = PBXGroup;
children = (
- E965CE8712A17F9300416CDF /* ConciseKit */,
+ E9B778E814BA586F00D8DC76 /* README.md */,
+ E965CE8A12A17FC400416CDF /* LICENSE */,
+ E9B778D814BA583500D8DC76 /* src */,
E92CB3401296DC6100BF1922 /* Spec */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
@@ -172,26 +173,23 @@
path = Support;
sourceTree = "<group>";
};
- E965CE8712A17F9300416CDF /* ConciseKit */ = {
+ E9B778D814BA583500D8DC76 /* src */ = {
isa = PBXGroup;
children = (
- E965CE8B12A17FC400416CDF /* README.markdown */,
- E965CE8A12A17FC400416CDF /* LICENSE */,
- E965CE8912A17FC400416CDF /* ConciseKit.h */,
- E965CFB912A1893100416CDF /* ConciseKit.m */,
- E965CE8812A17FC400416CDF /* CKMacros.h */,
- E965CFC012A18A1E00416CDF /* CKAdditions.h */,
- E90F45F1130431E4008EA62A /* CKSingleton.h */,
- E965CEA512A1816600416CDF /* NSArray+ConciseKit.h */,
- E965CEA612A1816600416CDF /* NSArray+ConciseKit.m */,
- E9692C1F12B4B45400520396 /* NSString+ConciseKit.h */,
- E9692C2012B4B45400520396 /* NSString+ConciseKit.m */,
- E925015112D92D890018D373 /* NSDictionary+ConciseKit.h */,
- E925015212D92D890018D373 /* NSDictionary+ConciseKit.m */,
+ E9B778D914BA583600D8DC76 /* CKAdditions.h */,
+ E9B778DA14BA583600D8DC76 /* CKMacros.h */,
+ E9B778DB14BA583600D8DC76 /* CKSingleton.h */,
+ E9B778DC14BA583600D8DC76 /* ConciseKit.h */,
+ E9B778DD14BA583600D8DC76 /* ConciseKit.m */,
+ E9B778DE14BA583600D8DC76 /* NSArray+ConciseKit.h */,
+ E9B778DF14BA583600D8DC76 /* NSArray+ConciseKit.m */,
+ E9B778E014BA583600D8DC76 /* NSDictionary+ConciseKit.h */,
+ E9B778E114BA583600D8DC76 /* NSDictionary+ConciseKit.m */,
+ E9B778E214BA583600D8DC76 /* NSString+ConciseKit.h */,
+ E9B778E314BA583600D8DC76 /* NSString+ConciseKit.m */,
);
- name = ConciseKit;
- path = ..;
- sourceTree = SOURCE_ROOT;
+ path = src;
+ sourceTree = "<group>";
};
/* End PBXGroup section */
@@ -219,8 +217,11 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ConciseKitSpecs" */;
- compatibilityVersion = "Xcode 3.1";
+ compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -245,7 +246,6 @@
files = (
E91C438512985E5A001522E5 /* Specs.xib in Resources */,
E965CE8C12A17FC400416CDF /* LICENSE in Resources */,
- E965CE8D12A17FC400416CDF /* README.markdown in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -260,15 +260,15 @@
E91C438212985E4F001522E5 /* main.m in Sources */,
E91C438312985E4F001522E5 /* ConciseKitSpecsAppDelegate.m in Sources */,
E965CE9412A1805800416CDF /* NSArrayConciseKitSpec.m in Sources */,
- E965CEA712A1816600416CDF /* NSArray+ConciseKit.m in Sources */,
- E965CFBA12A1893100416CDF /* ConciseKit.m in Sources */,
E965CFC212A18A5000416CDF /* ConciseKitSpec.m in Sources */,
E90DAB9D12A66B1D000A36AE /* Foo.m in Sources */,
E90DADE612A6A07A000A36AE /* CKMocks.m in Sources */,
- E9692C2112B4B45400520396 /* NSString+ConciseKit.m in Sources */,
E9692C2612B4B4FF00520396 /* NSStringConciseKitSpec.m in Sources */,
- E925015312D92D890018D373 /* NSDictionary+ConciseKit.m in Sources */,
E925015812D92E250018D373 /* NSDictionaryConciseKitSpec.m in Sources */,
+ E9B778E414BA583600D8DC76 /* ConciseKit.m in Sources */,
+ E9B778E514BA583600D8DC76 /* NSArray+ConciseKit.m in Sources */,
+ E9B778E614BA583600D8DC76 /* NSDictionary+ConciseKit.m in Sources */,
+ E9B778E714BA583600D8DC76 /* NSString+ConciseKit.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -286,7 +286,6 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
- PREBINDING = NO;
SDKROOT = macosx;
};
name = Debug;
@@ -300,7 +299,6 @@
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
SDKROOT = macosx;
};
name = Release;
@@ -316,14 +314,12 @@
"\"$(SRCROOT)/Frameworks\"",
);
GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
INFOPLIST_FILE = "Spec/Support/ConciseKitSpecs-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
- PREBINDING = NO;
PRODUCT_NAME = ConciseKitSpecs;
};
name = Debug;
@@ -339,13 +335,11 @@
"$(inherited)",
"\"$(SRCROOT)/Frameworks\"",
);
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
INFOPLIST_FILE = "Spec/Support/ConciseKitSpecs-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
- PREBINDING = NO;
PRODUCT_NAME = ConciseKitSpecs;
ZERO_LINK = NO;
};
View
7 ConciseKitSpecs/ConciseKitSpecs.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:ConciseKitSpecs.xcodeproj">
+ </FileRef>
+</Workspace>
View
BIN  ...codeproj/project.xcworkspace/xcuserdata/jihoon.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
View
10 ....xcodeproj/project.xcworkspace/xcuserdata/jihoon.xcuserdatad/WorkspaceSettings.xcsettings
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
+ <true/>
+ <key>IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges</key>
+ <true/>
+</dict>
+</plist>
View
84 ...onciseKitSpecs.xcodeproj/xcuserdata/jihoon.xcuserdatad/xcschemes/ConciseKitSpecs.xcscheme
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "E91C437A12985DDD001522E5"
+ BuildableName = "ConciseKitSpecs.app"
+ BlueprintName = "ConciseKitSpecs"
+ ReferencedContainer = "container:ConciseKitSpecs.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "E91C437A12985DDD001522E5"
+ BuildableName = "ConciseKitSpecs.app"
+ BlueprintName = "ConciseKitSpecs"
+ ReferencedContainer = "container:ConciseKitSpecs.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "E91C437A12985DDD001522E5"
+ BuildableName = "ConciseKitSpecs.app"
+ BlueprintName = "ConciseKitSpecs"
+ ReferencedContainer = "container:ConciseKitSpecs.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "E91C437A12985DDD001522E5"
+ BuildableName = "ConciseKitSpecs.app"
+ BlueprintName = "ConciseKitSpecs"
+ ReferencedContainer = "container:ConciseKitSpecs.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
View
22 ...onciseKitSpecs.xcodeproj/xcuserdata/jihoon.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>ConciseKitSpecs.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>E91C437A12985DDD001522E5</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
View
10 README.markdown → ConciseKitSpecs/README.md
@@ -1,7 +1,9 @@
-# ConciseKit 0.0.1
+# ConciseKit
A set of Objective-C additions and macros that lets you to write code more quickly.
+## Pull requests are welcome!
+
## $ class
### Method Swizzling
@@ -156,6 +158,10 @@ Useful when writing tests for asynchronous tasks. Default timeout is 10 seconds,
[string $insert:@"foo" at:1] => [string insertString:@"foo" atIndex:1] (+ returns self)
[string $set:@"foo"] => [string setString:@"foo"] (+ returns self)
+## Contributors
+
+* [nolanw](http://github.com/nolanw)
+
## License
-Copyright (c) 2010 Peter Jihoon Kim. This code is licensed under the MIT License.
+Copyright (c) 2010-2012 Peter Jihoon Kim. This code is licensed under the [MIT License](http://github.com/petejkim/ConciseKit/raw/master/LICENSE).
View
4 ConciseKitSpecs/Spec/ConciseKitSpec.m
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import "SpecHelper.h"
#import "ConciseKit.h"
#import "Foo.h"
View
4 ConciseKitSpecs/Spec/Fixtures/CKMocks.h
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import <Foundation/Foundation.h>
@interface CKMocks : NSObject {}
View
4 ConciseKitSpecs/Spec/Fixtures/CKMocks.m
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import "CKMocks.h"
#import "ConciseKit.h"
View
4 ConciseKitSpecs/Spec/Fixtures/Foo.h
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import <Foundation/Foundation.h>
@interface Foo : NSObject {}
View
4 ConciseKitSpecs/Spec/Fixtures/Foo.m
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import "Foo.h"
@implementation Foo
View
4 ConciseKitSpecs/Spec/NSArrayConciseKitSpec.m
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import "SpecHelper.h"
#import "ConciseKit.h"
View
4 ConciseKitSpecs/Spec/NSDictionaryConciseKitSpec.m
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import "SpecHelper.h"
#import "ConciseKit.h"
View
4 ConciseKitSpecs/Spec/NSStringConciseKitSpec.m
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import "SpecHelper.h"
#import "ConciseKit.h"
View
3  ConciseKitSpecs/src/CKAdditions.h
@@ -0,0 +1,3 @@
+#import "NSArray+ConciseKit.h"
+#import "NSString+ConciseKit.h"
+#import "NSDictionary+ConciseKit.h"
View
4 CKMacros.h → ConciseKitSpecs/src/CKMacros.h
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#ifndef __has_feature
#define __has_feature(x) 0
#endif
View
4 CKSingleton.h → ConciseKitSpecs/src/CKSingleton.h
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#define $shared(Klass) [Klass shared##Klass]
#ifdef ALLOW_ALLOC_INIT_FOR_SINGLETONS
View
4 ConciseKit.h → ConciseKitSpecs/src/ConciseKit.h
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import <Foundation/Foundation.h>
#import "CKMacros.h"
#import "CKAdditions.h"
View
4 ConciseKit.m → ConciseKitSpecs/src/ConciseKit.m
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import "ConciseKit.h"
#import <objc/runtime.h>
View
4 NSArray+ConciseKit.h → ConciseKitSpecs/src/NSArray+ConciseKit.h
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import <Foundation/Foundation.h>
@interface NSArray (ConciseKit)
View
4 NSArray+ConciseKit.m → ConciseKitSpecs/src/NSArray+ConciseKit.m
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import "NSArray+ConciseKit.h"
@implementation NSArray (ConciseKit)
View
4 NSDictionary+ConciseKit.h → ...iseKitSpecs/src/NSDictionary+ConciseKit.h
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import <Foundation/Foundation.h>
@interface NSDictionary (ConciseKit)
View
4 NSDictionary+ConciseKit.m → ...iseKitSpecs/src/NSDictionary+ConciseKit.m
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import "NSDictionary+ConciseKit.h"
@implementation NSDictionary (ConciseKit)
View
4 NSString+ConciseKit.h → ConciseKitSpecs/src/NSString+ConciseKit.h
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import <Foundation/Foundation.h>
@interface NSString (ConciseKit)
View
4 NSString+ConciseKit.m → ConciseKitSpecs/src/NSString+ConciseKit.m
@@ -1,7 +1,3 @@
-/* ConciseKit
- * Copyright 2010 Peter Jihoon Kim
- * Licensed under the MIT License.
- */
#import "NSString+ConciseKit.h"
@implementation NSString (ConciseKit)
View
175 README.md
@@ -0,0 +1,175 @@
+# ConciseKit
+
+A set of Objective-C additions and macros that lets you to write code more quickly.
+
+## Pull requests are welcome!
+
+## USAGE
+
+1. Copy files under `src/` to your project.
+
+```objective-c
+#import "ConciseKit.h"
+```
+
+## $ class
+
+### Method Swizzling
+
+ [$ swizzleMethod:@selector(foo) with:@selector(bar) in:[Foo class]]
+ [$ swizzleMethod:@selector(foo) in:[Foo class] with:@selector(bar) in:[Bar class]]
+
+ [$ swizzleClassMethod:@selector(foo) with:@selector(bar) in:[Foo class]]
+ [$ swizzleClassMethod:@selector(foo) in:[Foo class] with:@selector(bar) in:[Bar class]]
+
+### Path
+
+ [$ homePath] => path to user's home directory
+ [$ desktopPath] => path to user's desktop directory
+ [$ documentPath] => path to user's document directory
+ [$ appPath] => path to app directory
+ [$ resourcePath] => path to app's resources directory
+
+### waitUntil
+
+Useful when writing tests for asynchronous tasks. Default timeout is 10 seconds, checking is done every 0.1 seconds.
+
+ [$ waitUntil:^{ return (BOOL)(someConditionIsMet == YES) }]
+ [$ waitUntil:^{ return (BOOL)(someConditionIsMet == YES) } timeOut:10.0]
+ [$ waitUntil:^{ return (BOOL)(someConditionIsMet == YES) } timeOut:10.0 interval:0.1]
+
+## Singleton
+
+### Creating Singletons
+
+ @interface Foo
+ - (id)initSingleton; // <= add these to the interface
+ + (Foo *)sharedFoo; // <= where Foo is the class name
+ @end
+
+ @implementation Foo
+ $singleton(Foo); // => makes Foo a singleton class
+
+ - (id)initSingleton {
+ foo = 1; // do initialization in -initSingleton method
+ bar = 2;
+ return self;
+ }
+ @end
+
+### Using Singletons
+
+ $shared(Foo) // => returns the shared instance
+ /* or */
+ [Foo sharedFoo]
+
+## Macros
+
+### General shorthands
+
+ $new(Foo) => [[[Foo alloc] init] autorelease]
+ $eql(foo, bar) => [foo isEqual:bar]
+ $safe(obj) => (obj == [NSNull null] ? nil : obj)
+
+### NSArray shorthands
+
+ $arr(foo, bar) => [NSArray arrayWithObjects:foo, bar, nil]
+ $marr(foo, bar) => [NSMutableArray ...]
+
+### NSSet shorthands
+
+ $set(foo, bar) => [NSSet setWithObjects:foo, bar, nil]
+ $mset(foo, bar) => [NSMutableSet ...]
+
+### NSDictionary shorthands
+
+ $dict(v1, k1, v2, k2) => [NSDictionary dictionaryWithObjectsAndKeys:v1, k1, v2, k2, nil]
+ $mdict(v1, k1, v2, k2) => [NSMutableDictionary ...]
+
+### NSString shorthands
+
+ $str(@"foo: %@", bar) => [NSString stringWithFormat:@"foo: %@", bar]
+ $mstr(@"foo: %@", bar) => [NSMutableString ...]
+
+### NSNumber shorthands
+
+ $bool(YES) => [NSNumber numberWithBool:YES]
+ $int(123) => [NSNumber numberWithInt:123]
+ $float(123.4) => [NSNumber numberWithFloat:123.4]
+
+ $char(), $double(), $integer(), $long(), $longlong(), $short(),
+ $uchar(), $uint(), $uinteger(), $ulong(), $ulonglong(), $ushort()
+
+### NSValue shorthands
+ $nonretained(), $pointer(), $point(), $range(), $rect(), $size()
+
+## Additions
+
+### NSArray
+
+ [array $first] => [array objectAtIndex:0]
+ [array $last] => [array lastObject]
+ [array $at:1] => [array objectAtIndex:1]
+
+ [array $each:^(id obj) {
+ NSLog(@"%@", obj);
+ }]
+
+ [array $eachWithIndex:^(id obj, NSUInteger i) {
+ NSLog(@"%d %@", i, obj);
+ }]
+
+ [array $eachWithStop:^(id obj, BOOL *stop) {
+ NSLog(@"%@", obj);
+ if($eql(obj, @"foo")) {
+ *stop = YES;
+ }
+ }]
+
+ [array $eachWithIndexAndStop:^(id obj, NSUInteger i, BOOL *stop) {
+ NSLog(@"%d %@", i, obj);
+ if(i == 1) {
+ *stop = YES;
+ }
+ }]
+
+ [array $map:^(id obj) {
+ return $integer([obj integerValue] * 2);
+ }]
+
+ [array $mapWithIndex:^(id obj, NSUInteger i) {
+ return $integer([obj integerValue] * 2 + i);
+ }]
+
+### NSMutableArray
+
+ [array $push:foo] => [array addObject:foo] (+ returns self)
+
+### NSDictionary
+
+ [dict $for:@"foo"] => [dict objectForKey:@"foo"]
+
+### NSMutableDictionary
+
+ [dict $obj:@"bar" for:@"foo"] => [dict setObject:@"bar" forKey:@"foo"] (+ returns self)
+
+### NSString
+
+ [string $append:@"foo"] => [string stringByAppendString:@"foo"]
+ [string $prepend:@"foo"] => [NSString stringWithFormat:@"%@%@", @"foo", string]
+ [string $split:@","] => [string componentsSeparatedByString:@","]
+
+### NSMutableString
+
+ [string $append_:@"foo"] => [string appendString:@"foo"] (+ returns self)
+ [string $prepend_:@"foo"] => [string insertString:@"foo" atIndex:0] (+ returns self)
+ [string $insert:@"foo" at:1] => [string insertString:@"foo" atIndex:1] (+ returns self)
+ [string $set:@"foo"] => [string setString:@"foo"] (+ returns self)
+
+## Contributors
+
+* [nolanw](http://github.com/nolanw)
+
+## License
+
+Copyright (c) 2010-2012 Peter Jihoon Kim. This code is licensed under the [MIT License](http://github.com/petejkim/ConciseKit/raw/master/LICENSE).
View
3  src/CKAdditions.h
@@ -0,0 +1,3 @@
+#import "NSArray+ConciseKit.h"
+#import "NSString+ConciseKit.h"
+#import "NSDictionary+ConciseKit.h"
View
45 src/CKMacros.h
@@ -0,0 +1,45 @@
+#ifndef __has_feature
+ #define __has_feature(x) 0
+#endif
+#if __has_feature(objc_arc)
+ #define IF_ARC(with, without) with
+#else
+ #define IF_ARC(with, without) without
+#endif
+
+#define $new(Klass) IF_ARC([[Klass alloc] init], [[[Klass alloc] init] autorelease])
+#define $eql(a,b) [(a) isEqual:(b)]
+
+#define $arr(...) [NSArray arrayWithObjects:__VA_ARGS__, nil]
+#define $marr(...) [NSMutableArray arrayWithObjects:__VA_ARGS__, nil]
+#define $set(...) [NSSet setWithObjects:__VA_ARGS__, nil]
+#define $mset(...) [NSMutableSet setWithObjects:__VA_ARGS__, nil]
+#define $dict(...) [NSDictionary dictionaryWithObjectsAndKeys:__VA_ARGS__, nil]
+#define $mdict(...) [NSMutableDictionary dictionaryWithObjectsAndKeys:__VA_ARGS__, nil]
+#define $str(...) [NSString stringWithFormat:__VA_ARGS__]
+#define $mstr(...) [NSMutableString stringWithFormat:__VA_ARGS__]
+
+#define $bool(val) [NSNumber numberWithBool:(val)]
+#define $char(val) [NSNumber numberWithChar:(val)]
+#define $double(val) [NSNumber numberWithDouble:(val)]
+#define $float(val) [NSNumber numberWithFloat:(val)]
+#define $int(val) [NSNumber numberWithInt:(val)]
+#define $integer(val) [NSNumber numberWithInteger:(val)]
+#define $long(val) [NSNumber numberWithLong:(val)]
+#define $longlong(val) [NSNumber numberWithLongLong:(val)]
+#define $short(val) [NSNumber numberWithShort:(val)]
+#define $uchar(val) [NSNumber numberWithUnsignedChar:(val)]
+#define $uint(val) [NSNumber numberWithUnsignedInt:(val)]
+#define $uinteger(val) [NSNumber numberWithUnsignedInteger:(val)]
+#define $ulong(val) [NSNumber numberWithUnsignedLong:(val)]
+#define $ulonglong(val) [NSNumber numberWithUnsignedLongLong:(val)]
+#define $ushort(val) [NSNumber numberWithUnsignedShort:(val)]
+
+#define $nonretained(val) [NSValue valueWithNonretainedObject:(val)]
+#define $pointer(val) [NSValue valueWithPointer:(val)]
+#define $point(val) [NSValue valueWithPoint:(val)]
+#define $range(val) [NSValue valueWithRange:(val)]
+#define $rect(val) [NSValue valueWithRect:(val)]
+#define $size(val) [NSValue valueWithSize:(val)]
+
+#define $safe(obj) ((NSNull *)(obj) == [NSNull null] ? nil : (obj))
View
71 src/CKSingleton.h
@@ -0,0 +1,71 @@
+#define $shared(Klass) [Klass shared##Klass]
+
+#ifdef ALLOW_ALLOC_INIT_FOR_SINGLETONS
+ #define $singleton(Klass)\
+ \
+ static Klass *shared##Klass = nil;\
+ \
+ + (Klass *)shared##Klass {\
+ @synchronized(self) {\
+ if(shared##Klass == nil) {\
+ shared##Klass = [[super allocWithZone:NULL] initSingleton];\
+ }\
+ }\
+ return shared##Klass;\
+ }\
+ \
+ - (id)init {\
+ if((self = [super init])) {\
+ [self initSingleton];\
+ }\
+ return self;\
+ }
+#else
+ #define $singleton(Klass)\
+ \
+ static Klass *shared##Klass = nil;\
+ \
+ + (Klass *)shared##Klass {\
+ @synchronized(self) {\
+ if(shared##Klass == nil) {\
+ shared##Klass = [[super allocWithZone:NULL] init];\
+ }\
+ }\
+ return shared##Klass;\
+ }\
+ \
+ + (id)allocWithZone:(NSZone *)zone {\
+ return [[self shared##Klass] retain];\
+ }\
+ \
+ - (id)copyWithZone:(NSZone *)zone {\
+ return self;\
+ }\
+ \
+ - (id)retain {\
+ return self;\
+ }\
+ \
+ - (NSUInteger)retainCount {\
+ return NSUIntegerMax;\
+ }\
+ \
+ - (void)release {}\
+ \
+ - (id)autorelease {\
+ return self;\
+ }\
+ \
+ + (BOOL)isShared##Klass##Present {\
+ return shared##Klass != nil;\
+ }\
+ \
+ - (id)init {\
+ if(![[self class] isShared##Klass##Present]) {\
+ if((self = [super init])) {\
+ [self initSingleton];\
+ }\
+ }\
+ return self;\
+ }
+#endif
View
26 src/ConciseKit.h
@@ -0,0 +1,26 @@
+#import <Foundation/Foundation.h>
+#import "CKMacros.h"
+#import "CKAdditions.h"
+#import "CKSingleton.h"
+
+@interface ConciseKit : NSObject {}
+
++ (NSString *)homePath;
++ (NSString *)desktopPath;
++ (NSString *)documentPath;
++ (NSString *)appPath;
++ (NSString *)resourcePath;
+
++ (BOOL)swizzleMethod:(SEL)originalSelector with:(SEL)anotherSelector in:(Class)klass;
++ (BOOL)swizzleMethod:(SEL)originalSelector in:(Class)klass with:(SEL)anotherSelector in:(Class)anotherKlass;
++ (BOOL)swizzleClassMethod:(SEL)originalSelector with:(SEL)anotherSelector in:(Class)klass;
++ (BOOL)swizzleClassMethod:(SEL)originalSelector in:(Class)klass with:(SEL)anotherSelector in:(Class)anotherKlass;
+
++ (void)waitUntil:(BOOL (^)(void))condition;
++ (void)waitUntil:(BOOL (^)(void))condition timeOut:(NSTimeInterval)timeOut;
++ (void)waitUntil:(BOOL (^)(void))condition timeOut:(NSTimeInterval)timeOut interval:(NSTimeInterval)interval;
+
+@end
+
+@interface $ : ConciseKit {}
+@end
View
94 src/ConciseKit.m
@@ -0,0 +1,94 @@
+#import "ConciseKit.h"
+#import <objc/runtime.h>
+
+@implementation ConciseKit
+
++ (NSString *)homePath {
+ return NSHomeDirectory();
+}
+
++ (NSString *)desktopPath {
+ return [NSSearchPathForDirectoriesInDomains(NSDesktopDirectory, NSUserDomainMask, YES) objectAtIndex:0];
+}
+
++ (NSString *)documentPath {
+ return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
+}
+
++ (NSString *)appPath {
+ return [[NSBundle mainBundle] bundlePath];
+}
+
++ (NSString *)resourcePath {
+ return [[NSBundle mainBundle] resourcePath];
+}
+
++ (BOOL)swizzleMethod:(SEL)originalSelector with:(SEL)anotherSelector in:(Class)klass {
+ return [self swizzleMethod:originalSelector in:klass with:anotherSelector in:klass];
+}
+
++ (BOOL)swizzleMethod:(SEL)originalSelector in:(Class)klass with:(SEL)anotherSelector in:(Class)anotherKlass {
+ Method originalMethod = class_getInstanceMethod(klass, originalSelector);
+ Method anotherMethod = class_getInstanceMethod(anotherKlass, anotherSelector);
+ if(!originalMethod || !anotherMethod) {
+ return NO;
+ }
+ IMP originalMethodImplementation = class_getMethodImplementation(klass, originalSelector);
+ IMP anotherMethodImplementation = class_getMethodImplementation(anotherKlass, anotherSelector);
+ if(class_addMethod(klass, originalSelector, originalMethodImplementation, method_getTypeEncoding(originalMethod))) {
+ originalMethod = class_getInstanceMethod(klass, originalSelector);
+ }
+ if(class_addMethod(anotherKlass, anotherSelector, anotherMethodImplementation, method_getTypeEncoding(anotherMethod))) {
+ anotherMethod = class_getInstanceMethod(anotherKlass, anotherSelector);
+ }
+ method_exchangeImplementations(originalMethod, anotherMethod);
+ return YES;
+}
+
++ (BOOL)swizzleClassMethod:(SEL)originalSelector with:(SEL)anotherSelector in:(Class)klass {
+ return [self swizzleClassMethod:originalSelector in:klass with:anotherSelector in:klass];
+}
+
++ (BOOL)swizzleClassMethod:(SEL)originalSelector in:(Class)klass with:(SEL)anotherSelector in:(Class)anotherKlass {
+ Method originalMethod = class_getClassMethod(klass, originalSelector);
+ Method anotherMethod = class_getClassMethod(anotherKlass, anotherSelector);
+ if(!originalMethod || !anotherMethod) {
+ return NO;
+ }
+ Class metaClass = objc_getMetaClass(class_getName(klass));
+ Class anotherMetaClass = objc_getMetaClass(class_getName(anotherKlass));
+ IMP originalMethodImplementation = class_getMethodImplementation(metaClass, originalSelector);
+ IMP anotherMethodImplementation = class_getMethodImplementation(anotherMetaClass, anotherSelector);
+ if(class_addMethod(metaClass, originalSelector, originalMethodImplementation, method_getTypeEncoding(originalMethod))) {
+ originalMethod = class_getClassMethod(klass, originalSelector);
+ }
+ if(class_addMethod(anotherMetaClass, anotherSelector, anotherMethodImplementation, method_getTypeEncoding(anotherMethod))) {
+ anotherMethod = class_getClassMethod(anotherKlass, anotherSelector);
+ }
+ method_exchangeImplementations(originalMethod, anotherMethod);
+ return YES;
+}
+
++ (void)waitUntil:(BOOL (^)(void))condition {
+ [self waitUntil:condition timeOut:10.0 interval:0.1];
+}
+
++ (void)waitUntil:(BOOL (^)(void))condition timeOut:(NSTimeInterval)timeOut {
+ [self waitUntil:condition timeOut:timeOut interval:0.1];
+}
+
++ (void)waitUntil:(BOOL (^)(void))condition timeOut:(NSTimeInterval)timeOut interval:(NSTimeInterval)interval {
+ NSTimeInterval sleptSoFar=0;
+ while(1) {
+ if(condition() || (sleptSoFar >= timeOut)) {
+ return;
+ }
+ [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:interval]];
+ sleptSoFar += interval;
+ }
+}
+
+@end
+
+@implementation $
+@end
View
21 src/NSArray+ConciseKit.h
@@ -0,0 +1,21 @@
+#import <Foundation/Foundation.h>
+
+@interface NSArray (ConciseKit)
+
+- (id)$first;
+- (id)$last;
+- (id)$at:(NSUInteger)index;
+- (NSArray *)$each:(void (^)(id obj))block;
+- (NSArray *)$eachWithIndex:(void (^)(id obj, NSUInteger idx))block;
+- (NSArray *)$eachWithStop:(void (^)(id obj, BOOL *stop))block;
+- (NSArray *)$eachWithIndexAndStop:(void (^)(id obj, NSUInteger idx, BOOL *stop))block;
+- (NSArray *)$map:(id (^)(id obj))block;
+- (NSArray *)$mapWithIndex:(id (^)(id obj, NSUInteger idx))block;
+
+@end
+
+@interface NSMutableArray (ConciseKit)
+
+- (NSMutableArray *)$push:(id)anObject;
+
+@end
View
70 src/NSArray+ConciseKit.m
@@ -0,0 +1,70 @@
+#import "NSArray+ConciseKit.h"
+
+@implementation NSArray (ConciseKit)
+
+- (id)$first {
+ return [self objectAtIndex:0];
+}
+
+- (id)$last {
+ return [self lastObject];
+}
+
+- (id)$at:(NSUInteger)index {
+ return [self objectAtIndex:index];
+}
+
+- (NSArray *)$each:(void (^)(id obj))block {
+ [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ block(obj);
+ }];
+ return self;
+}
+
+- (NSArray *)$eachWithIndex:(void (^)(id obj, NSUInteger idx))block {
+ [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ block(obj, idx);
+ }];
+ return self;
+}
+
+- (NSArray *)$eachWithStop:(void (^)(id obj, BOOL *stop))block {
+ [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ block(obj, stop);
+ }];
+ return self;
+}
+
+- (NSArray *)$eachWithIndexAndStop:(void (^)(id obj, NSUInteger idx, BOOL *stop))block {
+ [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ block(obj, idx, stop);
+ }];
+ return self;
+}
+
+- (NSArray *)$map:(id (^)(id obj))block {
+ __block NSMutableArray *array = [NSMutableArray arrayWithCapacity:[self count]];
+ [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ [array addObject:block(obj)];
+ }];
+ return array;
+}
+
+- (NSArray *)$mapWithIndex:(id (^)(id obj, NSUInteger idx))block {
+ __block NSMutableArray *array = [NSMutableArray arrayWithCapacity:[self count]];
+ [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ [array addObject:block(obj, idx)];
+ }];
+ return array;
+}
+
+@end
+
+@implementation NSMutableArray (ConciseKit)
+
+- (NSMutableArray *)$push:(id)anObject {
+ [self addObject:anObject];
+ return self;
+}
+
+@end
View
13 src/NSDictionary+ConciseKit.h
@@ -0,0 +1,13 @@
+#import <Foundation/Foundation.h>
+
+@interface NSDictionary (ConciseKit)
+
+- (id)$for:(id)aKey;
+
+@end
+
+@interface NSMutableDictionary (ConciseKit)
+
+- (NSMutableDictionary *)$obj:(id)anObject for:(id)aKey;
+
+@end
View
18 src/NSDictionary+ConciseKit.m
@@ -0,0 +1,18 @@
+#import "NSDictionary+ConciseKit.h"
+
+@implementation NSDictionary (ConciseKit)
+
+- (id)$for:(id)aKey {
+ return [self objectForKey:aKey];
+}
+
+@end
+
+@implementation NSMutableDictionary (ConciseKit)
+
+- (NSMutableDictionary *)$obj:(id)anObject for:(id)aKey {
+ [self setObject:anObject forKey:aKey];
+ return self;
+}
+
+@end
View
18 src/NSString+ConciseKit.h
@@ -0,0 +1,18 @@
+#import <Foundation/Foundation.h>
+
+@interface NSString (ConciseKit)
+
+- (NSString *)$append:(NSString *)aString;
+- (NSString *)$prepend:(NSString *)aString;
+- (NSArray *)$split:(NSString *)aString;
+
+@end
+
+@interface NSMutableString (ConciseKit)
+
+- (NSMutableString *)$append_:(NSString *)aString;
+- (NSMutableString *)$prepend_:(NSString *)aString;
+- (NSMutableString *)$insert:(NSString *)aString at:(NSUInteger)anIndex;
+- (NSMutableString *)$set:(NSString *)aString;
+
+@end
View
41 src/NSString+ConciseKit.m
@@ -0,0 +1,41 @@
+#import "NSString+ConciseKit.h"
+
+@implementation NSString (ConciseKit)
+
+- (NSString *)$append:(NSString *)aString {
+ return [self stringByAppendingString:aString];
+}
+
+- (NSString *)$prepend:(NSString *)aString {
+ return [NSString stringWithFormat:@"%@%@", aString, self];
+}
+
+- (NSArray *)$split:(NSString *)aString {
+ return [self componentsSeparatedByString:aString];
+}
+
+@end
+
+@implementation NSMutableString (ConciseKit)
+
+- (NSMutableString *)$append_:(NSString *)aString {
+ [self appendString:aString];
+ return self;
+}
+
+- (NSMutableString *)$prepend_:(NSString *)aString {
+ [self insertString:aString atIndex:0];
+ return self;
+}
+
+- (NSMutableString *)$insert:(NSString *)aString at:(NSUInteger)anIndex {
+ [self insertString:aString atIndex:anIndex];
+ return self;
+}
+
+- (NSMutableString *)$set:(NSString *)aString {
+ [self setString:aString];
+ return self;
+}
+
+@end
Please sign in to comment.
Something went wrong with that request. Please try again.