summaryrefslogtreecommitdiff
path: root/lib/chef/version_class.rb
diff options
context:
space:
mode:
authorXabier de Zuazo <xabier@zuazo.org>2013-02-08 11:59:54 +0100
committerBryan McLellan <btm@opscode.com>2013-04-11 13:04:33 -0700
commit66d5485de8342a1e6f719547222c98dd6012908a (patch)
treef6b1487de8dce80f12bbc7c481a01a837cf81af7 /lib/chef/version_class.rb
parentdcfeebe24ab048d555fd70ff5f22fae868548ab4 (diff)
downloadchef-66d5485de8342a1e6f719547222c98dd6012908a.tar.gz
[CHEF-3919] Added support for setting ">", "<", "<=" ... versions in Chef::Platform
Diffstat (limited to 'lib/chef/version_class.rb')
-rw-r--r--lib/chef/version_class.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chef/version_class.rb b/lib/chef/version_class.rb
index e9879274ad..36ff05a46d 100644
--- a/lib/chef/version_class.rb
+++ b/lib/chef/version_class.rb
@@ -60,6 +60,8 @@ class Chef
[ $1.to_i, $2.to_i, $3.to_i ]
when /^(\d+)\.(\d+)$/
[ $1.to_i, $2.to_i, 0 ]
+ when /^(\d+)$/
+ [ $1.to_i, 0, 0 ]
else
msg = "'#{str.to_s}' does not match 'x.y.z' or 'x.y'"
raise Chef::Exceptions::InvalidCookbookVersion.new( msg )