From 26601811493f441e40b6fb4e0747e832d49cf8dc Mon Sep 17 00:00:00 2001 From: Marek Majkowski Date: Tue, 5 Jul 2011 10:47:53 +0100 Subject: [PATCH] Parametrize ruby version. --- Makefile | 7 ++++--- test.py | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4b322ecf..bb493631 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ all: # make install # test: dotnet/.ok erlang/.ok java/.ok python/.ok php/.ok ruby/.ok - python test.py + RUBYVER=$(RUBYVER) python test.py R=http://www.rabbitmq.com/releases dotnet/.ok: @@ -91,6 +91,7 @@ clean:: (cd php && \ rm -rf .ok lib) +RUBYVER:=1.9 GEMSVER=1.8.5 TOPDIR:=$(PWD) ruby/.ok: @@ -98,10 +99,10 @@ ruby/.ok: wget http://production.cf.rubygems.org/rubygems/rubygems-$(GEMSVER).tgz && \ tar xzf rubygems-$(GEMSVER).tgz && \ cd rubygems-$(GEMSVER) && \ - ruby1.8 setup.rb --prefix=$(TOPDIR)/ruby/gems && \ + ruby$(RUBYVER) setup.rb --prefix=$(TOPDIR)/ruby/gems && \ cd .. && \ rm -r rubygems-$(GEMSVER).tgz rubygems-$(GEMSVER) && \ - GEM_HOME=gems/gems RUBYLIB=gems/lib gems/bin/gem1.8 install amqp --version "0.8.0.rc13" && \ + GEM_HOME=gems/gems RUBYLIB=gems/lib gems/bin/gem$(RUBYVER) install amqp --version "0.8.0.rc13" && \ touch .ok) clean:: (cd ruby && \ diff --git a/test.py b/test.py index eb1ec839..344f0710 100755 --- a/test.py +++ b/test.py @@ -59,6 +59,7 @@ def gen(prog, arg="", **kwargs): 'ruby': kwargs.get('ruby', prog), 'php': kwargs.get('php', prog), 'arg': arg, + 'rubyver': os.environ.get('RUBYVER', '1.8'), } return [ ('python', './venv/bin/python %(python)s.py %(arg)s' % ctx), @@ -67,7 +68,7 @@ def gen(prog, arg="", **kwargs): 'rabbitmq-client.jar %(java)s %(arg)s' % ctx), ('dotnet', 'env MONO_PATH=lib/bin mono %(dotnet)s.exe %(arg)s' % ctx), ('ruby', 'env RUBYOPT=-rubygems GEM_HOME=gems/gems RUBYLIB=gems/lib ' - 'ruby1.8 %(ruby)s.rb %(arg)s' % ctx), + 'ruby%(rubyver)s %(ruby)s.rb %(arg)s' % ctx), ('php', 'php %(php)s.php %(arg)s' % ctx), ]