本文整理了Java中org.jruby.Ruby.isVerbose
方法的一些代码示例,展示了Ruby.isVerbose
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.isVerbose
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:isVerbose
暂无
代码示例来源:origin: org.jruby/jruby-complete
@Override
public void warning(ID id, String message) {
if (!runtime.warningsEnabled() || !runtime.isVerbose()) return;
writeWarning(runtime, id, message);
}
代码示例来源:origin: org.jruby/jruby-core
/**
* Prints a warning, only in verbose mode.
*/
@Override
public void warning(ID id, String fileName, int lineNumber, String message) {
if (!runtime.warningsEnabled() || !runtime.isVerbose()) return;
warn(id, fileName, lineNumber, message);
}
代码示例来源:origin: org.jruby/jruby-complete
public IRubyObject get(String name) {
assert name != null;
assert name.startsWith("$");
GlobalVariable variable = globalVariables.get(name);
if (variable != null) return variable.getAccessor().getValue();
if (runtime.isVerbose()) {
runtime.getWarnings().warning(ID.GLOBAL_NOT_INITIALIZED, "global variable `" + name + "' not initialized");
}
return runtime.getNil();
}
代码示例来源:origin: org.jruby/jruby-complete
public final IRubyObject getVariable(ThreadContext context, int index, String name, IRubyObject object) {
IRubyObject value = getValue(context, index, name, object);
if (value != null) return value;
Ruby runtime = context.runtime;
if (runtime.isVerbose()) {
warnAboutUninitializedIvar(runtime, name);
}
return runtime.getNil();
}
代码示例来源:origin: org.jruby/jruby-complete
/**
* @see org.jruby.runtime.IAccessor#getValue()
*/
public IRubyObject getValue() {
if (runtime.isVerbose()) {
runtime.getWarnings().warning(ID.ACCESSOR_NOT_INITIALIZED, "global variable `" + name + "' not initialized");
}
return runtime.getNil();
}
代码示例来源:origin: org.jruby/jruby-core
public final IRubyObject getVariable(ThreadContext context, int index, String name, IRubyObject object) {
IRubyObject value = getValue(context, index, name, object);
if (value != null) return value;
Ruby runtime = context.runtime;
if (runtime.isVerbose()) {
warnAboutUninitializedIvar(runtime, name);
}
return runtime.getNil();
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(name = "matchedsize")
public IRubyObject matchedsize(ThreadContext context) {
Ruby runtime = context.runtime;
if (runtime.isVerbose()) {
runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#matchedsize is obsolete; use #matched_size instead");
}
return matched_size();
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(name = "getbyte")
public IRubyObject getbyte(ThreadContext context) {
Ruby runtime = context.runtime;
if (runtime.isVerbose()) {
runtime.getWarnings().warning(ID.DEPRECATED_METHOD,
"StringScanner#getbyte is obsolete; use #get_byte instead");
}
return get_byte(context);
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(name = "empty?")
public RubyBoolean empty_p(ThreadContext context) {
Ruby runtime = context.runtime;
if (runtime.isVerbose()) {
runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#empty? is obsolete; use #eos? instead");
}
return eos_p(context);
}
代码示例来源:origin: org.jruby/jruby-complete
public static IRubyObject getInstanceVariable(IRubyObject self, Ruby runtime, String internedName) {
IRubyObject result = self.getInstanceVariables().getInstanceVariable(internedName);
if (result != null) return result;
if (runtime.isVerbose()) warnAboutUninitializedIvar(runtime, internedName);
return runtime.getNil();
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(name = "default_external=", meta = true)
public static IRubyObject setDefaultExternal(ThreadContext context, IRubyObject recv, IRubyObject encoding) {
if (context.runtime.isVerbose()) context.runtime.getWarnings().warning("setting Encoding.default_external");
EncodingUtils.rbEncSetDefaultExternal(context, encoding);
return encoding;
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(name = "peep", required = 1)
public IRubyObject peep(ThreadContext context, IRubyObject length) {
Ruby runtime = context.runtime;
if (runtime.isVerbose()) {
runtime.getWarnings().warning(
ID.DEPRECATED_METHOD, "StringScanner#peep is obsolete; use #peek instead");
}
return peek(context, length);
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(name = "restsize")
public RubyFixnum restsize(ThreadContext context) {
Ruby runtime = context.runtime;
if (runtime.isVerbose()) {
runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#restsize is obsolete; use #rest_size instead");
}
return rest_size();
}
代码示例来源:origin: org.jruby/jruby-core
@JRubyMethod(name = "restsize")
public RubyFixnum restsize(ThreadContext context) {
Ruby runtime = context.runtime;
if (runtime.isVerbose()) {
runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#restsize is obsolete; use #rest_size instead");
}
return rest_size();
}
代码示例来源:origin: org.jruby/jruby-core
@JRubyMethod(name = "getbyte")
public IRubyObject getbyte(ThreadContext context) {
Ruby runtime = context.runtime;
if (runtime.isVerbose()) {
runtime.getWarnings().warning(ID.DEPRECATED_METHOD,
"StringScanner#getbyte is obsolete; use #get_byte instead");
}
return get_byte(context);
}
代码示例来源:origin: org.jruby/jruby-core
public static IRubyObject getInstanceVariable(IRubyObject self, Ruby runtime, String internedName) {
IRubyObject result = self.getInstanceVariables().getInstanceVariable(internedName);
if (result != null) return result;
if (runtime.isVerbose()) warnAboutUninitializedIvar(runtime, internedName);
return runtime.getNil();
}
代码示例来源:origin: org.jruby/jruby-complete
@JRubyMethod(name = "clear")
public IRubyObject clear(ThreadContext context) {
check();
Ruby runtime = context.runtime;
if (runtime.isVerbose()) {
runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#clear is obsolete; use #terminate instead");
}
return terminate();
}
代码示例来源:origin: org.jruby/jruby-core
/**
* initialize(enum = nil, &block)
*/
@JRubyMethod(visibility = Visibility.PRIVATE) // def initialize(enum = nil, &block)
public IRubyObject initialize(ThreadContext context, Block block) {
if ( block.isGiven() && context.runtime.isVerbose() ) {
context.runtime.getWarnings().warning(IRubyWarnings.ID.BLOCK_UNUSED, "given block not used");
}
allocHash(context.runtime);
return this;
}
代码示例来源:origin: org.jruby/jruby-complete
@JIT
public static IRubyObject getVariableWithAccessor(IRubyObject self, VariableAccessor accessor, ThreadContext context, String name) {
Ruby runtime = context.runtime;
IRubyObject result = (IRubyObject)accessor.get(self);
if (result == null) {
if (runtime.isVerbose()) {
runtime.getWarnings().warning(IRubyWarnings.ID.IVAR_NOT_INITIALIZED, str(runtime, "instance variable ", ids(runtime, name)," not initialized"));
}
result = context.nil;
}
return result;
}
代码示例来源:origin: org.jruby/jruby-core
@JIT
public static IRubyObject getVariableWithAccessor(IRubyObject self, VariableAccessor accessor, ThreadContext context, String name) {
Ruby runtime = context.runtime;
IRubyObject result = (IRubyObject)accessor.get(self);
if (result == null) {
if (runtime.isVerbose()) {
runtime.getWarnings().warning(IRubyWarnings.ID.IVAR_NOT_INITIALIZED, str(runtime, "instance variable ", ids(runtime, name)," not initialized"));
}
result = context.nil;
}
return result;
}
内容来源于网络,如有侵权,请联系作者删除!