Skip to content
This repository
Browse code

applied guidelines to "# =>"

  • Loading branch information...
commit 8a2b69b7273379f3c9f68ff7903b653801951ac3 1 parent 599c505
Paco Guzmán authored August 12, 2010
4  actionmailer/README.rdoc
Source Rendered
@@ -65,8 +65,8 @@ simply call the method and optionally call +deliver+ on the return value.
65 65
 
66 66
 Calling the method returns a Mail Message object:
67 67
 
68  
-  message = Notifier.welcome  #=> Returns a Mail::Message object
69  
-  message.deliver             #=> delivers the email
  68
+  message = Notifier.welcome  # => Returns a Mail::Message object
  69
+  message.deliver             # => delivers the email
70 70
 
71 71
 Or you can just chain the methods together like:
72 72
 
14  activemodel/README.rdoc
Source Rendered
@@ -107,8 +107,8 @@ modules:
107 107
       extend ActiveModel::Naming
108 108
     end
109 109
     
110  
-    NamedPerson.model_name        #=> "NamedPerson"
111  
-    NamedPerson.model_name.human  #=> "Named person"
  110
+    NamedPerson.model_name        # => "NamedPerson"
  111
+    NamedPerson.model_name.human  # => "Named person"
112 112
 
113 113
   {Learn more}[link:classes/ActiveModel/Naming.html]
114 114
 
@@ -139,7 +139,7 @@ modules:
139 139
     end
140 140
     
141 141
     Person.human_attribute_name('my_attribute')
142  
-    #=> "My attribute"
  142
+    # => "My attribute"
143 143
   
144 144
   {Learn more}[link:classes/ActiveModel/Translation.html]
145 145
 
@@ -157,7 +157,7 @@ modules:
157 157
 
158 158
    person = Person.new
159 159
    person.first_name = 'zoolander'
160  
-   person.valid?  #=> false
  160
+   person.valid?  # => false
161 161
 
162 162
   {Learn more}[link:classes/ActiveModel/Validations.html]
163 163
   
@@ -176,9 +176,9 @@ modules:
176 176
    end
177 177
    
178 178
    p = ValidatorPerson.new
179  
-   p.valid?                  #=>  false
180  
-   p.errors.full_messages    #=> ["Name must exist"]
  179
+   p.valid?                  # =>  false
  180
+   p.errors.full_messages    # => ["Name must exist"]
181 181
    p.name = "Bob"
182  
-   p.valid?                  #=>  true
  182
+   p.valid?                  # =>  true
183 183
 
184 184
   {Learn more}[link:classes/ActiveModel/Validator.html]
2  activerecord/CHANGELOG
@@ -966,7 +966,7 @@ during calendar reform.  #7649, #7724 [fedot, Geoff Buesing]
966 966
 * Made increment_counter/decrement_counter play nicely with optimistic locking, and added a more general update_counters method [Jamis Buck]
967 967
 
968 968
 * Reworked David's query cache to be available as Model.cache {...}. For the duration of the block no select query should be run more then once. Any inserts/deletes/executes will flush the whole cache however [Tobias Lütke]
969  
-  Task.cache { Task.find(1); Task.find(1) } #=> 1 query
  969
+  Task.cache { Task.find(1); Task.find(1) } # => 1 query
970 970
 
971 971
 * When dealing with SQLite3, use the table_info pragma helper, so that the bindings can do some translation for when sqlite3 breaks incompatibly between point releases. [Jamis Buck]
972 972
 
10  activerecord/lib/active_record/autosave_association.rb
@@ -72,20 +72,20 @@ module ActiveRecord
72 72
   #
73 73
   #   post = Post.new(:title => 'ruby rocks')
74 74
   #   post.comments.build(:body => 'hello world')
75  
-  #   post.save #=> will save both post and comment
  75
+  #   post.save # => will save both post and comment
76 76
   #
77 77
   #   post = Post.create(:title => 'ruby rocks')
78 78
   #   post.comments.build(:body => 'hello world')
79  
-  #   post.save #=> will save both post and comment
  79
+  #   post.save # => will save both post and comment
80 80
   #
81 81
   #   post = Post.create(:title => 'ruby rocks')
82 82
   #   post.comments.create(:body => 'hello world')
83  
-  #   post.save #=> will save both post and comment
  83
+  #   post.save # => will save both post and comment
84 84
   #
85 85
   #   post = Post.create(:title => 'ruby rocks')
86 86
   #   post.comments.build(:body => 'hello world')
87 87
   #   post.comments[0].body = 'hi everyone'
88  
-  #   post.save #=> will save both post and comment and comment will have 'hi everyone'
  88
+  #   post.save # => will save both post and comment and comment will have 'hi everyone'
89 89
   #  
90 90
   #  In the above cases even without <tt>autosave</tt> option children got updated. 
91 91
   #
@@ -99,7 +99,7 @@ module ActiveRecord
99 99
   #   post = Post.create(:title => 'ruby rocks')
100 100
   #   post.comments.create(:body => 'hello world')
101 101
   #   post.comments[0].body = 'hi everyone'
102  
-  #   post.save #=> will save both post and comment and comment will have 'hi everyone'
  102
+  #   post.save # => will save both post and comment and comment will have 'hi everyone'
103 103
   #
104 104
   # Destroying one of the associated models members, as part of the parent's
105 105
   # save action, is as simple as marking it for destruction:
2  activerecord/lib/active_record/reflection.rb
@@ -41,7 +41,7 @@ def reflect_on_all_aggregations
41 41
 
42 42
       # Returns the AggregateReflection object for the named +aggregation+ (use the symbol). 
43 43
       #
44  
-      #   Account.reflect_on_aggregation(:balance) #=> the balance AggregateReflection
  44
+      #   Account.reflect_on_aggregation(:balance) # => the balance AggregateReflection
45 45
       #
46 46
       def reflect_on_aggregation(aggregation)
47 47
         reflections[aggregation].is_a?(AggregateReflection) ? reflections[aggregation] : nil
34  activeresource/README.rdoc
Source Rendered
@@ -34,7 +34,7 @@ lifecycle methods that operate against a persistent store.
34 34
 
35 35
    # Find a person with id = 1
36 36
    ryan = Person.find(1)
37  
-   Person.exists?(1)  #=> true
  37
+   Person.exists?(1)  # => true
38 38
 
39 39
 As you can see, the methods are quite similar to Active Record's methods for dealing with database
40 40
 records.  But rather than dealing directly with a database record, you're dealing with HTTP resources (which may or may not be database records).
@@ -69,8 +69,8 @@ for a request for a single element, the XML of that item is expected in response
69 69
 The XML document that is received is used to build a new object of type Person, with each
70 70
 XML element becoming an attribute on the object.
71 71
 
72  
-   ryan.is_a? Person  #=> true
73  
-   ryan.attribute1  #=> 'value1'
  72
+   ryan.is_a? Person  # => true
  73
+   ryan.attribute1  # => 'value1'
74 74
 
75 75
 Any complex element (one that contains other elements) becomes its own object:
76 76
 
@@ -81,8 +81,8 @@ Any complex element (one that contains other elements) becomes its own object:
81 81
    # for GET http://api.people.com:3000/people/1.xml
82 82
    #
83 83
    ryan = Person.find(1)
84  
-   ryan.complex  #=> <Person::Complex::xxxxx>
85  
-   ryan.complex.attribute2  #=> 'value2'
  84
+   ryan.complex  # => <Person::Complex::xxxxx>
  85
+   ryan.complex.attribute2  # => 'value2'
86 86
 
87 87
 Collections can also be requested in a similar fashion
88 88
 
@@ -96,8 +96,8 @@ Collections can also be requested in a similar fashion
96 96
    # for GET http://api.people.com:3000/people.xml
97 97
    #
98 98
    people = Person.find(:all)
99  
-   people.first  #=> <Person::xxx 'first' => 'Ryan' ...>
100  
-   people.last  #=> <Person::xxx 'first' => 'Jim' ...>
  99
+   people.first  # => <Person::xxx 'first' => 'Ryan' ...>
  100
+   people.last  # => <Person::xxx 'first' => 'Jim' ...>
101 101
 
102 102
 ==== Create
103 103
 
@@ -118,10 +118,10 @@ as the id of the ARes object.
118 118
   # Response (201): Location: http://api.people.com:3000/people/2
119 119
   #
120 120
   ryan = Person.new(:first => 'Ryan')
121  
-  ryan.new?  #=> true
122  
-  ryan.save  #=> true
123  
-  ryan.new?  #=> false
124  
-  ryan.id    #=> 2
  121
+  ryan.new?  # => true
  122
+  ryan.save  # => true
  123
+  ryan.new?  # => false
  124
+  ryan.id    # => 2
125 125
 
126 126
 ==== Update
127 127
 
@@ -139,9 +139,9 @@ server side was successful.
139 139
   # is expected with code (204)
140 140
   #
141 141
   ryan = Person.find(1)
142  
-  ryan.first #=> 'Ryan'
  142
+  ryan.first # => 'Ryan'
143 143
   ryan.first = 'Rizzle'
144  
-  ryan.save  #=> true
  144
+  ryan.save  # => true
145 145
 
146 146
 ==== Delete
147 147
 
@@ -155,10 +155,10 @@ Destruction of a resource can be invoked as a class and instance method of the r
155 155
   # is expected with response code (200)
156 156
   #
157 157
   ryan = Person.find(1)
158  
-  ryan.destroy  #=> true
159  
-  ryan.exists?  #=> false
160  
-  Person.delete(2)  #=> true
161  
-  Person.exists?(2) #=> false
  158
+  ryan.destroy  # => true
  159
+  ryan.exists?  # => false
  160
+  Person.delete(2)  # => true
  161
+  Person.exists?(2) # => false
162 162
 
163 163
 
164 164
 You can find more usage information in the ActiveResource::Base documentation.
6  activesupport/CHANGELOG
@@ -245,8 +245,8 @@ ActiveSupport.escape_html_entities_in_json from true to false to match previousl
245 245
 * Add Array#in_groups which splits or iterates over the array in specified number of groups. #579. [Adrian Mugnolo] Example:
246 246
   
247 247
   a = (1..10).to_a
248  
-  a.in_groups(3)        #=> [[1, 2, 3, 4], [5, 6, 7, nil], [8, 9, 10, nil]]
249  
-  a.in_groups(3, false) #=> [[1, 2, 3, 4], [5, 6, 7], [8, 9, 10]]
  248
+  a.in_groups(3)        # => [[1, 2, 3, 4], [5, 6, 7, nil], [8, 9, 10, nil]]
  249
+  a.in_groups(3, false) # => [[1, 2, 3, 4], [5, 6, 7], [8, 9, 10]]
250 250
 
251 251
 * Fix TimeWithZone unmarshaling: coerce unmarshaled Time instances to utc, because Ruby's marshaling of Time instances doesn't respect the zone [Geoff Buesing]
252 252
 
@@ -942,7 +942,7 @@ public for compatibility.  [Jeremy Kemper]
942 942
 * Enhance Symbol#to_proc so it works with list objects, such as multi-dimensional arrays. Closes #5295 [nov@yo.rim.or.jp].  Example:
943 943
 
944 944
     {1 => "one", 2 => "two", 3 => "three"}.sort_by(&:first).map(&:last)
945  
-    #=> ["one", "two", "three"]
  945
+    # => ["one", "two", "three"]
946 946
 
947 947
 * Added Hash.create_from_xml(string) which will create a hash from a XML string and even typecast if possible [David Heinemeier Hansson]. Example:
948 948
 
12  activesupport/lib/active_support/core_ext/class/attribute.rb
@@ -29,19 +29,19 @@ class Class
29 29
   # In such cases, you don't want to do changes in places but use setters:
30 30
   #
31 31
   #   Base.setting = []
32  
-  #   Base.setting                #=> []
33  
-  #   Subclass.setting            #=> []
  32
+  #   Base.setting                # => []
  33
+  #   Subclass.setting            # => []
34 34
   #
35 35
   #   # Appending in child changes both parent and child because it is the same object:
36 36
   #   Subclass.setting << :foo
37  
-  #   Base.setting               #=> [:foo]
38  
-  #   Subclass.setting           #=> [:foo]
  37
+  #   Base.setting               # => [:foo]
  38
+  #   Subclass.setting           # => [:foo]
39 39
   #
40 40
   #   # Use setters to not propagate changes:
41 41
   #   Base.setting = []
42 42
   #   Subclass.setting += [:foo]
43  
-  #   Base.setting               #=> []
44  
-  #   Subclass.setting           #=> [:foo]
  43
+  #   Base.setting               # => []
  44
+  #   Subclass.setting           # => [:foo]
45 45
   #
46 46
   # For convenience, a query method is defined as well:
47 47
   #
4  activesupport/lib/active_support/core_ext/class/attribute_accessors.rb
@@ -12,8 +12,8 @@
12 12
 #  end
13 13
 #
14 14
 #  Person.hair_colors = [:brown, :black, :blonde, :red]
15  
-#  Person.hair_colors     #=> [:brown, :black, :blonde, :red]
16  
-#  Person.new.hair_colors #=> [:brown, :black, :blonde, :red]
  15
+#  Person.hair_colors     # => [:brown, :black, :blonde, :red]
  16
+#  Person.new.hair_colors # => [:brown, :black, :blonde, :red]
17 17
 #
18 18
 # To opt out of the instance writer method, pass :instance_writer => false.
19 19
 # To opt out of the instance reader method, pass :instance_reader => false.
4  activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb
@@ -22,8 +22,8 @@ module ClassInheritableAttributes # :nodoc:
22 22
 #  end
23 23
 #
24 24
 #  Person.hair_colors = [:brown, :black, :blonde, :red]
25  
-#  Person.hair_colors     #=> [:brown, :black, :blonde, :red]
26  
-#  Person.new.hair_colors #=> [:brown, :black, :blonde, :red]
  25
+#  Person.hair_colors     # => [:brown, :black, :blonde, :red]
  26
+#  Person.new.hair_colors # => [:brown, :black, :blonde, :red]
27 27
 #
28 28
 # To opt out of the instance writer method, pass :instance_writer => false.
29 29
 # To opt out of the instance reader method, pass :instance_reader => false.
10  railties/guides/source/security.textile
Source Rendered
@@ -371,7 +371,7 @@ The mass-assignment feature may become a problem, as it allows an attacker to se
371 371
 
372 372
 <ruby>
373 373
 def signup
374  
-  params[:user] #=> {:name => “ow3ned”, :admin => true}
  374
+  params[:user] # => {:name => “ow3ned”, :admin => true}
375 375
   @user = User.new(params[:user])
376 376
 end
377 377
 </ruby>
@@ -385,7 +385,7 @@ Mass-assignment saves you much work, because you don't have to set each value in
385 385
 This will set the following parameters in the controller:
386 386
 
387 387
 <ruby>
388  
-params[:user] #=> {:name => “ow3ned”, :admin => true}
  388
+params[:user] # => {:name => “ow3ned”, :admin => true}
389 389
 </ruby>
390 390
 
391 391
 So if you create a new user using mass-assignment, it may be too easy to become an administrator.
@@ -423,11 +423,11 @@ attr_accessible :name
423 423
 If you want to set a protected attribute, you will to have to assign it individually:
424 424
 
425 425
 <ruby>
426  
-params[:user] #=> {:name => "ow3ned", :admin => true}
  426
+params[:user] # => {:name => "ow3ned", :admin => true}
427 427
 @user = User.new(params[:user])
428  
-@user.admin #=> false # not mass-assigned
  428
+@user.admin # => false # not mass-assigned
429 429
 @user.admin = true
430  
-@user.admin #=> true
  430
+@user.admin # => true
431 431
 </ruby>
432 432
 
433 433
 A more paranoid technique to protect your whole project would be to enforce that all models whitelist their accessible attributes.  This can be easily achieved with a very simple initializer:

0 notes on commit 8a2b69b

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