diff --git a/.gitignore b/.gitignore index 07fb61a..1bc4656 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ mkmf.log pkg/ tmp vendor +lib/mysql2/mysql2.rb diff --git a/tasks/compile.rake b/tasks/compile.rake index 7979ae2..c61b7b9 100644 --- a/tasks/compile.rake +++ b/tasks/compile.rake @@ -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