Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

No need for say_step in 'plugin new' generator

  • Loading branch information...
commit fdbd9df21e0063da4b34346c54fbe21ac9583ca6 1 parent d995953
@drogus drogus authored
View
10 railties/lib/rails/generators/app_base.rb
@@ -36,16 +36,6 @@ def self.add_shared_options_for(name)
: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
View
9 railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
@@ -102,8 +102,6 @@ def initialize(*args)
super
end
- say_step "Creating gem skeleton"
-
def create_root
super
end
@@ -133,21 +131,16 @@ def create_test_files
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
View
7 railties/test/generators/plugin_new_generator_test.rb
@@ -45,10 +45,9 @@ def test_generating_test_files
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
Please sign in to comment.
Something went wrong with that request. Please try again.