Ruby 2.2.0 リファレンスマニュアル > ライブラリ一覧 > shell/command-processorライブラリ > Shell::CommandProcessorクラス > []
test(command, file1, file2 = nil) -> bool | Time | Integer | nil[permalink][rdoc]self[command, file1, file2 = nil] -> bool | Time | Integer | nilKernel.#test や FileTest のメソッドに処理を委譲します。
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true
[SEE_ALSO] Kernel.#test, FileTest