lanekit 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +83 -42
- data/lib/lanekit/version.rb +1 -1
- data/lib/template/LKFeedCell.h.erb +2 -0
- data/lib/template/LKFeedCell.m.erb +2 -0
- data/lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Helpers/NSObject+LKConventions.h +15 -0
- data/lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Helpers/NSObject+LKConventions.m +79 -0
- data/lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project.xcodeproj/project.pbxproj +14 -0
- data/lib/template/lanekit-ios-project/lanekit-ios-project.xcworkspace/xcuserdata/larry.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/lib/template/model.h.erb +2 -0
- data/lib/template/model.m.erb +6 -4
- data/lib/template/model_base.h.erb +2 -0
- data/lib/template/model_base.m.erb +2 -0
- data/lib/template/model_fixture.h.erb +2 -0
- data/lib/template/model_fixture.m.erb +2 -0
- data/lib/template/model_test.h.erb +2 -0
- data/lib/template/model_test.m.erb +2 -0
- data/lib/template/provider.h.erb +2 -0
- data/lib/template/provider.m.erb +2 -0
- data/lib/template/provider_base.h.erb +2 -0
- data/lib/template/provider_base.m.erb +2 -0
- data/lib/template/tvc.h.erb +2 -0
- data/lib/template/tvc.m.erb +10 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmFkMWQ4YjgyOTU4MTMzZmE3M2NiMjJlYWJmMTBkNWZmZWZiM2Q5Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YWM2NGM0OGQwODFiNzJiNzhjNzczYzE2YTdhNTE2YWRiMWQ4MjE1Yw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjIxZmExODEwODU3YmQzYmVhZGNhYTY1ODc1YjVmMzg1MmZhMTBiNDc2ODJh
|
10
|
+
ZDFkNmNmYTQ1YWQ4NGMzYjI1OTI3YWQ5NDNkMTY4ZTFiMzJjMDgxZDBlMGE1
|
11
|
+
MzY3NGVlNjgxMDkxMWYzNTZkYzczMjhhOGRmMDlmNjkzNjBjMzg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDFkODNlODIzYzhkZGUyOTNhNGU1OWExODEyNWM0NTI2NWE1ODIwM2I2Zjg4
|
14
|
+
YTU1MGE0NTRjYTcxYTBkMjI2YTRmZTFlOTYxZWI0ZWViZDcxNDJiMzI0MGQ1
|
15
|
+
NjgzNzgwMzE0MmIxYjczYTczODUzNjdmZTI5ZTJiODUwN2QzNWQ=
|
data/README.md
CHANGED
@@ -23,32 +23,35 @@ including fixtures and tests. LaneKit is a command line app written in Ruby and
|
|
23
23
|
|
24
24
|
## How To Get Started
|
25
25
|
|
26
|
-
1. Install the LaneKit Ruby Gem from RubyGems.org
|
26
|
+
1. Install the LaneKit Ruby Gem from RubyGems.org on the command line:
|
27
27
|
|
28
28
|
$ gem install lanekit
|
29
|
-
Successfully installed lanekit-
|
29
|
+
Successfully installed lanekit-0.4.4
|
30
|
+
$ lanekit -v
|
31
|
+
LaneKit 0.4.4
|
30
32
|
|
31
|
-
2. LaneKit is ready to use
|
33
|
+
2. LaneKit is ready to use.
|
32
34
|
|
33
35
|
## Example Usage
|
34
36
|
|
35
|
-
### Add a new model called Video to an existing Xcode project
|
36
|
-
|
37
|
-
$ lanekit generate model Video
|
38
|
-
|
39
|
-
create
|
40
|
-
create
|
41
|
-
create
|
42
|
-
create
|
43
|
-
create
|
44
|
-
create
|
45
|
-
create
|
46
|
-
create
|
47
|
-
create
|
48
|
-
create
|
49
|
-
create
|
50
|
-
create
|
51
|
-
create
|
37
|
+
### Add a new model called Video to an existing Xcode project:
|
38
|
+
|
39
|
+
$ lanekit generate model Video headline:string duration:string id:integer image:string itemDate:date location:string
|
40
|
+
|
41
|
+
create SportsFrames/SportsFrames/Models
|
42
|
+
create SportsFrames/SportsFramesTests/Fixtures
|
43
|
+
create SportsFrames/SportsFramesTests/Models
|
44
|
+
create SportsFrames/SportsFramesTests/Resources
|
45
|
+
create SportsFrames/SportsFrames/Models/Video.h
|
46
|
+
create SportsFrames/SportsFrames/Models/Video.m
|
47
|
+
create SportsFrames/SportsFramesTests/Fixtures/VideoFixtures.h
|
48
|
+
create SportsFrames/SportsFramesTests/Fixtures/VideoFixtures.m
|
49
|
+
create SportsFrames/SportsFramesTests/Resources/VideoFixtures.one.json
|
50
|
+
create SportsFrames/SportsFramesTests/Resources/VideoFixtures.two.json
|
51
|
+
create SportsFrames/SportsFramesTests/Models/VideoTest.h
|
52
|
+
create SportsFrames/SportsFramesTests/Models/VideoTest.m
|
53
|
+
create SportsFrames/SportsFrames/Models/LKModel.h
|
54
|
+
create SportsFrames/SportsFrames/Models/LKModel.m
|
52
55
|
|
53
56
|
and here is the Objective-C header file that was generated by LaneKit:
|
54
57
|
|
@@ -56,20 +59,23 @@ and here is the Objective-C header file that was generated by LaneKit:
|
|
56
59
|
//
|
57
60
|
// Video.h
|
58
61
|
//
|
59
|
-
//
|
62
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
63
|
+
//
|
64
|
+
// This model was created on 2014-01-11 by LaneKit v0.4.4.
|
60
65
|
//
|
61
66
|
// The following LaneKit command was used to generate this file:
|
62
|
-
// lanekit generate model Video
|
67
|
+
// lanekit generate model Video headline:string duration:string id:integer image:string itemDate:date location:string
|
63
68
|
//
|
64
69
|
|
65
70
|
#import "LKModel.h"
|
66
71
|
|
67
72
|
@interface Video : LKModel
|
68
73
|
|
69
|
-
@property (nonatomic,strong) NSString *duration;
|
70
74
|
@property (nonatomic,strong) NSString *headline;
|
75
|
+
@property (nonatomic,strong) NSString *duration;
|
71
76
|
@property (nonatomic,strong) NSNumber *id;
|
72
77
|
@property (nonatomic,strong) NSString *image;
|
78
|
+
@property (nonatomic,strong) NSDate *itemDate;
|
73
79
|
@property (nonatomic,strong) NSString *location;
|
74
80
|
|
75
81
|
@end
|
@@ -81,38 +87,44 @@ and here is the Objective-C .m file that was generated by LaneKit:
|
|
81
87
|
//
|
82
88
|
// Video.m
|
83
89
|
//
|
84
|
-
//
|
90
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
91
|
+
//
|
92
|
+
// This model was created on 2014-01-11 by LaneKit v0.4.4.
|
85
93
|
//
|
86
94
|
// The following LaneKit command was used to generate this file:
|
87
|
-
// lanekit generate model Video
|
95
|
+
// lanekit generate model Video headline:string duration:string id:integer image:string itemDate:date location:string
|
88
96
|
//
|
89
97
|
|
90
98
|
#import "Video.h"
|
91
99
|
|
92
100
|
@implementation Video
|
93
101
|
|
94
|
-
|
102
|
+
#pragma mark LKModel overrides
|
103
|
+
|
104
|
+
// Dictionary to convert self to JSON/XML. For XML mappings, add .text to the end of the destination attribute name like this: "title.text".
|
95
105
|
+ (NSDictionary *)dictionaryForRequestMappings
|
96
106
|
{
|
97
107
|
return @{
|
98
108
|
// source key path : destination attribute name
|
99
|
-
@"duration": @"duration",
|
100
109
|
@"headline": @"headline",
|
110
|
+
@"duration": @"duration",
|
101
111
|
@"id": @"id",
|
102
112
|
@"image": @"image",
|
113
|
+
@"itemDate": @"itemDate",
|
103
114
|
@"location": @"location"
|
104
115
|
};
|
105
116
|
}
|
106
117
|
|
107
|
-
// Dictionary to convert JSON to self
|
118
|
+
// Dictionary to convert JSON/XML to self. For XML mappings, add .text to the end of the key path like this: "title.text".
|
108
119
|
+ (NSDictionary *)dictionaryForResponseMappings
|
109
120
|
{
|
110
121
|
return @{
|
111
122
|
// source key path : destination attribute name
|
112
|
-
@"duration": @"duration",
|
113
123
|
@"headline": @"headline",
|
124
|
+
@"duration": @"duration",
|
114
125
|
@"id": @"id",
|
115
126
|
@"image": @"image",
|
127
|
+
@"itemDate": @"itemDate",
|
116
128
|
@"location": @"location"
|
117
129
|
};
|
118
130
|
}
|
@@ -122,6 +134,11 @@ and here is the Objective-C .m file that was generated by LaneKit:
|
|
122
134
|
return @"video";
|
123
135
|
}
|
124
136
|
|
137
|
+
- (NSString *)descriptionForDisplay
|
138
|
+
{
|
139
|
+
return [NSString stringWithFormat:@"%@", self.headline];
|
140
|
+
}
|
141
|
+
|
125
142
|
@end
|
126
143
|
```
|
127
144
|
|
@@ -131,7 +148,12 @@ and here is the unit test fixtures file that was generated by LaneKit:
|
|
131
148
|
//
|
132
149
|
// VideoFixtures.m
|
133
150
|
//
|
134
|
-
//
|
151
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
152
|
+
//
|
153
|
+
// This model fixture was created on 2014-01-11 by LaneKit v0.4.4.
|
154
|
+
//
|
155
|
+
// The following LaneKit command was used to generate this file:
|
156
|
+
// lanekit generate model Video headline:string duration:string id:integer image:string itemDate:date location:string
|
135
157
|
//
|
136
158
|
|
137
159
|
#import "VideoFixtures.h"
|
@@ -142,8 +164,8 @@ and here is the unit test fixtures file that was generated by LaneKit:
|
|
142
164
|
{
|
143
165
|
Video *video = Video.new;
|
144
166
|
|
145
|
-
video.duration = @"MyString";
|
146
167
|
video.headline = @"MyString";
|
168
|
+
video.duration = @"MyString";
|
147
169
|
video.id = [NSNumber numberWithInteger:1];
|
148
170
|
video.image = @"MyString";
|
149
171
|
video.itemDate = NSDate.new;
|
@@ -156,8 +178,8 @@ and here is the unit test fixtures file that was generated by LaneKit:
|
|
156
178
|
{
|
157
179
|
Video *video = Video.new;
|
158
180
|
|
159
|
-
video.duration = @"MyString";
|
160
181
|
video.headline = @"MyString";
|
182
|
+
video.duration = @"MyString";
|
161
183
|
video.id = [NSNumber numberWithInteger:1];
|
162
184
|
video.image = @"MyString";
|
163
185
|
video.itemDate = NSDate.new;
|
@@ -169,13 +191,13 @@ and here is the unit test fixtures file that was generated by LaneKit:
|
|
169
191
|
@end
|
170
192
|
```
|
171
193
|
|
172
|
-
and here is
|
194
|
+
and here is a RestKit compatible JSON fixture file that was generated by LaneKit:
|
173
195
|
|
174
196
|
```json
|
175
197
|
{
|
176
198
|
"video": {
|
177
|
-
"duration": "MyString",
|
178
199
|
"headline": "MyString",
|
200
|
+
"duration": "MyString",
|
179
201
|
"id": "1",
|
180
202
|
"image": "MyString",
|
181
203
|
"itemDate": "03/01/2012",
|
@@ -184,7 +206,7 @@ and here is the RestKit compatible JSON fixture file that was generated by LaneK
|
|
184
206
|
}
|
185
207
|
```
|
186
208
|
|
187
|
-
and here is a unit test that was generated in Models/VideoTest.m by LaneKit:
|
209
|
+
and here is part of a unit test that was generated in Models/VideoTest.m by LaneKit:
|
188
210
|
|
189
211
|
```objective-c
|
190
212
|
- (void)testVideoNewOne
|
@@ -192,11 +214,34 @@ and here is a unit test that was generated in Models/VideoTest.m by LaneKit:
|
|
192
214
|
Video *video = VideoFixtures.one;
|
193
215
|
STAssertNotNil(video, @"video is nil");
|
194
216
|
|
217
|
+
STAssertTrue([video.headline isEqualToString:@"MyString"], @"headline not correct value");
|
195
218
|
STAssertTrue([video.duration isEqualToString:@"MyString"], @"duration not correct value");
|
219
|
+
STAssertTrue(video.id.integerValue == [NSNumber numberWithInteger:1].integerValue, @"id not [NSNumber numberWithInteger:1]");
|
220
|
+
STAssertTrue([video.image isEqualToString:@"MyString"], @"image not correct value");
|
221
|
+
STAssertNotNil(video.itemDate, @"itemDate is nil");
|
222
|
+
STAssertTrue([video.location isEqualToString:@"MyString"], @"location not correct value");
|
223
|
+
}
|
224
|
+
|
225
|
+
- (void)testVideoNewTwo
|
226
|
+
{
|
227
|
+
Video *video = VideoFixtures.two;
|
228
|
+
STAssertNotNil(video, @"video is nil");
|
229
|
+
|
196
230
|
STAssertTrue([video.headline isEqualToString:@"MyString"], @"headline not correct value");
|
231
|
+
STAssertTrue([video.duration isEqualToString:@"MyString"], @"duration not correct value");
|
197
232
|
STAssertTrue(video.id.integerValue == [NSNumber numberWithInteger:1].integerValue, @"id not [NSNumber numberWithInteger:1]");
|
198
233
|
STAssertTrue([video.image isEqualToString:@"MyString"], @"image not correct value");
|
199
234
|
STAssertNotNil(video.itemDate, @"itemDate is nil");
|
235
|
+
STAssertTrue([video.location isEqualToString:@"MyString"], @"location not correct value");
|
236
|
+
}
|
237
|
+
|
238
|
+
- (void)testMapping
|
239
|
+
{
|
240
|
+
RKObjectMapping *requestMapping = [Video requestMapping];
|
241
|
+
STAssertNotNil(requestMapping, @"[Video requestMapping] returned nil.");
|
242
|
+
|
243
|
+
RKObjectMapping *responseMapping = [Video responseMapping];
|
244
|
+
STAssertNotNil(responseMapping, @"[Video responseMapping] returned nil.");
|
200
245
|
}
|
201
246
|
```
|
202
247
|
|
@@ -293,18 +338,14 @@ This will display the Contents model that is a list of videos.
|
|
293
338
|
Installing UrbanAirship-iOS-SDK (3.0.1)
|
294
339
|
|
295
340
|
### Sample App
|
296
|
-
The SportsFrames app is a fully functional sample app using RestKit created to demonstrate the use of LaneKit in a real world app. It
|
341
|
+
The [SportsFrames](https://github.com/larryaasen/SportsFrames) app is a fully functional iOS sample app using RestKit created to demonstrate the use of LaneKit in a real world app. It
|
297
342
|
has models and resource providers that are generated from LaneKit.
|
298
343
|
Download the code from [GitHub](https://github.com/larryaasen/SportsFrames).
|
299
344
|
|
300
345
|
## Credits
|
301
346
|
|
302
|
-
LaneKit was created by [Larry Aasen](https://github.com/larryaasen).
|
303
|
-
|
304
|
-
## Contact
|
305
|
-
|
306
|
-
Follow Larry Aasen on Twitter [@LarryAasen](https://twitter.com/LarryAasen).
|
347
|
+
LaneKit was created by [Larry Aasen](https://github.com/larryaasen). Follow Larry Aasen on Twitter [@LarryAasen](https://twitter.com/LarryAasen).
|
307
348
|
|
308
349
|
## License
|
309
350
|
|
310
|
-
LaneKit is available under the MIT license. See the LICENSE file for more info.
|
351
|
+
LaneKit is available under the MIT license. See the [LICENSE](https://github.com/larryaasen/LaneKit/blob/master/LICENSE) file for more info.
|
data/lib/lanekit/version.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@register_class%>.h
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This model was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@register_class%>.m
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This model was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
@@ -0,0 +1,15 @@
|
|
1
|
+
//
|
2
|
+
// NSObject+LKConventions.h
|
3
|
+
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
6
|
+
|
7
|
+
#import <Foundation/Foundation.h>
|
8
|
+
|
9
|
+
@interface NSObject (LKConventions)
|
10
|
+
+ (NSSet *)allPropertyNames;
|
11
|
+
+ (NSString *)topPropertyNameByConvention;
|
12
|
+
|
13
|
+
- (id)topPropertyValueByConvention;
|
14
|
+
- (NSString *)descriptionOfTopProperty;
|
15
|
+
@end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
//
|
2
|
+
// NSObject+LKConventions.m
|
3
|
+
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
6
|
+
// Example:
|
7
|
+
// cell.textLabel.text = [model descriptionOfTopProperty];
|
8
|
+
|
9
|
+
//
|
10
|
+
|
11
|
+
#import "NSObject+LKConventions.h"
|
12
|
+
#import<objc/runtime.h>
|
13
|
+
|
14
|
+
@implementation NSObject (LKConventions)
|
15
|
+
|
16
|
+
// Returns an array of all of property names in this class.
|
17
|
+
+ (NSSet *)allPropertyNames
|
18
|
+
{
|
19
|
+
unsigned count;
|
20
|
+
objc_property_t *propertyList = class_copyPropertyList([self class], &count);
|
21
|
+
|
22
|
+
NSMutableSet *properties = NSMutableSet.set;
|
23
|
+
|
24
|
+
for (unsigned zz=0; zz<count; zz++)
|
25
|
+
{
|
26
|
+
objc_property_t property = propertyList[zz];
|
27
|
+
NSString *name = [NSString stringWithUTF8String:property_getName(property)];
|
28
|
+
[properties addObject:name];
|
29
|
+
}
|
30
|
+
|
31
|
+
free(propertyList);
|
32
|
+
|
33
|
+
return [properties copy];
|
34
|
+
}
|
35
|
+
|
36
|
+
// Returns the name of one of these properties searched in this order: name, title, headline, displayName, id.
|
37
|
+
+ (NSString *)topPropertyNameByConvention
|
38
|
+
{
|
39
|
+
NSArray *conventionalNames = @[@"name", @"title", @"headline", @"displayname", @"id"];
|
40
|
+
|
41
|
+
NSSet *propertyNames = [self allPropertyNames];
|
42
|
+
NSString *topName = nil;
|
43
|
+
for (NSString *name in conventionalNames)
|
44
|
+
{
|
45
|
+
if ([propertyNames containsObject:name])
|
46
|
+
{
|
47
|
+
topName = name;
|
48
|
+
break;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
return topName;
|
53
|
+
}
|
54
|
+
|
55
|
+
// Returns the value of the +[self topPropertyNameByConvention] property, or -[self description].
|
56
|
+
- (id)topPropertyValueByConvention
|
57
|
+
{
|
58
|
+
id propertyValue = nil;
|
59
|
+
NSString *propertyName = [[self class] topPropertyNameByConvention];
|
60
|
+
if (propertyName)
|
61
|
+
{
|
62
|
+
propertyValue = [self valueForKey:propertyName];
|
63
|
+
}
|
64
|
+
else
|
65
|
+
{
|
66
|
+
propertyValue = [self description];
|
67
|
+
}
|
68
|
+
return propertyValue;
|
69
|
+
}
|
70
|
+
|
71
|
+
// Returns the value of one of these properties name, title, headline, displayName, id, or description.
|
72
|
+
- (NSString *)descriptionOfTopProperty
|
73
|
+
{
|
74
|
+
id value = [self topPropertyValueByConvention];
|
75
|
+
NSString *description = [NSString stringWithFormat:@"%@", value];
|
76
|
+
return description;
|
77
|
+
}
|
78
|
+
|
79
|
+
@end
|
@@ -22,6 +22,7 @@
|
|
22
22
|
46C411921824966400B19AB2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 461263C6180B401300771CF8 /* UIKit.framework */; };
|
23
23
|
46C411A21824977D00B19AB2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 461263E4180B401300771CF8 /* InfoPlist.strings */; };
|
24
24
|
46C411A51824995C00B19AB2 /* lanekit-ios-projectTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 46C411A41824995C00B19AB2 /* lanekit-ios-projectTests.m */; };
|
25
|
+
46F02272183F752700287EE2 /* NSObject+LKConventions.m in Sources */ = {isa = PBXBuildFile; fileRef = 46F02271183F752700287EE2 /* NSObject+LKConventions.m */; };
|
25
26
|
/* End PBXBuildFile section */
|
26
27
|
|
27
28
|
/* Begin PBXContainerItemProxy section */
|
@@ -55,6 +56,8 @@
|
|
55
56
|
46C4118F1824966400B19AB2 /* lanekit-ios-projectTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "lanekit-ios-projectTests.octest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
56
57
|
46C411A41824995C00B19AB2 /* lanekit-ios-projectTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "lanekit-ios-projectTests.m"; sourceTree = "<group>"; };
|
57
58
|
46C411A618249A9600B19AB2 /* lanekit-ios-projectTests-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "lanekit-ios-projectTests-Prefix.pch"; sourceTree = "<group>"; };
|
59
|
+
46F02270183F752700287EE2 /* NSObject+LKConventions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSObject+LKConventions.h"; path = "Helpers/NSObject+LKConventions.h"; sourceTree = "<group>"; };
|
60
|
+
46F02271183F752700287EE2 /* NSObject+LKConventions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSObject+LKConventions.m"; path = "Helpers/NSObject+LKConventions.m"; sourceTree = "<group>"; };
|
58
61
|
/* End PBXFileReference section */
|
59
62
|
|
60
63
|
/* Begin PBXFrameworksBuildPhase section */
|
@@ -115,6 +118,7 @@
|
|
115
118
|
isa = PBXGroup;
|
116
119
|
children = (
|
117
120
|
466CCB7A18192CDC0028AD47 /* Controllers */,
|
121
|
+
46F0226F183F750A00287EE2 /* Helpers */,
|
118
122
|
466CCB7918192CD50028AD47 /* Models */,
|
119
123
|
466CCB7C18192CF30028AD47 /* Resources */,
|
120
124
|
461263C9180B401300771CF8 /* Supporting Files */,
|
@@ -211,6 +215,15 @@
|
|
211
215
|
name = Resources;
|
212
216
|
sourceTree = "<group>";
|
213
217
|
};
|
218
|
+
46F0226F183F750A00287EE2 /* Helpers */ = {
|
219
|
+
isa = PBXGroup;
|
220
|
+
children = (
|
221
|
+
46F02270183F752700287EE2 /* NSObject+LKConventions.h */,
|
222
|
+
46F02271183F752700287EE2 /* NSObject+LKConventions.m */,
|
223
|
+
);
|
224
|
+
name = Helpers;
|
225
|
+
sourceTree = "<group>";
|
226
|
+
};
|
214
227
|
/* End PBXGroup section */
|
215
228
|
|
216
229
|
/* Begin PBXNativeTarget section */
|
@@ -312,6 +325,7 @@
|
|
312
325
|
buildActionMask = 2147483647;
|
313
326
|
files = (
|
314
327
|
461263CF180B401300771CF8 /* main.m in Sources */,
|
328
|
+
46F02272183F752700287EE2 /* NSObject+LKConventions.m in Sources */,
|
315
329
|
461263D3180B401300771CF8 /* LKAppDelegate.m in Sources */,
|
316
330
|
);
|
317
331
|
runOnlyForDeploymentPostprocessing = 0;
|
Binary file
|
data/lib/template/model.h.erb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@model_file_name%>.h
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This model was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
data/lib/template/model.m.erb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@model_file_name%>.m
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This model was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
@@ -15,7 +17,9 @@
|
|
15
17
|
// All properties in this NSManagedObject need to be defined with @dynamic<% @attributes.each do |attribute| %>
|
16
18
|
@dynamic <%=attribute[:name]%>;<% end %><% end %>
|
17
19
|
|
18
|
-
|
20
|
+
#pragma mark LKModel overrides
|
21
|
+
|
22
|
+
// Dictionary to convert self to JSON/XML. For XML mappings, add .text to the end of the destination attribute name like this: "title.text".
|
19
23
|
+ (NSDictionary *)dictionaryForRequestMappings
|
20
24
|
{
|
21
25
|
return @{
|
@@ -24,7 +28,7 @@
|
|
24
28
|
<% end %><% end %> };
|
25
29
|
}
|
26
30
|
|
27
|
-
// Dictionary to convert JSON to self
|
31
|
+
// Dictionary to convert JSON/XML to self. For XML mappings, add .text to the end of the key path like this: "title.text".
|
28
32
|
+ (NSDictionary *)dictionaryForResponseMappings
|
29
33
|
{
|
30
34
|
return @{
|
@@ -47,8 +51,6 @@
|
|
47
51
|
<% end %><% end %> return mapping;
|
48
52
|
}<% end %>
|
49
53
|
|
50
|
-
#pragma mark LKModel overrides
|
51
|
-
|
52
54
|
- (NSString *)descriptionForDisplay
|
53
55
|
{<% if @first_string_attribute %>
|
54
56
|
return [NSString stringWithFormat:@"%@", self.<%=@first_string_attribute%>];<% else %>
|
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@model_base_file_name%>.h
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This base model was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@model_base_file_name%>.m
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This base model was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@model_fixtures_file_name%>.h
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This model fixture was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@model_fixtures_file_name%>.m
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This model fixture was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@model_tests_file_name%>.h
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This model test was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@model_tests_file_name%>.m
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This model test was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
data/lib/template/provider.h.erb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@provider_file_name%>.h
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This provider was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
data/lib/template/provider.m.erb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@provider_file_name%>.m
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This provider was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@provider_base_file_name%>.h
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This base provider was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@provider_base_file_name%>.m
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This base provider was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
data/lib/template/tvc.h.erb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@controller_file_name%>.h
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This model was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
data/lib/template/tvc.m.erb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
//
|
2
2
|
// <%=@controller_file_name%>.m
|
3
3
|
//
|
4
|
+
// LaneKit is available under the MIT license. See the LICENSE file for more info.
|
5
|
+
//
|
4
6
|
// This model was created on <%=config[:generate_date]%> by LaneKit v<%=config[:lanekit_version]%>.
|
5
7
|
//
|
6
8
|
// The following LaneKit command was used to generate this file:
|
@@ -9,6 +11,7 @@
|
|
9
11
|
|
10
12
|
#import "<%=@controller_file_name%>.h"
|
11
13
|
#import "<%=@provider_file_name%>.h"
|
14
|
+
#import "NSObject+LKConventions.h"
|
12
15
|
<%if @register_class != "UITableViewCell" %>#import "<%=@register_class%>.h"
|
13
16
|
<%end%>
|
14
17
|
@interface <%=@controller_class_name%> ()
|
@@ -90,7 +93,7 @@
|
|
90
93
|
|
91
94
|
// Configure the cell...
|
92
95
|
LKModel *model = [self.<%=@model_name%> objectAtIndex:indexPath.row];
|
93
|
-
cell.textLabel.text = [model
|
96
|
+
cell.textLabel.text = [model descriptionOfTopProperty];
|
94
97
|
|
95
98
|
if ([model respondsToSelector:@selector(image)] && [cell respondsToSelector:@selector(imageView)])
|
96
99
|
{
|
@@ -104,6 +107,12 @@
|
|
104
107
|
return cell;
|
105
108
|
}
|
106
109
|
|
110
|
+
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
111
|
+
{
|
112
|
+
LKModel *model = [self.<%=@model_name%> objectAtIndex:indexPath.row];
|
113
|
+
NSLog(@"[%@ %@] model selected: %@", [self description], NSStringFromSelector(_cmd), model);
|
114
|
+
}
|
115
|
+
|
107
116
|
/*
|
108
117
|
// Override to support conditional editing of the table view.
|
109
118
|
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lanekit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Larry Aasen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|
@@ -96,6 +96,8 @@ files:
|
|
96
96
|
- lib/template/lanekit-ios-project/Lanefile
|
97
97
|
- lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Controllers/LKAppDelegate.h
|
98
98
|
- lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Controllers/LKAppDelegate.m
|
99
|
+
- lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Helpers/NSObject+LKConventions.h
|
100
|
+
- lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Helpers/NSObject+LKConventions.m
|
99
101
|
- lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Resources/Base.lproj/Main_iPad.storyboard
|
100
102
|
- lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Resources/Base.lproj/Main_iPhone.storyboard
|
101
103
|
- lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Resources/en.lproj/InfoPlist.strings
|