kura 0.2.12 → 0.2.13

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: 1b7c812e214cec783cacf7fe58f768069b3f7a5b
4
- data.tar.gz: 489c5f2a69ae4fe658810145c94e4005f116286d
3
+ metadata.gz: 82e2481d7711b622ffa903f7f84d177bc4ef04f0
4
+ data.tar.gz: e8477315ada88d49725defb1693dcca1e96f8dca
5
5
  SHA512:
6
- metadata.gz: 25710128d223c775bf800d4158759964f11b2fd9e3bdb173044f1cb8663775bb57661023e9ba9450f88b1e5eae29decb5ba2106bdfbcd9c70c22d65af1ab6920
7
- data.tar.gz: c0e012b961c124c99f0bd0bb0c087bd9b544db6b6f5c3522f0beebd87054ec84d57f793d03df33647c0438724b03baa257d8ef292cd1e0ecdcb62f984dca4a56
6
+ metadata.gz: 2df39ba623737489a4ec5b56d1619b8130d7d31d59240870c32f8d79a51655df3642ef53c1c1524c0394566aae78ec9250e647a438655c615d1368c046582282
7
+ data.tar.gz: 2a31ad9a0afc7b87259d673c48de48b35c543c2ff1ed514c6ecce603497fb274037653ccc6903048b7657ae584151076c1570b17c05beae55fb485b53962c409
@@ -1,3 +1,9 @@
1
+ # 0.2.13
2
+
3
+ ## Enhancements
4
+
5
+ * Support #job, #cancel_job API in batch requests.
6
+
1
7
  # 0.2.12
2
8
 
3
9
  ## Enhancements
@@ -507,13 +507,20 @@ module Kura
507
507
  insert_job(configuration, wait: wait, job_id: job_id, project_id: job_project_id, &blk)
508
508
  end
509
509
 
510
- def job(job_id, project_id: @default_project_id)
511
- @api.get_job(project_id, job_id).tap{|j| j.kura_api = self}
510
+ def job(job_id, project_id: @default_project_id, &blk)
511
+ if blk
512
+ @api.get_job(project_id, job_id) do |j, e|
513
+ j.kura_api = self
514
+ blk.call(j, e)
515
+ end
516
+ else
517
+ @api.get_job(project_id, job_id).tap{|j| j.kura_api = self}
518
+ end
512
519
  rescue
513
520
  process_error($!)
514
521
  end
515
522
 
516
- def cancel_job(job, project_id: @default_project_id)
523
+ def cancel_job(job, project_id: @default_project_id, &blk)
517
524
  case job
518
525
  when String
519
526
  jobid = job
@@ -523,7 +530,14 @@ module Kura
523
530
  else
524
531
  raise TypeError, "Kura::Client#cancel_job accept String(job-id) or Google::Apis::BigqueryV2::Job"
525
532
  end
526
- @api.cancel_job(project_id, jobid).job.tap{|j| j.kura_api = self}
533
+ if blk
534
+ @api.cancel_job(project_id, jobid) do |r, e|
535
+ r.job.kura_api = self
536
+ blk.call(r.job, e)
537
+ end
538
+ else
539
+ @api.cancel_job(project_id, jobid).job.tap{|j| j.kura_api = self}
540
+ end
527
541
  end
528
542
 
529
543
  def job_finished?(r)
@@ -12,5 +12,9 @@ class Google::Apis::BigqueryV2::Job
12
12
  def cancel
13
13
  kura_api.cancel_job(self)
14
14
  end
15
+
16
+ def inspect
17
+ "<##{self.class} job_id=#{self.job_reference.job_id rescue nil}>"
18
+ end
15
19
  end
16
20
 
@@ -1,3 +1,3 @@
1
1
  module Kura
2
- VERSION = "0.2.12"
2
+ VERSION = "0.2.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kura
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chikanaga Tomoyuki