rspec-openhab-scripting 0.0.11-java → 0.0.12-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/hooks.rb +2 -2
- data/lib/rspec/openhab/version.rb +1 -1
- data/lib/rspec-openhab-scripting.rb +7 -6
- metadata +4 -5
- 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: 826f0aaf58b9c4d57282365b2022123b632614c972c4236e4cbaef54f7112277
|
4
|
+
data.tar.gz: 04d5dbd825e8136d99ab46a435a7d1e073b4399efc9df9e787d871ebf604b7dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f21ccb93cb88bdcd1dc469b68c7d85c9e0ecb8c087be90cda85973d0435bf222428bfdc87956f14bab26f6b546627a74dab16d00640860ff61d9b8c9aac6389
|
7
|
+
data.tar.gz: 6bf658c0b46e17faed956322bfe950af70b232ec80579252c921ba59649ea70cfe350532d0388a4fe499e63f74b9c78768235169bf66927d4d2be11788148356
|
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
|
@@ -78,7 +78,6 @@ require_relative "rspec/openhab/dsl/timers/timer"
|
|
78
78
|
|
79
79
|
# RSpec additions
|
80
80
|
require "rspec/core"
|
81
|
-
require "rspec/openhab/dsl/rules/rspec"
|
82
81
|
require "rspec/openhab/items"
|
83
82
|
require "rspec/openhab/helpers"
|
84
83
|
require "rspec/openhab/hooks"
|
@@ -102,9 +101,11 @@ end
|
|
102
101
|
# load rules files
|
103
102
|
OPENHAB_AUTOMATION_PATH = "#{org.openhab.core.OpenHAB.config_folder}/automation/jsr223/ruby/personal"
|
104
103
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
104
|
+
RSpec::OpenHAB::SuspendRules.suspend_rules do
|
105
|
+
Dir["#{OPENHAB_AUTOMATION_PATH}/*.rb"].each do |f|
|
106
|
+
load f
|
107
|
+
rescue Exception => e
|
108
|
+
warn "Failed loading #{f}: #{e.inspect}"
|
109
|
+
warn e.backtrace
|
110
|
+
end
|
110
111
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.12
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
@@ -15,15 +15,15 @@ dependencies:
|
|
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,6 @@ 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/rspec.rb
|
199
198
|
- lib/rspec/openhab/dsl/timers/timer.rb
|
200
199
|
- lib/rspec/openhab/helpers.rb
|
201
200
|
- lib/rspec/openhab/hooks.rb
|