From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id DD20F1F462 for ; Sat, 25 May 2019 12:48:23 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 19E2F120B48; Sat, 25 May 2019 21:48:18 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id D6CFF120AF0 for ; Sat, 25 May 2019 21:48:14 +0900 (JST) Received: by filter0095p3iad2.sendgrid.net with SMTP id filter0095p3iad2-26274-5CE9398F-11 2019-05-25 12:48:15.236482818 +0000 UTC m=+155335.273059400 Received: from herokuapp.com (unknown [54.83.89.4]) by ismtpd0067p1mdw1.sendgrid.net (SG) with ESMTP id 10G4hDyCSKWuThXPxz3tWQ for ; Sat, 25 May 2019 12:48:15.267 +0000 (UTC) Date: Sat, 25 May 2019 12:48:15 +0000 (UTC) From: deivid.rodriguez@riseup.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 68323 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15868 X-Redmine-Issue-Author: deivid X-Redmine-Sender: deivid X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?klzXTY0v3jOvaMSihdVenmzxCeXPrK4t1AV7GwiE8Tggs92VCHAVsmBqrt0jil?= =?us-ascii?Q?4c8Vlyx+Mdy+D9Wj=2FHZUrp=2FysaFCtLQy7Z7jaBO?= =?us-ascii?Q?tZsCy3=2FQgSZYBzhp87BiaFj02meOIXczLGHTLT=2F?= =?us-ascii?Q?9SUbH5P9ZnSd1deXlf2PwhAghIEGYfCaaE1y8Cv?= =?us-ascii?Q?Kdwh5h6N9spi67Nnag=2FnJi9qG5gj1v2heng=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92840 Subject: [ruby-core:92840] [Ruby trunk Feature#15868] Implement `File.absolute_path?` X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15868 has been updated by deivid (David Rodr=EDguez). I added a couple more specs to check that in https://github.com/ruby/ruby/p= ull/2198/commits/d59a5c93dd4b20aa0898a24fab78a68a2cc84925, but I'm not sure= where I can check whether they pass on Windows or not. ---------------------------------------- Feature #15868: Implement `File.absolute_path?` https://bugs.ruby-lang.org/issues/15868#change-78222 * Author: deivid (David Rodr=EDguez) * Status: Open * Priority: Normal * Assignee: = * Target version: = ---------------------------------------- Currently there's no way to check whether a path is absolute or not in a wa= y that works accross OSs. The pathname library has the #absolute? method, b= ut that only checks whether the path starts with a slash, which is not appr= opriate for Windows. I thought of reimplementing it as something like File.absolute_path(self) = =3D=3D self, but that would mean accessing the filesystem, which I don't th= ink we want here. I also thought of implementing the "windows letter checks" in the pathname'= s library, but then I saw that those are already implemented in file.c, so = I thought it would be a good idea to expose those. So I propose to add File= .absolute_path? for this. If this is accepted, I can do a follow-up PR to change Pathname#absolute? t= o delegate to File.absolute_path?. What do you think? I attach a patch to add `File.absolute_path?` here (I also opened a PR on G= ithub: https://github.com/ruby/ruby/pull/2198). = ---Files-------------------------------- 0001-Add-File.absolute_path.patch (3.24 KB) 0001-Add-File.absolute_path.patch (3.24 KB) -- = https://bugs.ruby-lang.org/ Unsubscribe: