@Override public boolean isEmpty() { return rubyHash.isEmpty(); }
@Override public boolean isEmpty() { return rubyHash.isEmpty(); }
public boolean isEmpty() { return hash.isEmpty(); }
public boolean isEmpty() { return hash.isEmpty(); }
@Deprecated static boolean isEnumConversionRequired(Type type, RubyHash enums) { if (type instanceof Type.Builtin && enums != null && !enums.isEmpty()) { switch (type.getNativeType()) { case CHAR: case UCHAR: case SHORT: case USHORT: case INT: case UINT: case LONG: case ULONG: case LONG_LONG: case ULONG_LONG: return true; default: return false; } } return false; }
static boolean isEnumConversionRequired(Type type, RubyHash enums) { if (type instanceof Type.Builtin && enums != null && !enums.isEmpty()) { switch (type.getNativeType()) { case CHAR: case UCHAR: case SHORT: case USHORT: case INT: case UINT: case LONG: case ULONG: case LONG_LONG: case ULONG_LONG: return true; default: return false; } } return false; }
@Deprecated static boolean isEnumConversionRequired(Type type, RubyHash enums) { if (type instanceof Type.Builtin && enums != null && !enums.isEmpty()) { switch (type.getNativeType()) { case CHAR: case UCHAR: case SHORT: case USHORT: case INT: case UINT: case LONG: case ULONG: case LONG_LONG: case ULONG_LONG: return true; default: return false; } } return false; }
static boolean isEnumConversionRequired(Type type, RubyHash enums) { if (type instanceof Type.Builtin && enums != null && !enums.isEmpty()) { switch (type.getNativeType()) { case CHAR: case UCHAR: case SHORT: case USHORT: case INT: case UINT: case LONG: case ULONG: case LONG_LONG: case ULONG_LONG: return true; default: return false; } } return false; }
private static IRubyObject[] dropLastArgIfOptions(final Ruby runtime, final IRubyObject[] args) { IRubyObject lastArg = args[args.length - 1]; if (lastArg instanceof RubyHash) { if (!((RubyHash) lastArg).isEmpty()) { runtime.getWarnings().warn(ID.UNSUPPORTED_SUBPROCESS_OPTION, "system does not support options in JRuby yet: " + lastArg); } return Arrays.copyOf(args, args.length - 1); } return args; }
private static IRubyObject[] dropLastArgIfOptions(final Ruby runtime, final IRubyObject[] args) { IRubyObject lastArg = args[args.length - 1]; if (lastArg instanceof RubyHash) { if (!((RubyHash) lastArg).isEmpty()) { runtime.getWarnings().warn(ID.UNSUPPORTED_SUBPROCESS_OPTION, "system does not support options in JRuby yet: " + lastArg); } return Arrays.copyOf(args, args.length - 1); } return args; }
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; }
@JRubyMethod(name = "any?", optional = 1) public IRubyObject any_p(ThreadContext context, IRubyObject[] args, Block block) { IRubyObject pattern = args.length > 0 ? args[0] : null; boolean patternGiven = pattern != null; if (isEmpty()) return context.fals; if (!block.isGiven() && !patternGiven) return context.tru; if (patternGiven) return any_p_p(context, pattern); if (block.getSignature().arityValue() > 1) { return any_p_i_fast(context, block); } return any_p_i(context, block); }
@JRubyMethod(name = "any?", optional = 1) public IRubyObject any_p(ThreadContext context, IRubyObject[] args, Block block) { IRubyObject pattern = args.length > 0 ? args[0] : null; boolean patternGiven = pattern != null; if (isEmpty()) return context.fals; if (!block.isGiven() && !patternGiven) return context.tru; if (patternGiven) return any_p_p(context, pattern); if (block.getSignature().arityValue() > 1) { return any_p_i_fast(context, block); } return any_p_i(context, block); }
private void recursivePop(IRubyObject list, IRubyObject obj, IRubyObject paired_obj) { if(paired_obj != null) { IRubyObject pair_list = ((RubyHash)list).fastARef(obj); if(pair_list == null) { throw runtime.newTypeError("invalid inspect_tbl pair_list for " + runtime.getCurrentContext().getFrameName()); } if(pair_list instanceof RubyHash) { ((RubyHash)pair_list).delete(runtime.getCurrentContext(), paired_obj, Block.NULL_BLOCK); if(!((RubyHash)pair_list).isEmpty()) { return; } } } ((RubyHash)list).delete(runtime.getCurrentContext(), obj, Block.NULL_BLOCK); }
private void recursivePop(IRubyObject list, IRubyObject obj, IRubyObject paired_obj) { if(paired_obj != null) { IRubyObject pair_list = ((RubyHash)list).fastARef(obj); if(pair_list == null) { throw newTypeError("invalid inspect_tbl pair_list for " + getCurrentContext().getFrameName()); } if(pair_list instanceof RubyHash) { ((RubyHash)pair_list).delete(getCurrentContext(), paired_obj, Block.NULL_BLOCK); if(!((RubyHash)pair_list).isEmpty()) { return; } } } ((RubyHash)list).delete(getCurrentContext(), obj, Block.NULL_BLOCK); }
private void recursivePop(IRubyObject list, IRubyObject obj, IRubyObject paired_obj) { if(paired_obj != null) { IRubyObject pair_list = ((RubyHash)list).fastARef(obj); if(pair_list == null) { throw runtime.newTypeError("invalid inspect_tbl pair_list for " + runtime.getCurrentContext().getFrameName()); } if(pair_list instanceof RubyHash) { ((RubyHash)pair_list).delete(runtime.getCurrentContext(), paired_obj, Block.NULL_BLOCK); if(!((RubyHash)pair_list).isEmpty()) { return; } } } ((RubyHash)list).delete(runtime.getCurrentContext(), obj, Block.NULL_BLOCK); }
private void recursivePop(IRubyObject list, IRubyObject obj, IRubyObject paired_obj) { if(paired_obj != null) { IRubyObject pair_list = ((RubyHash)list).fastARef(obj); if(pair_list == null) { throw newTypeError("invalid inspect_tbl pair_list for " + getCurrentContext().getFrameName()); } if(pair_list instanceof RubyHash) { ((RubyHash)pair_list).delete(getCurrentContext(), paired_obj, Block.NULL_BLOCK); if(!((RubyHash)pair_list).isEmpty()) { return; } } } ((RubyHash)list).delete(getCurrentContext(), obj, Block.NULL_BLOCK); }
if (options == null || (options != null && options.isEmpty())) { if (offset.isNil()) { mode |= ModeFlags.WRONLY;