lanekit 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +78 -11
- data/lib/lanekit/version.rb +1 -1
- data/lib/lanekit.rb +4 -2
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDgyZDZiZDVjZDUyYzE3ZDFkNDQ3MmEwNjA1Y2RhY2Q3NTg1Y2E0Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGQ0NjQ4MTc4YjU4NDU2MjMyMzU2MzM2MGY0OTlmOGUzY2RjNDA1Mg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTQxZTJiNjEzZGQ3YWIwNjM2OGE3MTQyYzAxZDU5MjVmMjYyNWFlZDYzMmFk
|
10
|
+
MWE3NTM3YWVjY2FkZGQ5MzdiNzVkOTBlMjc0OGJlOWY2N2RjMzc0NzhhZmJl
|
11
|
+
MDk3YWQ4ZjgyZDcxZTdmN2Q2NjFmOGFlYjI0OTM1NmJmMDJjZTM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWIzMWQyMTRhMzNiMzQxNjI4MWY3NzNkYWU3ZjEzNjc1MWMzMTdmZjk5MzIy
|
14
|
+
MzJiZDFkZDgwMjQzZWU5NjFmMTY5MzJiMWIwNDI2NjE1Mjk1ZTc2ZWM1Zjc3
|
15
|
+
YzFhMjZmOGZlMDhjZDk4Y2U2YzI4ZmY5YjQ5MTQ0MTAwMTI4MmU=
|
data/README.md
CHANGED
@@ -9,23 +9,91 @@ LaneKit is a Ruby command line app that creates iOS Objective-C models for integ
|
|
9
9
|
|
10
10
|
1. Install the LaneKit Ruby Gem from RubyGems.org
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
```
|
16
|
-
|
12
|
+
$ gem install lanekit
|
13
|
+
Successfully installed lanekit-x.x.x
|
14
|
+
|
17
15
|
2. LaneKit is ready to use
|
18
16
|
|
19
17
|
## Example Usage
|
20
18
|
|
21
19
|
### Add a new model called Video to an existing Xcode project.
|
22
20
|
```
|
23
|
-
$ lanekit generate model
|
21
|
+
$ lanekit generate model Video duration:string headline:string image:string location:string
|
24
22
|
create Classes/model
|
25
23
|
create Classes/model/Video.h
|
26
24
|
create Classes/model/Video.m
|
27
25
|
```
|
28
26
|
|
27
|
+
and here is the Objective-C header file that was generated by LaneKit:
|
28
|
+
|
29
|
+
```objective-c
|
30
|
+
//
|
31
|
+
// Video.h
|
32
|
+
//
|
33
|
+
// This model was created on 2013-05-27 by LaneKit.
|
34
|
+
//
|
35
|
+
// The following LaneKit command was used to generate this model:
|
36
|
+
// lanekit generate model Video duration:string headline:string image:string location:string
|
37
|
+
//
|
38
|
+
|
39
|
+
#import <Foundation/Foundation.h>
|
40
|
+
|
41
|
+
@class RKObjectMapping;
|
42
|
+
|
43
|
+
@interface Video : NSObject
|
44
|
+
|
45
|
+
@property (nonatomic,strong) NSString *duration;
|
46
|
+
@property (nonatomic,strong) NSString *headline;
|
47
|
+
@property (nonatomic,strong) NSString *image; // add special mapping image.uri
|
48
|
+
@property (nonatomic,strong) NSString *location;
|
49
|
+
|
50
|
+
+ (RKObjectMapping *)modelMapping;
|
51
|
+
|
52
|
+
@end
|
53
|
+
```
|
54
|
+
|
55
|
+
and here is the Objective-C .m file that was generated by LaneKit:
|
56
|
+
|
57
|
+
```objective-c
|
58
|
+
//
|
59
|
+
// Video.m
|
60
|
+
//
|
61
|
+
// This model was created on 2013-05-27 by LaneKit.
|
62
|
+
//
|
63
|
+
//
|
64
|
+
|
65
|
+
#import "Video.h"
|
66
|
+
#import "MobileCoreServices/MobileCoreServices.h"
|
67
|
+
#import "SystemConfiguration/SystemConfiguration.h"
|
68
|
+
#import "RestKit.h"
|
69
|
+
|
70
|
+
@implementation Video
|
71
|
+
|
72
|
+
+ (void)initialize
|
73
|
+
{
|
74
|
+
if (self == [Video class])
|
75
|
+
{
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
// Returns the RKObjectMapping for this class
|
80
|
+
+ (RKObjectMapping *)modelMapping
|
81
|
+
{
|
82
|
+
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[Video class]];
|
83
|
+
[mapping addAttributeMappingsFromDictionary:@{
|
84
|
+
@"duration": @"duration",
|
85
|
+
@"headline": @"headline",
|
86
|
+
@"image": @"image",
|
87
|
+
@"location": @"location"
|
88
|
+
}];
|
89
|
+
|
90
|
+
return mapping;
|
91
|
+
}
|
92
|
+
|
93
|
+
@end
|
94
|
+
```
|
95
|
+
|
96
|
+
|
29
97
|
### Add a new model called Contents that contains a list of Videos.
|
30
98
|
```
|
31
99
|
$ lanekit generate model contents contents:array:Video
|
@@ -34,6 +102,10 @@ create Classes/model/Contents.h
|
|
34
102
|
create Classes/model/Contents.m
|
35
103
|
```
|
36
104
|
|
105
|
+
### Sample App
|
106
|
+
The SportsFrames app is a fully functional sample app created to demonstrate the use of LaneKit in a real world app.
|
107
|
+
Download the code from [GitHub](https://github.com/larryaasen/SportsFrames).
|
108
|
+
|
37
109
|
## Credits
|
38
110
|
|
39
111
|
LaneKit was created by [Larry Aasen](https://github.com/larryaasen).
|
@@ -42,11 +114,6 @@ LaneKit was created by [Larry Aasen](https://github.com/larryaasen).
|
|
42
114
|
|
43
115
|
Follow Larry Aasen on Twitter [@LarryAasen](https://twitter.com/LarryAasen).
|
44
116
|
|
45
|
-
### Creators
|
46
|
-
|
47
|
-
[Larry Aasen](https://github.com/larryaasen)
|
48
|
-
[@larryaasen](https://twitter.com/larryaasen)
|
49
|
-
|
50
117
|
## License
|
51
118
|
|
52
119
|
LaneKit is available under the MIT license. See the LICENSE file for more info.
|
data/lib/lanekit/version.rb
CHANGED
data/lib/lanekit.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'date'
|
1
2
|
require 'thor'
|
2
3
|
require 'xcodeproj'
|
3
4
|
require 'lanekit/version'
|
@@ -6,8 +7,8 @@ require 'active_support/inflector'
|
|
6
7
|
|
7
8
|
module LaneKit
|
8
9
|
@@objc_types = {
|
9
|
-
array
|
10
|
-
|
10
|
+
"array" => "NSArray *"
|
11
|
+
}
|
11
12
|
|
12
13
|
# Model names are lower case
|
13
14
|
# "Car" => "car", "Bigbird" => "bigbird"
|
@@ -55,6 +56,7 @@ module LaneKit
|
|
55
56
|
include Thor::Actions
|
56
57
|
|
57
58
|
desc "model [name] [name:type, name:type, ...] where type is [date|integer|string|<class_name>]", "Generates an Objective-C model for RestKit"
|
59
|
+
method_options :banner => ""
|
58
60
|
def model(model_name, *attributes)
|
59
61
|
@model_name = LaneKit.derive_model_name(model_name)
|
60
62
|
@file_name = LaneKit.derive_file_name(@model_name)
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lanekit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.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: 2013-
|
11
|
+
date: 2013-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.18.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.18.1
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: xcodeproj
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|