[jrubyscripting] check if gems are installed before installing them (#13151)

* [jrubyscripting] check if gems are installed before installing them

this avoids unecessary downloads and overwrites, or even more importantly
errors if the GEM_HOME is not writable by the openhab user.

this also adds a configuration option for if you want to check for
updates every time configuration is applied (or openhab restarts). this
is useful if your OpenHAB system can't access the internet regularly.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
This commit is contained in:
Cody Cutrer
2022-08-07 10:02:34 -06:00
committed by GitHub
parent 7a31cb2785
commit 70eb7dc511
4 changed files with 71 additions and 31 deletions

View File

@@ -1,7 +1,11 @@
automation.config.jruby.check_update.label = Check for Gem Updates
automation.config.jruby.check_update.description = Check RubyGems for updates to the above gems when OpenHAB starts or JRuby settings are changed. Otherwise it will try to fulfill the requirements with locally installed gems, and you can manage them yourself with an external Ruby by setting the same GEM_HOME.
automation.config.jruby.check_update.option.true = Check For Updates
automation.config.jruby.check_update.option.false = Do Not Check For Updates
automation.config.jruby.gem_home.label = GEM_HOME
automation.config.jruby.gem_home.description = Location Ruby Gems will be installed and loaded, directory will be created if missing and gem installs are specified. Defaults to "OPENHAB_CONF/scripts/lib/ruby/gem_home" when not specified.
automation.config.jruby.gem_home.description = Location Ruby Gems will be installed and loaded, directory will be created if missing and gem installs are specified. Defaults to "<tt>OPENHAB_CONF/scripts/lib/ruby/gem_home</tt>" when not specified.
automation.config.jruby.gems.label = Ruby Gems
automation.config.jruby.gems.description = A comma separated list of Ruby Gems to install.
automation.config.jruby.gems.description = A comma separated list of Ruby Gems to install. Versions may be constrained by separating with an <tt>=</tt> and then the standard RubyGems version constraint, such as "<tt>openhab-scripting=~>4.0</tt>".
automation.config.jruby.group.environment.label = Ruby Environment
automation.config.jruby.group.environment.description = This group defines Ruby's environment.
automation.config.jruby.group.gems.label = Ruby Gems
@@ -9,20 +13,20 @@ automation.config.jruby.group.gems.description = This group defines the list of
automation.config.jruby.group.system.label = System Properties
automation.config.jruby.group.system.description = This group defines JRuby system properties.
automation.config.jruby.local_context.label = Context Instance Type
automation.config.jruby.local_context.description = The local context holds Ruby runtime, name-value pairs for sharing variables between Java and Ruby. See https://github.com/jruby/jruby/wiki/RedBridge#Context_Instance_Type for options and details.
automation.config.jruby.local_context.description = The local context holds Ruby runtime, name-value pairs for sharing variables between Java and Ruby. See <a href="https://github.com/jruby/jruby/wiki/RedBridge#Context_Instance_Type">the documentation</a> for options and details.
automation.config.jruby.local_context.option.singleton = Singleton
automation.config.jruby.local_context.option.threadsafe = ThreadSafe
automation.config.jruby.local_context.option.singlethread = SingleThread
automation.config.jruby.local_context.option.concurrent = Concurrent
automation.config.jruby.local_variable.label = Local Variable Behavior
automation.config.jruby.local_variable.description = Defines how variables are shared between Ruby and Java. See https://github.com/jruby/jruby/wiki/RedBridge#local-variable-behavior-options for options and details.
automation.config.jruby.local_variable.description = Defines how variables are shared between Ruby and Java. See <a href="https://github.com/jruby/jruby/wiki/RedBridge#local-variable-behavior-options">the documentation</a> for options and details.
automation.config.jruby.local_variable.option.transient = Transient
automation.config.jruby.local_variable.option.persistent = Persistent
automation.config.jruby.local_variable.option.global = Global
automation.config.jruby.require.label = Require Scripts
automation.config.jruby.require.description = A comma separated list of script names to be required by the JRuby Scripting Engine before running user scripts.
automation.config.jruby.rubylib.label = RUBYLIB
automation.config.jruby.rubylib.description = Search path for user libraries. Separate each path with a colon (semicolon in Windows). Defaults to "OPENHAB_CONF/automation/lib/ruby" when not specified.
automation.config.jruby.rubylib.description = Search path for user libraries. Separate each path with a colon (semicolon in Windows). Defaults to "<tt>OPENHAB_CONF/automation/lib/ruby</tt>" when not specified.
# service