@@ -1,33 +1,37 | |||
|
1 | 1 | class RedminePluginGenerator < Rails::Generators::NamedBase |
|
2 | 2 | source_root File.expand_path("../templates", __FILE__) |
|
3 | 3 | |
|
4 | 4 | attr_reader :plugin_path, :plugin_name, :plugin_pretty_name |
|
5 | 5 | |
|
6 | 6 | def initialize(*args) |
|
7 | 7 | super |
|
8 | 8 | @plugin_name = file_name.underscore |
|
9 | 9 | @plugin_pretty_name = plugin_name.titleize |
|
10 | 10 | @plugin_path = "plugins/#{plugin_name}" |
|
11 | 11 | end |
|
12 | 12 | |
|
13 | 13 | def copy_templates |
|
14 | 14 | empty_directory "#{plugin_path}/app" |
|
15 | 15 | empty_directory "#{plugin_path}/app/controllers" |
|
16 | 16 | empty_directory "#{plugin_path}/app/helpers" |
|
17 | 17 | empty_directory "#{plugin_path}/app/models" |
|
18 | 18 | empty_directory "#{plugin_path}/app/views" |
|
19 | 19 | empty_directory "#{plugin_path}/db/migrate" |
|
20 | 20 | empty_directory "#{plugin_path}/lib/tasks" |
|
21 | 21 | empty_directory "#{plugin_path}/assets/images" |
|
22 | 22 | empty_directory "#{plugin_path}/assets/javascripts" |
|
23 | 23 | empty_directory "#{plugin_path}/assets/stylesheets" |
|
24 | 24 | empty_directory "#{plugin_path}/config/locales" |
|
25 | 25 | empty_directory "#{plugin_path}/test" |
|
26 | empty_directory "#{plugin_path}/test/fixtures" | |
|
27 | empty_directory "#{plugin_path}/test/unit" | |
|
28 | empty_directory "#{plugin_path}/test/functional" | |
|
29 | empty_directory "#{plugin_path}/test/integration" | |
|
26 | 30 | |
|
27 | 31 | template 'README.rdoc', "#{plugin_path}/README.rdoc" |
|
28 | 32 | template 'init.rb.erb', "#{plugin_path}/init.rb" |
|
29 | 33 | template 'routes.rb', "#{plugin_path}/config/routes.rb" |
|
30 | 34 | template 'en_rails_i18n.yml', "#{plugin_path}/config/locales/en.yml" |
|
31 | 35 | template 'test_helper.rb.erb', "#{plugin_path}/test/test_helper.rb" |
|
32 | 36 | end |
|
33 | 37 | end |
General Comments 0
You need to be logged in to leave comments.
Login now