Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

Change autogen as a ruby gem, then we can use nsrails g ~/railsapp to ... #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ project.xcworkspace

# Ignore folders made with autogen

*.gen/

Models/

# Ignore RubyMotion noise

build-iPhoneOS
build-iPhoneSimulator
build
*.bridgesupport
.*
.*
*.gem
11 changes: 6 additions & 5 deletions autogen/generate → autogen/bin/nsrails
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,10 @@ class Runner
end

def self.print_help
this_file = File.expand_path(File.dirname(__FILE__))+"/generate"
pwd = Dir.pwd

puts "Usage:"
puts " #{this_file[pwd.length+1..this_file.length]} [options] APP_PATH"
puts " nsrails g [options] RAILS_APP_PATH"
puts ""
puts "Options for property translation:"
puts " --ruby Generate Ruby classes for MacRuby and RubyMotion"
Expand All @@ -468,15 +467,17 @@ begin
$options = Runner.parse_options(ARGV)
if ($options[:help])
print_help
else
elsif ($options[:g])
$options[:project] ||= $options[:path].split("/").last
$options[:company] ||= $options[:author] || ENV["USER"] || ENV["USERNAME"]
$options[:author] ||= "NSRails autogen"
$options[:author] ||= "NSRails Generator"

output = File.expand_path(File.dirname(__FILE__))+"/"+$options[:project]+".gen"
output = Dir.pwd + "/" + "Models"
Runner.class_variable_set(:@@output_path, output)

Runner.run
else
print_help
end
rescue => e
puts "Error! #{e}\nUse --help or -h for help."
Expand Down
18 changes: 18 additions & 0 deletions autogen/nsrails.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# coding: utf-8
Gem::Specification.new do |s|
s.name = %q{nsrails}
s.version = "0.0.1"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Dan Hassin", "Jason Lee"]
s.email = %q{huacnlee@gmail.com}
s.files = Dir['readme.md', 'bin/**/*', 'lib/**/{*,.[a-z]*}']
s.bindir = 'bin'
s.executables = ['nsrails']
s.homepage = %q{https://github.com/huacnlee/rails-settings-cached}
s.require_paths = ["lib"]
s.summary = %q{NSRails is a light-weight Objective-C framework that provides your classes with a high-level, ActiveResource-like API. This means CRUD and other operations on your corresponding Rails objects can be called natively via Objective-C methods.}

s.add_dependency 'activesupport', "> 3.0.0"
end