method
find_system_command
v1_9_3_392 -
Show latest stable
- Class:
Shell::CommandProcessor
find_system_command(command)public
private functions
# File lib/shell/command-processor.rb, line 350
def find_system_command(command)
return command if /^\// =~ command
case path = @system_commands[command]
when String
if exists?(path)
return path
else
Shell.Fail Error::CommandNotFound, command
end
when false
Shell.Fail Error::CommandNotFound, command
end
for p in @shell.system_path
path = join(p, command)
if FileTest.exist?(path)
@system_commands[command] = path
return path
end
end
@system_commands[command] = false
Shell.Fail Error::CommandNotFound, command
end Related methods
- Instance methods
- []
- append
- cat
- check_point
- concat
- echo
- expand_path
- find_system_command
- finish_all_jobs
- foreach
- glob
- mkdir
- notify
- open
- out
- rehash
- rmdir
- system
- tee
- test
- top_level_test
- transact
- unlink
- Class methods
- add_delegate_command_to_shell
- alias_command
- alias_map
- def_builtin_commands
- def_system_command
- initialize
- install_builtin_commands
- install_system_commands
- method_added
- new
- run_config
- unalias_command
- undef_system_command