From f06511e523e4e472673324095549f7cec62a8dfe Mon Sep 17 00:00:00 2001 From: Jimmy Tanagra Date: Sun, 16 Apr 2023 02:21:06 +1000 Subject: [PATCH] fix gem version Signed-off-by: Jimmy Tanagra --- lib/openhab/core/items/semantics.rb | 2 +- spec/openhab/core/items/semantics_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/openhab/core/items/semantics.rb b/lib/openhab/core/items/semantics.rb index 2432461854..1a45a28e0b 100644 --- a/lib/openhab/core/items/semantics.rb +++ b/lib/openhab/core/items/semantics.rb @@ -485,7 +485,7 @@ def self.lookup(id, locale = nil) def self.const_missing(sym) logger.trace("const missing, performing Semantics Lookup for: #{sym}") # @deprecated OH3.4 - the Property tag had an ID of "MeasurementProperty" in OH3.4. This was corrected in OH4. - sym = :MeasurementProperty if sym == :Property && Gem::Version.new(Core::VERSION) < "4" + sym = :MeasurementProperty if sym == :Property && Gem::Version.new(Core::VERSION) < Gem::Version.new("4.0.0") org.openhab.core.semantics.SemanticTags.get_by_id(sym.to_s) &.then do |tag| diff --git a/spec/openhab/core/items/semantics_spec.rb b/spec/openhab/core/items/semantics_spec.rb index 3b803f5b35..fab10af991 100644 --- a/spec/openhab/core/items/semantics_spec.rb +++ b/spec/openhab/core/items/semantics_spec.rb @@ -396,7 +396,7 @@ def points(*args) end # @deprecated OH3.4 - guard can be removed in OH4 - if Gem::Version.new(OpenHAB::Core::VERSION) >= "4" + unless Gem::Version.new(OpenHAB::Core::VERSION) < Gem::Version.new("4.0.0") it "has a synonyms attribute" do expect(Semantics::LivingRoom.synonyms).to include("Living Rooms") end