Project

General

Profile

Actions

Bug #14899

closed

Pathname#glob Matching to the directory results in lack

Added by hazi (yuhei mukoyama) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-darwin17]
[ruby-dev:50588]

Description

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>]
Actions

Also available in: Atom PDF

Like0
Like0