]> git.openstreetmap.org Git - chef.git/blob - cookbooks/chef/libraries/compare_versions.rb
Use systemd to manage serial getty on 16.04 machines
[chef.git] / cookbooks / chef / libraries / compare_versions.rb
1 class Chef
2   class Util
3     def self.compare_versions(a, b)
4       if a.is_a?(String)
5         a = a.split(".").map(&:to_i)
6       end
7
8       if b.is_a?(String)
9         b = b.split(".").map(&:to_i)
10       end
11
12       a <=> b
13     end
14   end
15 end