Skip to content

Commit

Permalink
Parametrize ruby version.
Browse files Browse the repository at this point in the history
  • Loading branch information
majek committed Jul 5, 2011
1 parent 8c5082f commit 2660181
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -91,17 +91,18 @@ clean::
(cd php && \
rm -rf .ok lib)

RUBYVER:=1.9
GEMSVER=1.8.5
TOPDIR:=$(PWD)
ruby/.ok:
(cd ruby && \
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 && \
Expand Down
3 changes: 2 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
]

Expand Down

0 comments on commit 2660181

Please sign in to comment.