[#324] Rename and update the chiliproject_plugin_controller generator

This commit is contained in:
Eric Davis 2011-04-08 09:56:57 -07:00
parent 1477e8b349
commit 71c6ceb223
2 changed files with 3 additions and 3 deletions

View File

@ -2,4 +2,4 @@ Description:
Generates a plugin controller.
Example:
./script/generate redmine_plugin_controller MyPlugin Pools index show vote
./script/generate chiliproject_plugin_controller MyPlugin Pools index show vote

View File

@ -1,13 +1,13 @@
require 'rails_generator/base'
require 'rails_generator/generators/components/controller/controller_generator'
class RedminePluginControllerGenerator < ControllerGenerator
class ChiliprojectPluginControllerGenerator < ControllerGenerator
attr_reader :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)