rspec-openhab-scripting 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '081cb83fa410165a1c537444929816faae13f6a7b6b55b003fef54035eedb57c'
4
- data.tar.gz: 93befbd99da2d87f0e251f919f541e7982cb438a559f305ce0113ea8afb6e9ea
3
+ metadata.gz: 88c81621c9a862e81d978ad293b6c3855e802c6f178484e10261a1c50033e152
4
+ data.tar.gz: 1dd7de9a0358d08e5006e208870af61f9d9c7b777e20cccccfb946b131b577bd
5
5
  SHA512:
6
- metadata.gz: 0e254f2f46b7fef68311e8c695d60a36e1986813edac3cdc61e232b7acdc69d25fc437fde7ef344e13d7a38306683d1a965442c73a360a73ac491b20b59ba35e
7
- data.tar.gz: 2ef07f698950dfc5b877566f4656c4cf7f3be4f05626b59c9740e362e132bb34d2ad6df613ce91fe366a8f834f78fea92a2e3f0cd808b161def17970f11a6d4d
6
+ metadata.gz: af8b2b36147936afff2729ce7050e2779910547cc91dc7e6463bf9fd8653b019f9db23b08cbfb526157dd46f02cff7b49defdb17de6aafa4e39c553d12dd551c
7
+ data.tar.gz: 2672ed326d2c88e5a10cd3144524383da703d48e16e79eda5c44ac7a9eaf6045e5266405458855fa124a5043a0ed14e2fc5a39f31f45a2202bd7877b0bee2906
@@ -217,8 +217,15 @@ module RSpec
217
217
  next unless metadata.uid.namespace == "autoupdate"
218
218
 
219
219
  to_add << metadata
220
+
221
+ # 3.2.0 can't remove single namespaces from the GenericMetadataProvider, so
222
+ # we have to remove everything from the item
223
+ unless gmp.respond_to?(:remove_metadata_by_namespace)
224
+ to_add.concat(gmp.all.select { |m2| m2.uid.item_name == metadata.uid.item_name })
225
+ gmp.remove_metadata(metadata.uid.item_name)
226
+ end
220
227
  end
221
- gmp.remove_metadata_by_namespace("autoupdate")
228
+ gmp.remove_metadata_by_namespace("autoupdate") if gmp.respond_to?(:remove_metadata_by_namespace)
222
229
 
223
230
  to_add.each do |m|
224
231
  if mmp.get(m.uid)
@@ -326,7 +326,6 @@ module RSpec
326
326
  org.openhab.core.thing.internal.console.FirmwareUpdateConsoleCommandExtension
327
327
  ],
328
328
  # the following bundles are blocked completely from starting
329
- "org.apache.felix.fileinstall" => nil,
330
329
  "org.apache.karaf.http.core" => nil,
331
330
  "org.apache.karaf.features.command" => nil,
332
331
  "org.apache.karaf.shell.commands" => nil,
@@ -545,15 +544,16 @@ module RSpec
545
544
  # import global variables and constants that openhab-scripting gem expects,
546
545
  # since we're going to be running it in this same VM
547
546
  def set_jruby_script_presets
548
- wait_for_service("org.openhab.core.automation.module.script.internal.ScriptExtensionManager") do |sem|
547
+ wait_for_service("org.openhab.core.automation.module.script.ScriptEngineFactory",
548
+ filter: "(service.config.description.uri=automation:jruby)") do |jrubyscripting|
549
+ # "org.openhab.core.automation.module.script.internal.ScriptExtensionManager") do |sem|
550
+ sem = ::OpenHAB::Core::OSGI.service(
551
+ "org.openhab.core.automation.module.script.internal.ScriptExtensionManager"
552
+ )
549
553
  # since we're not created by the ScriptEngineManager, this never gets set; manually set it
550
554
  $se = $scriptExtension = ScriptExtensionManagerWrapper.new(sem)
551
555
  scope_values = sem.find_default_presets("rspec")
552
556
  scope_values = scope_values.entry_set
553
- jrubyscripting = ::OpenHAB::Core::OSGI.services(
554
- "org.openhab.core.automation.module.script.ScriptEngineFactory",
555
- filter: "(service.pid=org.openhab.automation.jrubyscripting)"
556
- ).first
557
557
 
558
558
  %w[mapInstancePresets mapGlobalPresets].each do |method_name|
559
559
  method = jrubyscripting.class.java_class.get_declared_method(method_name, java.util.Map::Entry.java_class)
@@ -696,7 +696,7 @@ module RSpec
696
696
  startlevels = File.read(config_file)
697
697
  startlevels.sub!(",rules:refresh,rules:dslprovider", "")
698
698
 
699
- target_file = "#{oh_userdata}/etc/services.cfg"
699
+ target_file = "#{oh_userdata}/services.cfg"
700
700
  target_file_contents = File.read(target_file) if File.exist?(target_file)
701
701
  File.write(target_file, startlevels) unless target_file_contents == startlevels
702
702
  java.lang.System.set_property("openhab.servicecfg", target_file)
@@ -705,6 +705,9 @@ module RSpec
705
705
  # workaround for https://github.com/openhab/openhab-core/pull/3092
706
706
  def reset_start_level_service
707
707
  sls = ::OpenHAB::Core::OSGI.service("org.openhab.core.service.StartLevelService")
708
+ # no SLS yet? then we couldn't have hit the bug
709
+ return unless sls
710
+
708
711
  rs = ::OpenHAB::Core::OSGI.service("org.openhab.core.service.ReadyService")
709
712
  sls.class.field_reader :trackers, :markers
710
713
  rs.class.field_reader :trackers
@@ -732,6 +735,13 @@ module RSpec
732
735
  File.write("#{oh_userdata}/etc/org.apache.karaf.features.xml", <<~XML)
733
736
  <?xml version="1.0" encoding="UTF-8"?>
734
737
  <featuresProcessing xmlns="http://karaf.apache.org/xmlns/features-processing/v1.0.0" xmlns:f="http://karaf.apache.org/xmlns/features/v1.6.0">
738
+ <!-- From OpenHAB 3.2.0 -->
739
+ <bundleReplacements>
740
+ <bundle originalUri="mvn:org.ops4j.pax.logging/pax-logging-api/[0,2.0.13)" replacement="mvn:org.ops4j.pax.logging/pax-logging-api/2.0.13" mode="maven" />
741
+ <bundle originalUri="mvn:org.ops4j.pax.logging/pax-logging-log4j2/[0,2.0.13)" replacement="mvn:org.ops4j.pax.logging/pax-logging-log4j2/2.0.13" mode="maven" />
742
+ <bundle originalUri="mvn:org.ops4j.pax.logging/pax-logging-logback/[0,2.0.13)" replacement="mvn:org.ops4j.pax.logging/pax-logging-logback/2.0.13" mode="maven" />
743
+ </bundleReplacements>
744
+
735
745
  <blacklistedFeatures>
736
746
  <feature>openhab-runtime-ui</feature>
737
747
  <feature>openhab-core-ui*</feature>
@@ -757,6 +767,7 @@ module RSpec
757
767
  <f:feature>openhab-core-storage-json</f:feature>
758
768
  <f:feature>openhab-automation-jrubyscripting</f:feature>
759
769
  <f:feature>openhab-transport-http</f:feature>
770
+ <f:feature prerequisite="true">wrapper</f:feature>
760
771
  <f:bundle>mvn:org.openhab.core.bundles/org.openhab.core.karaf/#{version}</f:bundle>
761
772
  </feature>
762
773
  </replacement>
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module OpenHAB
5
- VERSION = "1.0.1"
5
+ VERSION = "1.0.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,184 +1,184 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-openhab-scripting
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2022-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: faraday
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
18
  version: '2.3'
20
- type: :runtime
19
+ name: faraday
21
20
  prerelease: false
21
+ type: :runtime
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.3'
27
27
  - !ruby/object:Gem::Dependency
28
- name: net-http-persistent
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
32
  version: '4.0'
34
- type: :runtime
33
+ name: net-http-persistent
35
34
  prerelease: false
35
+ type: :runtime
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '4.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: openhab-scripting
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - "~>"
46
45
  - !ruby/object:Gem::Version
47
46
  version: '4.42'
48
- type: :runtime
47
+ name: openhab-scripting
49
48
  prerelease: false
49
+ type: :runtime
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '4.42'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rspec-core
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - "~>"
60
59
  - !ruby/object:Gem::Version
61
60
  version: '3.11'
62
- type: :runtime
61
+ name: rspec-core
63
62
  prerelease: false
63
+ type: :runtime
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.11'
69
69
  - !ruby/object:Gem::Dependency
70
- name: timecop
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
72
  - - "~>"
74
73
  - !ruby/object:Gem::Version
75
74
  version: '0.9'
76
- type: :runtime
75
+ name: timecop
77
76
  prerelease: false
77
+ type: :runtime
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.9'
83
83
  - !ruby/object:Gem::Dependency
84
- name: irb
85
84
  requirement: !ruby/object:Gem::Requirement
86
85
  requirements:
87
86
  - - "~>"
88
87
  - !ruby/object:Gem::Version
89
88
  version: '1.4'
90
- type: :development
89
+ name: irb
91
90
  prerelease: false
91
+ type: :development
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.4'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rake
99
98
  requirement: !ruby/object:Gem::Requirement
100
99
  requirements:
101
100
  - - "~>"
102
101
  - !ruby/object:Gem::Version
103
102
  version: '13.0'
104
- type: :development
103
+ name: rake
105
104
  prerelease: false
105
+ type: :development
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '13.0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: rspec
113
112
  requirement: !ruby/object:Gem::Requirement
114
113
  requirements:
115
114
  - - "~>"
116
115
  - !ruby/object:Gem::Version
117
116
  version: '3.11'
118
- type: :development
117
+ name: rspec
119
118
  prerelease: false
119
+ type: :development
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '3.11'
125
125
  - !ruby/object:Gem::Dependency
126
- name: rubocop
127
126
  requirement: !ruby/object:Gem::Requirement
128
127
  requirements:
129
128
  - - "~>"
130
129
  - !ruby/object:Gem::Version
131
130
  version: '1.23'
132
- type: :development
131
+ name: rubocop
133
132
  prerelease: false
133
+ type: :development
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '1.23'
139
139
  - !ruby/object:Gem::Dependency
140
- name: rubocop-performance
141
140
  requirement: !ruby/object:Gem::Requirement
142
141
  requirements:
143
142
  - - "~>"
144
143
  - !ruby/object:Gem::Version
145
144
  version: '1.12'
146
- type: :development
145
+ name: rubocop-performance
147
146
  prerelease: false
147
+ type: :development
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '1.12'
153
153
  - !ruby/object:Gem::Dependency
154
- name: rubocop-rake
155
154
  requirement: !ruby/object:Gem::Requirement
156
155
  requirements:
157
156
  - - "~>"
158
157
  - !ruby/object:Gem::Version
159
158
  version: '0.6'
160
- type: :development
159
+ name: rubocop-rake
161
160
  prerelease: false
161
+ type: :development
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0.6'
167
167
  - !ruby/object:Gem::Dependency
168
- name: rubocop-rspec
169
168
  requirement: !ruby/object:Gem::Requirement
170
169
  requirements:
171
170
  - - "~>"
172
171
  - !ruby/object:Gem::Version
173
172
  version: '2.11'
174
- type: :development
173
+ name: rubocop-rspec
175
174
  prerelease: false
175
+ type: :development
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: '2.11'
181
- description:
181
+ description:
182
182
  email: cody@cutrer.us'
183
183
  executables: []
184
184
  extensions: []
@@ -210,7 +210,7 @@ licenses:
210
210
  - MIT
211
211
  metadata:
212
212
  rubygems_mfa_required: 'true'
213
- post_install_message:
213
+ post_install_message:
214
214
  rdoc_options: []
215
215
  require_paths:
216
216
  - lib
@@ -225,8 +225,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
225
  - !ruby/object:Gem::Version
226
226
  version: '0'
227
227
  requirements: []
228
- rubygems_version: 3.3.7
229
- signing_key:
228
+ rubygems_version: 3.2.29
229
+ signing_key:
230
230
  specification_version: 4
231
231
  summary: Library testing OpenHAB ruby rules with rspec.
232
232
  test_files: []