Merge pull request #38 from edavis10/ticket/master/324-plugin-generators
Rename plugin generators to ChiliProject. #324
This commit is contained in:
commit
9f07b2f4b4
|
@ -0,0 +1,20 @@
|
|||
Description:
|
||||
The plugin generator creates stubs for a new ChiliProject plugin.
|
||||
|
||||
Example:
|
||||
./script/generate chliproject_plugin meetings
|
||||
create vendor/plugins/chiliproject_meetings/app/controllers
|
||||
create vendor/plugins/chiliproject_meetings/app/helpers
|
||||
create vendor/plugins/chiliproject_meetings/app/models
|
||||
create vendor/plugins/chiliproject_meetings/app/views
|
||||
create vendor/plugins/chiliproject_meetings/db/migrate
|
||||
create vendor/plugins/chiliproject_meetings/lib/tasks
|
||||
create vendor/plugins/chiliproject_meetings/assets/images
|
||||
create vendor/plugins/chiliproject_meetings/assets/javascripts
|
||||
create vendor/plugins/chiliproject_meetings/assets/stylesheets
|
||||
create vendor/plugins/chiliproject_meetings/lang
|
||||
create vendor/plugins/chiliproject_meetings/README
|
||||
create vendor/plugins/chiliproject_meetings/init.rb
|
||||
create vendor/plugins/chiliproject_meetings/lang/en.yml
|
||||
create vendor/plugins/chiliproject_meetings/config/locales/en.yml
|
||||
create vendor/plugins/chiliproject_meetings/test/test_helper.rb
|
|
@ -1,9 +1,9 @@
|
|||
class RedminePluginGenerator < Rails::Generator::NamedBase
|
||||
class ChiliprojectPluginGenerator < Rails::Generator::NamedBase
|
||||
attr_reader :plugin_path, :plugin_name, :plugin_pretty_name
|
||||
|
||||
def initialize(runtime_args, runtime_options = {})
|
||||
super
|
||||
@plugin_name = "redmine_#{file_name.underscore}"
|
||||
@plugin_name = "chiliproject_#{file_name.underscore}"
|
||||
@plugin_pretty_name = plugin_name.titleize
|
||||
@plugin_path = "vendor/plugins/#{plugin_name}"
|
||||
end
|
|
@ -3,7 +3,7 @@ require 'redmine'
|
|||
Redmine::Plugin.register :<%= plugin_name %> do
|
||||
name '<%= plugin_pretty_name %> plugin'
|
||||
author 'Author name'
|
||||
description 'This is a plugin for Redmine'
|
||||
description 'This is a plugin for ChiliProject'
|
||||
version '0.0.1'
|
||||
url 'http://example.com/path/to/plugin'
|
||||
author_url 'http://example.com/about'
|
|
@ -0,0 +1,5 @@
|
|||
Description:
|
||||
Generates a plugin controller.
|
||||
|
||||
Example:
|
||||
./script/generate chiliproject_plugin_controller MyPlugin Pools index show vote
|
|
@ -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)
|
|
@ -0,0 +1,5 @@
|
|||
Description:
|
||||
Generates a plugin model.
|
||||
|
||||
Examples:
|
||||
./script/generate chiliproject_plugin_model MyPlugin pool title:string question:text
|
|
@ -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)
|
|
@ -1,20 +0,0 @@
|
|||
Description:
|
||||
The plugin generator creates stubs for a new Redmine plugin.
|
||||
|
||||
Example:
|
||||
./script/generate redmine_plugin meetings
|
||||
create vendor/plugins/redmine_meetings/app/controllers
|
||||
create vendor/plugins/redmine_meetings/app/helpers
|
||||
create vendor/plugins/redmine_meetings/app/models
|
||||
create vendor/plugins/redmine_meetings/app/views
|
||||
create vendor/plugins/redmine_meetings/db/migrate
|
||||
create vendor/plugins/redmine_meetings/lib/tasks
|
||||
create vendor/plugins/redmine_meetings/assets/images
|
||||
create vendor/plugins/redmine_meetings/assets/javascripts
|
||||
create vendor/plugins/redmine_meetings/assets/stylesheets
|
||||
create vendor/plugins/redmine_meetings/lang
|
||||
create vendor/plugins/redmine_meetings/README
|
||||
create vendor/plugins/redmine_meetings/init.rb
|
||||
create vendor/plugins/redmine_meetings/lang/en.yml
|
||||
create vendor/plugins/redmine_meetings/config/locales/en.yml
|
||||
create vendor/plugins/redmine_meetings/test/test_helper.rb
|
|
@ -1,5 +0,0 @@
|
|||
Description:
|
||||
Generates a plugin controller.
|
||||
|
||||
Example:
|
||||
./script/generate redmine_plugin_controller MyPlugin Pools index show vote
|
|
@ -1,5 +0,0 @@
|
|||
Description:
|
||||
Generates a plugin model.
|
||||
|
||||
Examples:
|
||||
./script/generate redmine_plugin_model MyPlugin pool title:string question:text
|
Loading…
Reference in New Issue