@@ -1,13 +1,13 | |||||
1 | class RedminePluginGenerator < Rails::Generator::NamedBase |
|
1 | class RedminePluginGenerator < Rails::Generator::NamedBase | |
2 | attr_reader :plugin_path, :plugin_name, :plugin_pretty_name |
|
2 | attr_reader :plugin_path, :plugin_name, :plugin_pretty_name | |
3 |
|
3 | |||
4 | def initialize(runtime_args, runtime_options = {}) |
|
4 | def initialize(runtime_args, runtime_options = {}) | |
5 | super |
|
5 | super | |
6 | @plugin_name = "redmine_#{file_name.underscore}" |
|
6 | @plugin_name = "redmine_#{file_name.underscore}" | |
7 | @plugin_pretty_name = plugin_name.titleize |
|
7 | @plugin_pretty_name = plugin_name.titleize | |
8 | @plugin_path = "vendor/plugins/#{plugin_name}" |
|
8 | @plugin_path = "vendor/plugins/#{plugin_name}" | |
9 | end |
|
9 | end | |
10 |
|
10 | |||
11 | def manifest |
|
11 | def manifest | |
12 | record do |m| |
|
12 | record do |m| | |
13 | m.directory "#{plugin_path}/app/controllers" |
|
13 | m.directory "#{plugin_path}/app/controllers" | |
@@ -22,7 +22,7 class RedminePluginGenerator < Rails::Generator::NamedBase | |||||
22 | m.directory "#{plugin_path}/lang" |
|
22 | m.directory "#{plugin_path}/lang" | |
23 | m.directory "#{plugin_path}/config/locales" |
|
23 | m.directory "#{plugin_path}/config/locales" | |
24 | m.directory "#{plugin_path}/test" |
|
24 | m.directory "#{plugin_path}/test" | |
25 |
|
25 | |||
26 | m.template 'README.rdoc', "#{plugin_path}/README.rdoc" |
|
26 | m.template 'README.rdoc', "#{plugin_path}/README.rdoc" | |
27 | m.template 'init.rb.erb', "#{plugin_path}/init.rb" |
|
27 | m.template 'init.rb.erb', "#{plugin_path}/init.rb" | |
28 | m.template 'en.yml', "#{plugin_path}/lang/en.yml" |
|
28 | m.template 'en.yml', "#{plugin_path}/lang/en.yml" |
General Comments 0
You need to be logged in to leave comments.
Login now