From f9cfb4ac3049e7895741a0185160b66664c104e1 Mon Sep 17 00:00:00 2001 From: Jordan Sissel Date: Thu, 3 Jan 2013 17:23:36 -0800 Subject: [PATCH] - clean up style guide a bit --- STYLE.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/STYLE.md b/STYLE.md index 010fb89dfe9..894a31e88f3 100644 --- a/STYLE.md +++ b/STYLE.md @@ -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]