Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove trailing whitespaces

  • Loading branch information...
commit 90c887fa7d0c454b7533e208daefc342dea4d5f3 1 parent 5ff5970
Florent Guilleux authored
Showing with 59 additions and 61 deletions.
  1. +1 −1  actionpack/lib/action_controller/metal/mime_responds.rb
  2. +1 −1  actionpack/lib/action_dispatch/middleware/flash.rb
  3. +2 −2 activemodel/test/cases/validations/format_validation_test.rb
  4. +1 −1  activemodel/test/models/oauthed_user.rb
  5. +1 −1  activemodel/test/models/user.rb
  6. +1 −1  activerecord/lib/active_record/log_subscriber.rb
  7. +2 −2 activerecord/test/cases/associations/eager_test.rb
  8. +2 −2 activerecord/test/cases/primary_keys_test.rb
  9. +3 −3 activerecord/test/cases/tasks/database_tasks_test.rb
  10. +3 −3 activerecord/test/cases/validations/uniqueness_validation_test.rb
  11. +1 −1  activerecord/test/models/eye.rb
  12. +1 −1  activesupport/lib/active_support/gzip.rb
  13. +5 −5 activesupport/test/callbacks_test.rb
  14. +1 −1  activesupport/test/core_ext/bigdecimal_test.rb
  15. +1 −1  activesupport/test/core_ext/duration_test.rb
  16. +4 −4 activesupport/test/core_ext/module/remove_method_test.rb
  17. +8 −10 activesupport/test/core_ext/numeric_ext_test.rb
  18. +3 −3 activesupport/test/core_ext/object/inclusion_test.rb
  19. +1 −1  activesupport/test/core_ext/object_and_class_ext_test.rb
  20. +2 −2 activesupport/test/deprecation_test.rb
  21. +1 −1  activesupport/test/inflector_test.rb
  22. +4 −4 activesupport/test/message_verifier_test.rb
  23. +1 −1  railties/lib/rails/code_statistics.rb
  24. +4 −4 railties/lib/rails/generators/rails/model/USAGE
  25. +1 −1  railties/lib/rails/source_annotation_extractor.rb
  26. +1 −1  railties/test/commands/console_test.rb
  27. +2 −2 railties/test/generators/generated_attribute_test.rb
  28. +1 −1  railties/test/generators/migration_generator_test.rb
View
2  actionpack/lib/action_controller/metal/mime_responds.rb
@@ -259,7 +259,7 @@ def respond_to(*mimes, &block)
# * for other requests - i.e. data formats such as xml, json, csv etc, if
# the resource passed to +respond_with+ responds to <code>to_<format></code>,
# the method attempts to render the resource in the requested format
- # directly, e.g. for an xml request, the response is equivalent to calling
+ # directly, e.g. for an xml request, the response is equivalent to calling
# <code>render xml: resource</code>.
#
# === Nested resources
View
2  actionpack/lib/action_dispatch/middleware/flash.rb
@@ -82,7 +82,7 @@ def self.from_session_value(value)
else
new
end
-
+
flash.tap(&:sweep)
end
View
4 activemodel/test/cases/validations/format_validation_test.rb
@@ -68,11 +68,11 @@ def test_validate_format_with_formatted_message
assert t.invalid?
assert_equal ["can't be Invalid title"], t.errors[:title]
end
-
+
def test_validate_format_of_with_multiline_regexp_should_raise_error
assert_raise(ArgumentError) { Topic.validates_format_of(:title, :with => /^Valid Title$/) }
end
-
+
def test_validate_format_of_with_multiline_regexp_and_option
assert_nothing_raised(ArgumentError) do
Topic.validates_format_of(:title, :with => /^Valid Title$/, :multiline => true)
View
2  activemodel/test/models/oauthed_user.rb
@@ -2,7 +2,7 @@ class OauthedUser
extend ActiveModel::Callbacks
include ActiveModel::Validations
include ActiveModel::SecurePassword
-
+
define_model_callbacks :create
has_secure_password(validations: false)
View
2  activemodel/test/models/user.rb
@@ -2,7 +2,7 @@ class User
extend ActiveModel::Callbacks
include ActiveModel::Validations
include ActiveModel::SecurePassword
-
+
define_model_callbacks :create
has_secure_password
View
2  activerecord/lib/active_record/log_subscriber.rb
@@ -1,7 +1,7 @@
module ActiveRecord
class LogSubscriber < ActiveSupport::LogSubscriber
IGNORE_PAYLOAD_NAMES = ["SCHEMA", "EXPLAIN"]
-
+
def self.runtime=(value)
Thread.current[:active_record_sql_runtime] = value
end
View
4 activerecord/test/cases/associations/eager_test.rb
@@ -984,10 +984,10 @@ def test_preload_has_many_with_association_condition_and_default_scope
post = Post.create!(:title => 'Beaches', :body => "I like beaches!")
Reader.create! :person => people(:david), :post => post
LazyReader.create! :person => people(:susan), :post => post
-
+
assert_equal 1, post.lazy_readers.to_a.size
assert_equal 2, post.lazy_readers_skimmers_or_not.to_a.size
-
+
post_with_readers = Post.includes(:lazy_readers_skimmers_or_not).find(post.id)
assert_equal 2, post_with_readers.lazy_readers_skimmers_or_not.to_a.size
end
View
4 activerecord/test/cases/primary_keys_test.rb
@@ -204,7 +204,7 @@ def test_set_primary_key_with_no_connection
if current_adapter?(:MysqlAdapter) or current_adapter?(:Mysql2Adapter)
class PrimaryKeyWithAnsiQuotesTest < ActiveRecord::TestCase
self.use_transactional_fixtures = false
-
+
def test_primaery_key_method_with_ansi_quotes
con = ActiveRecord::Base.connection
con.execute("SET SESSION sql_mode='ANSI_QUOTES'")
@@ -212,7 +212,7 @@ def test_primaery_key_method_with_ansi_quotes
ensure
con.reconnect!
end
-
+
end
end
View
6 activerecord/test/cases/tasks/database_tasks_test.rb
@@ -32,7 +32,7 @@ def structure_dump(filename); end
ActiveRecord::Tasks::DatabaseTasks.structure_dump({'adapter' => :foo}, "awesome-file.sql")
end
end
-
+
class DatabaseTasksCreateTest < ActiveRecord::TestCase
include DatabaseTasksSetupper
@@ -258,7 +258,7 @@ class DatabaseTasksPurgeTest < ActiveRecord::TestCase
class DatabaseTasksCharsetTest < ActiveRecord::TestCase
include DatabaseTasksSetupper
-
+
ADAPTERS_TASKS.each do |k, v|
define_method("test_#{k}_charset") do
eval("@#{v}").expects(:charset)
@@ -269,7 +269,7 @@ class DatabaseTasksCharsetTest < ActiveRecord::TestCase
class DatabaseTasksCollationTest < ActiveRecord::TestCase
include DatabaseTasksSetupper
-
+
ADAPTERS_TASKS.each do |k, v|
define_method("test_#{k}_collation") do
eval("@#{v}").expects(:collation)
View
6 activerecord/test/cases/validations/uniqueness_validation_test.rb
@@ -341,15 +341,15 @@ def test_validate_straight_inheritance_uniqueness
assert w6.errors[:city].any?, "Should have errors for city"
assert_equal ["has already been taken"], w6.errors[:city], "Should have uniqueness message for city"
end
-
+
def test_validate_uniqueness_with_conditions
Topic.validates_uniqueness_of(:title, :conditions => Topic.where('approved = ?', true))
Topic.create("title" => "I'm a topic", "approved" => true)
Topic.create("title" => "I'm an unapproved topic", "approved" => false)
-
+
t3 = Topic.new("title" => "I'm a topic", "approved" => true)
assert !t3.valid?, "t3 shouldn't be valid"
-
+
t4 = Topic.new("title" => "I'm an unapproved topic", "approved" => false)
assert t4.valid?, "t4 should be valid"
end
View
2  activerecord/test/models/eye.rb
@@ -15,7 +15,7 @@ class Eye < ActiveRecord::Base
after_create :trace_after_create2
after_update :trace_after_update2
after_save :trace_after_save2
-
+
def trace_after_create
(@after_create_callbacks_stack ||= []) << !iris.persisted?
end
View
2  activesupport/lib/active_support/gzip.rb
@@ -9,7 +9,7 @@ module ActiveSupport
# # => "\x1F\x8B\b\x00o\x8D\xCDO\x00\x03K\xCE\xCF-(J-.V\xC8MU\x04\x00R>n\x83\f\x00\x00\x00"
#
# ActiveSupport::Gzip.decompress(gzip)
- # # => "compress me!"
+ # # => "compress me!"
module Gzip
class Stream < StringIO
def initialize(*)
View
10 activesupport/test/callbacks_test.rb
@@ -297,7 +297,7 @@ def save
end
end
end
-
+
class AroundPersonResult < MySuper
attr_reader :result
@@ -308,7 +308,7 @@ class AroundPersonResult < MySuper
def tweedle_dum
@result = yield
end
-
+
def tweedle_1
:tweedle_1
end
@@ -316,7 +316,7 @@ def tweedle_1
def tweedle_2
:tweedle_2
end
-
+
def save
run_callbacks :save do
:running
@@ -410,7 +410,7 @@ def test_save_around
], around.history
end
end
-
+
class AroundCallbackResultTest < ActiveSupport::TestCase
def test_save_around
around = AroundPersonResult.new
@@ -709,5 +709,5 @@ def test_per_key_option_deprecaton
end
end
end
-
+
end
View
2  activesupport/test/core_ext/bigdecimal_test.rb
@@ -14,7 +14,7 @@ def test_to_d
bd = BigDecimal.new '10'
assert_equal bd, bd.to_d
end
-
+
def test_to_s
bd = BigDecimal.new '0.01'
assert_equal '0.01', bd.to_s
View
2  activesupport/test/core_ext/duration_test.rb
@@ -131,7 +131,7 @@ def test_adding_day_across_dst_boundary
assert_equal Time.local(2009,3,29,0,0,0) + 1.day, Time.local(2009,3,30,0,0,0)
end
end
-
+
def test_delegation_with_block_works
counter = 0
assert_nothing_raised do
View
8 activesupport/test/core_ext/module/remove_method_test.rb
@@ -6,19 +6,19 @@ class A
def do_something
return 1
end
-
+
end
end
class RemoveMethodTest < ActiveSupport::TestCase
-
+
def test_remove_method_from_an_object
RemoveMethodTests::A.class_eval{
self.remove_possible_method(:do_something)
}
assert !RemoveMethodTests::A.new.respond_to?(:do_something)
end
-
+
def test_redefine_method_in_an_object
RemoveMethodTests::A.class_eval{
self.redefine_method(:do_something) { return 100 }
@@ -26,4 +26,4 @@ def test_redefine_method_in_an_object
assert_equal 100, RemoveMethodTests::A.new.do_something
end
-end
+end
View
18 activesupport/test/core_ext/numeric_ext_test.rb
@@ -203,7 +203,7 @@ def gigabytes(number)
def terabytes(number)
gigabytes(number) * 1024
end
-
+
def test_to_s__phone
assert_equal("555-1234", 5551234.to_s(:phone))
assert_equal("800-555-1212", 8005551212.to_s(:phone))
@@ -217,7 +217,7 @@ def test_to_s__phone
assert_equal("22-555-1212", 225551212.to_s(:phone))
assert_equal("+45-22-555-1212", 225551212.to_s(:phone, :country_code => 45))
end
-
+
def test_to_s__currency
assert_equal("$1,234,567,890.50", 1234567890.50.to_s(:currency))
assert_equal("$1,234,567,890.51", 1234567890.506.to_s(:currency))
@@ -228,8 +228,7 @@ def test_to_s__currency
assert_equal("$1,234,567,890.5", 1234567890.50.to_s(:currency, :precision => 1))
assert_equal("&pound;1234567890,50", 1234567890.50.to_s(:currency, :unit => "&pound;", :separator => ",", :delimiter => ""))
end
-
-
+
def test_to_s__rounded
assert_equal("-111.235", -111.2346.to_s(:rounded))
assert_equal("111.235", 111.2346.to_s(:rounded))
@@ -246,7 +245,7 @@ def test_to_s__rounded
assert_equal("11.00", 10.995.to_s(:rounded, :precision => 2))
assert_equal("0.00", -0.001.to_s(:rounded, :precision => 2))
end
-
+
def test_to_s__percentage
assert_equal("100.000%", 100.to_s(:percentage))
assert_equal("100%", 100.to_s(:percentage, :precision => 0))
@@ -274,7 +273,6 @@ def test_to_s__delimited__with_options_hash
assert_equal '12.345.678,05', 12345678.05.to_s(:delimited, :separator => ',', :delimiter => '.')
assert_equal '12.345.678,05', 12345678.05.to_s(:delimited, :delimiter => '.', :separator => ',')
end
-
def test_to_s__rounded_with_custom_delimiter_and_separator
assert_equal '31,83', 31.825.to_s(:rounded, :precision => 2, :separator => ',')
@@ -350,7 +348,7 @@ def test_to_s__human_size_with_si_prefix
assert_equal '1.23 GB', 1234567890.to_s(:human_size, :prefix => :si)
assert_equal '1.23 TB', 1234567890123.to_s(:human_size, :prefix => :si)
end
-
+
def test_to_s__human_size_with_options_hash
assert_equal '1.2 MB', 1234567.to_s(:human_size, :precision => 2)
assert_equal '3 Bytes', 3.14159265.to_s(:human_size, :precision => 4)
@@ -366,13 +364,13 @@ def test_to_s__human_size_with_options_hash
assert_equal '1.012 KB', kilobytes(1.0123).to_s(:human_size, :precision => 3, :significant => false)
assert_equal '1 KB', kilobytes(1.0123).to_s(:human_size, :precision => 0, :significant => true) #ignores significant it precision is 0
end
-
+
def test_to_s__human_size_with_custom_delimiter_and_separator
assert_equal '1,01 KB', kilobytes(1.0123).to_s(:human_size, :precision => 3, :separator => ',')
assert_equal '1,01 KB', kilobytes(1.0100).to_s(:human_size, :precision => 4, :separator => ',')
assert_equal '1.000,1 TB', terabytes(1000.1).to_s(:human_size, :precision => 5, :delimiter => '.', :separator => ',')
end
-
+
def test_number_to_human
assert_equal '-123', -123.to_s(:human)
assert_equal '-0.5', -0.5.to_s(:human)
@@ -436,7 +434,7 @@ def test_number_to_human_with_custom_format
def test_to_s__injected_on_proper_types
assert_equal Fixnum, 1230.class
assert_equal '1.23 Thousand', 1230.to_s(:human)
-
+
assert_equal Float, Float(1230).class
assert_equal '1.23 Thousand', Float(1230).to_s(:human)
View
6 activesupport/test/core_ext/object/inclusion_test.rb
@@ -6,12 +6,12 @@ def test_in_multiple_args
assert :b.in?(:a,:b)
assert !:c.in?(:a,:b)
end
-
+
def test_in_multiple_arrays
assert [1,2].in?([1,2],[2,3])
assert ![1,2].in?([1,3],[2,1])
end
-
+
def test_in_array
assert 1.in?([1,2])
assert !3.in?([1,2])
@@ -53,7 +53,7 @@ def test_in_module
assert A.in?(C)
assert !A.in?(A)
end
-
+
def test_no_method_catching
assert_raise(ArgumentError) { 1.in?(1) }
end
View
2  activesupport/test/core_ext/object_and_class_ext_test.rb
@@ -162,7 +162,7 @@ def private_method
assert_raise(NoMethodError) { klass.new.try!(:private_method) }
end
-
+
def test_try_with_private_method
klass = Class.new do
private
View
4 activesupport/test/deprecation_test.rb
@@ -254,10 +254,10 @@ def test_deprecated_constant_with_deprecator_given
klass::OLD.to_s
end
end
-
+
def test_deprecated_instance_variable_with_instance_deprecator
deprecator = deprecator_with_messages
-
+
klass = Class.new() do
def initialize(deprecator)
@request = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(self, :request, :@request, deprecator)
View
2  activesupport/test/inflector_test.rb
@@ -361,7 +361,7 @@ def test_inflector_locality
inflect.singular(/s$/, '')
inflect.singular(/es$/, '')
-
+
inflect.irregular('el', 'los')
end
View
8 activesupport/test/message_verifier_test.rb
@@ -11,7 +11,7 @@
require 'active_support/json'
class MessageVerifierTest < ActiveSupport::TestCase
-
+
class JSONSerializer
def dump(value)
ActiveSupport::JSON.encode(value)
@@ -21,7 +21,7 @@ def load(value)
ActiveSupport::JSON.decode(value)
end
end
-
+
def setup
@verifier = ActiveSupport::MessageVerifier.new("Hey, I'm a secret!")
@data = { :some => "data", :now => Time.local(2010) }
@@ -43,13 +43,13 @@ def test_tampered_data_raises
assert_not_verified("#{data}--#{hash.reverse}")
assert_not_verified("purejunk")
end
-
+
def test_alternative_serialization_method
verifier = ActiveSupport::MessageVerifier.new("Hey, I'm a secret!", :serializer => JSONSerializer.new)
message = verifier.generate({ :foo => 123, 'bar' => Time.utc(2010) })
assert_equal verifier.verify(message), { "foo" => 123, "bar" => "2010-01-01T00:00:00Z" }
end
-
+
def assert_not_verified(message)
assert_raise(ActiveSupport::MessageVerifier::InvalidSignature) do
@verifier.verify(message)
View
2  railties/lib/rails/code_statistics.rb
@@ -38,7 +38,7 @@ def calculate_directory_statistics(directory, pattern = /.*\.(rb|js|coffee)$/)
next unless file_name =~ pattern
comment_started = false
-
+
case file_name
when /.*\.js$/
comment_pattern = /^\s*\/\//
View
8 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`
View
2  railties/lib/rails/source_annotation_extractor.rb
@@ -32,7 +32,7 @@ def to_s(options={})
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+.
View
2  railties/test/commands/console_test.rb
@@ -78,7 +78,7 @@ def test_default_environment_with_rails_env
assert_match(/\sspecial-production\s/, output)
end
end
-
+
def test_e_option
start ['-e', 'special-production']
assert_match(/\sspecial-production\s/, output)
View
4 railties/test/generators/generated_attribute_test.rb
@@ -117,13 +117,13 @@ def test_polymorphic_reference_is_true
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
View
2  railties/test/generators/migration_generator_test.rb
@@ -28,7 +28,7 @@ def test_migration_with_class_name
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
Please sign in to comment.
Something went wrong with that request. Please try again.