X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/3a4b1c2078cd515e93a5f1bf8967f380fbd1646f..d18cd92a98384aebf371376383a4408485f12374:/cookbooks/chef/libraries/compare_versions.rb?ds=inline diff --git a/cookbooks/chef/libraries/compare_versions.rb b/cookbooks/chef/libraries/compare_versions.rb index 2f5d60baf..45653935f 100644 --- a/cookbooks/chef/libraries/compare_versions.rb +++ b/cookbooks/chef/libraries/compare_versions.rb @@ -1,13 +1,9 @@ class Chef class Util def self.compare_versions(a, b) - if a.kind_of?(String) - a = a.split(".").map(&:to_i) - end + a = a.split(".").map(&:to_i) if a.is_a?(String) - if b.kind_of?(String) - b = b.split(".").map(&:to_i) - end + b = b.split(".").map(&:to_i) if b.is_a?(String) a <=> b end