From 9f7559e8df98355ddf66dcbfa6934ee3436a0b06 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 18 Aug 2011 17:13:50 +0300 Subject: [PATCH] Fix creating Gem::Version for python version which has non-numeric characters i.e 2.7.1+ --- Rakefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 54b3a50..40c1b95 100644 --- a/Rakefile +++ b/Rakefile @@ -61,10 +61,13 @@ task :compile, [:version] do |t, options| print "Checking for Python..." version = `python --version 2>&1` + version_number = version.split.last.match("[0-9.]+")[0] crash "Python not found!" if version.split.first != "Python" - crash "Python 3.x is unsupported by V8!" if Gem::Version.new(version.split.last) >= Gem::Version.new(3) - crash "Python 2.4+ is required by V8!" if Gem::Version.new(version.split.last) < Gem::Version.new("2.4") - puts version.split.last + crash "Python 3.x is unsupported by V8!" if + Gem::Version.new(version_number) >= + Gem::Version.new(3) + crash "Python 2.4+ is required by V8!" if Gem::Version.new(version_number) < Gem::Version.new("2.4") + puts version_number end puts "Compiling V8 (#{options.version})..."