adding a task for fat binary shim

This commit is contained in:
Aaron Patterson 2010-09-18 13:36:39 -07:00
parent 50775163ed
commit 84dc998a3b
2 changed files with 10 additions and 0 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ mkmf.log
pkg/
tmp
vendor
lib/mysql2/mysql2.rb

View File

@ -30,3 +30,12 @@ Rake::ExtensionTask.new("mysql2", gemspec) do |ext|
CLEAN.include "#{ext.lib_dir}/*.#{RbConfig::CONFIG['DLEXT']}"
end
Rake::Task[:spec].prerequisites << :compile
file 'lib/mysql2/mysql2.rb' do
name = gemspec.name
File.open("lib/#{name}/#{name}.rb", 'wb') do |f|
f.write <<-eoruby
require "#{name}/\#{RUBY_VERSION.sub(/\\.\\d+$/, '')}/#{name}"
eoruby
end
end