method
test
v1_9_1_378 -
Show latest stable
- Class:
Shell::CommandProcessor
test(command, file1, file2=nil)public
No documentation available.
# File lib/shell/command-processor.rb, line 173
def test(command, file1, file2=nil)
file1 = expand_path(file1)
file2 = expand_path(file2) if file2
command = command.id2name if command.kind_of?(Symbol)
case command
when Integer
if file2
top_level_test(command, file1, file2)
else
top_level_test(command, file1)
end
when String
if command.size == 1
if file2
top_level_test(command, file1, file2)
else
top_level_test(command, file1)
end
else
if file2
FileTest.send(command, file1, file2)
else
FileTest.send(command, file1)
end
end
end
end