]> git.openstreetmap.org Git - chef.git/blob - cookbooks/chef/libraries/compare_versions.rb
build(deps): bump kitchen-dokken from 2.17.2 to 2.17.3
[chef.git] / cookbooks / chef / libraries / compare_versions.rb
1 class Chef
2   class Util
3     def self.compare_versions(a, b)
4       a = a.split(".").map(&:to_i) if a.is_a?(String)
5
6       b = b.split(".").map(&:to_i) if b.is_a?(String)
7
8       a <=> b
9     end
10   end
11 end