Login Register






[Ruby] File Explorer filter_list
Author
Message
[Ruby] File Explorer #1
Hey guys, back again.

I had a 3 hour flight coming down to Florida and instead of sleeping, I said screw it and made a few things.

This is the first version of my file explorer. Currently, it's pretty buggy and the path history is less than perfect. You're also unable to open the files inside folders currently so I'll be adding that, too.

Code:
#File explorer by Nightc||ed, ©2015 @dir = "" def search system "cls" puts "Enter directory, leaving an open end (ex; C:\\Users\\Appdata):" puts "Hit enter with a blank field to return to C:\\" if @dir != "" system "cls" puts "Current directory: #{@dir}" puts @files @dir = @dir + gets.chomp + "\\" else @dir = gets.chomp end if @dir.include?("\\\\") @dir = "C:\\" else @dir = @dir end tree = Dir.entries("#{@dir}") @files = Array.new tree.each do |sub| sub = "├#{sub}" @files << sub end puts @files search end search
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply