Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master

This branch is 316 commits behind dingbat:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

..
Failed to load latest commit information.
generate
readme.md

readme.md

Usage:

$ cd path/to/nsrails_repo
$ autogen/generate [options] path/to/rails_project

Files will be created in the autogen/ directory with the extension .gen, whose contained files can then be added to your Xcode project.

Options

Use the -h (--help) flag for a list of these options.

Option Description
--ruby
Generate classes for RubyMotion or MacRuby (.rb). (Objective-C by default)
--created-at
--updated-at
Include created_at and/or updated_at properties. (Excluded by default)
--mutable-arrays
Use NSMutableArray for properties that are has-many (NSArray by default)
--nesting-retrievable-only
Make all nested properties retrievable-only. (Use this if you don't want to support accepting nested attributes)
--author, -a
--company, -c
--project, -p
Metadata (for headers of files). Each expects a string following it
--prefix, -x
Class and filename prefix. Expects a string following it

Example

$ autogen/generate -a "Nikola Tesla" -c "Tesla ELM" -p "The Coil" -x "NSR" --created-at --mutable-arrays APP_PATH

Could generate files like these:

//
//  NSRPost.h
//  The Coil
//
//  Created by Nikola Tesla on 1/29/12.
//  Copyright (c) 2012 Tesla ELM. All rights reserved.
//

#import "NSRails.h"

@class NSRResponse;

@interface NSRPost : NSRailsModel

@property (nonatomic, strong) NSRAuthor *author;
@property (nonatomic, strong) NSString *content;
@property (nonatomic, strong) NSDate *createdAt;
@property (nonatomic, strong) NSMutableArray *responses;

@end
//
//  NSRPost.m
//  The Coil
//
//  Created by Nikola Tesla on 1/29/12.
//  Copyright (c) 2012 Tesla ELM. All rights reserved.
//

#import "NSRPost.h"
#import "NSRResponse.h"

@implementation NSRPost
@synthesize content, author, createdAt, responses;
NSRailsSync(*, author -b, createdAt -r, responses:NSRResponse);

@end
Something went wrong with that request. Please try again.