sidecloq 0.2.0 → 0.3.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: bc79f44db3f6f94b4de477d87b170b6a8f0af0bf
4
- data.tar.gz: c2cdd0e3641298003d3ae8f3b8072876b86f8316
3
+ metadata.gz: b27e2e4e4be57df8dd1786682b5b60581c56ad16
4
+ data.tar.gz: 9dff323de41c33ac48524b1ac8ab280790ec8b10
5
5
  SHA512:
6
- metadata.gz: cd2cf8af352b2c6c3a77dff7e00ca9d2124cd0145a242390d4c874bc7cefdd638a8cca97531a0a86042e4513aa4b9b19ec3d6225298e586ceac9f32845889f08
7
- data.tar.gz: efacb0bce951f43c692e03b07536321baea03d448ed5d463a65f83aaa10b1697ba1acbfd04fd296d9c5c5017d4264ffb66991f05ddaa53af8da6f7cee9d3155d
6
+ metadata.gz: 9f23da51d63a47876d1030350f76d8d34b6486234bdcf53f8b9c7753b9b046cf23d46a1bb9aa632406a0ab3d7faae3a531083578f89802564b39b299ffe53619
7
+ data.tar.gz: c5db5145e7b68be1e43380874584465919e85f05597c550faf404349ea2f354753515b0533dc8d22fc013dc7778f8d4c7040746d9b444a9142cdea55813eb29b
data/.travis.yml CHANGED
@@ -5,23 +5,26 @@ services:
5
5
  - redis-server
6
6
  rvm:
7
7
  - 2.0.0
8
- - 2.1.8
8
+ - 2.1.10
9
9
  - 2.2.4
10
10
  - 2.3.0
11
11
  - ruby-head
12
12
  - jruby-9.0.4.0
13
13
  - jruby-head
14
- - rbx-2.6
15
- - rbx-2.7
14
+ - rbx-2.10
15
+ - rbx-2.11
16
+ - rbx-3.69
16
17
  env:
17
18
  - "sidekiq=master"
18
19
  - "sidekiq=stable"
19
- - "sidekiq=3.5.3"
20
+ - "sidekiq=3.5.4"
20
21
  matrix:
21
22
  allow_failures:
22
23
  - rvm: ruby-head
23
24
  - rvm: jruby-head
25
+ - rvm: rbx-2.10
26
+ - rvm: rbx-2.11
27
+ - rvm: rbx-3.69
24
28
  - env: "sidekiq=master"
25
- addons:
26
- code_climate:
27
- repo_token: dee2fdcb3562533038a22e862c0fc91a6f1fa38730cd2b77177655e5b9507c83
29
+ after_success:
30
+ - bundle exec codeclimate-test-reporter
data/Gemfile CHANGED
@@ -17,4 +17,12 @@ sidekiq_dep =
17
17
 
18
18
  gem 'sidekiq', sidekiq_dep
19
19
 
20
- gem 'codeclimate-test-reporter', group: :test, require: false
20
+ # rack >= 2.0 requires ruby >= 2.2.2
21
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.2.2")
22
+ gem 'rack', '< 2.0'
23
+ end
24
+
25
+ group :test do
26
+ gem "simplecov"
27
+ gem "codeclimate-test-reporter", "~> 1.0.0"
28
+ end
data/README.md CHANGED
@@ -30,7 +30,7 @@ Sidecloq is:
30
30
  Sidekiq 4, which no longer uses Celluloid.
31
31
  - **Clean:** Sidecloq leverages only the public API of Sidekiq, and does
32
32
  not pollute the Sidekiq namespace.
33
- - **Easy to deploy:** Sidecloq boots with all Sideqik processes,
33
+ - **Easy to deploy:** Sidecloq boots with all Sidekiq processes,
34
34
  automatically. Leader election ensures only one process enqueues
35
35
  jobs, and a new leader is automatically chosen should the current
36
36
  leader die.
@@ -55,7 +55,7 @@ Sidekiq, you can run Sidecloq.
55
55
  Tell Sidecloq where your schedule file is located:
56
56
 
57
57
  ```ruby
58
- Sidcloq.configure do |config|
58
+ Sidecloq.configure do |config|
59
59
  config[:schedule_file] = "path/to/myschedule.yml"
60
60
  end
61
61
  ```
@@ -119,6 +119,17 @@ it's corresponding "Enqueue now" button.
119
119
 
120
120
  ![Sidecloq web ui extension screenshot](assets/screenshot.png)
121
121
 
122
+ ## Notes
123
+
124
+ If you are running MRI < 2.2.2, you will need to make sure you are using
125
+ rack < 2.0. You can do this by adding:
126
+
127
+ ```ruby
128
+ gem 'rack', '< 2.0'
129
+ ```
130
+
131
+ To your app's Gemfile.
132
+
122
133
  ## Contributing
123
134
 
124
135
  Bug reports and pull requests are welcome.
@@ -23,7 +23,7 @@ module Sidecloq
23
23
 
24
24
  redis { |r| r.hgetall(REDIS_KEY) }.tap do |h|
25
25
  h.each do |name, config|
26
- specs[name] = MultiJson.decode(config)
26
+ specs[name] = JSON.parse(config)
27
27
  end
28
28
  end
29
29
  end
@@ -68,7 +68,7 @@ module Sidecloq
68
68
  def save_all_to_redis
69
69
  redis do |r|
70
70
  @job_specs.each do |name, spec|
71
- r.hset(REDIS_KEY, name, MultiJson.encode(spec))
71
+ r.hset(REDIS_KEY, name, spec.to_json)
72
72
  end
73
73
  end
74
74
  end
@@ -1,5 +1,5 @@
1
1
  module Sidecloq
2
- # Scheduler enqeues jobs according to the given schedule
2
+ # Scheduler enqueues jobs according to the given schedule
3
3
  class Scheduler
4
4
  include Utils
5
5
 
@@ -61,9 +61,9 @@ module Sidecloq
61
61
  end
62
62
 
63
63
  def safe_enqueue_job(name, spec)
64
- logger.info "enqueueing #{name}"
64
+ logger.info "enqueuing #{name}"
65
65
 
66
- # failed enqeueuing should not b0rk stuff
66
+ # failed enqueuing should not b0rk stuff
67
67
  begin
68
68
  enqueue_job!(spec)
69
69
  rescue => e
@@ -1,3 +1,3 @@
1
1
  module Sidecloq
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
data/lib/sidecloq/web.rb CHANGED
@@ -11,8 +11,10 @@ module Sidecloq
11
11
  end
12
12
 
13
13
  app.post '/recurring/:name/enqueue' do |name|
14
+ job_name = respond_to?(:route_params) ? route_params[:name] : name
15
+
14
16
  # rubocop:disable Lint/AssignmentInCondition
15
- if spec = Sidecloq::Schedule.from_redis.job_specs[name]
17
+ if spec = Sidecloq::Schedule.from_redis.job_specs[job_name]
16
18
  Sidekiq::Client.push(spec)
17
19
  end
18
20
  # rubocop:enableLint/AssignmentInCondition
data/lib/sidecloq.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'sidekiq'
2
2
  require 'concurrent'
3
+ require 'json'
3
4
  require 'redlock'
4
- require 'multi_json'
5
5
  require 'rufus-scheduler'
6
6
 
7
7
  require 'sidecloq/utils'
@@ -23,11 +23,9 @@ Gem::Specification.new do |spec|
23
23
  spec.add_dependency 'redlock', '~> 0.1.2'
24
24
  # mimics some dev dependencies of sidekiq:
25
25
  spec.add_dependency 'concurrent-ruby'
26
- spec.add_dependency 'sinatra', '~> 1.4', '>= 1.4.6'
27
- spec.add_dependency 'redis-namespace', '~> 1.5', '>= 1.5.2'
28
- spec.add_dependency 'multi_json', '~> 1.11'
29
26
  spec.add_dependency 'rufus-scheduler', '~> 3.1', '>= 3.1.10'
30
27
 
31
28
  spec.add_development_dependency 'rake', '~> 10.0'
32
29
  spec.add_development_dependency 'minitest'
30
+ spec.add_development_dependency 'redis-namespace', '~> 1.5', '>= 1.5.2'
33
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidecloq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Robinson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-27 00:00:00.000000000 Z
11
+ date: 2016-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
@@ -58,60 +58,6 @@ dependencies:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
- - !ruby/object:Gem::Dependency
62
- name: sinatra
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '1.4'
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- version: 1.4.6
71
- type: :runtime
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: '1.4'
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- version: 1.4.6
81
- - !ruby/object:Gem::Dependency
82
- name: redis-namespace
83
- requirement: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - "~>"
86
- - !ruby/object:Gem::Version
87
- version: '1.5'
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: 1.5.2
91
- type: :runtime
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - "~>"
96
- - !ruby/object:Gem::Version
97
- version: '1.5'
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- version: 1.5.2
101
- - !ruby/object:Gem::Dependency
102
- name: multi_json
103
- requirement: !ruby/object:Gem::Requirement
104
- requirements:
105
- - - "~>"
106
- - !ruby/object:Gem::Version
107
- version: '1.11'
108
- type: :runtime
109
- prerelease: false
110
- version_requirements: !ruby/object:Gem::Requirement
111
- requirements:
112
- - - "~>"
113
- - !ruby/object:Gem::Version
114
- version: '1.11'
115
61
  - !ruby/object:Gem::Dependency
116
62
  name: rufus-scheduler
117
63
  requirement: !ruby/object:Gem::Requirement
@@ -160,6 +106,26 @@ dependencies:
160
106
  - - ">="
161
107
  - !ruby/object:Gem::Version
162
108
  version: '0'
109
+ - !ruby/object:Gem::Dependency
110
+ name: redis-namespace
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: '1.5'
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: 1.5.2
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: '1.5'
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: 1.5.2
163
129
  description: Recurring jobs for Sidekiq
164
130
  email:
165
131
  - robinson.matty@gmail.com
@@ -181,7 +147,7 @@ files:
181
147
  - lib/sidecloq/utils.rb
182
148
  - lib/sidecloq/version.rb
183
149
  - lib/sidecloq/web.rb
184
- - sidetoq.gemspec
150
+ - sidecloq.gemspec
185
151
  - web/views/recurring.erb
186
152
  homepage: http://github.com/mattyr/sidecloq
187
153
  licenses: