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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df031ec7381a9dfbb95f0f57a937358131add7cb
4
- data.tar.gz: 873e797a516da04f5c3f7672c6ce3a02336c809a
3
+ metadata.gz: a3b3f01fed1dd8a0b55be71b85f918308f6a9362
4
+ data.tar.gz: 72e91b8d8eca47315fb73a3cd98b48d04bf80a8b
5
5
  SHA512:
6
- metadata.gz: b8e971c7582ee24f13c98b31f8129439b38831074966217e6174ea94e1a932cf1346a222b30f2f9e72a27a91f9c059c173eddbce3dceddc6428afbae609e1c61
7
- data.tar.gz: fdcbabf8bb94ba1016236fdce57cdfda61fadab796e345665e37ed3cb13e87ea08f2f1854d2ed29009b95077a7b4fde8e1e65845e11a0e360d24e6f8d99a402a
6
+ metadata.gz: 1d863fa3c9d9c6463d292863285ee5843a372ef0587e4ed2c77d7be59138d310fe9ea66a32334a5b386d22d3805b8b9bec11ff3d012fb9dd4ed171855068c942
7
+ data.tar.gz: 4c84a956904d442888657c43c196bfa6221a31dc0a415d1c77543a6f1755abe614c9de5ad926f0e3d988afa0dc714657e326d55e380afe134f7422cdebbcc19f
@@ -0,0 +1,3 @@
1
+ # 0.1.1
2
+ * Add Kura::Client#tables API.
3
+ * Kura::Client#wait_job yield block every second if block was passed.
@@ -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 BigQUery API v2. It is a wrapper of google-api-client.}
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
 
@@ -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"
@@ -1,3 +1,3 @@
1
1
  module Kura
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-12 00:00:00.000000000 Z
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 BigQUery API v2. It is a wrapper of google-api-client.
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