openhab-jrubyscripting 5.0.0.rc8 → 5.0.0.rc10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openhab/dsl/version.rb +1 -1
- data/lib/openhab/rspec/helpers.rb +18 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b71441ccf4d26d841cd42529fad556867999688248cb2092181db424f6c24680
|
4
|
+
data.tar.gz: d8091c761ba0873af8e4cc5649e7719f381f2e8c013773a449acc61f3ba9e946
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8e393230f51b03764b40ec28b0fd26784fd0192d50d10a5908542f58f96f3cda8043298b5d57ff82583c09f9bd996f65b9c86bf3884641e838bc51e001f1c22
|
7
|
+
data.tar.gz: 1e103c8f5d8f1d452c7eee91f471240a516f553768cf38f3eb38b0fb8a8f737b4a422daa5964fe23705cdfafed14e620793a179379e52e794e2baa9ad804fad8
|
data/lib/openhab/dsl/version.rb
CHANGED
@@ -184,7 +184,7 @@ module OpenHAB
|
|
184
184
|
def autorequires
|
185
185
|
ENV["RUBYLIB"] ||= ""
|
186
186
|
ENV["RUBYLIB"] += ":" unless ENV["RUBYLIB"].empty?
|
187
|
-
ENV["RUBYLIB"] +=
|
187
|
+
ENV["RUBYLIB"] += rubylib_dirs.join(":")
|
188
188
|
|
189
189
|
$LOAD_PATH.unshift(*ENV["RUBYLIB"]
|
190
190
|
.split(File::PATH_SEPARATOR)
|
@@ -265,10 +265,15 @@ module OpenHAB
|
|
265
265
|
# @return [void]
|
266
266
|
#
|
267
267
|
def load_rules
|
268
|
-
automation_path = "#{org.openhab.core.OpenHAB.config_folder}/automation/
|
268
|
+
automation_path = "#{org.openhab.core.OpenHAB.config_folder}/automation/ruby"
|
269
|
+
lib_dirs = rubylib_dirs.map { |d| File.join(d, "") }
|
270
|
+
lib_dirs << File.join(gem_home, "")
|
269
271
|
|
270
272
|
SuspendRules.suspend_rules do
|
271
273
|
files = Dir["#{automation_path}/**/*.rb"]
|
274
|
+
files.reject! do |f|
|
275
|
+
lib_dirs.any? { |l| f.start_with?(l) }
|
276
|
+
end
|
272
277
|
files.sort_by { |f| [get_start_level(f), f] }.each do |f|
|
273
278
|
load f
|
274
279
|
rescue Exception => e
|
@@ -376,8 +381,17 @@ module OpenHAB
|
|
376
381
|
ca.get_configuration("org.openhab.automation.jrubyscripting", nil)&.properties
|
377
382
|
end
|
378
383
|
|
379
|
-
def
|
380
|
-
jrubyscripting_config&.get("
|
384
|
+
def gem_home
|
385
|
+
gem_home = jrubyscripting_config&.get("gem_home")
|
386
|
+
return "#{org.openhab.core.OpenHAB.config_folder}/automation/ruby/.gem" unless gem_home
|
387
|
+
|
388
|
+
# strip everything after the first {
|
389
|
+
gem_home.split("{", 2).first
|
390
|
+
end
|
391
|
+
|
392
|
+
def rubylib_dirs
|
393
|
+
jrubyscripting_config&.get("rubylib")&.split(File::PATH_SEPARATOR) ||
|
394
|
+
["#{org.openhab.core.OpenHAB.config_folder}/automation/ruby/lib"]
|
381
395
|
end
|
382
396
|
|
383
397
|
def get_start_level(file)
|