sidekiq_status 1.1.0 → 1.2.0

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: f4e3282b9acea7633ee8a90aed6fe8982bc17946
4
- data.tar.gz: a480a2d256f63636be9ef162cfd791cea7ebaa32
3
+ metadata.gz: 376e629c68f174cace73a5c67c23a4b5cf65b0a5
4
+ data.tar.gz: c7e5a9e689c9ec74120f426e5937aad621b7dc10
5
5
  SHA512:
6
- metadata.gz: 61f4121815255d2d704cf262a9619a3ed0108a383e563188afbfb4cdd0367eb4acc32e6f14aed118c3d2eab0734046cf32571e703b3a097e0fc43debac79f1a6
7
- data.tar.gz: dd87aa7efdb084aa718d0cd257c7b768d573fe6158b4f5d563172d01dd16f1608e06dccbd43c93f71de93fe95d727cf37727627b30c8188022d6e98f5a201d8e
6
+ metadata.gz: 008af9ea34701fc54d72d47cbb5f98a13a20763d92da4fd7c75e7bed07ebb4795cec853956f44ab37bc66db2594314db2dc3451c70bd56958224b5a8a1ae7f3b
7
+ data.tar.gz: f5980070fb532c61230bd70b3574bd2f598eb024015a5af56f977ec5b3f29c0c5ceafa933e5411132b91a0f3e9ca69b9183b6363ce31c4ffea14a4a28450916b
@@ -1,18 +1,17 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.10
4
- - 2.2.4
5
- - 2.3.0
6
- - rbx-3.14
3
+ #- rbx
4
+ - 2.2.5
5
+ - 2.3.1
7
6
  env:
8
7
  global:
9
8
  - SHOW_SIDEKIQ=true
10
9
  matrix:
10
+ - SIDEKIQ_VERSION="~>4.2.0"
11
11
  - SIDEKIQ_VERSION="~>4.1.0"
12
12
  - SIDEKIQ_VERSION="~>4.0.2"
13
13
  - SIDEKIQ_VERSION="~>3.5.4"
14
14
  - SIDEKIQ_VERSION="~>3.4.2"
15
- - SIDEKIQ_VERSION="~>3.3.4"
16
15
 
17
16
  before_install:
18
17
  - sudo apt-get -qq update
data/README.md CHANGED
@@ -147,6 +147,10 @@ and clean status containers.
147
147
 
148
148
  ## Changelog
149
149
 
150
+ ### 1.2.0
151
+
152
+ * Support for sidekiq 4.2, integration with the new non-sinatra-based Sidekiq::Web (ncuesta)
153
+
150
154
  ### 1.1.0
151
155
 
152
156
  * Support for sidekiq 4.1, 4.0, 3.5, 3.4
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module SidekiqStatus
3
3
  # SidekiqStatus version
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  end
@@ -11,6 +11,16 @@ module SidekiqStatus
11
11
  path = File.join(VIEW_PATH, name.to_s) + ".erb"
12
12
  File.open(path).read
13
13
  end
14
+
15
+ def redirect_to(subpath)
16
+ if respond_to?(:to)
17
+ # Sinatra-based web UI
18
+ redirect to(subpath)
19
+ else
20
+ # Non-Sinatra based web UI (Sidekiq 4.2+)
21
+ redirect "#{root_path}#{subpath}"
22
+ end
23
+ end
14
24
  end
15
25
 
16
26
  app.get '/statuses' do
@@ -34,22 +44,22 @@ module SidekiqStatus
34
44
 
35
45
  app.get '/statuses/:jid/kill' do
36
46
  SidekiqStatus::Container.load(params[:jid]).request_kill
37
- redirect to(:statuses)
47
+ redirect_to :statuses
38
48
  end
39
49
 
40
50
  app.get '/statuses/delete/all' do
41
51
  SidekiqStatus::Container.delete
42
- redirect to(:statuses)
52
+ redirect_to :statuses
43
53
  end
44
54
 
45
55
  app.get '/statuses/delete/complete' do
46
56
  SidekiqStatus::Container.delete('complete')
47
- redirect to(:statuses)
57
+ redirect_to :statuses
48
58
  end
49
59
 
50
60
  app.get '/statuses/delete/finished' do
51
61
  SidekiqStatus::Container.delete(SidekiqStatus::Container::FINISHED_STATUS_NAMES)
52
- redirect to(:statuses)
62
+ redirect_to :statuses
53
63
  end
54
64
  end
55
65
  end
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.require_paths = ["lib"]
17
17
  gem.version = SidekiqStatus::VERSION
18
18
 
19
- gem.add_runtime_dependency("sidekiq", ">= 3.3", "< 4.2")
19
+ gem.add_runtime_dependency("sidekiq", ">= 3.3", "< 5")
20
20
 
21
21
  gem.add_development_dependency("activesupport")
22
22
  gem.add_development_dependency("rspec", '>= 3.4.0')
@@ -2,14 +2,10 @@ require 'rubygems'
2
2
  require 'bundler'
3
3
  Bundler.require
4
4
 
5
+ require 'active_support'
5
6
  require 'active_support/dependencies'
6
7
 
7
8
  DUMMY_APP_ROOT = Pathname.new(File.expand_path('../', __FILE__))
8
9
  Sidekiq.redis = {:url => "redis://localhost/15", :size => 5}
9
10
 
10
11
  ActiveSupport::Dependencies.autoload_paths += Dir.glob(DUMMY_APP_ROOT.join('app/*'))
11
-
12
-
13
-
14
-
15
-
@@ -60,6 +60,6 @@
60
60
  </tr>
61
61
  </tbody>
62
62
  </table>
63
- <a href="<%= to(:statuses) %>">Back</a>
63
+ <a href="<%= root_path %>statuses">Back</a>
64
64
  </div>
65
65
  </div>
@@ -2,15 +2,15 @@
2
2
 
3
3
  <div class="delete_jobs">
4
4
  Delete jobs in&nbsp;
5
- <a href="<%= to(:statuses) %>/delete/complete" onclick="return confirm('Are you sure? Delete is irreversible')">
5
+ <a href="<%= root_path %>statuses/delete/complete" onclick="return confirm('Are you sure? Delete is irreversible')">
6
6
  complete
7
7
  </a>
8
8
  ,&nbsp;
9
- <a href="<%= to(:statuses) %>/delete/finished" onclick="return confirm('Are you sure? Delete is irreversible')" title="<%= SidekiqStatus::Container::FINISHED_STATUS_NAMES.join(', ') %>">
9
+ <a href="<%= root_path %>statuses/delete/finished" onclick="return confirm('Are you sure? Delete is irreversible')" title="<%= SidekiqStatus::Container::FINISHED_STATUS_NAMES.join(', ') %>">
10
10
  finished
11
11
  </a>
12
12
  ,&nbsp;
13
- <a href="<%= to(:statuses) %>/delete/all" onclick="return confirm('Are you sure? Delete is irreversible')">
13
+ <a href="<%= root_path %>statuses/delete/all" onclick="return confirm('Are you sure? Delete is irreversible')">
14
14
  all
15
15
  </a>
16
16
  &nbsp;statuses
@@ -25,10 +25,10 @@
25
25
  <th>Message</th>
26
26
  <th>Actions</th>
27
27
  </tr>
28
- <% @statuses.each do |container| -%>
28
+ <% @statuses.each do |container| %>
29
29
  <tr>
30
30
  <td>
31
- <a href="<%= to(:statuses) %>/<%= container.jid %>">
31
+ <a href="<%= root_path %>/statuses/<%= container.jid %>">
32
32
  <%= container.worker %>
33
33
  <br />
34
34
  <%= container.jid %>
@@ -44,19 +44,19 @@
44
44
  </div>
45
45
  <td><%= container.message %></td>
46
46
  <td>
47
- <% if container.killable? -%>
48
- <a class="kill" href="<%= to(:statuses) %>/<%= container.jid %>/kill" onclick="return confirm('Are you sure?')">Kill</a>
49
- <% elsif container.kill_requested? -%>
47
+ <% if container.killable? %>
48
+ <a class="kill" href="<%= root_path %>statuses/<%= container.jid %>/kill" onclick="return confirm('Are you sure?')">Kill</a>
49
+ <% elsif container.kill_requested? %>
50
50
  Kill requested
51
51
  <% end %>
52
52
  </td>
53
53
  </tr>
54
- <% end -%>
55
- <% if @statuses.empty? -%>
54
+ <% end %>
55
+ <% if @statuses.empty? %>
56
56
  <tr>
57
57
  <td colspan="6"></td>
58
58
  </tr>
59
- <% end -%>
59
+ <% end %>
60
60
  </table>
61
61
 
62
62
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_status
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Ignatyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-13 00:00:00.000000000 Z
11
+ date: 2016-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '3.3'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '4.2'
22
+ version: '5'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '3.3'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '4.2'
32
+ version: '5'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activesupport
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -211,4 +211,3 @@ test_files:
211
211
  - spec/integration/sidekiq_spec.rb
212
212
  - spec/spec_helper.rb
213
213
  - spec/worker_spec.rb
214
- has_rdoc: