Last change
on this file since 398 was 321, checked in by coas-nagasima, 7 years ago |
文字コードを設定
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-ruby;charset=UTF-8
|
File size:
281 bytes
|
Rev | Line | |
---|
[279] | 1 | module 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 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.