From 92669b8320a45e3f0497bfb83c0c8e55d515be0c Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 25 Jul 2010 22:08:34 +0200 Subject: application generation: --skip-testunit and --skip-activerecord renamed to --skip-test-unit and --skip-active-record respectively Reason is their proper spellings are "Test::Unit" and "Active Record". Option names and descriptions have been revised, as well as some method names and minor details here and there. --- .../lib/rails/generators/rails/app/app_generator.rb | 18 +++++++++--------- .../rails/app/templates/config/application.rb | 2 +- .../rails/app/templates/test/test_helper.rb.tt | 2 +- railties/lib/rails/generators/test_case.rb | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'railties/lib') diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index c99aa3c0cd..1324cc1f67 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -168,7 +168,7 @@ module Rails :desc => "Path to an application builder (can be a filesystem path or URL)" class_option :template, :type => :string, :aliases => "-m", - :desc => "Path to an application template (can be a filesystem path or URL)." + :desc => "Path to an application template (can be a filesystem path or URL)" class_option :dev, :type => :boolean, :default => false, :desc => "Setup the application with Gemfile pointing to your Rails checkout" @@ -179,11 +179,11 @@ module Rails class_option :skip_gemfile, :type => :boolean, :default => false, :desc => "Don't create a Gemfile" - class_option :skip_activerecord, :type => :boolean, :aliases => "-O", :default => false, - :desc => "Skip ActiveRecord files" + class_option :skip_active_record, :type => :boolean, :aliases => "-O", :default => false, + :desc => "Skip Active Record files" - class_option :skip_testunit, :type => :boolean, :aliases => "-T", :default => false, - :desc => "Skip TestUnit files" + class_option :skip_test_unit, :type => :boolean, :aliases => "-T", :default => false, + :desc => "Skip Test::Unit files" class_option :skip_prototype, :type => :boolean, :aliases => "-J", :default => false, :desc => "Skip Prototype files" @@ -205,7 +205,7 @@ module Rails super - if !options[:skip_activerecord] && !DATABASES.include?(options[:database]) + if !options[:skip_active_record] && !DATABASES.include?(options[:database]) raise Error, "Invalid value for --database option. Supported for preconfiguration are: #{DATABASES.join(", ")}." end end @@ -239,8 +239,8 @@ module Rails template "config/boot.rb" end - def create_activerecord_files - return if options[:skip_activerecord] + def create_active_record_files + return if options[:skip_active_record] build(:database_yml) end @@ -281,7 +281,7 @@ module Rails end def create_test_files - build(:test) unless options[:skip_testunit] + build(:test) unless options[:skip_test_unit] end def create_tmp_files diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb index 190ab04cf5..7d63e99e05 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/application.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb @@ -1,6 +1,6 @@ require File.expand_path('../boot', __FILE__) -<% unless options[:skip_activerecord] -%> +<% unless options[:skip_active_record] -%> require 'rails/all' <% else -%> # Pick the frameworks you want: diff --git a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt index 86564031f5..a8f7aeac7d 100644 --- a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt @@ -3,7 +3,7 @@ require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' class ActiveSupport::TestCase -<% unless options[:skip_activerecord] -%> +<% unless options[:skip_active_record] -%> # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. # # Note: You'll currently still have to declare fixtures explicitly in integration tests diff --git a/railties/lib/rails/generators/test_case.rb b/railties/lib/rails/generators/test_case.rb index 0dfb5cd1c9..36bc542ffe 100644 --- a/railties/lib/rails/generators/test_case.rb +++ b/railties/lib/rails/generators/test_case.rb @@ -51,7 +51,7 @@ module Rails # Sets default arguments on generator invocation. This can be overwritten when # invoking it. # - # arguments %w(app_name --skip-activerecord) + # arguments %w(app_name --skip-active-record) # def self.arguments(array) self.default_arguments = array @@ -214,8 +214,8 @@ module Rails # destination File.expand_path("../tmp", File.dirname(__FILE__)) # teardown :cleanup_destination_root # - # test "database.yml is not created when skipping activerecord" do - # run_generator %w(myapp --skip-activerecord) + # test "database.yml is not created when skipping Active Record" do + # run_generator %w(myapp --skip-active-record) # assert_no_file "config/database.yml" # end # end -- cgit v1.2.3