rbhive 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rbhive/connection.rb +3 -1
- metadata +2 -2
data/lib/rbhive/connection.rb
CHANGED
@@ -3,11 +3,13 @@ require File.join(File.dirname(__FILE__), *%w[.. thrift thrift_hive])
|
|
3
3
|
module RBHive
|
4
4
|
def connect(server, port=10_000)
|
5
5
|
connection = RBHive::Connection.new(server, port)
|
6
|
+
ret = nil
|
6
7
|
begin
|
7
8
|
connection.open
|
8
|
-
yield(connection)
|
9
|
+
ret = yield(connection)
|
9
10
|
ensure
|
10
11
|
connection.close
|
12
|
+
ret
|
11
13
|
end
|
12
14
|
end
|
13
15
|
module_function :connect
|