To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / .svn / pristine / 95 / 9518b4c165dbfab5f7a31a09b585b6cec17723f3.svn-base @ 1297:0a574315af3e
History | View | Annotate | Download (1.28 KB)
| 1 |
class RedminePluginGenerator < Rails::Generator::NamedBase |
|---|---|
| 2 |
attr_reader :plugin_path, :plugin_name, :plugin_pretty_name |
| 3 |
|
| 4 |
def initialize(runtime_args, runtime_options = {})
|
| 5 |
super |
| 6 |
@plugin_name = "redmine_#{file_name.underscore}"
|
| 7 |
@plugin_pretty_name = plugin_name.titleize |
| 8 |
@plugin_path = "vendor/plugins/#{plugin_name}"
|
| 9 |
end |
| 10 |
|
| 11 |
def manifest |
| 12 |
record do |m| |
| 13 |
m.directory "#{plugin_path}/app/controllers"
|
| 14 |
m.directory "#{plugin_path}/app/helpers"
|
| 15 |
m.directory "#{plugin_path}/app/models"
|
| 16 |
m.directory "#{plugin_path}/app/views"
|
| 17 |
m.directory "#{plugin_path}/db/migrate"
|
| 18 |
m.directory "#{plugin_path}/lib/tasks"
|
| 19 |
m.directory "#{plugin_path}/assets/images"
|
| 20 |
m.directory "#{plugin_path}/assets/javascripts"
|
| 21 |
m.directory "#{plugin_path}/assets/stylesheets"
|
| 22 |
m.directory "#{plugin_path}/lang"
|
| 23 |
m.directory "#{plugin_path}/config/locales"
|
| 24 |
m.directory "#{plugin_path}/test"
|
| 25 |
|
| 26 |
m.template 'README.rdoc', "#{plugin_path}/README.rdoc"
|
| 27 |
m.template 'init.rb.erb', "#{plugin_path}/init.rb"
|
| 28 |
m.template 'en.yml', "#{plugin_path}/lang/en.yml"
|
| 29 |
m.template 'en_rails_i18n.yml', "#{plugin_path}/config/locales/en.yml"
|
| 30 |
m.template 'test_helper.rb.erb', "#{plugin_path}/test/test_helper.rb"
|
| 31 |
end |
| 32 |
end |
| 33 |
end |