Ruby/File Directory/Dir.open

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск

Open a folder with block logics

Dir.open("mydir") { |d| d.each { |x| puts x } }



Open a folder with grep as a filter

Dir.open("mydir") { |d| d.grep /file/ }