Skip to content

Commit

Permalink
fix gem version
Browse files Browse the repository at this point in the history
Signed-off-by: Jimmy Tanagra <[email protected]>
  • Loading branch information
jimtng committed Apr 15, 2023
1 parent 073a422 commit f06511e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/openhab/core/items/semantics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
2 changes: 1 addition & 1 deletion spec/openhab/core/items/semantics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f06511e

Please sign in to comment.