X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/935838c4747aac13b9c626c8728b5bf1fd4d6e4d..65cf383861b6a6b2568f22aab2e2f0b34a5198e0:/cookbooks/chef/libraries/compare_versions.rb?ds=sidebyside diff --git a/cookbooks/chef/libraries/compare_versions.rb b/cookbooks/chef/libraries/compare_versions.rb index d2ccf8a08..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 { |c| c.to_i } - end + a = a.split(".").map(&:to_i) if a.is_a?(String) - if b.kind_of?(String) - b = b.split(".").map { |c| c.to_i } - end + b = b.split(".").map(&:to_i) if b.is_a?(String) a <=> b end