Sha256: d52c08f33d8c692a295035b8f0602fbcd0ea3763744c31b16acbc8e543b01415
Contents?: true
Size: 696 Bytes
Versions: 4
Compression:
Stored size: 696 Bytes
Contents
class ModelGenerator < Templater::Generator def self.source_root File.join %W| #{File.dirname(__FILE__)} .. .. .. templates model | end first_argument :name, :require => true empty_directory :models, 'models' template :model do |t| t.source = File.join %W| models model.rb| t.destination = File.join %W| models %underscore%.rb| end empty_directory :tests, File.join('test','models') template :test do |t| t.source = File.join %W| test models test_model.rb | t.destination = File.join %W| test models test_%underscore%.rb | end invoke :migration do |generator| generator.new(destination_root, options.merge(:name => true), migration_name) end end
Version data entries
4 entries across 4 versions & 1 rubygems