Skip to content

Commit 36bae5d

Browse files
author
Dan Croak
committed
Fix code blocks for Github
1 parent 7f8b997 commit 36bae5d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

README.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,7 @@ Ruby
168168
* Avoid monkey-patching core classes.
169169
* Avoid `return` unless required.
170170
* Avoid superfluous parentheses when calling methods, but keep them when you
171-
assign the return value.
172-
x = Math.sin(y)
173-
array.delete e
171+
assign the return value: `x = Math.sin(y); array.delete e`
174172
* Avoid ternary operators (`boolean ? true : false`). Use multi-line `if`
175173
instead to emphasize code branches.
176174
* Define the version of Ruby the project uses in the Gemfile.
@@ -181,8 +179,7 @@ Ruby
181179
with ActiveRecord and keep `select`/`reject` symmetry.
182180
* Prefer `map` over `collect` and `reduce` over `inject` due to symmetry and
183181
familarity with mapping and reducing in other technologies.
184-
* Use `_` for unused block parameters.
185-
hash.map { |_, v| v + 1 }
182+
* Use `_` for unused block parameters: `hash.map { |_, v| v + 1 }`
186183
* Use `%{}` for single-line strings needing interpolation and double-quotes.
187184
* Use `%w()` over `['', '']` for an array of words.
188185
* Use `&&` and `||` for boolean expressions.
@@ -231,8 +228,8 @@ Rails
231228
* Set `config.action_mailer.delivery_method = :test` in the test environment.
232229
* Use `_path` over `_url` for named routes everywhere except mailer views.
233230
* Use `def self.method` over the `named_scope :method` DSL.
234-
* Use [Foreman](https://github.com/ddollar/foreman) to run Rails apps in
235-
development mode.
231+
* Use [Foreman](https://github.com/ddollar/foreman) to run the development
232+
server.
236233
* Use `I18n.t 'dot.separated.key'` over
237234
`I18n.t :key, :scope => [:dot, :separated]`.
238235
* Use [Haml](http://haml-lang.com) for view templates.

0 commit comments

Comments
 (0)