org.jruby.Ruby.getLoadService()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(153)

本文整理了Java中org.jruby.Ruby.getLoadService方法的一些代码示例,展示了Ruby.getLoadService的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.getLoadService方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:getLoadService

Ruby.getLoadService介绍

[英]Returns the loadService.
[中]返回loadService。

代码示例

代码示例来源:origin: org.jruby/jruby-complete

/**
   * @see org.jruby.runtime.GlobalVariable#get()
   */
  @Override
  public IRubyObject get() {
    return runtime.getLoadService().getLoadedFeatures();
  }
}

代码示例来源:origin: org.jruby/jruby-core

/**
   * @see org.jruby.runtime.GlobalVariable#get()
   */
  @Override
  public IRubyObject get() {
    return runtime.getLoadService().getLoadPath();
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
   * @see org.jruby.runtime.GlobalVariable#get()
   */
  @Override
  public IRubyObject get() {
    return runtime.getLoadService().getLoadedFeatures();
  }
}

代码示例来源:origin: org.jruby/jruby-complete

/**
   * @see org.jruby.runtime.GlobalVariable#get()
   */
  @Override
  public IRubyObject get() {
    return runtime.getLoadService().getLoadPath();
  }
}

代码示例来源:origin: org.jruby/jruby-core

/**
   * @see org.jruby.runtime.GlobalVariable#get()
   */
  @Override
  public IRubyObject get() {
    return runtime.getLoadService().getLoadedFeatures();
  }
}

代码示例来源:origin: org.jruby/jruby-complete

public void load(final Ruby runtime, boolean wrap) throws IOException {
    runtime.getLoadService().removeBuiltinLibrary("net/protocol.rb");
    runtime.getLoadService().removeInternalLoadedFeature("net/protocol.rb");
    runtime.getLoadService().require("net/protocol");

    NetProtocolBufferedIO.create(runtime);
  }
}// NetProtocolBufferedIOLibrary

代码示例来源:origin: org.jruby/jruby-core

/**
 * Get an instance of a JRuby runtime.
 * @param loadPaths additional load paths you wish to add
 * @param config a runtime configuration instance
 * @return an instance
 */
public static Ruby initialize(List<String> loadPaths, RubyInstanceConfig config) {
  Ruby runtime = Ruby.newInstance(config);
  runtime.getLoadService().addPaths(loadPaths);
  runtime.getLoadService().require("java");
  return runtime;
}

代码示例来源:origin: org.jruby/jruby-complete

/**
 * Get an instance of a JRuby runtime.
 * @param loadPaths additional load paths you wish to add
 * @param config a runtime configuration instance
 * @return an instance
 */
public static Ruby initialize(List<String> loadPaths, RubyInstanceConfig config) {
  Ruby runtime = Ruby.newInstance(config);
  runtime.getLoadService().addPaths(loadPaths);
  runtime.getLoadService().require("java");
  return runtime;
}

代码示例来源:origin: org.jruby/jruby-core

public void load(Ruby runtime, boolean wrap) throws IOException {
    RubyBigDecimal.createBigDecimal(runtime);

    // using load since this file does not exist in MRI
    runtime.getLoadService().load("jruby/bigdecimal.rb", false);
  }
}// BigDecimalLibrary

代码示例来源:origin: org.jruby/jruby-complete

public void load(Ruby runtime, boolean wrap) throws IOException {
    RubyBigDecimal.createBigDecimal(runtime);

    // using load since this file does not exist in MRI
    runtime.getLoadService().load("jruby/bigdecimal.rb", false);
  }
}// BigDecimalLibrary

代码示例来源:origin: org.jruby/jruby-complete

public void load(final Ruby runtime) {
    final String file = getFile().asJavaString();
    if (runtime.getLoadService().autoloadRequire(file)) {
      // Do not finish autoloading by cyclic autoload
      module.finishAutoload(baseName);
    }
  }
});

代码示例来源:origin: org.jruby/jruby-core

static RubyModule getTSort(final Ruby runtime) {
  if ( ! runtime.getObject().hasConstant("TSort") ) {
    runtime.getLoadService().require("tsort");
  }
  return runtime.getModule("TSort");
}

代码示例来源:origin: org.jruby/jruby-core

public void load(final Ruby runtime) {
    final String file = getFile().asJavaString();
    if (runtime.getLoadService().autoloadRequire(file)) {
      // Do not finish autoloading by cyclic autoload
      module.finishAutoload(baseName);
    }
  }
});

代码示例来源:origin: org.jruby/jruby-complete

static RubyModule getTSort(final Ruby runtime) {
  if ( ! runtime.getObject().hasConstant("TSort") ) {
    runtime.getLoadService().require("tsort");
  }
  return runtime.getModule("TSort");
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

private static IRubyObject loadCommon(IRubyObject fileName, Ruby runtime, IRubyObject[] args, Block block) {
  RubyString file = fileName.convertToString();
  boolean wrap = args.length == 2 ? args[1].isTrue() : false;
  runtime.getLoadService().load(file.toString(), wrap);
  return runtime.getTrue();
}

代码示例来源:origin: org.jruby/jruby-complete

public static void createDigestBubbleBabble(Ruby runtime) {
  runtime.getLoadService().require("digest");
  RubyModule Digest = runtime.getModule("Digest");
  RubyClass Base = Digest.getClass("Base");
  RubyClass MD5 = Digest.defineClassUnder("BubbleBabble", Base, Base.getAllocator());
  MD5.setInternalVariable("metadata", new Metadata("BubbleBabble", 64));
}

代码示例来源:origin: org.jruby/jruby-complete

public static void createDigestMD5(Ruby runtime) {
  runtime.getLoadService().require("digest");
  RubyModule Digest = runtime.getModule("Digest");
  RubyClass Base = Digest.getClass("Base");
  RubyClass MD5 = Digest.defineClassUnder("MD5", Base, Base.getAllocator());
  MD5.setInternalVariable("metadata", new Metadata("MD5", 64));
}

代码示例来源:origin: org.jruby/jruby-complete

public static void createDigestSHA1(Ruby runtime) {
  runtime.getLoadService().require("digest");
  RubyModule Digest = runtime.getModule("Digest");
  RubyClass Base = Digest.getClass("Base");
  RubyClass SHA1 = Digest.defineClassUnder("SHA1", Base, Base.getAllocator());
  SHA1.setInternalVariable("metadata", new Metadata("SHA1", 64));
}

代码示例来源:origin: org.jruby/jruby-complete

public static void createDigestRMD160(Ruby runtime) {
  runtime.getLoadService().require("digest");
  if(provider == null) {
    throw runtime.newLoadError("RMD160 not supported without BouncyCastle");
  }
  RubyModule Digest = runtime.getModule("Digest");
  RubyClass Base = Digest.getClass("Base");
  RubyClass RMD160 = Digest.defineClassUnder("RMD160", Base, Base.getAllocator());
  RMD160.setInternalVariable("metadata", new Metadata("RIPEMD160", 64));
}

代码示例来源:origin: org.jruby/jruby-complete

static RubyClass createSetClass(final Ruby runtime) {
  RubyClass Set = runtime.defineClass("Set", runtime.getObject(), ALLOCATOR);
  Set.setReifiedClass(RubySet.class);
  Set.includeModule(runtime.getEnumerable());
  Set.defineAnnotatedMethods(RubySet.class);
  Set.setMarshal(new SetMarshal(Set.getMarshal()));
  runtime.getLoadService().require("jruby/set.rb");
  return Set;
}

相关文章

Ruby类方法