[ruby-dev:50588] [Ruby trunk Bug#14899] Pathname#glob Matching to the directory results in lack

From: yuhei.mukoyama@...
Date: 2018-07-07 08:47:26 UTC
List: ruby-dev #50588
Issue #14899 has been reported by hazi (yuhei mukoyama).

----------------------------------------
Bug #14899: Pathname#glob Matching to the directory results in lack
https://bugs.ruby-lang.org/issues/14899

* Author: hazi (yuhei mukoyama)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-darwin17]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Pathname.glob では問題ないのですが、
ruby 2.5 から追加された Pathname#glob で、スラッシュで終わる引数を渡すとディレクトリ名の最初の1文字がかけた状態で返ってきます

~~~
Pathname('/tmp/test').glob('**/*')  => [#<Pathname:/tmp/test/abc>,  #<Pathname:/tmp/test/123>]
Pathname.glob('/tmp/test/**/*/')    => [#<Pathname:/tmp/test/abc/>, #<Pathname:/tmp/test/123/>]
Pathname('/tmp/test').glob('**/*/') => [#<Pathname:/tmp/test/bc>,   #<Pathname:/tmp/test/23>]
~~~





-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next