Module: DirParser
- Defined in:
- lib/codefusion/dir_parser.rb
Class Method Summary collapse
Class Method Details
.make_hash(dir, parent_dir) ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/codefusion/dir_parser.rb', line 2 def self.make_hash(dir, parent_dir) full_path = File.join(parent_dir, dir) children = Dir.entries(full_path).partition do |child| File.directory?( File.join(full_path, child) ) end { folder_name: dir, files: DirParser.return_files( children[1], full_path, parent_dir ), folders: DirParser.return_folders( children[0], dir, parent_dir ) } end |