bigquery 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bigquery.rb +12 -4
- metadata +1 -1
data/lib/bigquery.rb
CHANGED
@@ -7,11 +7,19 @@ class BigQuery
|
|
7
7
|
def initialize(opts = {})
|
8
8
|
@client = Google::APIClient.new
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
key = Google::APIClient::PKCS12.load_key(
|
11
|
+
BASE_PATH + "/config/#{opts['key']}",
|
12
|
+
"notasecret"
|
13
|
+
)
|
14
|
+
|
15
|
+
asserter = Google::APIClient::JWTAsserter.new(
|
16
|
+
opts['service_email'],
|
17
|
+
opts['auth_url'],
|
18
|
+
key
|
19
|
+
)
|
20
|
+
|
21
|
+
@client.authorization = asserter.authorize
|
13
22
|
|
14
|
-
@client.authorization.fetch_access_token!
|
15
23
|
@bq = @client.discovered_api("bigquery", "v2")
|
16
24
|
|
17
25
|
@project_id = opts['project_id']
|