Sha256: f8dbe1344641c8e9b80655259ed5d059fa6df3dc41b2b0283c4b8e434516ce34

Contents?: true

Size: 786 Bytes

Versions: 1

Compression:

Stored size: 786 Bytes

Contents

#!/usr/local/bin/ruby
require File.dirname(__FILE__) + '/../config/environments/production'
require 'generator'

if ARGV.size == 1
  rails_root = File.dirname(__FILE__) + '/..'
  name = ARGV.shift
  Generator::Model.new(rails_root, name).generate
else
  puts <<-HELP

NAME
     new_model - create model stub files

SYNOPSIS
     new_model ModelName

DESCRIPTION
     The new_model generator takes a model name (in CamelCase) and generates
     a new, empty model in app/models, a test suite in test/unit with one
     failing test case, and a fixtures directory in test/fixtures.

EXAMPLE
     new_model Account

     This will generate an Account class in app/models/account.rb, an
     AccountTest in test/unit/account_test.rb, and the directory
     test/fixtures/account.

HELP
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-0.8.5 generators/new_model.rb