From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bozhidar Batsov Newsgroups: gmane.emacs.devel Subject: [ruby-mode] Private/protected method definition layout in Ruby 2.1 Date: Wed, 15 Jan 2014 16:41:33 +0200 Message-ID: <0E94BE5F9874463D9B4C2A039A3C24E9@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="52d69e1d_17ec0c4_1c26" X-Trace: ger.gmane.org 1389796908 22895 80.91.229.3 (15 Jan 2014 14:41:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Jan 2014 14:41:48 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 15 15:41:56 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W3RfG-0000xl-6k for ged-emacs-devel@m.gmane.org; Wed, 15 Jan 2014 15:41:54 +0100 Original-Received: from localhost ([::1]:55273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3RfF-0005zY-Sz for ged-emacs-devel@m.gmane.org; Wed, 15 Jan 2014 09:41:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3Rf8-0005v1-Os for emacs-devel@gnu.org; Wed, 15 Jan 2014 09:41:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3Rf4-0000wH-9X for emacs-devel@gnu.org; Wed, 15 Jan 2014 09:41:46 -0500 Original-Received: from mail-ee0-x22f.google.com ([2a00:1450:4013:c00::22f]:53293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3Rf4-0000vw-1A for emacs-devel@gnu.org; Wed, 15 Jan 2014 09:41:42 -0500 Original-Received: by mail-ee0-f47.google.com with SMTP id d49so160545eek.20 for ; Wed, 15 Jan 2014 06:41:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:message-id:subject:mime-version:content-type; bh=R0ViRLo6G1TUDYol+iZCS059KILAe6tkde4dvt520ls=; b=05afQ18/fbeWnPgjymx7FnkS4/IFM63EHZcOkAYhoozrlJt5fZUPwTxT0FpzcsGNHZ ekLGCv0/CS5Y1mzfo+YuYovYPccqstghQlem0A2svzbTLN489OwwjoxLnO9JpPfaOPWO VfqLg0Z2oy0/h6XLoEA2DDdpK1TEFzD3KTFUiPas8xouR6tWJdMgOGrCnO7H1SqFzhyE s637PfwU0N5vvum9GoRqEy3uF0ipanjR866g1rpSx2oJ+8GKmddiZDcQt4yGb4LBwa2l P/doZ40VD97bVFdNPWbi+6NKGlbXpC0TzS/DlInj2R+3yqsn2TjJQQril5pQYzMlwFwe XhGw== X-Received: by 10.14.0.201 with SMTP id 49mr4305745eeb.38.1389796898150; Wed, 15 Jan 2014 06:41:38 -0800 (PST) Original-Received: from [192.168.1.28] ([95.87.231.111]) by mx.google.com with ESMTPSA id w4sm10764580eef.20.2014.01.15.06.41.36 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 15 Jan 2014 06:41:37 -0800 (PST) X-Mailer: sparrow 1.6.4 (build 1178) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:168457 Archived-At: --52d69e1d_17ec0c4_1c26 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Ruby 2.1 has made it possible to define private/protected/public methods = on a per method basis (because a =60def=60 now returns a symbol instead o= f nil). It means that now it=E2=80=99s possible to write code like this: private def map(attribute, to:) =40rules=5Battribute=5D =3D to end We currently don=E2=80=99t support such an indentation scheme, as =60def=60= is always aligned with =60end=60: private def map(attribute, to:) =40rules=5Battribute=5D =3D to end I=E2=80=99m not saying the first alignment is preferable, but it light of= recent changes we did to accommodate similar alignment for =60if/unless=60= it seems like a good idea to add a defcustom supporting the first style = as well. vim already added support for it (https://github.com/vim-ruby/vim-ruby/is= sues/190). More on the topic can be read here http://www.sitepoint.com/look-ruby-2-1= /. -- =20 Cheers, Bozhidar --52d69e1d_17ec0c4_1c26 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Ruby 2.1 has made it = possible to define private/protected/public methods on a per method basis= (because a =60def=60 now returns a symbol instead of nil). It means that= now it=E2=80=99s possible to write code like this:

private def map(at= tribute, to:)
  =40rules=5Battribute=5D =3D to
e= nd

We curr= ently don=E2=80=99t support such an indentation scheme, as =60def=60 is a= lways aligned with =60end=60:

private def map(attribute, to:)
              =40rules=5Battribute=5D= =3D to
            end

I=E2=80=99m not= saying the first alignment is preferable, but it light of recent changes= we did to accommodate similar alignment for =60if/unless=60 it seems lik= e a good idea to add a defcustom supporting the first style as well.

vim already added support for it (https://github.= com/vim-ruby/vim-ruby/issues/190).