kura 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +3 -0
- data/kura.gemspec +1 -1
- data/lib/kura/client.rb +12 -0
- data/lib/kura/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3b3f01fed1dd8a0b55be71b85f918308f6a9362
|
4
|
+
data.tar.gz: 72e91b8d8eca47315fb73a3cd98b48d04bf80a8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d863fa3c9d9c6463d292863285ee5843a372ef0587e4ed2c77d7be59138d310fe9ea66a32334a5b386d22d3805b8b9bec11ff3d012fb9dd4ed171855068c942
|
7
|
+
data.tar.gz: 4c84a956904d442888657c43c196bfa6221a31dc0a415d1c77543a6f1755abe614c9de5ad926f0e3d988afa0dc714657e326d55e380afe134f7422cdebbcc19f
|
data/ChangeLog.md
ADDED
data/kura.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["nagachika@ruby-lang.org"]
|
11
11
|
|
12
12
|
spec.summary = %q{Interface to BigQuery API v2.}
|
13
|
-
spec.description = %q{Kura is an interfece to
|
13
|
+
spec.description = %q{Kura is an interfece to BigQuery API v2. It is a wrapper of google-api-client.}
|
14
14
|
spec.homepage = "https://github.com/nagachika/kura/"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
data/lib/kura/client.rb
CHANGED
@@ -70,6 +70,15 @@ module Kura
|
|
70
70
|
r.data
|
71
71
|
end
|
72
72
|
|
73
|
+
def tables(dataset_id, project_id: @project_id, limit: 1000)
|
74
|
+
params = { projectId: project_id, datasetId: dataset_id, maxResult: limit }
|
75
|
+
r = @api.execute(api_method: @bigquery_api.tables.list, parameters: params)
|
76
|
+
unless r.success?
|
77
|
+
raise Kura::ApiError.new(r.data["error"]["reason"], r.data["error"]["message"])
|
78
|
+
end
|
79
|
+
r.data.tables
|
80
|
+
end
|
81
|
+
|
73
82
|
def table(dataset_id, table_id, project_id: @project_id)
|
74
83
|
params = { projectId: project_id, datasetId: dataset_id, tableId: table_id }
|
75
84
|
r = @api.execute(api_method: @bigquery_api.tables.get, parameters: params)
|
@@ -211,6 +220,9 @@ module Kura
|
|
211
220
|
if job_finished?(job_id)
|
212
221
|
return true
|
213
222
|
end
|
223
|
+
if block_given?
|
224
|
+
yield
|
225
|
+
end
|
214
226
|
sleep 1
|
215
227
|
end
|
216
228
|
raise Kura::TimeoutError, "wait job timeout"
|
data/lib/kura/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kura
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chikanaga Tomoyuki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-api-client
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
-
description: Kura is an interfece to
|
111
|
+
description: Kura is an interfece to BigQuery API v2. It is a wrapper of google-api-client.
|
112
112
|
email:
|
113
113
|
- nagachika@ruby-lang.org
|
114
114
|
executables: []
|
@@ -117,6 +117,7 @@ extra_rdoc_files: []
|
|
117
117
|
files:
|
118
118
|
- ".gitignore"
|
119
119
|
- ".travis.yml"
|
120
|
+
- ChangeLog.md
|
120
121
|
- Gemfile
|
121
122
|
- LICENSE.txt
|
122
123
|
- README.md
|