From 90c887fa7d0c454b7533e208daefc342dea4d5f3 Mon Sep 17 00:00:00 2001 From: Florent Guilleux Date: Sat, 1 Dec 2012 13:20:39 -0500 Subject: Remove trailing whitespaces --- railties/lib/rails/code_statistics.rb | 2 +- railties/lib/rails/generators/rails/model/USAGE | 8 ++++---- railties/lib/rails/source_annotation_extractor.rb | 2 +- railties/test/commands/console_test.rb | 2 +- railties/test/generators/generated_attribute_test.rb | 4 ++-- railties/test/generators/migration_generator_test.rb | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/code_statistics.rb b/railties/lib/rails/code_statistics.rb index 1aed2796c1..9ca5046369 100644 --- a/railties/lib/rails/code_statistics.rb +++ b/railties/lib/rails/code_statistics.rb @@ -38,7 +38,7 @@ class CodeStatistics #:nodoc: next unless file_name =~ pattern comment_started = false - + case file_name when /.*\.js$/ comment_pattern = /^\s*\/\// diff --git a/railties/lib/rails/generators/rails/model/USAGE b/railties/lib/rails/generators/rails/model/USAGE index e29e19490e..9076992a8c 100644 --- a/railties/lib/rails/generators/rails/model/USAGE +++ b/railties/lib/rails/generators/rails/model/USAGE @@ -21,7 +21,7 @@ Description: Available field types: - Just after the field name you can specify a type like text or boolean. + Just after the field name you can specify a type like text or boolean. It will generate the column with the associated SQL type. For instance: `rails generate model post title:string body:text` @@ -57,16 +57,16 @@ Available field types: limit Set the maximum size of the field giving a number between curly braces default Set a default value for the field - precision Defines the precision for the decimal fields + precision Defines the precision for the decimal fields scale Defines the scale for the decimal fields - uniq Defines the field values as unique + uniq Defines the field values as unique index Will add an index on the field Examples: `rails generate model user pseudo:string{30}` `rails generate model user pseudo:string:uniq` - + Examples: `rails generate model account` diff --git a/railties/lib/rails/source_annotation_extractor.rb b/railties/lib/rails/source_annotation_extractor.rb index 3474b02af4..b718bc37bd 100644 --- a/railties/lib/rails/source_annotation_extractor.rb +++ b/railties/lib/rails/source_annotation_extractor.rb @@ -32,7 +32,7 @@ class SourceAnnotationExtractor end # Prints all annotations with tag +tag+ under the root directories +app+, +config+, +lib+, - # +script+, and +test+ (recursively). Filenames with extension + # +script+, and +test+ (recursively). Filenames with extension # +.builder+, +.rb+, +.erb+, +.haml+, +.slim+, +.css+, +.scss+, +.js+, # +.coffee+, and +.rake+ are taken into account. The +options+ hash is passed to each # annotation's +to_s+. diff --git a/railties/test/commands/console_test.rb b/railties/test/commands/console_test.rb index f99ea13022..87f5560434 100644 --- a/railties/test/commands/console_test.rb +++ b/railties/test/commands/console_test.rb @@ -78,7 +78,7 @@ class Rails::ConsoleTest < ActiveSupport::TestCase assert_match(/\sspecial-production\s/, output) end end - + def test_e_option start ['-e', 'special-production'] assert_match(/\sspecial-production\s/, output) diff --git a/railties/test/generators/generated_attribute_test.rb b/railties/test/generators/generated_attribute_test.rb index 6ab1cd58c7..c4288a0e6f 100644 --- a/railties/test/generators/generated_attribute_test.rb +++ b/railties/test/generators/generated_attribute_test.rb @@ -117,13 +117,13 @@ class GeneratedAttributeTest < Rails::Generators::TestCase assert create_generated_attribute("#{attribute_type}{polymorphic}").polymorphic? end end - + def test_polymorphic_reference_is_false %w(foo bar baz).each do |attribute_type| assert !create_generated_attribute("#{attribute_type}{polymorphic}").polymorphic? end end - + def test_blank_type_defaults_to_string_raises_exception assert_equal :string, create_generated_attribute(nil, 'title').type assert_equal :string, create_generated_attribute("", 'title').type diff --git a/railties/test/generators/migration_generator_test.rb b/railties/test/generators/migration_generator_test.rb index 15e5a0b92b..c7b97cff58 100644 --- a/railties/test/generators/migration_generator_test.rb +++ b/railties/test/generators/migration_generator_test.rb @@ -28,7 +28,7 @@ class MigrationGeneratorTest < Rails::Generators::TestCase run_generator [migration] assert_migration "db/migrate/change_title_body_from_posts.rb", /class #{migration} < ActiveRecord::Migration/ end - + def test_migration_with_invalid_file_name migration = "add_something:datetime" assert_raise ActiveRecord::IllegalMigrationNameError do -- cgit v1.2.3