forward3d / rbhive

Ruby gem for querying Apache Hive
http://www.forward3d.com
MIT License
98 stars 75 forks source link

requires with .. broken in jruby #4

Closed grisha closed 10 years ago

grisha commented 11 years ago

If you use the rbhive gem in a framework that packs it into a jar (such as redstorm), you get an error in connection.rb where it attempts to import a file stepping up to a parent path using a ".."

Here is a simple fix for that:

diff --git a/lib/rbhive/connection.rb b/lib/rbhive/connection.rb index e2a0e62..02cc088 100644 --- a/lib/rbhive/connection.rb +++ b/lib/rbhive/connection.rb @@ -1,7 +1,7 @@

suppress warnings

old_verbose, $VERBOSE = $VERBOSE, nil

require thrift autogenerated files

-require File.join(File.dirname(FILE), %w[.. thrift thrift_hive]) +require File.join(File.split(File.dirname(FILE)).first, %w[thrift thrift_hive])

restore warnings

$VERBOSE = old_verbose

andytinycat commented 10 years ago

Resolved with 9024f67cdfc58f3aaf0800db7c04971fb10eb1dc