barbeque 0.2.1 → 0.2.2

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: a43082ae404cbe883e4ba07cbd59e6704c928ab3
4
- data.tar.gz: a2f5fabeb566ac7c2345c5b77f7e4093d43243f9
3
+ metadata.gz: c235c801a5847d1f7ee491ead2247b9e3c08845a
4
+ data.tar.gz: f2157e1f492cba1a78fc8e64d528abb850e144e7
5
5
  SHA512:
6
- metadata.gz: cb8b997431c6661bd6c5fd03dfcc17a1c86146b8e88db452aa43b1d668ea1473375c6dd42ce6c54057c965cc6a6fab7181818e01a9aab337f6acf1cee2149e5d
7
- data.tar.gz: 833426bd91b0901351f491b4962ebc7f15460cb181b66f2d9242358279e9ae288a49a13563c96a4d705ffffe512c26d7bfa5268072717b977fc7af90053f62f6
6
+ metadata.gz: '08626acefc490c6da1fe8abf979216974743335448aae55404551ae9d9cc43038729b928cef678b51f8f24f7703095b74071863d0f16fb1851432c96da0095e3'
7
+ data.tar.gz: 299a6c177bf233a04d9bf9fbf6907014cf4663d7cb894459657592e0441030b6af760f90ec8ba89b0d3976cb800f8266d7198b23523723be32cedf29f379f54c
@@ -15,12 +15,14 @@ class Barbeque::Api::JobExecutionsController < Barbeque::Api::ApplicationControl
15
15
  end
16
16
 
17
17
  def require_resource
18
- @resource = Barbeque::JobExecution.find_or_initialize_by(message_id: params[:message_id])
18
+ model = Barbeque::JobExecution.find_or_initialize_by(message_id: params[:message_id])
19
+ @resource = Barbeque::Api::JobExecutionResource.new(model, url_options)
19
20
  end
20
21
 
21
22
  def create_resource
22
23
  message_id = enqueue_message
23
- Barbeque::JobExecution.new(message_id: message_id).to_resource
24
+ model = Barbeque::JobExecution.new(message_id: message_id)
25
+ @resource = Barbeque::Api::JobExecutionResource.new(model, url_options)
24
26
  end
25
27
 
26
28
  # @return [String] id of a message queued to SQS.
@@ -32,4 +34,13 @@ class Barbeque::Api::JobExecutionsController < Barbeque::Api::ApplicationControl
32
34
  message: params[:message],
33
35
  ).run
34
36
  end
37
+
38
+ # Link to job_execution isn't available if it isn't dequeued yet
39
+ def location
40
+ if @resource.id
41
+ super
42
+ else
43
+ nil
44
+ end
45
+ end
35
46
  end
@@ -3,5 +3,22 @@ class Barbeque::Api::JobExecutionResource < Barbeque::Api::ApplicationResource
3
3
 
4
4
  property :status
5
5
 
6
- delegate :message_id, :status, to: :model
6
+ property :id
7
+
8
+ property :html_url, selectable: true
9
+
10
+ delegate :message_id, :status, :id, to: :model
11
+
12
+ def initialize(model, url_options)
13
+ super(model)
14
+ @url_options = url_options
15
+ end
16
+
17
+ def html_url
18
+ if model.id
19
+ Barbeque::Engine.routes.url_helpers.job_execution_url(model, @url_options)
20
+ else
21
+ nil
22
+ end
23
+ end
7
24
  end
@@ -18,8 +18,4 @@ class Barbeque::JobExecution < Barbeque::ApplicationRecord
18
18
  def execution_log
19
19
  @execution_log ||= Barbeque::ExecutionLog.load(execution: self)
20
20
  end
21
-
22
- def to_resource
23
- Barbeque::Api::JobExecutionResource.new(self)
24
- end
25
21
  end
@@ -1,3 +1,3 @@
1
1
  module Barbeque
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barbeque
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-31 00:00:00.000000000 Z
11
+ date: 2017-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: adminlte2-rails
@@ -387,7 +387,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
387
387
  version: '0'
388
388
  requirements: []
389
389
  rubyforge_project:
390
- rubygems_version: 2.6.8
390
+ rubygems_version: 2.6.10
391
391
  signing_key:
392
392
  specification_version: 4
393
393
  summary: Job queue system to run job with Docker