@@ -1,31 +1,31 | |||
|
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}/test" |
|
24 | 24 | |
|
25 | m.template 'README', "#{plugin_path}/README" | |
|
26 | m.template 'init.rb', "#{plugin_path}/init.rb" | |
|
25 | m.template 'README.rdoc', "#{plugin_path}/README.rdoc" | |
|
26 | m.template 'init.rb.erb', "#{plugin_path}/init.rb" | |
|
27 | 27 | m.template 'en.yml', "#{plugin_path}/lang/en.yml" |
|
28 | m.template 'test_helper.rb', "#{plugin_path}/test/test_helper.rb" | |
|
28 | m.template 'test_helper.rb.erb', "#{plugin_path}/test/test_helper.rb" | |
|
29 | 29 | end |
|
30 | 30 | end |
|
31 | 31 | end |
|
1 | NO CONTENT: file renamed from lib/generators/redmine_plugin/templates/README to lib/generators/redmine_plugin/templates/README.rdoc |
|
1 | NO CONTENT: file renamed from lib/generators/redmine_plugin/templates/init.rb to lib/generators/redmine_plugin/templates/init.rb.erb |
|
1 | NO CONTENT: file renamed from lib/generators/redmine_plugin/templates/test_helper.rb to lib/generators/redmine_plugin/templates/test_helper.rb.erb |
General Comments 0
You need to be logged in to leave comments.
Login now