big query: raise exception if not configured.

This commit is contained in:
evazion
2017-04-05 00:58:54 -05:00
parent f57561118c
commit d66d19f328

View File

@@ -2,6 +2,14 @@ require "big_query"
module GoogleBigQuery
class Base
def self.enabled?
File.exists?(Danbooru.config.google_api_json_key_path)
end
def initialize
raise NotImplementedError.new("Google Big Query is not configured.") unless GoogleBigQuery::Base.enabled?
end
def query(q)
client.query(q)
end