[#324] Rename and update the chiliproject_plugin_model generator

This commit is contained in:
Eric Davis 2011-04-08 09:55:16 -07:00
parent cdb8c68018
commit 1477e8b349
2 changed files with 3 additions and 3 deletions

View File

@ -2,4 +2,4 @@ Description:
Generates a plugin model.
Examples:
./script/generate redmine_plugin_model MyPlugin pool title:string question:text
./script/generate chiliproject_plugin_model MyPlugin pool title:string question:text

View File

@ -1,13 +1,13 @@
require 'rails_generator/base'
require 'rails_generator/generators/components/model/model_generator'
class RedminePluginModelGenerator < ModelGenerator
class ChiliprojectPluginModelGenerator < ModelGenerator
attr_accessor :plugin_path, :plugin_name, :plugin_pretty_name
def initialize(runtime_args, runtime_options = {})
runtime_args = runtime_args.dup
usage if runtime_args.empty?
@plugin_name = "redmine_" + runtime_args.shift.underscore
@plugin_name = "chiliproject_" + runtime_args.shift.underscore
@plugin_pretty_name = plugin_name.titleize
@plugin_path = "vendor/plugins/#{plugin_name}"
super(runtime_args, runtime_options)