Merge branch 'fastbinary'


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@674688 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/Rakefile b/lib/rb/Rakefile
index e88e984..6ddca52 100644
--- a/lib/rb/Rakefile
+++ b/lib/rb/Rakefile
@@ -23,7 +23,7 @@
   # ensure this is a full thrift checkout and not a tarball of the ruby libs
   cmd = 'head -1 ../../README 2>/dev/null | grep Thrift >/dev/null 2>/dev/null'
   system(cmd) or fail "rake test requires a full thrift checkout"
-  sh 'make', '-C', File.dirname(__FILE__) + "/../../test/rb"
+  sh 'make', '-C', File.dirname(__FILE__) + "/../../test/rb", "check"
 end
 
 desc 'Compile the .thrift files for the specs'
@@ -57,6 +57,15 @@
     p.url = "http://incubator.apache.org/thrift/"
     p.include_rakefile = true
   end
+
+  task :install => [:check_site_lib]
+
+  require 'rbconfig'
+  task :check_site_lib do
+    if File.exist?(File.join(Config::CONFIG['sitelibdir'], 'thrift.rb'))
+      fail "thrift is already installed in site_ruby"
+    end
+  end
 rescue LoadError
   [:install, :package].each do |t|
     desc "Stub for #{t}"