2011-10-29 16:19:11 +04:00
|
|
|
#-- encoding: UTF-8
|
2011-05-30 00:11:52 +04:00
|
|
|
#-- copyright
|
|
|
|
# ChiliProject is a project management system.
|
2011-05-30 22:52:25 +04:00
|
|
|
#
|
2012-01-03 23:36:40 +04:00
|
|
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
2011-05-30 22:52:25 +04:00
|
|
|
#
|
2011-05-30 00:11:52 +04:00
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2011-05-30 22:52:25 +04:00
|
|
|
#
|
2011-05-30 00:11:52 +04:00
|
|
|
# See doc/COPYRIGHT.rdoc for more details.
|
|
|
|
#++
|
|
|
|
|
2011-04-08 20:52:32 +04:00
|
|
|
class ChiliprojectPluginGenerator < Rails::Generator::NamedBase
|
2008-09-05 14:31:06 +04:00
|
|
|
attr_reader :plugin_path, :plugin_name, :plugin_pretty_name
|
2011-05-30 22:52:25 +04:00
|
|
|
|
2008-09-05 14:31:06 +04:00
|
|
|
def initialize(runtime_args, runtime_options = {})
|
|
|
|
super
|
2011-04-08 20:52:32 +04:00
|
|
|
@plugin_name = "chiliproject_#{file_name.underscore}"
|
2008-09-05 14:31:06 +04:00
|
|
|
@plugin_pretty_name = plugin_name.titleize
|
|
|
|
@plugin_path = "vendor/plugins/#{plugin_name}"
|
|
|
|
end
|
2011-05-30 22:52:25 +04:00
|
|
|
|
2008-09-05 14:31:06 +04:00
|
|
|
def manifest
|
|
|
|
record do |m|
|
|
|
|
m.directory "#{plugin_path}/app/controllers"
|
|
|
|
m.directory "#{plugin_path}/app/helpers"
|
|
|
|
m.directory "#{plugin_path}/app/models"
|
|
|
|
m.directory "#{plugin_path}/app/views"
|
|
|
|
m.directory "#{plugin_path}/db/migrate"
|
|
|
|
m.directory "#{plugin_path}/lib/tasks"
|
|
|
|
m.directory "#{plugin_path}/assets/images"
|
|
|
|
m.directory "#{plugin_path}/assets/javascripts"
|
|
|
|
m.directory "#{plugin_path}/assets/stylesheets"
|
|
|
|
m.directory "#{plugin_path}/lang"
|
2009-06-10 07:39:02 +04:00
|
|
|
m.directory "#{plugin_path}/config/locales"
|
2008-09-05 14:31:06 +04:00
|
|
|
m.directory "#{plugin_path}/test"
|
2011-05-30 22:52:25 +04:00
|
|
|
|
2008-10-25 08:37:31 +04:00
|
|
|
m.template 'README.rdoc', "#{plugin_path}/README.rdoc"
|
|
|
|
m.template 'init.rb.erb', "#{plugin_path}/init.rb"
|
2008-09-05 14:31:06 +04:00
|
|
|
m.template 'en.yml', "#{plugin_path}/lang/en.yml"
|
2009-06-10 07:39:02 +04:00
|
|
|
m.template 'en_rails_i18n.yml', "#{plugin_path}/config/locales/en.yml"
|
2008-10-25 08:37:31 +04:00
|
|
|
m.template 'test_helper.rb.erb', "#{plugin_path}/test/test_helper.rb"
|
2008-09-05 14:31:06 +04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|