// difficult ways to debug.
private static final Set<String> FILTERED_PRESETS = Set.of("File", "Files", "Path", "Paths");
private static final Set<String> INSTANCE_PRESETS = Set.of();
- private static final Set<String> GLOBAL_PRESETS = Set.of("scriptExtension", "automationManager", "ruleRegistry",
- "items", "voice", "rules", "things", "events", "itemRegistry", "ir", "actions", "se", "audio",
- "lifecycleTracker");
private final javax.script.ScriptEngineFactory factory = new org.jruby.embed.jsr223.JRubyEngineFactory();
// Adds $ in front of a set of variables so that Ruby recognizes them as global variables
private static Map.Entry<String, Object> mapGlobalPresets(Map.Entry<String, Object> entry) {
- if (GLOBAL_PRESETS.contains(entry.getKey())) {
+ if (Character.isLowerCase(entry.getKey().charAt(0)) && !(entry.getValue() instanceof Class)
+ && !(entry.getValue() instanceof Enum)) {
return Map.entry("$" + entry.getKey(), entry.getValue());
} else {
return entry;