Ruby/File Directory/Dir.open

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

Версия от 17:10, 26 мая 2010; (Обсуждение)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

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/ }