add Kernel#open

This commit is contained in:
Akira Yumiyama
2013-04-02 15:32:01 +09:00
parent 5a425f598b
commit 911003987b
+11
View File
@@ -0,0 +1,11 @@
module Kernel
def open(file, *rest)
raise ArgumentError unless file.is_a?(String)
if file[0] == "|"
IO.popen(file[1..-1], *rest)
else
File.open(file, *rest)
end
end
end