projects
/
chef.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Compare kernel versions correctly
[chef.git]
/
cookbooks
/
chef
/
libraries
/
compare_versions.rb
1
class Chef
2
class Util
3
def self.compare_versions(a, b)
4
if a.kind_of?(String)
5
a = a.split(".").map { |c| c.to_i }
6
end
7
8
if b.kind_of?(String)
9
b = b.split(".").map { |c| c.to_i }
10
end
11
12
a <=> b
13
end
14
end
15
end