diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/configs/databases/frontbase.yml | 4 | ||||
-rw-r--r-- | railties/configs/databases/mysql.yml | 4 | ||||
-rw-r--r-- | railties/configs/databases/oracle.yml | 6 | ||||
-rw-r--r-- | railties/configs/databases/postgresql.yml | 4 | ||||
-rw-r--r-- | railties/configs/databases/sqlite2.yml | 4 | ||||
-rw-r--r-- | railties/configs/databases/sqlite3.yml | 4 | ||||
-rw-r--r-- | railties/configs/initializers/new_rails_defaults.rb | 8 | ||||
-rw-r--r-- | railties/environments/environment.rb | 8 | ||||
-rw-r--r-- | railties/environments/test.rb | 2 | ||||
-rw-r--r-- | railties/lib/initializer.rb | 46 | ||||
-rw-r--r-- | railties/lib/rails_generator/base.rb | 2 | ||||
-rw-r--r-- | railties/lib/tasks/databases.rake | 2 | ||||
-rw-r--r-- | railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml | 2 | ||||
-rw-r--r-- | railties/test/generators/generator_test_helper.rb | 60 |
14 files changed, 78 insertions, 78 deletions
diff --git a/railties/configs/databases/frontbase.yml b/railties/configs/databases/frontbase.yml index 2eed3133a1..c0c3588be1 100644 --- a/railties/configs/databases/frontbase.yml +++ b/railties/configs/databases/frontbase.yml @@ -10,8 +10,8 @@ development: username: <%= app_name %> password: '' -# Warning: The database defined as 'test' will be erased and -# re-generated from your development database when you run 'rake'. +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: frontbase diff --git a/railties/configs/databases/mysql.yml b/railties/configs/databases/mysql.yml index c5c894c5e1..7fcadcdf2c 100644 --- a/railties/configs/databases/mysql.yml +++ b/railties/configs/databases/mysql.yml @@ -26,8 +26,8 @@ development: host: localhost <% end -%> -# Warning: The database defined as 'test' will be erased and -# re-generated from your development database when you run 'rake'. +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: mysql diff --git a/railties/configs/databases/oracle.yml b/railties/configs/databases/oracle.yml index c86cbdbaba..a1883f6256 100644 --- a/railties/configs/databases/oracle.yml +++ b/railties/configs/databases/oracle.yml @@ -4,7 +4,7 @@ # http://rubyforge.org/projects/ruby-oci8/ # # Specify your database using any valid connection syntax, such as a -# tnsnames.ora service name, or a sql connect url string of the form: +# tnsnames.ora service name, or a SQL connect url string of the form: # # //host:[port][/service name] # @@ -23,8 +23,8 @@ development: username: <%= app_name %> password: -# Warning: The database defined as 'test' will be erased and -# re-generated from your development database when you run 'rake'. +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: oracle diff --git a/railties/configs/databases/postgresql.yml b/railties/configs/databases/postgresql.yml index c1b911a9a4..36f6e5ae49 100644 --- a/railties/configs/databases/postgresql.yml +++ b/railties/configs/databases/postgresql.yml @@ -30,8 +30,8 @@ development: # The server defaults to notice. #min_messages: warning -# Warning: The database defined as 'test' will be erased and -# re-generated from your development database when you run 'rake'. +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: postgresql diff --git a/railties/configs/databases/sqlite2.yml b/railties/configs/databases/sqlite2.yml index 26d3957d79..fc48bd6753 100644 --- a/railties/configs/databases/sqlite2.yml +++ b/railties/configs/databases/sqlite2.yml @@ -4,8 +4,8 @@ development: adapter: sqlite database: db/development.sqlite2 -# Warning: The database defined as 'test' will be erased and -# re-generated from your development database when you run 'rake'. +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: sqlite diff --git a/railties/configs/databases/sqlite3.yml b/railties/configs/databases/sqlite3.yml index b444b03cd4..fff44a4124 100644 --- a/railties/configs/databases/sqlite3.yml +++ b/railties/configs/databases/sqlite3.yml @@ -5,8 +5,8 @@ development: database: db/development.sqlite3 timeout: 5000 -# Warning: The database defined as 'test' will be erased and -# re-generated from your development database when you run 'rake'. +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: sqlite3 diff --git a/railties/configs/initializers/new_rails_defaults.rb b/railties/configs/initializers/new_rails_defaults.rb index b959c6d549..5e60c0ade4 100644 --- a/railties/configs/initializers/new_rails_defaults.rb +++ b/railties/configs/initializers/new_rails_defaults.rb @@ -1,15 +1,15 @@ # These settings change the behavior of Rails 2 apps and will be defaults # for Rails 3. You can remove this initializer when Rails 3 is released. -# Include ActiveRecord class name as root for JSON serialized output. +# Include Active Record class name as root for JSON serialized output. ActiveRecord::Base.include_root_in_json = true -# Store the full class name (including module namespace) in STI type column +# Store the full class name (including module namespace) in STI type column. ActiveRecord::Base.store_full_sti_class = true -# Use ISO 8601 format for JSON serialized times and dates +# Use ISO 8601 format for JSON serialized times and dates. ActiveSupport.use_standard_json_time_format = true -# Don't escape HTML entities in JSON, leave that for the #json_escape helper +# Don't escape HTML entities in JSON, leave that for the #json_escape helper. # if you're including raw json in an HTML page. ActiveSupport.escape_html_entities_in_json = false
\ No newline at end of file diff --git a/railties/environments/environment.rb b/railties/environments/environment.rb index d03447e1d3..468fa45ef6 100644 --- a/railties/environments/environment.rb +++ b/railties/environments/environment.rb @@ -21,7 +21,7 @@ Rails::Initializer.run do |config| # config.frameworks -= [ :active_record, :active_resource, :action_mailer ] # Specify gems that this application depends on. - # They can then be installed with rake gem:install on new installations. + # They can then be installed with "rake gems:install" on new installations. # config.gem "bj" # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net" # config.gem "aws-s3", :lib => "aws/s3" @@ -38,9 +38,9 @@ Rails::Initializer.run do |config| # (by default production uses :info, the others :debug) # config.log_level = :debug - # Make Time.zone default to the specified zone, and make ActiveRecord store time values + # Make Time.zone default to the specified zone, and make Active Record store time values # in the database in UTC, and return them converted to the specified local zone. - # Run `rake -D time` for a list of tasks for finding time zone names. Uncomment to use default local time. + # Run "rake -D time" for a list of tasks for finding time zone names. Uncomment to use default local time. config.time_zone = 'UTC' # Your secret key for verifying cookie session data integrity. @@ -54,7 +54,7 @@ Rails::Initializer.run do |config| # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information - # (create the session table with 'rake db:sessions:create') + # (create the session table with "rake db:sessions:create") # config.action_controller.session_store = :active_record_store # Use SQL instead of Active Record's schema dumper when creating the test database. diff --git a/railties/environments/test.rb b/railties/environments/test.rb index 58850a7974..1e709e1d19 100644 --- a/railties/environments/test.rb +++ b/railties/environments/test.rb @@ -16,7 +16,7 @@ config.action_controller.perform_caching = false # Disable request forgery protection in test environment config.action_controller.allow_forgery_protection = false -# Tell ActionMailer not to deliver emails to the real world. +# Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 2e56485989..8f963cb4a5 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -164,12 +164,12 @@ module Rails end # If Rails is vendored and RubyGems is available, install stub GemSpecs - # for Rails, ActiveSupport, ActiveRecord, ActionPack, ActionMailer, and - # ActiveResource. This allows Gem plugins to depend on Rails even when + # for Rails, Active Support, Active Record, Action Pack, Action Mailer, and + # Active Resource. This allows Gem plugins to depend on Rails even when # the Gem version of Rails shouldn't be loaded. def install_gem_spec_stubs unless Rails.respond_to?(:vendor_rails?) - abort "Your config/boot.rb is outdated: Run 'rake rails:update'." + abort %{Your config/boot.rb is outdated: Run "rake rails:update".} end if Rails.vendor_rails? @@ -214,8 +214,8 @@ module Rails end # Requires all frameworks specified by the Configuration#frameworks - # list. By default, all frameworks (ActiveRecord, ActiveSupport, - # ActionPack, ActionMailer, and ActiveResource) are loaded. + # list. By default, all frameworks (Active Record, Active Support, + # Action Pack, Action Mailer, and Active Resource) are loaded. def require_frameworks configuration.frameworks.each { |framework| require(framework.to_s) } rescue LoadError => e @@ -289,7 +289,7 @@ module Rails def load_observers if configuration.frameworks.include?(:active_record) if @configuration.gems.any? { |g| !g.loaded? } - puts "Unable to instantiate observers, some gems that this application depends on are missing. Run 'rake gems:install'" + puts %{Unable to instantiate observers, some gems that this application depends on are missing. Run "rake gems:install"} else ActiveRecord::Base.instantiate_observers end @@ -330,7 +330,7 @@ module Rails end end - # If the +RAILS_DEFAULT_LOGGER+ constant is already set, this initialization + # If the RAILS_DEFAULT_LOGGER constant is already set, this initialization # routine does nothing. If the constant is not set, and Configuration#logger # is not +nil+, this also does nothing. Otherwise, a new logger instance # is created at Configuration#log_path, with a default log level of @@ -363,10 +363,10 @@ module Rails silence_warnings { Object.const_set "RAILS_DEFAULT_LOGGER", logger } end - # Sets the logger for ActiveRecord, ActionController, and ActionMailer + # Sets the logger for Active Record, Action Controller, and Action Mailer # (but only for those frameworks that are to be loaded). If the framework's # logger is already set, it is not changed, otherwise it is set to use - # +RAILS_DEFAULT_LOGGER+. + # RAILS_DEFAULT_LOGGER. def initialize_framework_logging for framework in ([ :active_record, :action_controller, :action_mailer ] & configuration.frameworks) framework.to_s.camelize.constantize.const_get("Base").logger ||= RAILS_DEFAULT_LOGGER @@ -384,7 +384,7 @@ module Rails ActionController::Base.view_paths = [configuration.view_path] if configuration.frameworks.include?(:action_controller) && ActionController::Base.view_paths.empty? end - # If ActionController is not one of the loaded frameworks (Configuration#frameworks) + # If Action Controller is not one of the loaded frameworks (Configuration#frameworks) # this does nothing. Otherwise, it loads the routing definitions and sets up # loading module used to lazily load controllers (Configuration#controller_paths). def initialize_routing @@ -413,13 +413,13 @@ module Rails end end - # Sets the default value for Time.zone, and turns on ActiveRecord time_zone_aware_attributes. + # Sets the default value for Time.zone, and turns on ActiveRecord::Base#time_zone_aware_attributes. # If assigned value cannot be matched to a TimeZone, an exception will be raised. def initialize_time_zone if configuration.time_zone zone_default = Time.send!(:get_zone, configuration.time_zone) unless zone_default - raise "Value assigned to config.time_zone not recognized. Run `rake -D time` for a list of tasks for finding appropriate time zone names." + raise %{Value assigned to config.time_zone not recognized. Run "rake -D time" for a list of tasks for finding appropriate time zone names.} end Time.zone_default = zone_default if configuration.frameworks.include?(:active_record) @@ -479,22 +479,22 @@ module Rails # The application's base directory. attr_reader :root_path - # A stub for setting options on ActionController::Base + # A stub for setting options on ActionController::Base. attr_accessor :action_controller - # A stub for setting options on ActionMailer::Base + # A stub for setting options on ActionMailer::Base. attr_accessor :action_mailer - # A stub for setting options on ActionView::Base + # A stub for setting options on ActionView::Base. attr_accessor :action_view - # A stub for setting options on ActiveRecord::Base + # A stub for setting options on ActiveRecord::Base. attr_accessor :active_record - # A stub for setting options on ActiveRecord::Base + # A stub for setting options on ActiveRecord::Base. attr_accessor :active_resource - # A stub for setting options on ActiveSupport + # A stub for setting options on ActiveSupport. attr_accessor :active_support # Whether or not classes should be cached (set to false if you want @@ -622,9 +622,9 @@ module Rails end alias_method :breakpoint_server=, :breakpoint_server - # Sets the default time_zone. Setting this will enable time_zone - # awareness for ActiveRecord models and set the ActiveRecord default - # timezone to :utc. + # Sets the default +time_zone+. Setting this will enable +time_zone+ + # awareness for Active Record models and set the Active Record default + # timezone to <tt>:utc</tt>. attr_accessor :time_zone # Create a new Configuration instance, initialized with the default @@ -689,7 +689,7 @@ module Rails end # Return the currently selected environment. By default, it returns the - # value of the +RAILS_ENV+ constant. + # value of the RAILS_ENV constant. def environment ::RAILS_ENV end @@ -847,7 +847,7 @@ end # Needs to be duplicated from Active Support since its needed before Active # Support is available. Here both Options and Hash are namespaced to prevent -# conflicts with other implementations AND with the classes residing in ActiveSupport. +# conflicts with other implementations AND with the classes residing in Active Support. class Rails::OrderedOptions < Array #:nodoc: def []=(key, value) key = key.to_sym diff --git a/railties/lib/rails_generator/base.rb b/railties/lib/rails_generator/base.rb index 1ebcff9062..b5cfe79867 100644 --- a/railties/lib/rails_generator/base.rb +++ b/railties/lib/rails_generator/base.rb @@ -36,7 +36,7 @@ module Rails # view.html.erb # # The directory name (+controller+) matches the name of the generator file - # (controller_generator.rb) and class (+ControllerGenerator+). The files + # (controller_generator.rb) and class (ControllerGenerator). The files # that will be copied or used as templates are stored in the +templates+ # directory. # diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake index f40f8463f7..8077d0a401 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -173,7 +173,7 @@ namespace :db do pending_migrations.each do |pending_migration| puts ' %4d %s' % [pending_migration.version, pending_migration.name] end - abort "Run `rake db:migrate` to update your database then try again." + abort %{Run "rake db:migrate" to update your database then try again.} end end end diff --git a/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml b/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml index 79d5721a53..fe80872a16 100644 --- a/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml +++ b/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml @@ -1 +1 @@ -# an empty yaml file - any content in here seems to get parsed as a string
\ No newline at end of file +# an empty YAML file - any content in here seems to get parsed as a string
\ No newline at end of file diff --git a/railties/test/generators/generator_test_helper.rb b/railties/test/generators/generator_test_helper.rb index c99df6e2d3..05dca3400e 100644 --- a/railties/test/generators/generator_test_helper.rb +++ b/railties/test/generators/generator_test_helper.rb @@ -86,19 +86,19 @@ class GeneratorTestCase < Test::Unit::TestCase # don't complain, test/unit end - # Instantiates the Generator + # Instantiates the Generator. def build_generator(name, params) Rails::Generator::Base.instance(name, params) end - # Runs the create command (like the command line does) + # Runs the +create+ command (like the command line does). def run_generator(name, params) silence_generator do build_generator(name, params).command(:create).invoke! end end - # Silences the logger temporarily and returns the output as a String + # Silences the logger temporarily and returns the output as a String. def silence_generator logger_original = Rails::Generator::Base.logger myout = StringIO.new @@ -108,7 +108,7 @@ class GeneratorTestCase < Test::Unit::TestCase myout.string end - # asserts that the given controller was generated. + # Asserts that the given controller was generated. # It takes a name or symbol without the <tt>_controller</tt> part and an optional super class. # The contents of the class source file is passed to a block. def assert_generated_controller_for(name, parent = "ApplicationController") @@ -117,44 +117,44 @@ class GeneratorTestCase < Test::Unit::TestCase end end - # asserts that the given model was generated. + # Asserts that the given model was generated. # It takes a name or symbol and an optional super class. - # the contents of the class source file is passed to a block. + # The contents of the class source file is passed to a block. def assert_generated_model_for(name, parent = "ActiveRecord::Base") assert_generated_class "app/models/#{name.to_s.underscore}", parent do |body| yield body if block_given? end end - # asserts that the given helper was generated. - # It takes a name or symbol without the <tt>_helper</tt> part - # the contents of the module source file is passed to a block. + # Asserts that the given helper was generated. + # It takes a name or symbol without the <tt>_helper</tt> part. + # The contents of the module source file is passed to a block. def assert_generated_helper_for(name) assert_generated_module "app/helpers/#{name.to_s.underscore}_helper" do |body| yield body if block_given? end end - # asserts that the given functional test was generated. + # Asserts that the given functional test was generated. # It takes a name or symbol without the <tt>_controller_test</tt> part and an optional super class. - # the contents of the class source file is passed to a block. + # The contents of the class source file is passed to a block. def assert_generated_functional_test_for(name, parent = "ActionController::TestCase") assert_generated_class "test/functional/#{name.to_s.underscore}_controller_test",parent do |body| yield body if block_given? end end - # asserts that the given unit test was generated. + # Asserts that the given unit test was generated. # It takes a name or symbol without the <tt>_test</tt> part and an optional super class. - # the contents of the class source file is passed to a block. + # The contents of the class source file is passed to a block. def assert_generated_unit_test_for(name, parent = "ActiveSupport::TestCase") assert_generated_class "test/unit/#{name.to_s.underscore}_test", parent do |body| yield body if block_given? end end - # asserts that the given file was generated. - # the contents of the file is passed to a block. + # Asserts that the given file was generated. + # The contents of the file is passed to a block. def assert_generated_file(path) assert_file_exists(path) File.open("#{RAILS_ROOT}/#{path}") do |f| @@ -168,9 +168,9 @@ class GeneratorTestCase < Test::Unit::TestCase "The file '#{RAILS_ROOT}/#{path}' should exist" end - # asserts that the given class source file was generated. + # Asserts that the given class source file was generated. # It takes a path without the <tt>.rb</tt> part and an optional super class. - # the contents of the class source file is passed to a block. + # The contents of the class source file is passed to a block. def assert_generated_class(path, parent = nil) # FIXME: Sucky way to detect namespaced classes if path.split('/').size > 3 @@ -187,9 +187,9 @@ class GeneratorTestCase < Test::Unit::TestCase end end - # asserts that the given module source file was generated. + # Asserts that the given module source file was generated. # It takes a path without the <tt>.rb</tt> part. - # the contents of the class source file is passed to a block. + # The contents of the class source file is passed to a block. def assert_generated_module(path) # FIXME: Sucky way to detect namespaced modules if path.split('/').size > 3 @@ -206,18 +206,18 @@ class GeneratorTestCase < Test::Unit::TestCase end end - # asserts that the given css stylesheet file was generated. + # Asserts that the given CSS stylesheet file was generated. # It takes a path without the <tt>.css</tt> part. - # the contents of the stylesheet source file is passed to a block. + # The contents of the stylesheet source file is passed to a block. def assert_generated_stylesheet(path) assert_generated_file("public/stylesheets/#{path}.css") do |body| yield body if block_given? end end - # asserts that the given yaml file was generated. + # Asserts that the given YAML file was generated. # It takes a path without the <tt>.yml</tt> part. - # the parsed yaml tree is passed to a block. + # The parsed YAML tree is passed to a block. def assert_generated_yaml(path) assert_generated_file("#{path}.yml") do |body| yaml = YAML.load(body) @@ -226,18 +226,18 @@ class GeneratorTestCase < Test::Unit::TestCase end end - # asserts that the given fixtures yaml file was generated. + # Asserts that the given fixtures yaml file was generated. # It takes a fixture name without the <tt>.yml</tt> part. - # the parsed yaml tree is passed to a block. + # The parsed YAML tree is passed to a block. def assert_generated_fixtures_for(name) assert_generated_yaml "test/fixtures/#{name.to_s.underscore}" do |yaml| yield yaml if block_given? end end - # asserts that the given views were generated. + # Asserts that the given views were generated. # It takes a controller name and a list of views (including extensions). - # The body of each view is passed to a block + # The body of each view is passed to a block. def assert_generated_views_for(name, *actions) actions.each do |action| assert_generated_file("app/views/#{name.to_s.underscore}/#{action}") do |body| @@ -262,7 +262,7 @@ class GeneratorTestCase < Test::Unit::TestCase assert !File.exist?(migration_file), "should not create migration #{migration_file}" end - # asserts that the given resource was added to the routes. + # Asserts that the given resource was added to the routes. def assert_added_route_for(name) assert_generated_file("config/routes.rb") do |body| assert_match /map.resources :#{name.to_s.underscore}/, body, @@ -270,7 +270,7 @@ class GeneratorTestCase < Test::Unit::TestCase end end - # asserts that the given methods are defined in the body. + # Asserts that the given methods are defined in the body. # This does assume standard rails code conventions with regards to the source code. # The body of each individual method is passed to a block. def assert_has_method(body, *methods) @@ -280,7 +280,7 @@ class GeneratorTestCase < Test::Unit::TestCase end end - # asserts that the given column is defined in the migration + # Asserts that the given column is defined in the migration. def assert_generated_column(body, name, type) assert_match /t\.#{type.to_s} :#{name.to_s}/, body, "should have column #{name.to_s} defined" end |