sidetiq 0.3.6 → 0.3.7

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: 1df64df09fdf5d7e87b13410a3a8b39c325fd70a
4
- data.tar.gz: 43e79f2eb7c71065ba27f54cf8e36924c8575250
3
+ metadata.gz: cd23a1f597a8ea9f38f1a7d978c25aacb9881278
4
+ data.tar.gz: 38857c20bd446738e877befb5357da050d317f7b
5
5
  SHA512:
6
- metadata.gz: 3b11cd2d90c41504bd9914ca3058cc242c9d4819d4d8550348e2326d85aaacbcf9293f02f5ac01b058be6b222f94eedbca5bafeba76c3cc231e168c1d63a964c
7
- data.tar.gz: c5b583be6d96c52e8494bc790c406f5d06cd84e0e0b643e0ca14ef9eae1dc36b5e858cfde858a2e8891d3c11bb18d2982f4018370beba0451cccd54f1171930d
6
+ metadata.gz: 4f3b2ac3341c8a3fa3f4b38ca192a8ff234f066d2fae8ebd2b0012393ca0fc418da7b64603caec2bf1aabf8fbed61200326fda4c74d0b6c3ac1422fa0fbc6c6f
7
+ data.tar.gz: 6024d079bea833aeef1d2b803bb32ed2f2dfe9108333bdaa6a9558ab28a07c3b67c52a38f5f34980ed4de29c4f988b50f78ed87a82b79481b3f57330f900639f
@@ -1,3 +1,13 @@
1
+ 0.3.7
2
+ -----
3
+
4
+ - Bump Sidekiq dependency to ~> 2.14.0.
5
+ - Use ERB templates instead of slim.
6
+ - Don't check if `Sidekiq::Web.tabs` is an Array in Sidetiq::Web.
7
+ - Fix Ruby parser warnings in web.rb.
8
+ - Move development dependencies from Gemfile to gemspec.
9
+ - Use coveralls instead of simplecov.
10
+
1
11
  0.3.6
2
12
  -----
3
13
 
data/Gemfile CHANGED
@@ -1,16 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- group :development do
4
- gem 'rake'
5
- gem 'sinatra', require: false
6
- gem 'slim', require: false
7
- end
8
-
9
- group :test do
10
- gem 'simplecov'
11
- gem 'mocha'
12
- gem 'rack-test'
13
- end
14
-
15
3
  gemspec
16
4
 
data/README.md CHANGED
@@ -3,6 +3,8 @@ Sidetiq
3
3
 
4
4
  [![Build Status](https://travis-ci.org/tobiassvn/sidetiq.png)](https://travis-ci.org/tobiassvn/sidetiq)
5
5
  [![Dependency Status](https://gemnasium.com/tobiassvn/sidetiq.png)](https://gemnasium.com/tobiassvn/sidetiq)
6
+ [![Coverage Status](https://coveralls.io/repos/tobiassvn/sidetiq/badge.png)](https://coveralls.io/r/tobiassvn/sidetiq)
7
+ [![Code Climate](https://codeclimate.com/github/tobiassvn/sidetiq.png)](https://codeclimate.com/github/tobiassvn/sidetiq)
6
8
 
7
9
  Recurring jobs for [Sidekiq](http://mperham.github.com/sidekiq/).
8
10
 
@@ -8,7 +8,7 @@ module Sidetiq
8
8
  MINOR = 3
9
9
 
10
10
  # Public: Sidetiq patch level.
11
- PATCH = 6
11
+ PATCH = 7
12
12
 
13
13
  # Public: String representation of the current Sidetiq version.
14
14
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
@@ -0,0 +1,35 @@
1
+ <header class="row">
2
+ <div class="span5">
3
+ <h3>Recurring Jobs</h3>
4
+ </div>
5
+ </header>
6
+
7
+ <% if @schedules.length > 0 %>
8
+ <table class="table table-striped table-bordered table-white" style="width: 100%; margin: 0; table-layout:fixed;">
9
+ thead
10
+ <thead>
11
+ <th style="width: 50%">Worker</th>
12
+ <th style="width: 20%">Queue</th>
13
+ <th style="width: 20%">Next Run</th>
14
+ <th style="width: 10%">Actions</th>
15
+ </thead>
16
+ <% @schedules.each do |worker, schedule| %>
17
+ <tr>
18
+ <td>
19
+ <a href="<%= "#{root_path}sidetiq/#{worker.name}" %>"><%= worker.name %></a>
20
+ <td><%= worker.get_sidekiq_options["queue"] %></td>
21
+ <td>
22
+ <%= relative_time(schedule.next_occurrence(@time)) %>
23
+ </td>
24
+ <td>
25
+ <form action="<%= "#{root_path}sidetiq/#{worker.name}/trigger" %>" method="post">
26
+ <input class="btn btn-danger btn-small" type="submit" name="trigger" value="Trigger" data-confirm="Are you sure you want to trigger this job?" />
27
+ </form>
28
+ </td>
29
+ </tr>
30
+ <% end %>
31
+ </table>
32
+ <% else %>
33
+ <div class="alert alert-success">No recurring jobs found.</div>
34
+ <% end %>
35
+
@@ -0,0 +1,49 @@
1
+ <header class="row">
2
+ <div class="span5">
3
+ <h3>Recurring Job: <%= @worker.name %></h3>
4
+ </div>
5
+ </header>
6
+
7
+ <% if (recurrences = @schedule.recurrence_rules).length > 0 %>
8
+ <table class="table table-striped table-bordered table-white" style="width: 100%; margin: 0; table-layout:fixed;">
9
+ <thead>
10
+ <th>Recurrences</th>
11
+ </thead>
12
+ <% recurrences.each do |rule| %>
13
+ <tr>
14
+ <td><%= rule.to_s %></td>
15
+ </tr>
16
+ <% end %>
17
+ </table>
18
+ <% end %>
19
+
20
+ <br />
21
+
22
+ <% if (exceptions = @schedule.exception_rules).length > 0 %>
23
+ <table class="table table-striped table-bordered table-white" style="width: 100%; margin: 0; table-layout:fixed;">
24
+ <thead>
25
+ <th>Exceptions</th>
26
+ </thead>
27
+ <% exceptions.each do |rule| %>
28
+ <tr>
29
+ <td><%= rule.to_s %></td>
30
+ </tr>
31
+ <% end %>
32
+ </table>
33
+ <% end %>
34
+
35
+ <br />
36
+
37
+ <table class="table table-striped table-bordered table-white" style="width: 100%; margin: 0; table-layout:fixed;">
38
+ <thead>
39
+ <th style="width: 25%">Next 10 runs</th>
40
+ <th style="width: 75%" />
41
+ <% @schedule.next_occurrences(10, @time).each do |time| %>
42
+ <tr>
43
+ <td><time><%= time.getutc %></time></td>
44
+ <td><%= relative_time(time) %></td>
45
+ </tr>
46
+ <% end %>
47
+ </table>
48
+
49
+ <br />
@@ -18,7 +18,7 @@ module Sidetiq
18
18
  app.get "/sidetiq" do
19
19
  @schedules = sidetiq_schedules
20
20
  @time = sidetiq_clock.gettime
21
- slim File.read(File.join(VIEWS, 'sidetiq.slim'))
21
+ erb File.read(File.join(VIEWS, 'sidetiq.erb'))
22
22
  end
23
23
 
24
24
  app.get "/sidetiq/:name" do
@@ -26,18 +26,18 @@ module Sidetiq
26
26
 
27
27
  @time = sidetiq_clock.gettime
28
28
 
29
- @worker, @schedule = sidetiq_schedules.select do |worker, schedule|
29
+ @worker, @schedule = sidetiq_schedules.select do |worker, _|
30
30
  worker.name == name
31
31
  end.flatten
32
32
 
33
- slim File.read(File.join(VIEWS, 'sidetiq_details.slim'))
33
+ erb File.read(File.join(VIEWS, 'sidetiq_details.erb'))
34
34
  end
35
35
 
36
36
  app.post "/sidetiq/:name/trigger" do
37
37
  halt 404 unless (name = params[:name])
38
38
 
39
- worker, _ = sidetiq_schedules.select do |worker, schedule|
40
- worker.name == name
39
+ worker, _ = sidetiq_schedules.select do |w, _|
40
+ w.name == name
41
41
  end.flatten
42
42
 
43
43
  worker.perform_async
@@ -49,10 +49,5 @@ module Sidetiq
49
49
  end
50
50
 
51
51
  Sidekiq::Web.register(Sidetiq::Web)
52
-
53
- if Sidekiq::Web.tabs.is_a?(Array)
54
- Sidekiq::Web.tabs << "sidetiq"
55
- else
56
- Sidekiq::Web.tabs["Sidetiq"] = "sidetiq"
57
- end
52
+ Sidekiq::Web.tabs["Sidetiq"] = "sidetiq"
58
53
 
@@ -19,6 +19,15 @@ Gem::Specification.new do |gem|
19
19
  gem.require_paths = ["lib"]
20
20
  gem.extensions = []
21
21
 
22
- gem.add_dependency 'sidekiq', '~> 2.13.0'
22
+ gem.add_dependency 'sidekiq', '~> 2.14.0'
23
23
  gem.add_dependency 'ice_cube', '~> 0.11.0'
24
+
25
+ gem.add_development_dependency 'rake'
26
+ gem.add_development_dependency 'sinatra'
27
+ gem.add_development_dependency 'mocha'
28
+ gem.add_development_dependency 'rack-test'
29
+
30
+ if RUBY_PLATFORM != "java"
31
+ gem.add_development_dependency 'coveralls'
32
+ end
24
33
  end
@@ -1,6 +1,6 @@
1
- if ENV["COVERAGE"]
2
- require 'simplecov'
3
- SimpleCov.start { add_filter "/test/" }
1
+ if RUBY_PLATFORM != "java"
2
+ require 'coveralls'
3
+ Coveralls.wear!
4
4
  end
5
5
 
6
6
  require 'minitest/autorun'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidetiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Svensson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-13 00:00:00.000000000 Z
11
+ date: 2013-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 2.13.0
19
+ version: 2.14.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 2.13.0
26
+ version: 2.14.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ice_cube
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +38,76 @@ dependencies:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.11.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sinatra
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: mocha
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rack-test
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: coveralls
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
41
111
  description: Recurring jobs for Sidekiq
42
112
  email:
43
113
  - tob@tobiassvensson.co.uk
@@ -61,8 +131,8 @@ files:
61
131
  - lib/sidetiq/schedulable.rb
62
132
  - lib/sidetiq/schedule.rb
63
133
  - lib/sidetiq/version.rb
64
- - lib/sidetiq/views/sidetiq.slim
65
- - lib/sidetiq/views/sidetiq_details.slim
134
+ - lib/sidetiq/views/sidetiq.erb
135
+ - lib/sidetiq/views/sidetiq_details.erb
66
136
  - lib/sidetiq/web.rb
67
137
  - sidetiq.gemspec
68
138
  - test/fixtures/backfill_worker.rb
@@ -1,24 +0,0 @@
1
- header.row
2
- .span5
3
- h3 Recurring Jobs
4
-
5
- - if @schedules.length > 0
6
- table class="table table-striped table-bordered table-white" style="width: 100%; margin: 0; table-layout:fixed;"
7
- thead
8
- th style="width: 50%" Worker
9
- th style="width: 20%" Queue
10
- th style="width: 20%" Next Run
11
- th style="width: 10%" Actions
12
- - @schedules.each do |worker, schedule|
13
- tr
14
- td
15
- a href="#{root_path}sidetiq/#{worker.name}"= worker.name
16
- td= worker.get_sidekiq_options['queue']
17
- td
18
- == relative_time(schedule.next_occurrence(@time))
19
- td
20
- form action="#{root_path}sidetiq/#{worker.name}/trigger" method="post"
21
- input.btn.btn-danger.btn-small type="submit" name="trigger" value="Trigger" data-confirm="Are you sure you want to trigger this job?"
22
- - else
23
- .alert.alert-success No recurring jobs found.
24
-
@@ -1,40 +0,0 @@
1
- header.row
2
- .span5
3
- h3
4
- ' Recurring Job:
5
- = @worker.name
6
-
7
- - if (recurrences = @schedule.recurrence_rules).length > 0
8
- table class="table table-striped table-bordered table-white" style="width: 100%; margin: 0; table-layout:fixed;"
9
- thead
10
- th Recurrences
11
- - recurrences.each do |rule|
12
- tr
13
- td
14
- = rule.to_s
15
-
16
- br
17
-
18
- - if (exceptions = @schedule.exception_rules).length > 0
19
- table class="table table-striped table-bordered table-white" style="width: 100%; margin: 0; table-layout:fixed;"
20
- thead
21
- th Exceptions
22
- - exceptions.each do |rule|
23
- tr
24
- td
25
- = rule.to_s
26
-
27
- br
28
-
29
- table class="table table-striped table-bordered table-white" style="width: 100%; margin: 0; table-layout:fixed;"
30
- thead
31
- th style="width: 25%" Next 10 runs
32
- th style="width: 75%"
33
- - @schedule.next_occurrences(10, @time).each do |time|
34
- tr
35
- td
36
- time= time.getutc
37
- td
38
- == relative_time(time)
39
-
40
- br