Permalink
Browse files

application generation: --skip-testunit and --skip-activerecord renam…

…ed 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.
  • Loading branch information...
1 parent 331df84 commit 92669b8320a45e3f0497bfb83c0c8e55d515be0c @fxn fxn committed Jul 25, 2010
View
@@ -1,5 +1,8 @@
*Rails 3.0.0 [Release Candidate] (unreleased)*
+* Application generation: --skip-testunit and --skip-activerecord become --skip-test-unit
+ and --skip-active-record respectively. [fxn]
+
* Added console to Rails::Railtie as a hook called just after console starts. [José Valim]
* Rails no longer autoload code in lib for application. You need to explicitly require it. [José Valim]
@@ -168,7 +168,7 @@ class AppGenerator < Base
: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 @@ class AppGenerator < Base
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 @@ def initialize(*args)
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 @@ def create_boot_file
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 @@ def create_script_files
end
def create_test_files
- build(:test) unless options[:skip_testunit]
+ build(:test) unless options[:skip_test_unit]
end
def create_tmp_files
@@ -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:
@@ -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
@@ -51,7 +51,7 @@ def self.tests(klass)
# 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 @@ def assert_field_default_value(attribute_type, value)
# 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
@@ -38,7 +38,7 @@ def app
], middleware
end
- test "removing activerecord omits its middleware" do
+ test "removing Active Record omits its middleware" do
use_frameworks []
boot!
assert !middleware.include?("ActiveRecord::ConnectionAdapters::ConnectionManagement")
@@ -65,7 +65,7 @@ def test_application_controller_and_layout_files
end
def test_options_before_application_name_raises_an_error
- content = capture(:stderr){ run_generator(["--skip-activerecord", destination_root]) }
+ content = capture(:stderr){ run_generator(["--skip-active-record", destination_root]) }
assert_equal "Options should be given after the application name. For details run: rails --help\n", content
end
@@ -117,13 +117,13 @@ def test_config_another_database
assert_file "Gemfile", /^gem\s+["']mysql["']$/
end
- def test_config_database_is_not_added_if_skip_activerecord_is_given
- run_generator [destination_root, "--skip-activerecord"]
+ def test_config_database_is_not_added_if_skip_active_record_is_given
+ run_generator [destination_root, "--skip-active-record"]
assert_no_file "config/database.yml"
end
- def test_activerecord_is_removed_from_frameworks_if_skip_activerecord_is_given
- run_generator [destination_root, "--skip-activerecord"]
+ def test_active_record_is_removed_from_frameworks_if_skip_active_record_is_given
+ run_generator [destination_root, "--skip-active-record"]
assert_file "config/application.rb", /#\s+require\s+["']active_record\/railtie["']/
end
@@ -137,7 +137,7 @@ def test_prototype_and_test_unit_are_added_by_default
end
def test_prototype_and_test_unit_are_skipped_if_required
- run_generator [destination_root, "--skip-prototype", "--skip-testunit"]
+ run_generator [destination_root, "--skip-prototype", "--skip-test-unit"]
assert_file "config/application.rb", /^\s+config\.action_view\.javascript_expansions\[:defaults\]\s+=\s+%w\(\)/
assert_file "public/javascripts/application.js"
assert_no_file "public/javascripts/prototype.js"
@@ -108,7 +108,7 @@ def test_rails_generators_with_others_information
assert_match /^ fixjour$/, output
end
- def test_rails_generators_does_not_show_activerecord_hooks
+ def test_rails_generators_does_not_show_active_record_hooks
output = capture(:stdout){ Rails::Generators.help }
assert_match /ActiveRecord:/, output
assert_match /^ active_record:fixjour$/, output

0 comments on commit 92669b8

Please sign in to comment.