@@ -1,33 +1,33 | |||
|
1 | 1 | class RedminePluginGenerator < Rails::Generator::NamedBase |
|
2 | 2 | attr_reader :plugin_path, :plugin_name, :plugin_pretty_name |
|
3 | ||
|
3 | ||
|
4 | 4 | def initialize(runtime_args, runtime_options = {}) |
|
5 | 5 | super |
|
6 | 6 | @plugin_name = "redmine_#{file_name.underscore}" |
|
7 | 7 | @plugin_pretty_name = plugin_name.titleize |
|
8 | 8 | @plugin_path = "vendor/plugins/#{plugin_name}" |
|
9 | 9 | end |
|
10 | ||
|
10 | ||
|
11 | 11 | def manifest |
|
12 | 12 | record do |m| |
|
13 | 13 | m.directory "#{plugin_path}/app/controllers" |
|
14 | 14 | m.directory "#{plugin_path}/app/helpers" |
|
15 | 15 | m.directory "#{plugin_path}/app/models" |
|
16 | 16 | m.directory "#{plugin_path}/app/views" |
|
17 | 17 | m.directory "#{plugin_path}/db/migrate" |
|
18 | 18 | m.directory "#{plugin_path}/lib/tasks" |
|
19 | 19 | m.directory "#{plugin_path}/assets/images" |
|
20 | 20 | m.directory "#{plugin_path}/assets/javascripts" |
|
21 | 21 | m.directory "#{plugin_path}/assets/stylesheets" |
|
22 | 22 | m.directory "#{plugin_path}/lang" |
|
23 | 23 | m.directory "#{plugin_path}/config/locales" |
|
24 | 24 | m.directory "#{plugin_path}/test" |
|
25 | ||
|
25 | ||
|
26 | 26 | m.template 'README.rdoc', "#{plugin_path}/README.rdoc" |
|
27 | 27 | m.template 'init.rb.erb', "#{plugin_path}/init.rb" |
|
28 | 28 | m.template 'en.yml', "#{plugin_path}/lang/en.yml" |
|
29 | 29 | m.template 'en_rails_i18n.yml', "#{plugin_path}/config/locales/en.yml" |
|
30 | 30 | m.template 'test_helper.rb.erb', "#{plugin_path}/test/test_helper.rb" |
|
31 | 31 | end |
|
32 | 32 | end |
|
33 | 33 | end |
General Comments 0
You need to be logged in to leave comments.
Login now