[#74190] [Ruby trunk Feature#12134] Comparison between `true` and `false` — duerst@...
Issue #12134 has been updated by Martin D端rst.
3 messages
2016/03/07
[#74269] Type systems for Ruby — Rob Blanco <ml@...>
Dear ruby-core,
5 messages
2016/03/10
[#74395] [Ruby trunk Feature#12142] Hash tables with open addressing — shyouhei@...
Issue #12142 has been updated by Shyouhei Urabe.
3 messages
2016/03/17
[ruby-core:74477] [Ruby trunk Feature#12194] File.dirname optional parameter
From:
shevegen@...
Date:
2016-03-20 16:15:40 UTC
List:
ruby-core #74477
Issue #12194 has been updated by Robert A. Heiler.
I myself have found Pathname harder or less elegant to use than the direct File* or Dir* methods so I am in support of the suggestion by nobu.
So to Benoit, I understand that you may consider File.dirname(path, 2) not ideal either (a user may wonder what the 2 means), the alternative
suggestion to use Pathname is not ideal either and additionally requires pathname call:
require 'pathname'
# require 'fileutils'; FileUtils.mkdir_p('/tmp/foobar/') # <-- this line just for testing purpose, disregard it
Pathname("/tmp/foobar/").parent.parent.to_s # => "/"
Being able to directly do so on File.dirname() itself is good, in my opinion.
----------------------------------------
Feature #12194: File.dirname optional parameter
https://bugs.ruby-lang.org/issues/12194#change-57596
* Author: Nobuyoshi Nakada
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
As talked at the last developers' meeting, I propose an addition of an optional parameter to `File.dirname`.
Often I see the code, like
```ruby
File.dirname(File.dirname(path)) # or
File.expand_path("../..", path)
```
which are not concise.
This proposal can make them as:
```ruby
File.dirname(path, 2)
```
https://github.com/ruby/ruby/compare/trunk...nobu:feature/dirname-level?expand=1
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>