diff options
author | Luis Lavena <luislavena@gmail.com> | 2009-10-21 22:12:12 -0300 |
---|---|---|
committer | Luis Lavena <luislavena@gmail.com> | 2009-10-21 22:14:04 -0300 |
commit | 1bb1c7e9c3d02f6f37eb6c5bd9f7bc653d4c6196 (patch) | |
tree | ce6478020a407f29adaa7f03cc01f3901c1e9e0e /spec | |
parent | 95079509ee1deb94a2627b9e0d89113f8eddea97 (diff) | |
download | rake-compiler-1bb1c7e9c3d02f6f37eb6c5bd9f7bc653d4c6196.tar.gz |
Allow alteration of the Gem Specification when cross compiling. Closes GH-3
This is useful to indicate a custom requirement message, like DLLs
installation or similar.
Rake::ExtensionTask.new('my_extension', GEM_SPEC) do |ext|
ext.cross_compile = true
ext.cross_compiling do |gem_spec|
gem_spec.post_install_message = "You've installed a binary version of this gem"
end
end
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/rake/extensiontask_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/rake/extensiontask_spec.rb b/spec/lib/rake/extensiontask_spec.rb index 8045f0f..0fa55ef 100644 --- a/spec/lib/rake/extensiontask_spec.rb +++ b/spec/lib/rake/extensiontask_spec.rb @@ -299,6 +299,16 @@ describe Rake::ExtensionTask do err.should match(/no configuration section for specified version of Ruby/) end + it 'should capture an action block to be executed when cross compiling' do + lambda { + Rake::ExtensionTask.new('extension_one') do |ext| + ext.cross_compiling do |gem_spec| + gem_spec.post_install_message = "Cross compiled gem" + end + end + }.should_not raise_error + end + it 'should allow usage of RUBY_CC_VERSION to indicate a different version of ruby' do config = mock(Hash) config.should_receive(:[]).with("rbconfig-1.9.1").and_return('/path/to/ruby/1.9.1/rbconfig.rb') |