56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/objective_command/shell.rb', line 56
def shell *args, &block
local_shell = ocmd_shell
unless args.empty?
runner = ocmd_shell.runner
options = {}
for arg in args.flatten do
case arg
when OCmd::Runners::Runner then runner = arg
when Hash then options.merge! arg
when Symbol then options[arg] = true
else raise ArgumentError, "Bad argument: #{arg}"
end
end
local_shell = Shell::Simple.new runner, options
end
if block
block.bind(local_shell).call
else
local_shell
end
end
|