Writing a Jeweler Rakefile that adds dependencies depending on RUBY_ENGINE (ruby or jruby)
Posted
by Matt Zukowski
on Stack Overflow
See other posts from Stack Overflow
or by Matt Zukowski
Published on 2010-05-27T00:27:50Z
Indexed on
2010/05/27
0:31 UTC
Read the original article
Hit count: 530
I have a Rakefile that includes this:
Jeweler::Tasks.new do |gem|
# ...
gem.add_dependency('json')
end
The gemspec that this generates builds a gem that can't be installed on jruby because the 'json' gem is native.
For jruby, this would have to be:
Jeweler::Tasks.new do |gem|
# ...
gem.add_dependency('json-jruby')
end
How do I conditionally add the dependency for 'json-jruby' when RUBY_ENGINE == 'java'?
It seems like my only option is to manually edit the gemspec file that jeweler generates to add the RUBY_ENGINE check. But I'd rather avoid this, since it kind of defeats the purpose of using jeweler in the first place.
Any ideas?
© Stack Overflow or respective owner