10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/yap/shell/commands.rb', line 10
def self.build_command_for(world:, command:, args:, heredoc:, internally_evaluate:, line:)
return RubyCommand.new(world:world, str:command) if internally_evaluate
case command
when ShellCommand then ShellCommand.new(world:world, str:command, args:args, heredoc:heredoc, line:line)
when BuiltinCommand then BuiltinCommand.new(world:world, str:command, args:args, heredoc:heredoc)
when FileSystemCommand then FileSystemCommand.new(world:world, str:command, args:args, heredoc:heredoc)
else
UnknownCommand.new(world:world, str:command, args:args, heredoc:heredoc)
end
end
|