Skip to content
This repository
Browse code

Changed a few instances of of words in the API docs written in Britis…

…h English to

American English(according to Weber)

Conflicts:

	actionpack/lib/action_controller/metal/request_forgery_protection.rb
	railties/lib/rails/engine.rb
  • Loading branch information...
commit 8b30f1d7ea4c3f3844b936a3e61c64bf83087643 1 parent 582a621
Ömür Özkir authored July 24, 2011 fxn committed July 24, 2011
19  actionpack/lib/action_controller/metal/request_forgery_protection.rb
@@ -7,17 +7,16 @@ class InvalidAuthenticityToken < ActionControllerError #:nodoc:
7 7
   # Controller actions are protected from Cross-Site Request Forgery (CSRF) attacks
8 8
   # by including a token in the rendered html for your application. This token is
9 9
   # stored as a random string in the session, to which an attacker does not have
10  
-  # access. When a request reaches your application, \Rails then verifies the received
11  
-  # token with the token in the session. Only HTML and javascript requests are checked,
  10
+  # access. When a request reaches your application, \Rails verifies the received
  11
+  # token with the token in the session. Only HTML and JavaScript requests are checked,
12 12
   # so this will not protect your XML API (presumably you'll have a different
13 13
   # authentication scheme there anyway). Also, GET requests are not protected as these
14 14
   # should be idempotent.
15 15
   #
16 16
   # CSRF protection is turned on with the <tt>protect_from_forgery</tt> method,
17  
-  # which will check the token and raise an ActionController::InvalidAuthenticityToken
18  
-  # if it doesn't match what was expected. A call to this method is generated for new
19  
-  # \Rails applications by default. You can customize the error message by editing
20  
-  # public/422.html.
  17
+  # which checks the token and resets the session if it doesn't match what was expected.
  18
+  # A call to this method is generated for new \Rails applications by default.
  19
+  # You can customize the error message by editing public/422.html.
21 20
   #
22 21
   # The token parameter is named <tt>authenticity_token</tt> by default. The name and
23 22
   # value of this token must be added to every layout that renders forms by including
@@ -63,7 +62,7 @@ module ClassMethods
63 62
       #
64 63
       # Valid Options:
65 64
       #
66  
-      # * <tt>:only/:except</tt> - Passed to the <tt>before_filter</tt> call.  Set which actions are verified.
  65
+      # * <tt>:only/:except</tt> - Passed to the <tt>before_filter</tt> call. Set which actions are verified.
67 66
       def protect_from_forgery(options = {})
68 67
         self.request_forgery_protection_token ||= :authenticity_token
69 68
         prepend_before_filter :verify_authenticity_token, options
@@ -71,7 +70,7 @@ def protect_from_forgery(options = {})
71 70
     end
72 71
 
73 72
     protected
74  
-      # The actual before_filter that is used.  Modify this to change how you handle unverified requests.
  73
+      # The actual before_filter that is used. Modify this to change how you handle unverified requests.
75 74
       def verify_authenticity_token
76 75
         unless verified_request?
77 76
           logger.debug "WARNING: Can't verify CSRF token authenticity" if logger
@@ -79,11 +78,13 @@ def verify_authenticity_token
79 78
         end
80 79
       end
81 80
 
  81
+      # This is the method that defines the application behavior when a request is found to be unverified.
  82
+      # By default, \Rails resets the session when it finds an unverified request.
82 83
       def handle_unverified_request
83 84
         reset_session
84 85
       end
85 86
 
86  
-      # Returns true or false if a request is verified.  Checks:
  87
+      # Returns true or false if a request is verified. Checks:
87 88
       #
88 89
       # * is it a GET request?  Gets should be safe and idempotent
89 90
       # * Does the form_authenticity_token match the given token value from the params?
2  actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -154,7 +154,7 @@ module Helpers #:nodoc:
154 154
     #     "/release-#{RELEASE_NUMBER}#{asset_path}"
155 155
     #   }
156 156
     #
157  
-    # This example would cause the following behaviour on all servers no
  157
+    # This example would cause the following behavior on all servers no
158 158
     # matter when they were deployed:
159 159
     #
160 160
     #   image_tag("rails.png")
4  actionpack/lib/action_view/helpers/form_helper.rb
@@ -259,8 +259,8 @@ def convert_to_model(object)
259 259
       #    :remote => true
260 260
       #
261 261
       # in the options hash creates a form that will allow the unobtrusive JavaScript drivers to modify its
262  
-      # behaviour. The expected default behaviour is an XMLHttpRequest in the background instead of the regular
263  
-      # POST arrangement, but ultimately the behaviour is the choice of the JavaScript driver implementor.
  262
+      # behavior. The expected default behaviour is an XMLHttpRequest in the background instead of the regular
  263
+      # POST arrangement, but ultimately the behavior is the choice of the JavaScript driver implementor.
264 264
       # Even though it's using JavaScript to serialize the form elements, the form submission will work just like
265 265
       # a regular submission as viewed by the receiving side (all elements available in <tt>params</tt>).
266 266
       #
2  actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -30,7 +30,7 @@ module FormTagHelper
30 30
       #   (by passing <tt>false</tt>).
31 31
       # * A list of parameters to feed to the URL the form will be posted to.
32 32
       # * <tt>:remote</tt> - If set to true, will allow the Unobtrusive JavaScript drivers to control the
33  
-      #   submit behaviour. By default this behaviour is an ajax submit.
  33
+      #   submit behavior. By default this behaviour is an ajax submit.
34 34
       #
35 35
       # ==== Examples
36 36
       #   form_tag('/posts')
8  actionpack/lib/action_view/helpers/url_helper.rb
@@ -55,8 +55,8 @@ def url_options
55 55
       #
56 56
       # ==== Relying on named routes
57 57
       #
58  
-      # Passing a record (like an Active Record or Active Resource) instead of a Hash as the options parameter will 
59  
-      # trigger the named route for that record. The lookup will happen on the name of the class. So passing a 
  58
+      # Passing a record (like an Active Record or Active Resource) instead of a Hash as the options parameter will
  59
+      # trigger the named route for that record. The lookup will happen on the name of the class. So passing a
60 60
       # Workshop object will attempt to use the +workshop_path+ route. If you have a nested route, such as
61 61
       # +admin_workshop_path+ you'll have to call that explicitly (it's impossible for +url_for+ to guess that route).
62 62
       #
@@ -113,7 +113,7 @@ def url_for(options = {})
113 113
       end
114 114
 
115 115
       # Creates a link tag of the given +name+ using a URL created by the set of +options+.
116  
-      # See the valid options in the documentation for +url_for+. It's also possible to 
  116
+      # See the valid options in the documentation for +url_for+. It's also possible to
117 117
       # pass a String instead of an options hash, which generates a link tag that uses the
118 118
       # value of the String as the href for the link. Using a <tt>:back</tt> Symbol instead
119 119
       # of an options hash will generate a link to the referrer (a JavaScript back link
@@ -278,7 +278,7 @@ def link_to(*args, &block)
278 278
       #   prompt with the question specified. If the user accepts, the link is
279 279
       #   processed normally, otherwise no action is taken.
280 280
       # * <tt>:remote</tt> -  If set to true, will allow the Unobtrusive JavaScript drivers to control the
281  
-      #   submit behaviour. By default this behaviour is an ajax submit.
  281
+      #   submit behavior. By default this behaviour is an ajax submit.
282 282
       # * <tt>:form_class</tt> - This controls the class of the form within which the submit button will
283 283
       #   be placed
284 284
       #
2  actionpack/test/template/asset_tag_helper_test.rb
@@ -443,7 +443,7 @@ def test_favicon_link_tag
443 443
 
444 444
   def test_image_tag_windows_behaviour
445 445
     old_asset_id, ENV["RAILS_ASSET_ID"] = ENV["RAILS_ASSET_ID"], "1"
446  
-    # This simulates the behaviour of File#exist? on windows when testing a file ending in "."
  446
+    # This simulates the behavior of File#exist? on windows when testing a file ending in "."
447 447
     # If the file "rails.png" exists, windows will return true when asked if "rails.png." exists (notice trailing ".")
448 448
     # OS X, linux etc will return false in this case.
449 449
     File.stubs(:exist?).with('template/../fixtures/public/images/rails.png.').returns(true)
2  activerecord/lib/active_record/associations/collection_association.rb
@@ -378,7 +378,7 @@ def merge_target_lists(persisted, memory)
378 378
 
379 379
           persisted.map! do |record|
380 380
             # Unfortunately we cannot simply do memory.delete(record) since on 1.8 this returns
381  
-            # record rather than memory.at(memory.index(record)). The behaviour is fixed in 1.9.
  381
+            # record rather than memory.at(memory.index(record)). The behavior is fixed in 1.9.
382 382
             mem_index = memory.index(record)
383 383
 
384 384
             if mem_index
4  activerecord/test/cases/identity_map_test.rb
@@ -164,7 +164,7 @@ def test_inherited_with_type_attribute
164 164
   end
165 165
 
166 166
   ##############################################################################
167  
-  # Tests checking dirty attribute behaviour with IM                           #
  167
+  # Tests checking dirty attribute behavior with IM                            #
168 168
   ##############################################################################
169 169
 
170 170
   def test_loading_new_instance_should_not_update_dirty_attributes
@@ -238,7 +238,7 @@ def test_im_with_polymorphic_has_many_going_through_join_model_with_custom_selec
238 238
   end
239 239
 
240 240
   ##############################################################################
241  
-  # Tests checking Identity Map behaviour with preloaded associations, joins,  #
  241
+  # Tests checking Identity Map behavior with preloaded associations, joins,   #
242 242
   # includes etc.                                                              #
243 243
   ##############################################################################
244 244
 
4  activerecord/test/cases/invalid_date_test.rb
@@ -24,9 +24,9 @@ def test_assign_valid_dates
24 24
         topic = Topic.new({"last_read(1i)" => date_src[0].to_s, "last_read(2i)" => date_src[1].to_s, "last_read(3i)" => date_src[2].to_s})
25 25
         # Oracle DATE columns are datetime columns and Oracle adapter returns Time value
26 26
         if current_adapter?(:OracleAdapter)
27  
-          assert_equal(topic.last_read.to_date, Time.local(*date_src).to_date, "The date should be modified according to the behaviour of the Time object")
  27
+          assert_equal(topic.last_read.to_date, Time.local(*date_src).to_date, "The date should be modified according to the behavior of the Time object")
28 28
         else
29  
-          assert_equal(topic.last_read, Time.local(*date_src).to_date, "The date should be modified according to the behaviour of the Time object")
  29
+          assert_equal(topic.last_read, Time.local(*date_src).to_date, "The date should be modified according to the behavior of the Time object")
30 30
         end
31 31
       end
32 32
     end
2  activeresource/lib/active_resource/base.rb
@@ -395,7 +395,7 @@ def site
395 395
         #   Subclass.site.user = 'david'
396 396
         #   Parent.site # => 'http://david@test.com'
397 397
         #
398  
-        # Without superclass_delegating_reader (expected behaviour)
  398
+        # Without superclass_delegating_reader (expected behavior)
399 399
         #
400 400
         #   Parent.site = 'http://anonymous@test.com'
401 401
         #   Subclass.site # => 'http://anonymous@test.com'
2  activeresource/lib/active_resource/http_mock.rb
@@ -149,7 +149,7 @@ def responses
149 149
       # Note, by default, every time you call +respond_to+, any previous request and response pairs stored
150 150
       # in HttpMock will be deleted giving you a clean slate to work on.
151 151
       #
152  
-      # If you want to override this behaviour, pass in +false+ as the last argument to +respond_to+
  152
+      # If you want to override this behavior, pass in +false+ as the last argument to +respond_to+
153 153
       #
154 154
       # === Example
155 155
       #
2  activesupport/lib/active_support/core_ext/string/multibyte.rb
@@ -35,7 +35,7 @@ class String
35 35
     # object. Interoperability problems can be resolved easily with a +to_s+ call.
36 36
     #
37 37
     # For more information about the methods defined on the Chars proxy see ActiveSupport::Multibyte::Chars. For
38  
-    # information about how to change the default Multibyte behaviour see ActiveSupport::Multibyte.
  38
+    # information about how to change the default Multibyte behavior see ActiveSupport::Multibyte.
39 39
     def mb_chars
40 40
       if ActiveSupport::Multibyte.proxy_class.consumes?(self)
41 41
         ActiveSupport::Multibyte.proxy_class.new(self)
4  activesupport/lib/active_support/deprecation/behaviors.rb
@@ -7,12 +7,12 @@ class << self
7 7
       # Whether to print a backtrace along with the warning.
8 8
       attr_accessor :debug
9 9
 
10  
-      # Returns the set behaviour or if one isn't set, defaults to +:stderr+
  10
+      # Returns the set behavior or if one isn't set, defaults to +:stderr+
11 11
       def behavior
12 12
         @behavior ||= [DEFAULT_BEHAVIORS[:stderr]]
13 13
       end
14 14
 
15  
-      # Sets the behaviour to the specified value. Can be a single value or an array.
  15
+      # Sets the behavior to the specified value. Can be a single value or an array.
16 16
       #
17 17
       # Examples
18 18
       #
2  railties/lib/rails.rb
@@ -15,7 +15,7 @@
15 15
 
16 16
 # For Ruby 1.8, this initialization sets $KCODE to 'u' to enable the
17 17
 # multibyte safe operations. Plugin authors supporting other encodings
18  
-# should override this behaviour and set the relevant +default_charset+
  18
+# should override this behavior and set the relevant +default_charset+
19 19
 # on ActionController::Base.
20 20
 #
21 21
 # For Ruby 1.9, UTF-8 is the default internal and external encoding.
13  railties/lib/rails/engine.rb
@@ -5,7 +5,7 @@
5 5
 require 'rails/engine/railties'
6 6
 
7 7
 module Rails
8  
-  # Rails::Engine allows you to wrap a specific Rails application or subset of
  8
+  # <tt>Rails::Engine</tt> allows you to wrap a specific Rails application or subset of
9 9
   # functionality and share it with other applications. Since Rails 3.0, every
10 10
   # <tt>Rails::Application</tt> is just an engine, which allows for simple
11 11
   # feature and application sharing.
@@ -176,13 +176,14 @@ module Rails
176 176
   # == Engine name
177 177
   #
178 178
   # There are some places where an Engine's name is used:
  179
+  #
179 180
   # * routes: when you mount an Engine with <tt>mount(MyEngine::Engine => '/my_engine')</tt>,
180 181
   #   it's used as default :as option
181 182
   # * some of the rake tasks are based on engine name, e.g. <tt>my_engine:install:migrations</tt>,
182 183
   #   <tt>my_engine:install:assets</tt>
183 184
   #
184 185
   # Engine name is set by default based on class name. For <tt>MyEngine::Engine</tt> it will be
185  
-  # <tt>my_engine_engine</tt>. You can change it manually it manually using the <tt>engine_name</tt> method:
  186
+  # <tt>my_engine_engine</tt>. You can change it manually using the <tt>engine_name</tt> method:
186 187
   #
187 188
   #   module MyEngine
188 189
   #     class Engine < Rails::Engine
@@ -219,7 +220,7 @@ module Rails
219 220
   # If an engine is marked as isolated, +FooController+ has access only to helpers from +Engine+ and
220 221
   # <tt>url_helpers</tt> from <tt>MyEngine::Engine.routes</tt>.
221 222
   #
222  
-  # The next thing that changes in isolated engines is the behaviour of routes. Normally, when you namespace
  223
+  # The next thing that changes in isolated engines is the behavior of routes. Normally, when you namespace
223 224
   # your controllers, you also need to do namespace all your routes. With an isolated engine,
224 225
   # the namespace is applied by default, so you can ignore it in routes:
225 226
   #
@@ -231,7 +232,7 @@ module Rails
231 232
   # need to use longer url helpers like <tt>my_engine_articles_path</tt>. Instead, you should simply use
232 233
   # <tt>articles_path</tt> as you would do with your application.
233 234
   #
234  
-  # To make that behaviour consistent with other parts of the framework, an isolated engine also has influence on
  235
+  # To make that behavior consistent with other parts of the framework, an isolated engine also has influence on
235 236
   # <tt>ActiveModel::Naming</tt>. When you use a namespaced model, like <tt>MyEngine::Article</tt>, it will normally
236 237
   # use the prefix "my_engine". In an isolated engine, the prefix will be omitted in url helpers and
237 238
   # form fields for convenience.
@@ -299,7 +300,7 @@ module Rails
299 300
   #   helper MyEngine::SharedEngineHelper
300 301
   # end
301 302
   #
302  
-  # If you want to include all of the engine's helpers, you can use #helpers method on egine's
  303
+  # If you want to include all of the engine's helpers, you can use #helpers method on an engine's
303 304
   # instance:
304 305
   #
305 306
   # class ApplicationController < ActionController::Base
@@ -308,7 +309,7 @@ module Rails
308 309
   #
309 310
   # It will include all of the helpers from engine's directory. Take into account that this does
310 311
   # not include helpers defined in controllers with helper_method or other similar solutions,
311  
-  # only helpers defined in helpers directory will be included.
  312
+  # only helpers defined in the helpers directory will be included.
312 313
   #
313 314
   # == Migrations & seed data
314 315
   #

0 notes on commit 8b30f1d

Please sign in to comment.
Something went wrong with that request. Please try again.