source: EcnlProtoTool/trunk/mruby-2.1.1/mrbgems/mruby-io/mrblib/kernel.rb@ 439

Last change on this file since 439 was 439, checked in by coas-nagasima, 4 years ago

mrubyを2.1.1に更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-ruby;charset=UTF-8
File size: 482 bytes
Line 
1module Kernel
2 def `(cmd)
3 IO.popen(cmd) { |io| io.read }
4 end
5
6 def open(file, *rest, &block)
7 raise ArgumentError unless file.is_a?(String)
8
9 if file[0] == "|"
10 IO.popen(file[1..-1], *rest, &block)
11 else
12 File.open(file, *rest, &block)
13 end
14 end
15
16 def print(*args)
17 $stdout.print(*args)
18 end
19
20 def puts(*args)
21 $stdout.puts(*args)
22 end
23
24 def printf(*args)
25 $stdout.printf(*args)
26 end
27
28 def gets(*args)
29 $stdin.gets(*args)
30 end
31end
Note: See TracBrowser for help on using the repository browser.