job_state 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 057d896b858980e91d0992257cd510bf65f30926cec65b1e0e39be93b86fc109
4
- data.tar.gz: 535744d4838989b7b0110ccd87c0502fd56e31bd083976d8414e14cd213baeef
3
+ metadata.gz: 672e848f5e7cd27e743fe7ce15835e757f698b71a7dd2fd494f9ef9e1b9eafcc
4
+ data.tar.gz: c334c57dab6d87dbc88a98640c93c2feb6cd56c58eb1aa218ee0fa9df9294196
5
5
  SHA512:
6
- metadata.gz: e90329ab73c7b4136a2d117348285e053af2b503435a4675addc5607de0b0f2de08dc251e78461301cb5c1d8410aad94f1641a603b5c5c703c1ca55e6957e8d2
7
- data.tar.gz: 72c1d9fdd9518e3e634bc6a5a74398d4561def8dbfc1c932377d126b39f83bcdcc0233e6375aa2a21e48aed571a5779c8450889ff350a81a67dee7b7083b9ed5
6
+ metadata.gz: f009eca345fd7a910d9d569749e2d9231c31fc3739bd7551a4454f41e5fd43c07ccfb0af708f456be5661aad311477242dea54c8e777a71e6d1e8b743c94520e
7
+ data.tar.gz: 6fa0d39d19063fa0db1c9488b04836615d1cd376288375517d5165f1a99a356665722f6d57e1bee87a05fd13a579fc221e7d6cbb85067c6c4d41854a245f7d60
@@ -11,6 +11,14 @@
11
11
  self._poll();
12
12
  };
13
13
 
14
+ self.killJob = function() {
15
+ $.ajax({
16
+ url: '/job_state/job_states/' + self._jobUuid + '/kill',
17
+ type: 'POST',
18
+ dataType: 'json'
19
+ });
20
+ }
21
+
14
22
  self._poll = function() {
15
23
  setTimeout(function() {
16
24
  $.ajax({
@@ -3,7 +3,7 @@ module JobState
3
3
 
4
4
  respond_to :html, :json
5
5
 
6
- before_action :fetch_job_state, only: [:show]
6
+ before_action :fetch_job_state
7
7
 
8
8
  def show
9
9
  respond_to do |format|
@@ -13,6 +13,11 @@ module JobState
13
13
  end
14
14
  end
15
15
 
16
+ def kill
17
+ @job_state.kill
18
+ head :ok
19
+ end
20
+
16
21
  private
17
22
 
18
23
  def fetch_job_state
data/config/routes.rb CHANGED
@@ -1,3 +1,7 @@
1
1
  JobState::Engine.routes.draw do
2
- resources :job_states, :only => [:show]
2
+ resources :job_states, :only => [:show] do
3
+ member do
4
+ post 'kill'
5
+ end
6
+ end
3
7
  end
@@ -123,6 +123,14 @@ module JobState
123
123
  @job_uuid
124
124
  end
125
125
 
126
+ #**********************************************************************
127
+ # KILLING
128
+ #
129
+ # This method kills the job
130
+ def kill
131
+ Resque::Plugins::Status::Hash.kill(@job_uuid)
132
+ end
133
+
126
134
  private
127
135
 
128
136
  def status_hash
@@ -1,3 +1,3 @@
1
1
  module JobState
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: job_state
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wyatt Greene
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-05-24 00:00:00.000000000 Z
13
+ date: 2025-02-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -116,43 +116,43 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  requirements: []
119
- rubygems_version: 3.0.9
119
+ rubygems_version: 3.3.27
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: This engine provides a way to poll resque jobs for their status and display
123
123
  to the user.
124
124
  test_files:
125
- - test/dummy/app/controllers/application_controller.rb
126
- - test/dummy/app/views/layouts/application.html.erb
125
+ - test/dummy/README.rdoc
126
+ - test/dummy/Rakefile
127
127
  - test/dummy/app/assets/javascripts/application.js
128
128
  - test/dummy/app/assets/stylesheets/application.css
129
+ - test/dummy/app/controllers/application_controller.rb
129
130
  - test/dummy/app/helpers/application_helper.rb
130
- - test/dummy/bin/rake
131
+ - test/dummy/app/views/layouts/application.html.erb
131
132
  - test/dummy/bin/bundle
132
133
  - test/dummy/bin/rails
133
- - test/dummy/config/routes.rb
134
- - test/dummy/config/locales/en.yml
135
- - test/dummy/config/environments/production.rb
136
- - test/dummy/config/environments/development.rb
137
- - test/dummy/config/environments/test.rb
138
- - test/dummy/config/environment.rb
134
+ - test/dummy/bin/rake
139
135
  - test/dummy/config/application.rb
140
- - test/dummy/config/database.yml
141
136
  - test/dummy/config/boot.rb
137
+ - test/dummy/config/database.yml
138
+ - test/dummy/config/environment.rb
139
+ - test/dummy/config/environments/development.rb
140
+ - test/dummy/config/environments/production.rb
141
+ - test/dummy/config/environments/test.rb
142
142
  - test/dummy/config/initializers/backtrace_silencers.rb
143
- - test/dummy/config/initializers/mime_types.rb
144
143
  - test/dummy/config/initializers/filter_parameter_logging.rb
144
+ - test/dummy/config/initializers/inflections.rb
145
+ - test/dummy/config/initializers/mime_types.rb
146
+ - test/dummy/config/initializers/secret_token.rb
145
147
  - test/dummy/config/initializers/session_store.rb
146
148
  - test/dummy/config/initializers/wrap_parameters.rb
147
- - test/dummy/config/initializers/secret_token.rb
148
- - test/dummy/config/initializers/inflections.rb
149
+ - test/dummy/config/locales/en.yml
150
+ - test/dummy/config/routes.rb
149
151
  - test/dummy/config.ru
150
- - test/dummy/Rakefile
151
- - test/dummy/public/favicon.ico
152
+ - test/dummy/public/404.html
152
153
  - test/dummy/public/422.html
153
154
  - test/dummy/public/500.html
154
- - test/dummy/public/404.html
155
- - test/dummy/README.rdoc
155
+ - test/dummy/public/favicon.ico
156
156
  - test/integration/navigation_test.rb
157
157
  - test/job_state_test.rb
158
158
  - test/test_helper.rb