ENV[‘HOME’] (for unix-like)
ENV[‘HOMEDRIVE’]+ ENV[‘HOMEPATH’] (for windows)
return the path of home directory
ex:
on my mac , output is “/Users/Pan”
ARGV
the parameter to the ruby program
ruby test.rb 123
ARGV[0] is 123
張貼留言
沒有留言:
張貼留言