Commit cc40f93a authored by Akira Yumiyama's avatar Akira Yumiyama

Kernel#open block support

parent 91100398
module Kernel
def open(file, *rest)
def open(file, *rest, &block)
raise ArgumentError unless file.is_a?(String)
if file[0] == "|"
IO.popen(file[1..-1], *rest)
IO.popen(file[1..-1], *rest, &block)
else
File.open(file, *rest)
File.open(file, *rest, &block)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment