diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-10-23 20:56:02 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-11-02 17:14:51 +0100 |
commit | fdbd9df21e0063da4b34346c54fbe21ac9583ca6 (patch) | |
tree | 030031e0e79e2ab08537dd5a771569a88f64e4c0 | |
parent | d995953869ca09906af8f5c5058d47cb66bc2467 (diff) | |
download | rails-fdbd9df21e0063da4b34346c54fbe21ac9583ca6.tar.gz rails-fdbd9df21e0063da4b34346c54fbe21ac9583ca6.tar.bz2 rails-fdbd9df21e0063da4b34346c54fbe21ac9583ca6.zip |
No need for say_step in 'plugin new' generator
3 files changed, 4 insertions, 22 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index ad44d9a14e..a355f3b055 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -36,16 +36,6 @@ module Rails :desc => "Show this help message and quit" end - def self.say_step(message) - @step = (@step || 0) + 1 - class_eval <<-METHOD, __FILE__, __LINE__ + 1 - def step_#{@step} - #{"puts" if @step > 1} - say_status "STEP #{@step}", #{message.inspect} - end - METHOD - end - def initialize(*args) @original_wd = Dir.pwd diff --git a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb index 9c0d83cd70..8c4ddc822a 100644 --- a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb +++ b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb @@ -102,8 +102,6 @@ end super end - say_step "Creating gem skeleton" - def create_root super end @@ -133,21 +131,16 @@ end build(:test) unless options[:skip_test_unit] end - say_step "Vendoring Rails application at test/dummy" - def create_test_dummy_files + say_status :vendor_app, dummy_path build(:generate_test_dummy) end - say_step "Configuring Rails application" - def change_config_files store_application_definition! build(:test_dummy_config) end - say_step "Removing unneeded files" - def remove_uneeded_rails_files build(:test_dummy_clean) end diff --git a/railties/test/generators/plugin_new_generator_test.rb b/railties/test/generators/plugin_new_generator_test.rb index 2049d31b18..bf395749e5 100644 --- a/railties/test/generators/plugin_new_generator_test.rb +++ b/railties/test/generators/plugin_new_generator_test.rb @@ -45,10 +45,9 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase assert_file "test/bukkits_test.rb", /assert_kind_of Module, Bukkits/ end - def test_ensure_that_plugin_options_are_not_passed_app_generator - output = run_generator [destination_root, "--skip_gemfile"] - assert_no_file "Gemfile" - assert_match /STEP 2.*create Gemfile/m, output + def test_ensure_that_plugin_options_are_not_passed_to_app_generator + FileUtils.cd(Rails.root) + assert_no_match /It works from file!.*It works_from_file/, run_generator([destination_root, "-m", "lib/template.rb"]) end def test_template_from_dir_pwd |