public void propertyChange(PropertyChangeEvent evt) { if (evt.getSource() == RubyInstallation.getInstance() && evt.getPropertyName().equals("roots")) { resetCache(); } // if (evt.getSource() == this.evaluator && evt.getPropertyName().equals(PLATFORM_ACTIVE)) { // //Active platform was changed // resetCache (); // } // else if (evt.getSource() == this.platformManager && JavaPlatformManager.PROP_INSTALLED_PLATFORMS.equals(evt.getPropertyName()) && activePlatformName != null) { // //Platform definitions were changed, check if the platform was not resolved or deleted // if (this.isActivePlatformValid) { // if (RubyProjectUtil.getActivePlatform (this.activePlatformName) == null) { // //the platform was not removed // this.resetCache(); // } // } // else { // if (RubyProjectUtil.getActivePlatform (this.activePlatformName) != null) { // this.resetCache(); // } // } // } }
@Override public void propertyChange(PropertyChangeEvent evt) { if ((evt.getSource() == RubyInstallation.getInstance() && evt.getPropertyName().equals("roots")) || evt.getSource() == RubyPreferences.getInstance() && evt.getPropertyName().equals(RubyPreferences.VENDOR_GEMS_PROPERTY)) { resetCache(); } if (evt.getPropertyName().equals(SharedRubyProjectProperties.PLATFORM_ACTIVE)) { platform = RubyPlatformProvider.getPlatform((String) evt.getNewValue()); resetCache(); } if (evt.getPropertyName().equals(RequiredGems.REQUIRED_GEMS_TESTS_PROPERTY) && forTests) { requiredGems.setRequiredGems((String) evt.getNewValue()); resetCache(); } if (evt.getPropertyName().equals(RequiredGems.REQUIRED_GEMS_PROPERTY) && !forTests) { requiredGems.setRequiredGems((String) evt.getNewValue()); resetCache(); } }
private static RubyPlatform findDefaultPlatform() { String path = RubyInstallation.getInstance().getJRuby(); return path == null ? null : new RubyPlatform(PLATFORM_ID_DEFAULT, path, Info.forDefaultPlatform()); }
static Ruby getRuntime(final JTextComponent text) { final TextAreaReadline tar = new TextAreaReadline(text, " " + NbBundle.getMessage(IrbTopComponent.class, "IrbWelcome") + " \n\n"); // NOI18N // Ensure that ClassPath can find libraries etc. RubyInstallation.getInstance().setJRubyLoadPaths(); final PipedInputStream pipeIn = new PipedInputStream(); final RubyInstanceConfig config = new RubyInstanceConfig() {{ setInput(pipeIn); setOutput(new PrintStream(tar.getOutputStream())); setError(new PrintStream(tar.getOutputStream())); setObjectSpaceEnabled(false); //setArgv(args); }}; final Ruby runtime = Ruby.newInstance(config); runtime.getGlobalVariables().defineReadonly("$$", new ValueAccessor(runtime.newFixnum(System.identityHashCode(runtime)))); runtime.getLoadService().init(new ArrayList()); tar.hookIntoRuntime(runtime); return runtime; }