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 / 04 / 042b73a7fb39bc9f350c595849fe7907d6d24b4a.svn-base @ 1298:4f746d8966dd
History | View | Annotate | Download (1.47 KB)
| 1 |
class RedminePluginGenerator < Rails::Generators::NamedBase |
|---|---|
| 2 |
source_root File.expand_path("../templates", __FILE__)
|
| 3 |
|
| 4 |
attr_reader :plugin_path, :plugin_name, :plugin_pretty_name |
| 5 |
|
| 6 |
def initialize(*args) |
| 7 |
super |
| 8 |
@plugin_name = file_name.underscore |
| 9 |
@plugin_pretty_name = plugin_name.titleize |
| 10 |
@plugin_path = "plugins/#{plugin_name}"
|
| 11 |
end |
| 12 |
|
| 13 |
def copy_templates |
| 14 |
empty_directory "#{plugin_path}/app"
|
| 15 |
empty_directory "#{plugin_path}/app/controllers"
|
| 16 |
empty_directory "#{plugin_path}/app/helpers"
|
| 17 |
empty_directory "#{plugin_path}/app/models"
|
| 18 |
empty_directory "#{plugin_path}/app/views"
|
| 19 |
empty_directory "#{plugin_path}/db/migrate"
|
| 20 |
empty_directory "#{plugin_path}/lib/tasks"
|
| 21 |
empty_directory "#{plugin_path}/assets/images"
|
| 22 |
empty_directory "#{plugin_path}/assets/javascripts"
|
| 23 |
empty_directory "#{plugin_path}/assets/stylesheets"
|
| 24 |
empty_directory "#{plugin_path}/config/locales"
|
| 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"
|
| 30 |
|
| 31 |
template 'README.rdoc', "#{plugin_path}/README.rdoc"
|
| 32 |
template 'init.rb.erb', "#{plugin_path}/init.rb"
|
| 33 |
template 'routes.rb', "#{plugin_path}/config/routes.rb"
|
| 34 |
template 'en_rails_i18n.yml', "#{plugin_path}/config/locales/en.yml"
|
| 35 |
template 'test_helper.rb.erb', "#{plugin_path}/test/test_helper.rb"
|
| 36 |
end |
| 37 |
end |