X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/3a4d52bd4c0f8e6ae7679145846b7bc7845d8ace..66c8810de3626826ca758bf47b0def637254c97c:/cookbooks/chef/libraries/compare_versions.rb diff --git a/cookbooks/chef/libraries/compare_versions.rb b/cookbooks/chef/libraries/compare_versions.rb index cf6ab1ea2..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.is_a?(String) - a = a.split(".").map(&:to_i) - end + a = a.split(".").map(&:to_i) if a.is_a?(String) - if b.is_a?(String) - b = b.split(".").map(&:to_i) - end + b = b.split(".").map(&:to_i) if b.is_a?(String) a <=> b end