@@ -7,12 +7,7 class RedminePluginGenerator < Rails::Generators::NamedBase | |||||
7 | super |
|
7 | super | |
8 | @plugin_name = file_name.underscore |
|
8 | @plugin_name = file_name.underscore | |
9 | @plugin_pretty_name = plugin_name.titleize |
|
9 | @plugin_pretty_name = plugin_name.titleize | |
10 | if Redmine::Configuration['plugins_path'].nil? |
|
10 | @plugin_path = File.join(Redmine::Plugin.directory, plugin_name) | |
11 | @plugin_path = File.join(Rails.root, 'plugins', plugin_name) |
|
|||
12 | else |
|
|||
13 | @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name) |
|
|||
14 | end |
|
|||
15 | puts @plugin_path |
|
|||
16 | end |
|
11 | end | |
17 |
|
12 | |||
18 | def copy_templates |
|
13 | def copy_templates |
@@ -9,11 +9,7 class RedminePluginControllerGenerator < Rails::Generators::NamedBase | |||||
9 | super |
|
9 | super | |
10 | @plugin_name = file_name.underscore |
|
10 | @plugin_name = file_name.underscore | |
11 | @plugin_pretty_name = plugin_name.titleize |
|
11 | @plugin_pretty_name = plugin_name.titleize | |
12 | if Redmine::Configuration['plugins_path'].nil? |
|
12 | @plugin_path = File.join(Redmine::Plugin.directory, plugin_name) | |
13 | @plugin_path = File.join(Rails.root, 'plugins', plugin_name) |
|
|||
14 | else |
|
|||
15 | @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name) |
|
|||
16 | end |
|
|||
17 | @controller_class = controller.camelize |
|
13 | @controller_class = controller.camelize | |
18 | end |
|
14 | end | |
19 |
|
15 |
@@ -14,11 +14,7 class RedminePluginModelGenerator < Rails::Generators::NamedBase | |||||
14 | super |
|
14 | super | |
15 | @plugin_name = file_name.underscore |
|
15 | @plugin_name = file_name.underscore | |
16 | @plugin_pretty_name = plugin_name.titleize |
|
16 | @plugin_pretty_name = plugin_name.titleize | |
17 | if Redmine::Configuration['plugins_path'].nil? |
|
17 | @plugin_path = File.join(Redmine::Plugin.directory, plugin_name) | |
18 | @plugin_path = File.join(Rails.root, 'plugins', plugin_name) |
|
|||
19 | else |
|
|||
20 | @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name) |
|
|||
21 | end |
|
|||
22 | @model_class = model.camelize |
|
18 | @model_class = model.camelize | |
23 | @table_name = @model_class.tableize |
|
19 | @table_name = @model_class.tableize | |
24 | @migration_filename = "create_#{@table_name}" |
|
20 | @migration_filename = "create_#{@table_name}" |
General Comments 0
You need to be logged in to leave comments.
Login now