public ParserConfiguration(Ruby runtime, int lineNumber, boolean extraPositionInformation, boolean inlineSource, boolean isFileParse, boolean saveData, RubyInstanceConfig config) { this(runtime, lineNumber, extraPositionInformation, inlineSource, isFileParse, config.getCompatVersion(), saveData); this.isDebug = config.isParserDebug(); }
/** * Returns a Ruby version currently chosen, which is one of CompatVersion.RUBY1_8, * CompatVersion.RUBY1_9, or CompatVersion.BOTH. The default version is * CompatVersion.RUBY1_8. * * @since JRuby 1.5.0. * * @return a Ruby version */ public CompatVersion getCompatVersion() { return provider.getRubyInstanceConfig().getCompatVersion(); }
/** * Returns a Ruby version currently chosen, which is one of CompatVersion.RUBY1_8, * CompatVersion.RUBY1_9, or CompatVersion.BOTH. The default version is * CompatVersion.RUBY1_8. * * @since JRuby 1.5.0. * * @return a Ruby version */ public CompatVersion getCompatVersion() { return provider.getRubyInstanceConfig().getCompatVersion(); }
@Deprecated public org.jruby.CompatVersion getCompatVersion() { return provider.getRubyInstanceConfig().getCompatVersion(); }
public ParserConfiguration(Ruby runtime, int lineNumber, boolean extraPositionInformation, boolean inlineSource, boolean isFileParse, boolean saveData, RubyInstanceConfig config) { this(runtime, lineNumber, extraPositionInformation, inlineSource, isFileParse, config.getCompatVersion(), saveData); this.isDebug = config.isParserDebug(); }
/** * Returns version information about JRuby and Ruby supported by this platform. * * @return version information. */ public String getSupportedRubyVersion() { return OutputStrings.getVersionString(provider.getRubyInstanceConfig().getCompatVersion()).trim(); }
/** * Returns version information about JRuby and Ruby supported by this platform. * * @return version information. */ public String getSupportedRubyVersion() { return OutputStrings.getVersionString(provider.getRubyInstanceConfig().getCompatVersion()).trim(); }
public String getCompatVersion() { return ruby.get().getInstanceConfig().getCompatVersion().name(); }
public ASTCompiler newCompiler() { if (getCompatVersion() == CompatVersion.RUBY1_8) { return new ASTCompiler(); } else { return new ASTCompiler19(); } }
public ASTCompiler newCompiler() { if (getCompatVersion() == CompatVersion.RUBY1_8) { return new ASTCompiler(); } else { return new ASTCompiler19(); } }
private void doShowVersion() { if (config.isShowVersion()) { config.getOutput().println(OutputStrings.getVersionString(config.getCompatVersion())); } }
private void doShowVersion() { if (config.isShowVersion()) { config.getOutput().println(OutputStrings.getVersionString(config.getCompatVersion())); } }
@JRubyMethod(name = "%", required = 1) public IRubyObject op_format(ThreadContext context, IRubyObject arg) { return opFormatCommon(context, arg, context.runtime.getInstanceConfig().getCompatVersion()); }
@JRubyMethod(name = "%", required = 1) public IRubyObject op_format(ThreadContext context, IRubyObject arg) { return opFormatCommon(context, arg, context.runtime.getInstanceConfig().getCompatVersion()); }
public boolean defineAnnotatedMethod(Method method, MethodFactory methodFactory) { JRubyMethod jrubyMethod = method.getAnnotation(JRubyMethod.class); if (jrubyMethod == null) return false; CompatVersion compatVersion = getRuntime().getInstanceConfig().getCompatVersion(); if (shouldBindMethod(compatVersion, jrubyMethod.compat())) { JavaMethodDescriptor desc = new JavaMethodDescriptor(method); DynamicMethod dynamicMethod = methodFactory.getAnnotatedMethod(this, desc); define(this, desc, method.getName(), dynamicMethod); return true; } return false; }
public boolean defineAnnotatedMethod(Method method, MethodFactory methodFactory) { JRubyMethod jrubyMethod = method.getAnnotation(JRubyMethod.class); if (jrubyMethod == null) return false; CompatVersion compatVersion = getRuntime().getInstanceConfig().getCompatVersion(); if (shouldBindMethod(compatVersion, jrubyMethod.compat())) { JavaMethodDescriptor desc = new JavaMethodDescriptor(method); DynamicMethod dynamicMethod = methodFactory.getAnnotatedMethod(this, desc); define(this, desc, method.getName(), dynamicMethod); return true; } return false; }
@SuppressWarnings("unchecked") void doInitialize(final Ruby runtime) { setOut( runtime.getOut() ); setErr( runtime.getErr() ); rubyENV = runtime.getENV(); compatVersion = runtime.getInstanceConfig().getCompatVersion(); }
public boolean defineAnnotatedMethod(String name, JavaMethodDescriptor desc, MethodFactory methodFactory) { JRubyMethod jrubyMethod = desc.anno; if (jrubyMethod == null) return false; CompatVersion compatVersion = getRuntime().getInstanceConfig().getCompatVersion(); if (shouldBindMethod(compatVersion, jrubyMethod.compat())) { DynamicMethod dynamicMethod = methodFactory.getAnnotatedMethod(this, desc); define(this, desc, name, dynamicMethod); return true; } return false; }
public void populate(RubyModule cls, Class clazz) { JavaMethod javaMethod; DynamicMethod moduleMethod; CompatVersion compatVersion = cls.getRuntime().getInstanceConfig().getCompatVersion(); Ruby runtime = cls.getRuntime(); if (compatVersion == CompatVersion.RUBY1_8 || compatVersion == CompatVersion.BOTH) { javaMethod = new org.jruby.RubyObject$INVOKER$i$0$0$initialize(cls, Visibility.PRIVATE); populateMethod(javaMethod, 0, "initialize", false, CallConfiguration.FrameNoneScopeNone, false, org.jruby.RubyObject.class, "initialize", org.jruby.runtime.builtin.IRubyObject.class, new Class[] {org.jruby.runtime.ThreadContext.class}); cls.addMethodAtBootTimeOnly("initialize", javaMethod); runtime.addBoundMethod("org.jruby.RubyObject","initialize","initialize"); } } static {
public boolean defineAnnotatedMethod(String name, JavaMethodDescriptor desc, MethodFactory methodFactory) { JRubyMethod jrubyMethod = desc.anno; if (jrubyMethod == null) return false; CompatVersion compatVersion = getRuntime().getInstanceConfig().getCompatVersion(); if (shouldBindMethod(compatVersion, jrubyMethod.compat())) { DynamicMethod dynamicMethod = methodFactory.getAnnotatedMethod(this, desc); define(this, desc, name, dynamicMethod); return true; } return false; }