File.join () simply combines all its arguments with a single slash. For instance,
File.join("a", "b", "c")
returns "a / b / c". This is almost equivalent to the more commonly used Array union method, like this:
["hello", "ruby", "world"].join(", ")
# => "hello, ruby, world"
File.join(), , : , -, , "/" ( "," ). Ruby - , , .
Dir [] , , "*" "**" . ,
Dir["/var/*"]
# => ["/var/lock", "/var/backups", "/var/lib", "/var/tmp", "/var/opt", "/var/local", "/var/run", "/var/spool", "/var/log", "/var/cache", "/var/mail"]
Dir["/var/**/*"]
# => ["/var/lock", "/var/backups", "/var/backups/dpkg.status.3.gz", "/var/backups/passwd.bak" ... (all files in all dirs in '/var')]