diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-10-28 16:33:25 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-10-28 16:33:25 +0000 |
commit | 66bbc4f4e61a384a0bdb6aa0ba48f5641278db30 (patch) | |
tree | 7860f8baae114f34715ff382694f060d0a9bb0d2 /railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb | |
parent | d5e48ae7d278cb6e03bef104eac23ac5cad46c5a (diff) | |
download | rails-66bbc4f4e61a384a0bdb6aa0ba48f5641278db30.tar.gz rails-66bbc4f4e61a384a0bdb6aa0ba48f5641278db30.tar.bz2 rails-66bbc4f4e61a384a0bdb6aa0ba48f5641278db30.zip |
Added plugin generator to create a stub structure for a new plugin in vendor/plugins (see "script/generate plugin" for help) [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2784 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb')
-rw-r--r-- | railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb b/railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb new file mode 100644 index 0000000000..2db7f98f8d --- /dev/null +++ b/railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb @@ -0,0 +1,17 @@ +class PluginGenerator < Rails::Generator::NamedBase + def manifest + record do |m| + m.directory File.join('vendor', 'plugins', file_name) + m.directory File.join('vendor', 'plugins', file_name, 'lib') + m.directory File.join('vendor', 'plugins', file_name, 'test') + m.directory File.join('vendor', 'plugins', file_name, 'tasks') + + m.template 'plugin.rb', File.join('vendor', 'plugins', file_name, 'lib', "#{file_name}.rb") + m.template 'unit_test.rb', File.join('vendor', 'plugins', file_name, 'test', "#{file_name}_test.rb") + + m.template 'init.rb', File.join('vendor', 'plugins', file_name, 'init.rb') + m.template 'tasks.rake', File.join('vendor', 'plugins', file_name, 'tasks', "#{file_name}_tasks.rake") + m.template 'README', File.join('vendor', 'plugins', file_name, 'README') + end + end +end |