Refine search
@Override public IRubyObject set(IRubyObject value) { runtime.getWarnings().warn(ID.INEFFECTIVE_GLOBAL, "warning: variable " + name + " is no longer effective; ignored"); return value; }
@JRubyMethod public IRubyObject chars(final ThreadContext context, final Block block) { context.runtime.getWarnings().warn("StringIO#chars is deprecated; use #each_char instead"); return each_char(context, block); }
/** rb_hash_index * */ @JRubyMethod(name = "index") public IRubyObject index(ThreadContext context, IRubyObject expected) { context.runtime.getWarnings().warn(ID.DEPRECATED_METHOD, "Hash#index is deprecated; use Hash#key"); return key(context, expected); }
public void warn(WARNING_ID id, String message, Object... data) { ID ourID; if (id == WARNING_ID.DUMMY_VALUE_USED) { ourID = ID.DUMMY_VALUE_USED; } else { ourID = ID.MISCELLANEOUS; } runtime.getWarnings().warn(ourID, message); }
@JRubyMethod(meta = true) public static IRubyObject ver(ThreadContext context, IRubyObject recv) { context.runtime.getWarnings().warn(IRubyWarnings.ID.DEPRECATED_METHOD, "BigDecimal.ver is deprecated; use BigDecimal::VERSION instead"); return RubyString.newStringShared(context.runtime, VERSION); }
public synchronized void addEventHook(EventHook hook) { if (!RubyInstanceConfig.FULL_TRACE_ENABLED) { // without full tracing, many events will not fire getWarnings().warn("tracing (e.g. set_trace_func) will not capture all events without --debug flag"); } EventHook[] hooks = eventHooks; EventHook[] newHooks = Arrays.copyOf(hooks, hooks.length + 1); newHooks[hooks.length] = hook; eventHooks = newHooks; hasEventHooks = true; }
@JRubyMethod(name = "chars") public IRubyObject chars(ThreadContext context, Block block) { context.runtime.getWarnings().warn("IO#chars is deprecated; use #each_char instead"); return each_charInternal(context, block); }
private void warnIfPowExponentTooBig(final ThreadContext context, final long other) { // MRI issuses warning here on (RBIGNUM(x)->len * SIZEOF_BDIGITS * yy > 1024*1024) if ( ((value.bitLength() + 7) / 8) * 4 * Math.abs((double) other) > 1024 * 1024 ) { context.runtime.getWarnings().warn(ID.MAY_BE_TOO_BIG, "in a**b, b may be too big"); } }
/** rb_hash_index * */ @JRubyMethod(name = "index") public IRubyObject index(ThreadContext context, IRubyObject expected) { context.runtime.getWarnings().warn(ID.DEPRECATED_METHOD, "Hash#index is deprecated; use Hash#key"); return key(context, expected); }
private void warnIfPowExponentTooBig(final ThreadContext context, final long other) { // MRI issuses warning here on (RBIGNUM(x)->len * SIZEOF_BDIGITS * yy > 1024*1024) if ( ((value.bitLength() + 7) / 8) * 4 * Math.abs((double) other) > 1024 * 1024 ) { context.runtime.getWarnings().warn(ID.MAY_BE_TOO_BIG, "in a**b, b may be too big"); } }
@JRubyMethod public IRubyObject codepoints(ThreadContext context, Block block) { context.runtime.getWarnings().warn("IO#codepoints is deprecated; use #each_codepoint instead"); return eachCodePointCommon(context, block, "each_codepoint"); }
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; }
@JRubyMethod(name = "bytes") public IRubyObject bytes(ThreadContext context, Block block) { context.runtime.getWarnings().warn("IO#bytes is deprecated; use #each_byte instead"); return each_byte(context, block); }
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; }
@JRubyMethod(name = "lines") public IRubyObject lines(final ThreadContext context, Block block) { context.runtime.getWarnings().warn("IO#lines is deprecated; use #each_line instead"); return each_line(context, block); }
/** rb_obj_type * * The deprecated version of type, that emits a deprecation * warning. */ @Deprecated public RubyClass type_deprecated() { getRuntime().getWarnings().warn(ID.DEPRECATED_METHOD, "Object#type is deprecated; use Object#class"); return type(); }
@JRubyMethod(name = "bytes") public IRubyObject bytes(ThreadContext context, Block block) { context.runtime.getWarnings().warn("IO#bytes is deprecated; use #each_byte instead"); return each_byte(context, block); }
static void checkUnsupportedOptions(ThreadContext context, RubyHash opts, String[] unsupported, String error) { final Ruby runtime = context.runtime; for (String key : unsupported) { if (opts.fastARef(runtime.newSymbol(key)) != null) { runtime.getWarnings().warn(error + ": " + key); } } }
@JRubyMethod(name = "times", meta = true, compat = CompatVersion.RUBY1_8) public static IRubyObject times(ThreadContext context, IRubyObject recv) { context.runtime.getWarnings().warn("obsolete method Time::times; use Process::times"); return RubyProcess.times(context, recv, Block.NULL_BLOCK); }
/** rb_obj_type * * The deprecated version of type, that emits a deprecation * warning. */ public RubyClass type_deprecated() { getRuntime().getWarnings().warn(ID.DEPRECATED_METHOD, "Object#type is deprecated; use Object#class"); return type(); }