appjam 0.1.8.7 → 0.1.8.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +9 -1
- data/lib/appjam/generators/help.rb +1 -1
- data/lib/appjam/generators/templates/blank/EiffelApplication.xcodeproj/project.pbxproj +356 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication.xcodeproj/project.xcworkspace/xcuserdata/eiffel.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/AppDelegate.h.tt +3 -3
- data/lib/appjam/generators/templates/blank/EiffelApplication/AppDelegate.m.tt +5 -5
- data/lib/appjam/generators/templates/blank/EiffelApplication/EiffelApplication-Info.plist +1 -1
- data/lib/appjam/generators/templates/blank/EiffelApplication/EiffelApplication-Prefix.pch.tt +1 -1
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/Toast/Toast+UIView.h +51 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/Toast/Toast+UIView.m +315 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/RaptureXML/RXMLElement.h +97 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/RaptureXML/RXMLElement.m +450 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/Objective-C-HMTL-Parser/HTMLNode.h +111 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/Objective-C-HMTL-Parser/HTMLNode.m +412 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/Objective-C-HMTL-Parser/HTMLParser.h +37 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/Objective-C-HMTL-Parser/HTMLParser.m +130 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSArray+ObjectiveSugar.h +39 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSArray+ObjectiveSugar.m +145 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSDictionary+ObjectiveSugar.h +18 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSDictionary+ObjectiveSugar.m +42 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSMutableArray+ObjectiveSugar.h +18 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSMutableArray+ObjectiveSugar.m +37 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSNumber+ObjectiveSugar.h +45 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSNumber+ObjectiveSugar.m +117 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSSet+ObjectiveSugar.h +21 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSSet+ObjectiveSugar.m +50 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSString+ObjectiveSugar.h +17 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/NSString+ObjectiveSugar.m +43 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/ObjectiveSugar/ObjectiveSugar.h +10 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SSKeychain/SSKeychain.h +160 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SSKeychain/SSKeychain.m +79 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SSKeychain/SSKeychainQuery.h +80 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SSKeychain/SSKeychainQuery.m +228 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SecureUDID/SecureUDID.h +75 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SecureUDID/SecureUDID.m +679 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Helpers/NSString+Versioning.h +41 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Helpers/NSString+Versioning.m +71 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Helpers/SS+Functions.h +38 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Helpers/SS+Functions.m +122 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Helpers/SS+System.h +41 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Helpers/SS+System.m +132 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Helpers/SSArguments.h +156 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSArray+JavaScript.h +46 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSArray+JavaScript.m +135 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSDate+JavaScript.h +42 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSDate+JavaScript.m +90 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSDictionary+JavaScript.h +38 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSDictionary+JavaScript.m +38 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSMutableArray+JavaScript.h +46 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSMutableArray+JavaScript.m +131 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSMutableDictionary+JavaScript.h +36 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSMutableDictionary+JavaScript.m +42 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSMutableString+JavaScript.h +36 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSMutableString+JavaScript.m +42 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSNumber+JavaScript.h +36 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSNumber+JavaScript.m +44 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSObject+JavaScript.h +50 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSObject+JavaScript.m +114 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSString+JavaScript.h +43 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/NSString+JavaScript.m +94 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/SS+JavaScript.h +52 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/SS+JavaScript.m +168 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/SS+Types.h +42 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/JavaScript/SS+Types.m +42 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/NSDictionary+NamedProperties.h +41 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/NSDictionary+NamedProperties.m +271 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/SS.h +36 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/SS.m +38 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/SubjectiveScript.h +67 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/SubjectiveScript.m +30 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSArray+SS.h +58 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSArray+SS.m +152 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSDate+SS.h +37 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSDate+SS.m +47 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSDictionary+SS.h +45 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSDictionary+SS.m +61 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSMutableArray+SS.h +43 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSMutableArray+SS.m +83 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSMutableDictionary+SS.h +47 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSMutableDictionary+SS.m +100 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSMutableString+SS.h +42 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSMutableString+SS.m +70 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSNumber+SS.h +51 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSNumber+SS.m +86 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSObject+SS.h +54 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSObject+SS.m +153 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSString+SS.h +46 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/NSString+SS.m +91 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/SubjectiveScript/Types/SSTypes.h +67 -0
- data/lib/appjam/generators/templates/blank/EiffelApplicationTests/EiffelApplicationTests-Info.plist +1 -1
- data/lib/appjam/generators/templates/blank/EiffelApplicationTests/EiffelApplicationTests.h.tt +5 -5
- data/lib/appjam/generators/templates/blank/EiffelApplicationTests/EiffelApplicationTests.m.tt +7 -7
- data/lib/appjam/version.rb +1 -1
- metadata +84 -3
@@ -0,0 +1,38 @@
|
|
1
|
+
//
|
2
|
+
// NSDictionary+JavaScript.h
|
3
|
+
// SubjectiveScript.m
|
4
|
+
//
|
5
|
+
// Created by Kevin Malakoff on 7/29/12.
|
6
|
+
// Copyright (c) 2012 Kevin Malakoff. All rights reserved.
|
7
|
+
//
|
8
|
+
// Permission is hereby granted, free of charge, to any person
|
9
|
+
// obtaining a copy of this software and associated documentation
|
10
|
+
// files (the "Software"), to deal in the Software without
|
11
|
+
// restriction, including without limitation the rights to use,
|
12
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
// copies of the Software, and to permit persons to whom the
|
14
|
+
// Software is furnished to do so, subject to the following
|
15
|
+
// conditions:
|
16
|
+
//
|
17
|
+
// The above copyright notice and this permission notice shall be
|
18
|
+
// included in all copies or substantial portions of the Software.
|
19
|
+
//
|
20
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
21
|
+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
22
|
+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
23
|
+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
24
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
25
|
+
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
27
|
+
// OTHER DEALINGS IN THE SOFTWARE.
|
28
|
+
//
|
29
|
+
|
30
|
+
#import "SSTypes.h"
|
31
|
+
|
32
|
+
@interface NSDictionary (JavaScript)
|
33
|
+
|
34
|
+
- (NSS*(^)())toString;
|
35
|
+
|
36
|
+
- (B(^)(id key))hasOwnProperty;
|
37
|
+
|
38
|
+
@end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
//
|
2
|
+
// NSDictionary+JavaScript.m
|
3
|
+
// SubjectiveScript.m
|
4
|
+
//
|
5
|
+
// Created by Kevin Malakoff on 7/29/12.
|
6
|
+
// Copyright (c) 2012 Kevin Malakoff. All rights reserved.
|
7
|
+
//
|
8
|
+
// Permission is hereby granted, free of charge, to any person
|
9
|
+
// obtaining a copy of this software and associated documentation
|
10
|
+
// files (the "Software"), to deal in the Software without
|
11
|
+
// restriction, including without limitation the rights to use,
|
12
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
// copies of the Software, and to permit persons to whom the
|
14
|
+
// Software is furnished to do so, subject to the following
|
15
|
+
// conditions:
|
16
|
+
//
|
17
|
+
// The above copyright notice and this permission notice shall be
|
18
|
+
// included in all copies or substantial portions of the Software.
|
19
|
+
//
|
20
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
21
|
+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
22
|
+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
23
|
+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
24
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
25
|
+
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
27
|
+
// OTHER DEALINGS IN THE SOFTWARE.
|
28
|
+
//
|
29
|
+
|
30
|
+
#import "NSDictionary+JavaScript.h"
|
31
|
+
|
32
|
+
@implementation NSDictionary (JavaScript)
|
33
|
+
|
34
|
+
- (NSS*(^)())toString { return ^{ return @"[object Object]"; }; }
|
35
|
+
|
36
|
+
- (B(^)(id key))hasOwnProperty { return ^B(id key) { return [self objectForKey:key] != nil; }; }
|
37
|
+
|
38
|
+
@end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
//
|
2
|
+
// NSMutableArray+JavaScript.h
|
3
|
+
// SubjectiveScript.m
|
4
|
+
//
|
5
|
+
// Created by Kevin Malakoff on 7/29/12.
|
6
|
+
// Copyright (c) 2012 Kevin Malakoff. All rights reserved.
|
7
|
+
//
|
8
|
+
// Permission is hereby granted, free of charge, to any person
|
9
|
+
// obtaining a copy of this software and associated documentation
|
10
|
+
// files (the "Software"), to deal in the Software without
|
11
|
+
// restriction, including without limitation the rights to use,
|
12
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
// copies of the Software, and to permit persons to whom the
|
14
|
+
// Software is furnished to do so, subject to the following
|
15
|
+
// conditions:
|
16
|
+
//
|
17
|
+
// The above copyright notice and this permission notice shall be
|
18
|
+
// included in all copies or substantial portions of the Software.
|
19
|
+
//
|
20
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
21
|
+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
22
|
+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
23
|
+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
24
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
25
|
+
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
27
|
+
// OTHER DEALINGS IN THE SOFTWARE.
|
28
|
+
//
|
29
|
+
|
30
|
+
#import "SSTypes.h"
|
31
|
+
|
32
|
+
@interface NSMutableArray (JavaScript)
|
33
|
+
|
34
|
+
// accessor Array functions
|
35
|
+
- (A*(^)(NSA* other))concat;
|
36
|
+
- (A*(^)())reverse;
|
37
|
+
|
38
|
+
// mutator Array functions
|
39
|
+
- (NSO*(^)())pop;
|
40
|
+
- (A*(^)(id value))push;
|
41
|
+
- (A*(^)(SSSortBlock iterator))sort;
|
42
|
+
- (NSA*(^)(I start, I count, id item1, ... /* NIL_TERMINATED */))splice;
|
43
|
+
- (A*(^)(id item1, ... /* NIL_TERMINATED */))unshift;
|
44
|
+
- (NSO*(^)())shift;
|
45
|
+
|
46
|
+
@end
|
@@ -0,0 +1,131 @@
|
|
1
|
+
//
|
2
|
+
// NSMutableArray+JavaScript.m
|
3
|
+
// SubjectiveScript.m
|
4
|
+
//
|
5
|
+
// Created by Kevin Malakoff on 7/29/12.
|
6
|
+
// Copyright (c) 2012 Kevin Malakoff. All rights reserved.
|
7
|
+
//
|
8
|
+
// Permission is hereby granted, free of charge, to any person
|
9
|
+
// obtaining a copy of this software and associated documentation
|
10
|
+
// files (the "Software"), to deal in the Software without
|
11
|
+
// restriction, including without limitation the rights to use,
|
12
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
// copies of the Software, and to permit persons to whom the
|
14
|
+
// Software is furnished to do so, subject to the following
|
15
|
+
// conditions:
|
16
|
+
//
|
17
|
+
// The above copyright notice and this permission notice shall be
|
18
|
+
// included in all copies or substantial portions of the Software.
|
19
|
+
//
|
20
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
21
|
+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
22
|
+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
23
|
+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
24
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
25
|
+
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
27
|
+
// OTHER DEALINGS IN THE SOFTWARE.
|
28
|
+
//
|
29
|
+
|
30
|
+
#import "NSMutableArray+JavaScript.h"
|
31
|
+
#import "NSMutableArray+SS.h"
|
32
|
+
#import "NSArray+SS.h"
|
33
|
+
#import "SS+Types.h"
|
34
|
+
#import "SSArguments.h"
|
35
|
+
|
36
|
+
@implementation NSMutableArray (JavaScript)
|
37
|
+
|
38
|
+
// accessor Array functions
|
39
|
+
- (A*(^)(NSA* other))concat
|
40
|
+
{
|
41
|
+
return ^(NSA* other) {
|
42
|
+
A* result = self.mutableCopy;
|
43
|
+
[result addObjectsFromArray:other];
|
44
|
+
return result;
|
45
|
+
};
|
46
|
+
}
|
47
|
+
|
48
|
+
// mutator Array functions
|
49
|
+
- (A*(^)(id))push
|
50
|
+
{
|
51
|
+
return ^(id value) {
|
52
|
+
[self addObject:value];
|
53
|
+
return self;
|
54
|
+
};
|
55
|
+
}
|
56
|
+
|
57
|
+
- (NSO*(^)())pop
|
58
|
+
{
|
59
|
+
return ^() {
|
60
|
+
id value = [self lastObject];
|
61
|
+
[self removeLastObject];
|
62
|
+
return value;
|
63
|
+
};
|
64
|
+
}
|
65
|
+
|
66
|
+
- (A*(^)())reverse
|
67
|
+
{
|
68
|
+
return ^{
|
69
|
+
A* result = A.newC(self.count);
|
70
|
+
for (id item in self.reverseObjectEnumerator) {
|
71
|
+
[result addObject:item];
|
72
|
+
}
|
73
|
+
return result;
|
74
|
+
};
|
75
|
+
}
|
76
|
+
|
77
|
+
- (A*(^)(SSSortBlock iterator))sort
|
78
|
+
{
|
79
|
+
return ^(SSSortBlock block) {
|
80
|
+
if (SS.isBlock(block))
|
81
|
+
[self sortUsingComparator:block];
|
82
|
+
else
|
83
|
+
[self sortUsingSelector:@selector(compare:)];
|
84
|
+
return self;
|
85
|
+
};
|
86
|
+
}
|
87
|
+
|
88
|
+
- (NSA*(^)(I start, I count, id item1, ... /* NIL_TERMINATED */))splice
|
89
|
+
{
|
90
|
+
return ^(I start, I count, id item1, ... /* NIL_TERMINATED */) {
|
91
|
+
ARGS_AO(items, item1);
|
92
|
+
|
93
|
+
NSA* results;
|
94
|
+
NSRange range = self.resolveRange(start, count);
|
95
|
+
if (range.length>0)
|
96
|
+
{
|
97
|
+
results = [self subarrayWithRange:range];
|
98
|
+
[self removeObjectsInRange:range];
|
99
|
+
}
|
100
|
+
else
|
101
|
+
results = NSA.new;
|
102
|
+
|
103
|
+
for (id item in items.reverseObjectEnumerator)
|
104
|
+
[self insertObject:item atIndex:range.location];
|
105
|
+
|
106
|
+
return results;
|
107
|
+
};
|
108
|
+
}
|
109
|
+
|
110
|
+
- (A*(^)(id item1, ...))unshift
|
111
|
+
{
|
112
|
+
return ^(id item1, ...) {
|
113
|
+
ARGS_AO(items, item1);
|
114
|
+
for (id item in items.reverseObjectEnumerator)
|
115
|
+
[self insertObject:item atIndex:0];
|
116
|
+
|
117
|
+
return self;
|
118
|
+
};
|
119
|
+
}
|
120
|
+
|
121
|
+
- (NSO*(^)())shift
|
122
|
+
{
|
123
|
+
return ^NSO*() {
|
124
|
+
if (!self.count) return nil;
|
125
|
+
id value = [self objectAtIndex:0];
|
126
|
+
[self removeObjectAtIndex:0];
|
127
|
+
return value;
|
128
|
+
};
|
129
|
+
}
|
130
|
+
|
131
|
+
@end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
//
|
2
|
+
// NSMutableDictionary+JavaScript.h
|
3
|
+
// SubjectiveScript.m
|
4
|
+
//
|
5
|
+
// Created by Kevin Malakoff on 7/29/12.
|
6
|
+
// Copyright (c) 2012 Kevin Malakoff. All rights reserved.
|
7
|
+
//
|
8
|
+
// Permission is hereby granted, free of charge, to any person
|
9
|
+
// obtaining a copy of this software and associated documentation
|
10
|
+
// files (the "Software"), to deal in the Software without
|
11
|
+
// restriction, including without limitation the rights to use,
|
12
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
// copies of the Software, and to permit persons to whom the
|
14
|
+
// Software is furnished to do so, subject to the following
|
15
|
+
// conditions:
|
16
|
+
//
|
17
|
+
// The above copyright notice and this permission notice shall be
|
18
|
+
// included in all copies or substantial portions of the Software.
|
19
|
+
//
|
20
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
21
|
+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
22
|
+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
23
|
+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
24
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
25
|
+
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
27
|
+
// OTHER DEALINGS IN THE SOFTWARE.
|
28
|
+
//
|
29
|
+
|
30
|
+
#import "SSTypes.h"
|
31
|
+
|
32
|
+
@interface NSMutableDictionary (JavaScript)
|
33
|
+
|
34
|
+
- (O*(^)(id key))delete_;
|
35
|
+
|
36
|
+
@end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
//
|
2
|
+
// NSMutableDictionary+JavaScript.m
|
3
|
+
// SubjectiveScript.m
|
4
|
+
//
|
5
|
+
// Created by Kevin Malakoff on 7/29/12.
|
6
|
+
// Copyright (c) 2012 Kevin Malakoff. All rights reserved.
|
7
|
+
//
|
8
|
+
// Permission is hereby granted, free of charge, to any person
|
9
|
+
// obtaining a copy of this software and associated documentation
|
10
|
+
// files (the "Software"), to deal in the Software without
|
11
|
+
// restriction, including without limitation the rights to use,
|
12
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
// copies of the Software, and to permit persons to whom the
|
14
|
+
// Software is furnished to do so, subject to the following
|
15
|
+
// conditions:
|
16
|
+
//
|
17
|
+
// The above copyright notice and this permission notice shall be
|
18
|
+
// included in all copies or substantial portions of the Software.
|
19
|
+
//
|
20
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
21
|
+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
22
|
+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
23
|
+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
24
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
25
|
+
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
27
|
+
// OTHER DEALINGS IN THE SOFTWARE.
|
28
|
+
//
|
29
|
+
|
30
|
+
#import "NSMutableDictionary+JavaScript.h"
|
31
|
+
|
32
|
+
@implementation NSMutableDictionary (JavaScript)
|
33
|
+
|
34
|
+
- (O*(^)(id key))delete_
|
35
|
+
{
|
36
|
+
return ^(id key) {
|
37
|
+
[self removeObjectForKey:key];
|
38
|
+
return self;
|
39
|
+
};
|
40
|
+
}
|
41
|
+
|
42
|
+
@end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
//
|
2
|
+
// NSMutableString+JavaScript.h
|
3
|
+
// SubjectiveScript.m
|
4
|
+
//
|
5
|
+
// Created by Kevin Malakoff on 7/29/12.
|
6
|
+
// Copyright (c) 2012 Kevin Malakoff. All rights reserved.
|
7
|
+
//
|
8
|
+
// Permission is hereby granted, free of charge, to any person
|
9
|
+
// obtaining a copy of this software and associated documentation
|
10
|
+
// files (the "Software"), to deal in the Software without
|
11
|
+
// restriction, including without limitation the rights to use,
|
12
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
// copies of the Software, and to permit persons to whom the
|
14
|
+
// Software is furnished to do so, subject to the following
|
15
|
+
// conditions:
|
16
|
+
//
|
17
|
+
// The above copyright notice and this permission notice shall be
|
18
|
+
// included in all copies or substantial portions of the Software.
|
19
|
+
//
|
20
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
21
|
+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
22
|
+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
23
|
+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
24
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
25
|
+
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
27
|
+
// OTHER DEALINGS IN THE SOFTWARE.
|
28
|
+
//
|
29
|
+
|
30
|
+
#import "SSTypes.h"
|
31
|
+
|
32
|
+
@interface NSMutableString (JavaScript)
|
33
|
+
|
34
|
+
- (S*(^)(NSS* value))append;
|
35
|
+
|
36
|
+
@end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
//
|
2
|
+
// NSMutableString+JavaScript.m
|
3
|
+
// SubjectiveScript.m
|
4
|
+
//
|
5
|
+
// Created by Kevin Malakoff on 7/29/12.
|
6
|
+
// Copyright (c) 2012 Kevin Malakoff. All rights reserved.
|
7
|
+
//
|
8
|
+
// Permission is hereby granted, free of charge, to any person
|
9
|
+
// obtaining a copy of this software and associated documentation
|
10
|
+
// files (the "Software"), to deal in the Software without
|
11
|
+
// restriction, including without limitation the rights to use,
|
12
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
// copies of the Software, and to permit persons to whom the
|
14
|
+
// Software is furnished to do so, subject to the following
|
15
|
+
// conditions:
|
16
|
+
//
|
17
|
+
// The above copyright notice and this permission notice shall be
|
18
|
+
// included in all copies or substantial portions of the Software.
|
19
|
+
//
|
20
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
21
|
+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
22
|
+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
23
|
+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
24
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
25
|
+
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
27
|
+
// OTHER DEALINGS IN THE SOFTWARE.
|
28
|
+
//
|
29
|
+
|
30
|
+
#import "NSMutableString+JavaScript.h"
|
31
|
+
|
32
|
+
@implementation NSMutableString (JavaScript)
|
33
|
+
|
34
|
+
- (S*(^)(NSS* value))append
|
35
|
+
{
|
36
|
+
return ^(NSS* value) {
|
37
|
+
[self appendString:value];
|
38
|
+
return self;
|
39
|
+
};
|
40
|
+
}
|
41
|
+
|
42
|
+
@end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
//
|
2
|
+
// NSNumber+JavaScript.h
|
3
|
+
// SubjectiveScript.m
|
4
|
+
//
|
5
|
+
// Created by Kevin Malakoff on 7/29/12.
|
6
|
+
// Copyright (c) 2012 Kevin Malakoff. All rights reserved.
|
7
|
+
//
|
8
|
+
// Permission is hereby granted, free of charge, to any person
|
9
|
+
// obtaining a copy of this software and associated documentation
|
10
|
+
// files (the "Software"), to deal in the Software without
|
11
|
+
// restriction, including without limitation the rights to use,
|
12
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
// copies of the Software, and to permit persons to whom the
|
14
|
+
// Software is furnished to do so, subject to the following
|
15
|
+
// conditions:
|
16
|
+
//
|
17
|
+
// The above copyright notice and this permission notice shall be
|
18
|
+
// included in all copies or substantial portions of the Software.
|
19
|
+
//
|
20
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
21
|
+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
22
|
+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
23
|
+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
24
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
25
|
+
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
27
|
+
// OTHER DEALINGS IN THE SOFTWARE.
|
28
|
+
//
|
29
|
+
|
30
|
+
#import "SSTypes.h"
|
31
|
+
|
32
|
+
@interface NSNumber (JavaScript)
|
33
|
+
|
34
|
+
- (NSS*(^)())toString;
|
35
|
+
|
36
|
+
@end
|