From 24fe856b0cb4003a54ffe6c901430a38b95a641b Mon Sep 17 00:00:00 2001 From: passbe Date: Mon, 24 Oct 2011 10:14:01 +0000 Subject: [PATCH] Module config max_ver now has the ability to use 'latest' git-svn-id: https://beef.googlecode.com/svn/trunk@1381 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- core/module.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/module.rb b/core/module.rb index 5201c3a80..8e027e49a 100644 --- a/core/module.rb +++ b/core/module.rb @@ -221,7 +221,7 @@ module Module end end if subv.key?('max_ver') - if subv['max_ver'].kind_of? Fixnum and opts['ver'].to_i <= subv['max_ver'] + if (subv['max_ver'].kind_of? Fixnum and opts['ver'].to_i <= subv['max_ver']) or subv['max_ver'] == "latest" rating += 1 else break @@ -256,6 +256,8 @@ module Module end if rating != 1 results << {'rating' => rating, 'const' => k} + else + results << {'rating' => 2, 'const' => k} end end end @@ -357,7 +359,7 @@ module Module def self.match_target_browser_spec(v) browser = {} if v.class == Hash - if v.key?('max_ver') and (v['max_ver'].is_a?(Fixnum) or v['max_ver'].is_a?(Float)) + if v.key?('max_ver') and (v['max_ver'].is_a?(Fixnum) or v['max_ver'].is_a?(Float) or v['max_ver'] == "latest") browser['max_ver'] = v['max_ver'] end if v.key?('min_ver') and (v['min_ver'].is_a?(Fixnum) or v['min_ver'].is_a?(Float))