Skip to content

Commit

Permalink
- clean up style guide a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansissel committed Jan 4, 2013
1 parent c7d5559 commit f9cfb4a
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,25 @@ Short example:

## Specific cases

### Hash synatx
### Hash Syntax

Use of the "hash colon" syntax (ruby 1.9) is not accepted: { foo: "bar" }
Use of the "hash colon" syntax (ruby 1.9) is not accepted.

# This is NOT good.
{ foo: "bar" }

# This is good.
{ :foo => "bar" }

### String#[]

String#[] with one numeric argument must not be used due to bugs between ruby
versions.
String#[] with one numeric argument must not be used due to bugs and
inconsistencies between ruby versions.

str = "foo"

# This is NOT good
str[0]

* Do not use this: "foo"[0]
* Use this: "foo"[0,1]
# This is good.
str[0, 1]

0 comments on commit f9cfb4a

Please sign in to comment.