Skip to content

Commit 78b6fca

Browse files
ydakukabbatsov
authored andcommitted
Add cosmetic changes
1 parent 9b76e0a commit 78b6fca

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

README.adoc

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Use Unix-style line endings.footnote:[*BSD/Solaris/Linux/macOS users are covered
214214
====
215215
If you're using Git you might want to add the following configuration setting to protect your project from Windows line endings creeping in:
216216
217-
[source,bash]
217+
[source,shell]
218218
----
219219
$ git config --global core.autocrlf true
220220
----
@@ -328,7 +328,7 @@ foo&.bar
328328
Avoid chaining of `&.`. Replace with `.` and an explicit check.
329329
E.g. if users are guaranteed to have an address and addresses are guaranteed to have a zip code:
330330

331-
[source, ruby]
331+
[source,ruby]
332332
----
333333
# bad
334334
user&.address&.zip
@@ -338,7 +338,7 @@ user && user.address.zip
338338
----
339339

340340
If such a change introduces excessive conditional logic, consider other approaches, such as delegation:
341-
[source, ruby]
341+
[source,ruby]
342342
----
343343
# bad
344344
user && user.address && user.address.zip
@@ -3842,12 +3842,12 @@ This convention tends to reduce repetitive boilerplate in such classes.
38423842
[source,ruby]
38433843
----
38443844
class TestClass
3845-
# bad -- more work when class renamed/method moved
3845+
# bad - more work when class renamed/method moved
38463846
def self.call(param1, param2)
38473847
TestClass.new(param1).call(param2)
38483848
end
38493849
3850-
# bad -- more verbose than necessary
3850+
# bad - more verbose than necessary
38513851
def self.call(param1, param2)
38523852
self.new(param1).call(param2)
38533853
end
@@ -5505,9 +5505,10 @@ class Organization < ActiveRecord::Base
55055505
end
55065506
55075507
linux_organization = Organization.find(...)
5508-
# BAD - violates privacy
5508+
5509+
# bad - violates privacy
55095510
linux_organization.send(:reset_token)
5510-
# GOOD - should throw an exception
5511+
# good - should throw an exception
55115512
linux_organization.public_send(:reset_token)
55125513
----
55135514

@@ -5523,10 +5524,10 @@ u1 = UDPSocket.new
55235524
u1.bind('127.0.0.1', 4913)
55245525
u2 = UDPSocket.new
55255526
u2.connect('127.0.0.1', 4913)
5526-
# Won't send a message to the receiver obj.
5527-
# Instead it will send a message via UDP socket.
5527+
5528+
# bad - Won't send a message to the receiver object. Instead it will send a message via UDP socket.
55285529
u2.send :sleep, 0
5529-
# Will actually send a message to the receiver obj.
5530+
# good - Will actually send a message to the receiver object.
55305531
u2.__send__ ...
55315532
----
55325533

0 commit comments

Comments
 (0)