Skip to content

Commit 2660181

Browse files
committed
Parametrize ruby version.
1 parent 8c5082f commit 2660181

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ all:
3131
# make install
3232
#
3333
test: dotnet/.ok erlang/.ok java/.ok python/.ok php/.ok ruby/.ok
34-
python test.py
34+
RUBYVER=$(RUBYVER) python test.py
3535

3636
R=http://www.rabbitmq.com/releases
3737
dotnet/.ok:
@@ -91,17 +91,18 @@ clean::
9191
(cd php && \
9292
rm -rf .ok lib)
9393

94+
RUBYVER:=1.9
9495
GEMSVER=1.8.5
9596
TOPDIR:=$(PWD)
9697
ruby/.ok:
9798
(cd ruby && \
9899
wget http://production.cf.rubygems.org/rubygems/rubygems-$(GEMSVER).tgz && \
99100
tar xzf rubygems-$(GEMSVER).tgz && \
100101
cd rubygems-$(GEMSVER) && \
101-
ruby1.8 setup.rb --prefix=$(TOPDIR)/ruby/gems && \
102+
ruby$(RUBYVER) setup.rb --prefix=$(TOPDIR)/ruby/gems && \
102103
cd .. && \
103104
rm -r rubygems-$(GEMSVER).tgz rubygems-$(GEMSVER) && \
104-
GEM_HOME=gems/gems RUBYLIB=gems/lib gems/bin/gem1.8 install amqp --version "0.8.0.rc13" && \
105+
GEM_HOME=gems/gems RUBYLIB=gems/lib gems/bin/gem$(RUBYVER) install amqp --version "0.8.0.rc13" && \
105106
touch .ok)
106107
clean::
107108
(cd ruby && \

test.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def gen(prog, arg="", **kwargs):
5959
'ruby': kwargs.get('ruby', prog),
6060
'php': kwargs.get('php', prog),
6161
'arg': arg,
62+
'rubyver': os.environ.get('RUBYVER', '1.8'),
6263
}
6364
return [
6465
('python', './venv/bin/python %(python)s.py %(arg)s' % ctx),
@@ -67,7 +68,7 @@ def gen(prog, arg="", **kwargs):
6768
'rabbitmq-client.jar %(java)s %(arg)s' % ctx),
6869
('dotnet', 'env MONO_PATH=lib/bin mono %(dotnet)s.exe %(arg)s' % ctx),
6970
('ruby', 'env RUBYOPT=-rubygems GEM_HOME=gems/gems RUBYLIB=gems/lib '
70-
'ruby1.8 %(ruby)s.rb %(arg)s' % ctx),
71+
'ruby%(rubyver)s %(ruby)s.rb %(arg)s' % ctx),
7172
('php', 'php %(php)s.php %(arg)s' % ctx),
7273
]
7374

0 commit comments

Comments
 (0)