rspec-openhab-scripting 0.0.11-java → 0.0.14-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rspec/openhab/api.rb +1 -3
- data/lib/rspec/openhab/dsl/rules/triggers/watch.rb +11 -0
- data/lib/rspec/openhab/dsl/timers/timer.rb +1 -1
- data/lib/rspec/openhab/helpers.rb +1 -1
- data/lib/rspec/openhab/hooks.rb +2 -2
- data/lib/rspec/openhab/version.rb +1 -1
- data/lib/rspec-openhab-scripting.rb +8 -6
- metadata +6 -6
- data/lib/rspec/openhab/dsl/rules/rspec.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b18cd9bfb33b5ddab9ba78ef3e83f9b5572aebc17ade365599bc9fae9ebd9bc
|
4
|
+
data.tar.gz: fab8152b3c09bcb23ae2af7ce6fb5a8380d97190ce7a3153e156d26d3c405d8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cf4905df6306b1a85db73ea49d164d245ce1510c76934bbf74d33e8941227a158ea3bf009b80fb9a2db726a8bf1d5dfd6b2948acc9f622096f39873464b2718
|
7
|
+
data.tar.gz: ffd0784c0995bac8a2188d6a8d5f7617422f441237affc07dc81782a89a54bd14f0de5709946b976fe9fa690a23b1ed8d35ffcb0b77a9d9a13661c5b89e8556e
|
data/lib/rspec/openhab/api.rb
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "faraday"
|
4
4
|
|
5
5
|
module OpenHAB
|
6
6
|
class API
|
7
7
|
def initialize(url)
|
8
8
|
@faraday = Faraday.new(url) do |f|
|
9
|
-
f.request :retry
|
10
9
|
f.response :raise_error
|
11
10
|
f.response :json
|
12
|
-
f.adapter :net_http_persistent
|
13
11
|
f.path_prefix = "/rest/"
|
14
12
|
end
|
15
13
|
end
|
data/lib/rspec/openhab/hooks.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.configure do |config|
|
4
|
-
config.before(:all) { OpenHAB::DSL::Timers.timer_manager.cancel_all }
|
5
|
-
|
6
4
|
config.before do
|
7
5
|
suspend_rules do
|
8
6
|
$ir.for_each do |_provider, item|
|
7
|
+
next if item.is_a?(GroupItem) # groups only have calculated states
|
8
|
+
|
9
9
|
item.state = NULL unless item.raw_state == NULL
|
10
10
|
end
|
11
11
|
end
|
@@ -75,10 +75,10 @@ require "rspec/openhab/core/cron_scheduler"
|
|
75
75
|
|
76
76
|
# override several timer methods
|
77
77
|
require_relative "rspec/openhab/dsl/timers/timer"
|
78
|
+
require_relative "rspec/openhab/dsl/rules/triggers/watch"
|
78
79
|
|
79
80
|
# RSpec additions
|
80
81
|
require "rspec/core"
|
81
|
-
require "rspec/openhab/dsl/rules/rspec"
|
82
82
|
require "rspec/openhab/items"
|
83
83
|
require "rspec/openhab/helpers"
|
84
84
|
require "rspec/openhab/hooks"
|
@@ -102,9 +102,11 @@ end
|
|
102
102
|
# load rules files
|
103
103
|
OPENHAB_AUTOMATION_PATH = "#{org.openhab.core.OpenHAB.config_folder}/automation/jsr223/ruby/personal"
|
104
104
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
105
|
+
RSpec::OpenHAB::SuspendRules.suspend_rules do
|
106
|
+
Dir["#{OPENHAB_AUTOMATION_PATH}/*.rb"].each do |f|
|
107
|
+
load f
|
108
|
+
rescue Exception => e
|
109
|
+
warn "Failed loading #{f}: #{e.inspect}"
|
110
|
+
warn e.backtrace
|
111
|
+
end
|
110
112
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-openhab-scripting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: '
|
19
|
-
name:
|
18
|
+
version: '2.3'
|
19
|
+
name: faraday
|
20
20
|
prerelease: false
|
21
21
|
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
@@ -195,7 +195,7 @@ files:
|
|
195
195
|
- lib/rspec/openhab/core/osgi.rb
|
196
196
|
- lib/rspec/openhab/core/script_handling.rb
|
197
197
|
- lib/rspec/openhab/dsl/imports.rb
|
198
|
-
- lib/rspec/openhab/dsl/rules/
|
198
|
+
- lib/rspec/openhab/dsl/rules/triggers/watch.rb
|
199
199
|
- lib/rspec/openhab/dsl/timers/timer.rb
|
200
200
|
- lib/rspec/openhab/helpers.rb
|
201
201
|
- lib/rspec/openhab/hooks.rb
|