Skip to content

Instantly share code, notes, and snippets.

View dpogue's full-sized avatar
👨‍💻
I may be slow to respond.

Darryl Pogue dpogue

👨‍💻
I may be slow to respond.
View GitHub Profile
require 'yaml'
def dir_to_array(dir)
Dir.entries(dir).reject { |e| ['.', '..'].include? e }.map { |entry|
if File.directory? "#{dir}/#{entry}"
{ "#{entry}" => dir_to_array "#{dir}/#{entry}"}
else
entry
end
}