lanekit 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +17 -4
- data/lib/lanekit/version.rb +1 -1
- data/lib/lanekit.rb +5 -0
- data/lib/template/model.h.erb +4 -2
- data/lib/template/model.m.erb +2 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODhlYmIzZDdjMDY4NDg4YzEzNDAzOTE5N2MxZmNkZWI4NmYwNzIxYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGNhOWYxYjAzNzYzZDc4YmZjMzRmMzViY2Y2MGEzNWZmZDdjZDU1MQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmJmYzEwMTAzMGMyMWM1OWNkNmQ5NDhkODRhZmIyOTIzMGU5YjBkZWFmN2Fh
|
10
|
+
Njg2MDIwZjQyN2IzZGU3ZTRkMWZmYmY1YTNhZmY2ZGQxZjkzOTA4NDc5NDRh
|
11
|
+
NGY0ZDU1MTk2ZjIxMWY5NDIwNmFiNjI2YTMwZTVmMzUxYjRiYWE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODQ1MjBkNTEzZjQ1MzAxNjhjYmIxZDM1NzIxM2RlNmU4YTkxMjk4NTJiZDAw
|
14
|
+
ZWY0YjIzNzQ1Mzc4NGRiZGEyNTQ2YmJkNWZiZjRkZTRmNDk5Nzc2M2YwODgw
|
15
|
+
ODQ0Y2RlMzkwMTk3ZmM3NGRiMjg3YjliMDIyMWZkNjk2OGU5NWU=
|
data/README.md
CHANGED
@@ -2,23 +2,36 @@
|
|
2
2
|
|
3
3
|
LaneKit is a Ruby command line app that creates iOS Objective-C models for integration with RestKit.
|
4
4
|
|
5
|
+
- [Source code for LaneKit](https://github.com/LarryAasen/LaneKit/zipball/master) from [GitHub](http://github.com).
|
6
|
+
- Questions? [Stack Overflow](http://stackoverflow.com/questions/tagged/lanekit) is the best place to find answers.
|
7
|
+
|
5
8
|
## How To Get Started
|
6
9
|
|
7
10
|
1. Install the LaneKit Ruby Gem from RubyGems.org
|
8
11
|
|
9
12
|
```
|
10
13
|
$ gem install lanekit
|
11
|
-
Successfully installed lanekit-0.1.
|
14
|
+
Successfully installed lanekit-0.1.3
|
12
15
|
```
|
13
16
|
|
14
|
-
|
15
|
-
- Questions? [Stack Overflow](http://stackoverflow.com/questions/tagged/lanekit) is the best place to find answers.
|
17
|
+
2. LaneKit is ready to use
|
16
18
|
|
17
19
|
## Example Usage
|
18
20
|
|
19
|
-
###
|
21
|
+
### Add a new model called Video to an existing Xcode project.
|
20
22
|
```
|
21
23
|
$ lanekit generate model video duration:string headline:string image:string
|
24
|
+
create Classes/model
|
25
|
+
create Classes/model/Video.h
|
26
|
+
create Classes/model/Video.m
|
27
|
+
```
|
28
|
+
|
29
|
+
### Add a new model called Contents that contains a list of Videos.
|
30
|
+
```
|
31
|
+
$ lanekit generate model contents contents:array:Video
|
32
|
+
exist Classes/model
|
33
|
+
create Classes/model/Contents.h
|
34
|
+
create Classes/model/Contents.m
|
22
35
|
```
|
23
36
|
|
24
37
|
## Credits
|
data/lib/lanekit/version.rb
CHANGED
data/lib/lanekit.rb
CHANGED
@@ -74,6 +74,11 @@ module LaneKit
|
|
74
74
|
}
|
75
75
|
@any_relationships = relationship ? true : @any_relationships
|
76
76
|
}
|
77
|
+
|
78
|
+
script_name = File.basename($0)
|
79
|
+
script_args = ARGV.join(' ')
|
80
|
+
|
81
|
+
@command = "#{script_name} #{script_args}"
|
77
82
|
|
78
83
|
self.initialize_stuff
|
79
84
|
self.create_model_folders
|
data/lib/template/model.h.erb
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
//
|
4
4
|
// This model was created on <%=@model_date%> by LaneKit.
|
5
5
|
//
|
6
|
+
// The following LaneKit command was used to generate this model:
|
7
|
+
// <%=@command%>
|
6
8
|
//
|
7
9
|
|
8
10
|
#import <Foundation/Foundation.h><% if @using_core_data %>
|
@@ -11,8 +13,8 @@
|
|
11
13
|
@class RKObjectMapping;
|
12
14
|
|
13
15
|
@interface <%=@class_name%> : NSObject
|
14
|
-
|
15
|
-
|
16
|
+
<% @attributes.each do |attribute| %>
|
17
|
+
@property (nonatomic,strong) <%=attribute[:objective_c_type]%><%=attribute[:name]%>;<% if attribute[:relationship] %> // relates to: <%=attribute[:relationship]%><% end %><% end %>
|
16
18
|
|
17
19
|
+ (RKObjectMapping *)modelMapping;
|
18
20
|
|
data/lib/template/model.m.erb
CHANGED
@@ -25,12 +25,9 @@
|
|
25
25
|
{
|
26
26
|
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[<%=@class_name%> class]];
|
27
27
|
[mapping addAttributeMappingsFromDictionary:@{
|
28
|
-
<% @attributes.each_with_index do |attribute, index| %>
|
29
|
-
<% if !attribute[:relationship] %>
|
30
|
-
@"<%=attribute[:name]%>": @"<%=attribute[:name]%>"<% if index != @attributes.size-1 %>,<% end %>
|
28
|
+
<% @attributes.each_with_index do |attribute, index| %><% if !attribute[:relationship] %> @"<%=attribute[:name]%>": @"<%=attribute[:name]%>"<% if index != @attributes.size-1 %>,<% end %>
|
31
29
|
<% end %><% end %> }];
|
32
|
-
<% @attributes.each_with_index do |attribute, index| %>
|
33
|
-
<% if attribute[:relationship] %>
|
30
|
+
<% @attributes.each_with_index do |attribute, index| %><% if attribute[:relationship] %>
|
34
31
|
[mapping addRelationshipMappingWithSourceKeyPath:@"<%=attribute[:name]%>" mapping:[<%=attribute[:relationship]%> modelMapping]];
|
35
32
|
<% end %><% end %>
|
36
33
|
|
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.1.
|
4
|
+
version: 0.1.4
|
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-05-
|
11
|
+
date: 2013-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcodeproj
|