From 58136e1bd359ce71275eb8e8e5c20d1c9b286b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 17 Jan 2010 15:17:50 +0100 Subject: [PATCH] Plugin generator should use templates. --- .../templates/{MIT-LICENSE => MIT-LICENSE.tt} | 0 .../rails/plugin/templates/{README => README.tt} | 0 .../plugin/templates/{Rakefile => Rakefile.tt} | 0 railties/test/generators/plugin_generator_test.rb | 15 +++++++++++++++ 4 files changed, 15 insertions(+) rename railties/lib/rails/generators/rails/plugin/templates/{MIT-LICENSE => MIT-LICENSE.tt} (100%) rename railties/lib/rails/generators/rails/plugin/templates/{README => README.tt} (100%) rename railties/lib/rails/generators/rails/plugin/templates/{Rakefile => Rakefile.tt} (100%) diff --git a/railties/lib/rails/generators/rails/plugin/templates/MIT-LICENSE b/railties/lib/rails/generators/rails/plugin/templates/MIT-LICENSE.tt similarity index 100% rename from railties/lib/rails/generators/rails/plugin/templates/MIT-LICENSE rename to railties/lib/rails/generators/rails/plugin/templates/MIT-LICENSE.tt diff --git a/railties/lib/rails/generators/rails/plugin/templates/README b/railties/lib/rails/generators/rails/plugin/templates/README.tt similarity index 100% rename from railties/lib/rails/generators/rails/plugin/templates/README rename to railties/lib/rails/generators/rails/plugin/templates/README.tt diff --git a/railties/lib/rails/generators/rails/plugin/templates/Rakefile b/railties/lib/rails/generators/rails/plugin/templates/Rakefile.tt similarity index 100% rename from railties/lib/rails/generators/rails/plugin/templates/Rakefile rename to railties/lib/rails/generators/rails/plugin/templates/Rakefile.tt diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index f84b8b6d50..2989cdb67d 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -6,12 +6,27 @@ class PluginGeneratorTest < GeneratorsTestCase def test_plugin_skeleton_is_created run_generator + year = Date.today.year %w( vendor/plugins vendor/plugins/plugin_fu + vendor/plugins/plugin_fu/init.rb + vendor/plugins/plugin_fu/install.rb + vendor/plugins/plugin_fu/uninstall.rb vendor/plugins/plugin_fu/lib + vendor/plugins/plugin_fu/lib/plugin_fu.rb ).each{ |path| assert_file path } + + %w( + vendor/plugins/plugin_fu/README + vendor/plugins/plugin_fu/Rakefile + ).each{ |path| assert_file path, /PluginFu/ } + + %w( + vendor/plugins/plugin_fu/README + vendor/plugins/plugin_fu/MIT-LICENSE + ).each{ |path| assert_file path, /#{year}/ } end def test_check_class_collision