From 66013dc6d071f432fc6a1902f8e0d16abb08aa5a Mon Sep 17 00:00:00 2001 From: drbrain Date: Thu, 17 Jan 2013 01:21:28 +0000 Subject: [PATCH] * doc/syntax/miscellaneous.rdoc: Added Ending an Expression and indentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ doc/syntax/miscellaneous.rdoc | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index c54b201a17..248540a1dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jan 17 10:21:05 2013 Eric Hodel + + * doc/syntax/miscellaneous.rdoc: Added Ending an Expression and + indentation. + Thu Jan 17 09:30:21 2013 Eric Hodel * lib/rubygems/installer.rb: Untaint string when checking output diff --git a/doc/syntax/miscellaneous.rdoc b/doc/syntax/miscellaneous.rdoc index 409afc797b..cb5865ff01 100644 --- a/doc/syntax/miscellaneous.rdoc +++ b/doc/syntax/miscellaneous.rdoc @@ -1,5 +1,21 @@ = Miscellaneous Syntax +== Ending an Expression + +Ruby uses a newline as the end of an expression. When ending a line with an +operator, open parentheses, comma, etc. the expression will continue. + +You can end an expression with a ; (semicolon). Semicolons are +most frequently used with ruby -e. + +== Indentation + +Ruby does not require any indentation. Typically ruby programs are indented +two spaces. + +If you run ruby with warnings enabled and have an indentation mis-match you +will receive a warning. + == +alias+ The +alias+ keyword is most frequently used to alias methods. When aliasing a