diff --git a/.gitignore b/.gitignore index 584ccf20c8..bdabe9a699 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/.ext/ /.bundle/ /.yardoc /Gemfile.lock @@ -5,9 +6,6 @@ /coverage/ /html/ /lib/*.jar -/lib/*.so -/lib/*.dylib -/lib/*.bundle /pkg/ /spec/reports/ /tmp/ diff --git a/Rakefile b/Rakefile index ba061e3f46..a5aa36798b 100644 --- a/Rakefile +++ b/Rakefile @@ -31,16 +31,21 @@ if RUBY_ENGINE == "jruby" ext.target_version = '1.8' ext.ext_dir = 'ext/jruby' end + extra_require_path = "ext/jruby/lib" elsif RUBY_ENGINE == "ruby" require 'rake/extensiontask' - Rake::ExtensionTask.new("strscan") + Rake::ExtensionTask.new("strscan") do |x| + extra_require_path = x.lib_dir.sub!(%r[(?:\A|/)\Klib(?=/|\z)]) { + ".ext/#{RUBY_VERSION}/#{x.platform}" + } + end else task :compile + extra_require_path = "lib" end desc "Run test" task :test do - extra_require_path = RUBY_ENGINE == 'jruby' ? "ext/jruby/lib" : "lib" ENV["RUBYOPT"] = "-I#{extra_require_path} -rbundler/setup" ruby("run-test.rb") end