@Deprecated public void setLoadPaths(List loadPaths) { if (config != null) { config.setLoadPaths(loadPaths); } }
@Deprecated public void setLoadPaths(List loadPaths) { if (config != null) { config.setLoadPaths(loadPaths); } }
/** * Changes a list of load paths Ruby scripts/libraries. The default value * is an empty array. If no paths is given, the list is created from * java.class.path System property. This value can be set by * org.jruby.embed.class.path System property, also. * Call this method before you use put/get, runScriptlet, and parse methods so that * the given paths will be used. * * @since JRuby 1.5.0. * * @param paths a new list of load paths. */ public void setLoadPaths(List<String> paths) { provider.getRubyInstanceConfig().setLoadPaths(paths); }
/** * Changes a list of load paths Ruby scripts/libraries. The default value * is an empty array. If no paths is given, the list is created from * java.class.path System property. This value can be set by * org.jruby.embed.class.path System property, also. * Call this method before you use put/get, runScriptlet, and parse methods so that * the given paths will be used. * * @since JRuby 1.5.0. * * @param paths a new list of load paths. */ public void setLoadPaths(List<String> paths) { provider.getRubyInstanceConfig().setLoadPaths(paths); }
/** * Changes a list of load paths Ruby scripts/libraries. The default value * is an empty array. If no paths is given, the list is created from * java.class.path System property. This value can be set by * org.jruby.embed.class.path System property, also. * Call this method before you use put/get, runScriptlet, and parse methods so that * the given paths will be used. * * @since JRuby 1.5.0. * * @param paths a new list of load paths. */ public void setLoadPaths(List<String> paths) { provider.getRubyInstanceConfig().setLoadPaths(paths); }
/** * Changes a list of load paths Ruby scripts/libraries. The default value * is an empty array. If no paths is given, the list is created from * java.class.path System property. This value can be set by * org.jruby.embed.class.path System property, also. * Call this method before you use put/get, runScriptlet, and parse methods so that * the given paths will be used. * * @since JRuby 1.5.0. * * @param paths a new list of load paths. */ public void setLoadPaths(List<String> paths) { provider.getRubyInstanceConfig().setLoadPaths(paths); }
JRubyMain(String bundleDisableSharedGems, String currentDirectory, String jrubyHome, RubyInstanceConfig config) { super(config); // TODO have property to disable hard exit - see warbler config.setHardExit(true); config.setCurrentDirectory(currentDirectory + "/"); config.setJRubyHome(jrubyHome); // for jruby 1.7.x add the current directory explicitly to LOAD_PATH config.setLoadPaths(Arrays.asList(currentDirectory + "/")); Map<String, String> env = new HashMap<String, String>(System.getenv()); // we assume the embedded jars are placed in jars directory env.put("JARS_HOME", currentDirectory + "/jars"); // we assume the embedded gems are placed at the root of the "archive" env.put("GEM_PATH", currentDirectory + "/"); // make sure we do not inherit it from outside // NOTE: setting it to GEM_PATH will break the extractingMain cases env.put("GEM_HOME", jrubyHome + "/lib/ruby/gems/shared"); if (bundleDisableSharedGems != null) { // for spawning jruby we need bundler to tell to // NOT clean up the load Path env.put("BUNDLE_DISABLE_SHARED_GEMS", bundleDisableSharedGems); } config.setEnvironment(env); // older jruby-1.7.x does need this config.setLoader(JRubyMain.class.getClassLoader()); }
JRubyMain(String bundleDisableSharedGems, String currentDirectory, String jrubyHome, RubyInstanceConfig config) { super(config); // TODO have property to disable hard exit - see warbler config.setHardExit(true); config.setCurrentDirectory(currentDirectory + "/"); config.setJRubyHome(jrubyHome); // for jruby 1.7.x add the current directory explicitly to LOAD_PATH config.setLoadPaths(Arrays.asList(currentDirectory + "/")); Map<String, String> env = new HashMap<String, String>(System.getenv()); // we assume the embedded jars are placed in jars directory env.put("JARS_HOME", currentDirectory + "/jars"); // we assume the embedded gems are placed at the root of the "archive" env.put("GEM_PATH", currentDirectory + "/"); // make sure we do not inherit it from outside // NOTE: setting it to GEM_PATH will break the extractingMain cases env.put("GEM_HOME", jrubyHome + "/lib/ruby/gems/shared"); if (bundleDisableSharedGems != null) { // for spawning jruby we need bundler to tell to // NOT clean up the load Path env.put("BUNDLE_DISABLE_SHARED_GEMS", bundleDisableSharedGems); } config.setEnvironment(env); // older jruby-1.7.x does need this config.setLoader(JRubyMain.class.getClassLoader()); }
private void initConfig() throws URISyntaxException, UnsupportedEncodingException { List<String> paths = SystemPropertyCatcher.findLoadPaths(); provider.getRubyInstanceConfig().setLoadPaths(paths); String home = SystemPropertyCatcher.findJRubyHome(this); if (home != null) { provider.getRubyInstanceConfig().setJRubyHome(home); } provider.getRubyInstanceConfig().setScriptFileName("<script>"); }
private void initConfig() throws URISyntaxException, UnsupportedEncodingException { List<String> paths = SystemPropertyCatcher.findLoadPaths(); provider.getRubyInstanceConfig().setLoadPaths(paths); String home = SystemPropertyCatcher.findJRubyHome(this); if (home != null) { provider.getRubyInstanceConfig().setJRubyHome(home); } provider.getRubyInstanceConfig().setScriptFileName("<script>"); }