Permalink
Browse files

Corrected some typos and American vs. Queen's English issues

  • Loading branch information...
1 parent 18b153d commit 4f234bfd799f471490775a2843b3cf7db2af21ed @leereilly leereilly committed May 29, 2011
@@ -60,11 +60,11 @@ def assert_redirected_to(options = {}, message=nil)
assert_response(:redirect, message)
return true if options == @response.location
- redirected_to_after_normalisation = normalize_argument_to_redirection(@response.location)
- options_after_normalisation = normalize_argument_to_redirection(options)
+ redirected_to_after_normalization = normalize_argument_to_redirection(@response.location)
+ options_after_normalization = normalize_argument_to_redirection(options)
- if redirected_to_after_normalisation != options_after_normalisation
- flunk "Expected response to be a redirect to <#{options_after_normalisation}> but was a redirect to <#{redirected_to_after_normalisation}>"
+ if redirected_to_after_normalization != options_after_normalization
+ flunk "Expected response to be a redirect to <#{options_after_normalization}> but was a redirect to <#{redirected_to_after_normalization}>"
end
end
@@ -40,7 +40,7 @@ module Submodule
class ContainedEmptyController < ActionController::Base ; end
class ContainedSubEmptyController < ContainedEmptyController ; end
class ContainedNonDefaultPathController < ActionController::Base
- def self.controller_path; "i_am_extremly_not_default"; end
+ def self.controller_path; "i_am_extremely_not_default"; end
end
end
@@ -89,7 +89,7 @@ class BaseTest < Rack::TestCase
end
test "namespaced non-default controller path" do
- assert_equal 'i_am_extremly_not_default', Submodule::ContainedNonDefaultPathController.controller_path
+ assert_equal 'i_am_extremely_not_default', Submodule::ContainedNonDefaultPathController.controller_path
assert_equal Submodule::ContainedNonDefaultPathController.controller_path, Submodule::ContainedNonDefaultPathController.new.controller_path
end
@@ -860,7 +860,7 @@ def association_instance_set(name, association)
# the inverse of each other and the inverse of the +dungeon+ association on +EvilWizard+
# is the +evil_wizard+ association on +Dungeon+ (and vice-versa). By default,
# Active Record doesn't know anything about these inverse relationships and so no object
- # loading optimisation is possible. For example:
+ # loading optimization is possible. For example:
#
# d = Dungeon.first
# t = d.traps.first
@@ -17,7 +17,7 @@ module ClassMethods
# posts.each {|p| puts p.name } # Fires "select * from posts" and loads post objects
#
# fruits = Fruit.scoped
- # fruits = fruits.where(:colour => 'red') if options[:red_only]
+ # fruits = fruits.where(:color => 'red') if options[:red_only]
# fruits = fruits.limit(10) if limited?
#
# Anonymous \scopes tend to be useful when procedurally generating complex
@@ -106,7 +106,7 @@ def table(table, stream)
spec = {}
spec[:name] = column.name.inspect
- # AR has an optimisation which handles zero-scale decimals as integers. This
+ # AR has an optimization which handles zero-scale decimals as integers. This
# code ensures that the dumper still dumps the column as a decimal.
spec[:type] = if column.type == :integer && [/^numeric/, /^decimal/].any? { |e| e.match(column.sql_type) }
'decimal'
@@ -283,7 +283,7 @@ class << self
# attribute 'name', :string
#
# # or use the convenience methods and pass >=1 attribute names
- # string 'eye_colour', 'hair_colour'
+ # string 'eye_color', 'hair_color'
# integer 'age'
# float 'height', 'weight'
#

6 comments on commit 4f234bf

@evanfarrar
Contributor

Whoa whoa whoa. Are we going American english? This codebase is like 99% Queen's English, I've always let those slip because the codebase is remarkably consistent about it. Let's s/Behaviour/Behavior/ if that is the way we're going.

@tenderlove
Member

Ugh. @fxn can you weigh in? Maybe I made a mistake merging?

@evanfarrar
Contributor

Well, I take that back, we're somewhere in the middle between the two dialects. But yeah, the question stands for me, if American spellings are preferred, I have a torrent of patches to unleash on docrails.

@bcardarella
Contributor

Let the Rails commit gold rush begin..

@fxn
Member
fxn commented on 4f234bf May 31, 2011

@tenderlove it's OK :).

There have been a few commits like this, and I have thought about this for a while.

While I think having a mix of dialects is not good quality, when we wrote and applied the guidelines for guides and API (some three years ago) there was nothing about English in them because there was more urgent stuff to work on.

I do believe it is good to standarize (even standarise!). Pick a book, pick a novel, you won't get a good feeling if -our is used in the 1st chapter and -or in the 2nd chapter. Perhaps now conventions are mature enough that we can take a choice about this (to me) missing one. And for consistency code should also follow that convention.

I don't really mind which dialect is set, but since Lee has taken this initiative (with several commits before this one), and there are a ton of people in USA, and we can imagine we flipped a coin... American English is just a good choice in my opinion. It is just a matter of picking a choice and stick to that, let it be American.

I'll update the guidelines, and will point to http://en.wikipedia.org/wiki/American_and_British_English_spelling_differences.

@fxn
Member
fxn commented on 4f234bf May 31, 2011

Oh, let me add that as far as code is concerned this is good to follow for new code, local variables, etc., but of course existing APIs should be left untouched, let's work towards consistency, but let's also embrace imperfection :).

Please sign in to comment.