static IRubyObject handleOptionsCommon(ThreadContext context, Ruby runtime, ExecArg eargp, RubyHash opthash, boolean raise) { if (opthash.isEmpty()) return null; RubyHash nonopts = null; for (Map.Entry<IRubyObject, IRubyObject> entry : (Set<Map.Entry<IRubyObject, IRubyObject>>)opthash.directEntrySet()) { IRubyObject key = entry.getKey(); IRubyObject val = entry.getValue(); if (execargAddopt(context, runtime, eargp, key, val) != ST_CONTINUE) { if (raise) { if (key instanceof RubySymbol) { switch (key.toString()) { case "gid" : throw runtime.newNotImplementedError("popen does not support :gid option in JRuby"); case "uid" : throw runtime.newNotImplementedError("popen does not support :uid option in JRuby"); default : throw runtime.newArgumentError("wrong exec option symbol: " + key); } } else { throw runtime.newArgumentError("wrong exec option: " + key); } } if (nonopts == null) nonopts = RubyHash.newHash(runtime); nonopts.op_aset(context, key, val); } } return nonopts != null ? nonopts : context.nil; }
static IRubyObject handleOptionsCommon(ThreadContext context, Ruby runtime, ExecArg eargp, RubyHash opthash, boolean raise) { if (opthash.isEmpty()) return null; RubyHash nonopts = null; for (Map.Entry<IRubyObject, IRubyObject> entry : (Set<Map.Entry<IRubyObject, IRubyObject>>)opthash.directEntrySet()) { IRubyObject key = entry.getKey(); IRubyObject val = entry.getValue(); if (execargAddopt(context, runtime, eargp, key, val) != ST_CONTINUE) { if (raise) { if (key instanceof RubySymbol) { switch (key.toString()) { case "gid" : throw runtime.newNotImplementedError("popen does not support :gid option in JRuby"); case "uid" : throw runtime.newNotImplementedError("popen does not support :uid option in JRuby"); default : throw runtime.newArgumentError("wrong exec option symbol: " + key); } } else { throw runtime.newArgumentError("wrong exec option: " + key); } } if (nonopts == null) nonopts = RubyHash.newHash(runtime); nonopts.op_aset(context, key, val); } } return nonopts != null ? nonopts : context.nil; }
fd2 = RubyNumeric.num2int(fd2v); execargAddopt(context, runtime, eargp, runtime.newFixnum(fd), runtime.newFixnum(fd2));
fd2 = RubyNumeric.num2int(fd2v); execargAddopt(context, runtime, eargp, runtime.newFixnum(fd), runtime.newFixnum(fd2));