class Object
Public Instance Methods
help()
click to toggle source
# File lib/antonio.rb, line 34 def help puts "\nUse Antonio to hide/show files and directories.\n\n" puts " hide or h: Hides the following file." puts " (Usage: antonio hide secret-file.txt)\n\n" puts " show or s: Shows the following file." puts " (Usage: antonio show .secret-file.txt)\n\n" puts " help: Shows this help screen." puts " (Usage: antonio help)\n\n" end
hide()
click to toggle source
# File lib/antonio.rb, line 6 def hide if $val.nil? puts "Dude, you need to tell me what to hide." elsif $val[0..0] == "." puts "Please try to hide a shown file." else if File.exist? $val File.rename($val, "." << $val ) else puts "That's not a valid file. Try again." end end end
show()
click to toggle source
# File lib/antonio.rb, line 20 def show if $val.nil? puts "Dude, you need to tell me what to show." elsif $val[0..0] != "." puts "Please try to show a hidden file." else if File.exist? $val File.rename($val, $val[1..-1]) else puts "That's not a valid file. Try again." end end end