From 9e82ccef5eeb3228c7c958b049de4cbbf6b0d8a2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Mar 2011 21:49:33 -0400 Subject: v3, v2: bin/sisu*: v3 development ruby >=1.9.2p180; v2 maintenance ruby >=1.8.7 * bin/sisu* version checks --- bin/sisu3 | 93 +++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 64 insertions(+), 29 deletions(-) (limited to 'bin/sisu3') diff --git a/bin/sisu3 b/bin/sisu3 index 359a8744..e3246376 100644 --- a/bin/sisu3 +++ b/bin/sisu3 @@ -1,38 +1,73 @@ #!/usr/bin/env ruby # encoding: utf-8 #SiSU: copyright (C) 1997 - 2011 Ralph Amissah; License GPL, see appended program information -#raise "Please, use Ruby1.8 (1.8.4 or later), current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' -def check_sisu_stable_ruby_version? - rbv_sisu_stable='1.8.7' - if RUBY_VERSION < rbv_sisu_stable - raise "Please, use Ruby#{rbv_sisu_stable} or later, current Ruby #{RUBY_VERSION}" +begin + def check_sisu_stable_ruby_version? + rbv_sisu_stable='1.8.7' + if RUBY_VERSION < rbv_sisu_stable + raise "Please, use Ruby#{rbv_sisu_stable} or later, current Ruby #{RUBY_VERSION}" + else check_incompatible_ruby_build? + end end -end -def check_sisu_dev_ruby_version? - rbv_sisu_dev='1.9.2' - if RUBY_VERSION < rbv_sisu_dev - raise "Please, use Ruby#{rbv_sisu_dev} or later, current Ruby #{RUBY_VERSION}" + def check_sisu_dev_ruby_version? + rbv_sisu_dev='1.9.2' + if RUBY_VERSION < rbv_sisu_dev + raise "Please, use Ruby#{rbv_sisu_dev} or later, current Ruby #{RUBY_VERSION}" + else check_incompatible_ruby_build? + end end + def check_incompatible_ruby_build? + require 'rbconfig' + e=Config::CONFIG + if RUBY_VERSION == '1.9.2' \ + and e['PATCHLEVEL'].to_i < 180 + raise <