Built in way to list directories in a directory in ruby

前端 未结 2 1156
别跟我提以往
别跟我提以往 2021-02-05 10:41

Is there a cleaner built-in way to do this?

ree> Pathname.new(\'/path/to\').children.select{|e| e.directory?}.map{|d| d.basename.to_s}
 => [\"test1\", \"t         


        
2条回答
提交回复
热议问题