]> git.basschouten.com Git - openhab-addons.git/commit
[jrubyscripting] Implement dependency tracking (#13810)
authorCody Cutrer <cody@cutrer.us>
Mon, 5 Dec 2022 07:19:51 +0000 (00:19 -0700)
committerGitHub <noreply@github.com>
Mon, 5 Dec 2022 07:19:51 +0000 (08:19 +0100)
commit2382fadaaa7e5421109a2d0eb448b83c92b96f32
tree257c2abd6d7f011b7ec052ee3b618718da0e0339
parenta0ac57cfd9b0d9ad937004f1a16c00565e5658cb
[jrubyscripting] Implement dependency tracking (#13810)

* [jrubyscripting] implement dependency tracking

watchers had to be refactored similar to jsscripting.
it supports watching any directory referenced from RUBYLIB,
as well as the gem home. it properly excludes lib and gem home
(as well as other gem homes if you have multiple jruby versions
installed) from loading as regular scripts.

this is a breaking change if you don't have RUBYLIB explicitly
configured, and you are using the old default directory.

it's expected that the detection of what files and gems any
given script uses will be self-identified by the script, presumably
by the helper library.

JRubyScriptEngineConfiguration was largely refactored as part of this.
 * CONFIGURATION_PARAMETERS was renamed, and is no longer static, since
   it's modified every time the configuration is changed
 * OptionalConfigurationElement was simplified since default values
   are always provided now. this also simplified lots of other code
   that accesses the current settings.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
bundles/org.openhab.automation.jrubyscripting/README.md
bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal/JRubyScriptEngineConfiguration.java
bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal/JRubyScriptEngineFactory.java
bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal/watch/BidiSetBag.java [new file with mode: 0644]
bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal/watch/JRubyDependencyTracker.java [new file with mode: 0644]
bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal/watch/JRubyGemWatchService.java [new file with mode: 0644]
bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal/watch/JRubyLibWatchService.java [new file with mode: 0644]
bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal/watch/JRubyScriptFileWatcher.java [new file with mode: 0644]
bundles/org.openhab.automation.jrubyscripting/src/main/resources/OH-INF/config/config.xml
bundles/org.openhab.automation.jrubyscripting/src/main/resources/OH-INF/i18n/jruby.properties