exel-sidekiq 1.0.0 → 1.0.1

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: 3fcc3d8f156d37752c4590eccf49b68e1e777c99
4
- data.tar.gz: d5973955df99b74878e54bd33701714fca41aa6b
3
+ metadata.gz: 8a32d28307810ce39c5e22962bd27e9e7cd7bc8d
4
+ data.tar.gz: c20243b2f7d01719984e9370c87b00ff5b77913e
5
5
  SHA512:
6
- metadata.gz: 5f28626d9fb7d4d710160e0b4f3d5b5e87cde31728b3e1e38b68516c46d43015b78c015d9323ab9a8a1fefaa3e8d4b1f51bd39616758460d81855380c060b021
7
- data.tar.gz: 9b12729a14ec7985e9333c8c265c96166c88172aa76d6a8f218e0cf76834eaf2e5a9be196bf4a92844b75bc63d6bf14f34694368bb9d904fb850b6ee6b74320f
6
+ metadata.gz: d4a66a8bdbcc85f3dfb3d952ba6825ceda812fd99aa7e8b4f35ee16232f47395b2248fae859dd5caa6dae554406fe290dff7fb444a7f8e34c78833c0e9e7e18e
7
+ data.tar.gz: cd339ab53034b3403cadf860b13dc084d77d6161298a2d3a665d31d2a92dff27e948dabb6b8504f897f8580fa97834593c8c3abddaad83dde43389b888a7cae4
data/.rubocop.yml ADDED
@@ -0,0 +1,17 @@
1
+ require:
2
+ - rubocop-rspec
3
+ - rubocop/rspec/focused
4
+
5
+ inherit_from: .rubocop_todo.yml
6
+
7
+ AllCops:
8
+ DisplayStyleGuide: true
9
+
10
+ Metrics/LineLength:
11
+ Max: 120
12
+
13
+ Style/SpaceInsideHashLiteralBraces:
14
+ EnforcedStyle: no_space
15
+
16
+ RSpec/DescribedClass:
17
+ Enabled: false
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,24 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2015-12-14 23:05:51 -0500 using RuboCop version 0.35.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Configuration parameters: AllowURI, URISchemes.
11
+ Metrics/LineLength:
12
+ Exclude:
13
+ - 'exel-sidekiq.gemspec'
14
+
15
+ # Offense count: 4
16
+ # Configuration parameters: Exclude.
17
+ Style/Documentation:
18
+ Exclude:
19
+ - 'spec/**/*'
20
+ - 'test/**/*'
21
+ - 'lib/exel/sidekiq.rb'
22
+ - 'lib/exel/sidekiq/execution_worker.rb'
23
+ - 'lib/exel/sidekiq/sidekiq_provider.rb'
24
+ - 'lib/exel/sidekiq/version.rb'
data/Guardfile CHANGED
@@ -1,14 +1,21 @@
1
- guard :rspec, cmd: 'bundle exec rspec' do
2
- require 'guard/rspec/dsl'
3
- dsl = Guard::RSpec::Dsl.new(self)
1
+ group :rspec_rubocop, halt_on_fail: true do
2
+ guard :rspec, cmd: 'bundle exec rspec' do
3
+ require 'guard/rspec/dsl'
4
+ dsl = Guard::RSpec::Dsl.new(self)
4
5
 
5
- # RSpec files
6
- rspec = dsl.rspec
7
- watch(rspec.spec_helper) { rspec.spec_dir }
8
- watch(rspec.spec_support) { rspec.spec_dir }
9
- watch(rspec.spec_files)
6
+ # RSpec files
7
+ rspec = dsl.rspec
8
+ watch(rspec.spec_helper) { rspec.spec_dir }
9
+ watch(rspec.spec_support) { rspec.spec_dir }
10
+ watch(rspec.spec_files)
10
11
 
11
- # Ruby files
12
- ruby = dsl.ruby
13
- dsl.watch_spec_files_for(ruby.lib_files)
12
+ # Ruby files
13
+ ruby = dsl.ruby
14
+ dsl.watch_spec_files_for(ruby.lib_files)
15
+ end
16
+
17
+ guard :rubocop do
18
+ watch(/.+\.rb$/)
19
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
20
+ end
14
21
  end
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015 David
1
+ Copyright (c) 2015 yroo
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # EXEL::Sidekiq
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/exel-sidekiq.svg)](https://badge.fury.io/rb/exel-sidekiq)
4
+ [![Build Status](https://snap-ci.com/47colborne/exel-sidekiq/branch/master/build_image)](https://snap-ci.com/47colborne/exel-sidekiq/branch/master)
5
+
3
6
  This gem adds Sidekiq support for [EXEL's](https://github.com/47colborne/exel) async command.
4
7
 
5
8
  ## Installation
@@ -18,8 +21,7 @@ Or install it yourself as:
18
21
 
19
22
  ## Usage
20
23
 
21
- If you wish to use a queue other than default, you may specify it's name in the options passed to `async`. The retry limit
22
- can also be set, as in the following example:
24
+ By requiring this gem, Sidekiq support will automatically be added to [EXEL](https://github.com/47colborne/exel). Any calls to `async` will enqueue a worker to run the given block. If you wish to use a queue other than default, you may specify its name in the options passed to `async`. The retry limit can also be set, as in the following example:
23
25
 
24
26
  async queue: :my_queue, retry: 3 do
25
27
  process with: MyProcessor
data/Rakefile CHANGED
@@ -1,2 +1 @@
1
- require "bundler/gem_tasks"
2
-
1
+ require 'bundler/gem_tasks'
data/exel-sidekiq.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = EXEL::Sidekiq::VERSION
9
9
  spec.authors = ['yroo']
10
10
  spec.email = ['dev@yroo.com']
11
- spec.summary = %q{Async provider for EXEL using Sidekiq}
12
- spec.description = %q{When used with EXEL (https://github.com/47colborne/exel), the async command will launch a Sidekiq worker}
11
+ spec.summary = 'Async provider for EXEL using Sidekiq'
12
+ spec.description = 'When used with EXEL (https://github.com/47colborne/exel), the async command will launch a Sidekiq worker'
13
13
  spec.homepage = 'https://github.com/47colborne/exel-sidekiq'
14
14
  spec.license = 'MIT'
15
15
 
@@ -19,13 +19,17 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_dependency 'exel', '~> 1'
22
- spec.add_dependency 'sidekiq', '~> 3'
22
+ spec.add_dependency 'sidekiq', '< 5'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.6'
25
25
  spec.add_development_dependency 'rake', '~> 10'
26
26
  spec.add_development_dependency 'rspec', '~> 3'
27
27
  spec.add_development_dependency 'guard', '~> 2'
28
28
  spec.add_development_dependency 'guard-rspec', '~> 4'
29
+ spec.add_development_dependency 'guard-rubocop', '~> 1'
29
30
  spec.add_development_dependency 'terminal-notifier', '~> 1'
30
31
  spec.add_development_dependency 'terminal-notifier-guard', '~> 1'
32
+ spec.add_development_dependency 'rubocop', '~> 0'
33
+ spec.add_development_dependency 'rubocop-rspec', '~> 1'
34
+ spec.add_development_dependency 'rubocop-rspec-focused', '~> 0'
31
35
  end
@@ -1,5 +1,5 @@
1
1
  module EXEL
2
2
  module Sidekiq
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
@@ -21,14 +21,16 @@ module EXEL
21
21
  let(:context) { EXEL::Context.new(queue: 'import_processor') }
22
22
 
23
23
  it 'pushes the execution worker to the given queue' do
24
- expect(::Sidekiq::Client).to receive(:push).with('queue' => context[:queue], 'class' => ExecutionWorker, 'args' => [serialized_context_uri])
24
+ expect(::Sidekiq::Client).to receive(:push).with(
25
+ 'queue' => context[:queue], 'class' => ExecutionWorker, 'args' => [serialized_context_uri])
25
26
  provider.do_async(callback)
26
27
  end
27
28
  end
28
29
 
29
30
  context 'without queue name' do
30
31
  it 'pushes the execution worker to the default queue' do
31
- expect(::Sidekiq::Client).to receive(:push).with('class' => ExecutionWorker, 'args' => [serialized_context_uri])
32
+ expect(::Sidekiq::Client).to receive(:push).with(
33
+ 'class' => ExecutionWorker, 'args' => [serialized_context_uri])
32
34
  provider.do_async(callback)
33
35
  end
34
36
  end
@@ -37,14 +39,16 @@ module EXEL
37
39
  let(:context) { EXEL::Context.new(retry: 1) }
38
40
 
39
41
  it 'pushes the execution worker with a specified number of retries' do
40
- expect(::Sidekiq::Client).to receive(:push).with('retry' => context[:retry], 'class' => ExecutionWorker, 'args' => [serialized_context_uri])
42
+ expect(::Sidekiq::Client).to receive(:push).with(
43
+ 'retry' => context[:retry], 'class' => ExecutionWorker, 'args' => [serialized_context_uri])
41
44
  provider.do_async(callback)
42
45
  end
43
46
  end
44
47
 
45
48
  context 'with no retries specified' do
46
49
  it 'pushes the execution worker with no specified number of retries' do
47
- expect(::Sidekiq::Client).to receive(:push).with('class' => ExecutionWorker, 'args' => [serialized_context_uri])
50
+ expect(::Sidekiq::Client).to receive(:push).with(
51
+ 'class' => ExecutionWorker, 'args' => [serialized_context_uri])
48
52
  provider.do_async(callback)
49
53
  end
50
54
  end
@@ -0,0 +1,7 @@
1
+ module EXEL
2
+ describe Sidekiq do
3
+ it 'sets itself as the async provider' do
4
+ expect(EXEL.async_provider).to eq(EXEL::Sidekiq::SidekiqProvider)
5
+ end
6
+ end
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exel-sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - yroo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-11 00:00:00.000000000 Z
11
+ date: 2016-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: exel
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: sidekiq
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '3'
33
+ version: '5'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - "<"
39
39
  - !ruby/object:Gem::Version
40
- version: '3'
40
+ version: '5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '4'
111
+ - !ruby/object:Gem::Dependency
112
+ name: guard-rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: terminal-notifier
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +150,48 @@ dependencies:
136
150
  - - "~>"
137
151
  - !ruby/object:Gem::Version
138
152
  version: '1'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop-rspec
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '1'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '1'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop-rspec-focused
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
139
195
  description: When used with EXEL (https://github.com/47colborne/exel), the async command
140
196
  will launch a Sidekiq worker
141
197
  email:
@@ -146,6 +202,8 @@ extra_rdoc_files: []
146
202
  files:
147
203
  - ".gitignore"
148
204
  - ".rspec"
205
+ - ".rubocop.yml"
206
+ - ".rubocop_todo.yml"
149
207
  - Gemfile
150
208
  - Guardfile
151
209
  - LICENSE.txt
@@ -158,6 +216,7 @@ files:
158
216
  - lib/exel/sidekiq/version.rb
159
217
  - spec/exel/sidekiq/execution_worker_spec.rb
160
218
  - spec/exel/sidekiq/sidekiq_provider_spec.rb
219
+ - spec/exel/sidekiq_spec.rb
161
220
  - spec/spec_helper.rb
162
221
  homepage: https://github.com/47colborne/exel-sidekiq
163
222
  licenses:
@@ -179,11 +238,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
238
  version: '0'
180
239
  requirements: []
181
240
  rubyforge_project:
182
- rubygems_version: 2.4.5.1
241
+ rubygems_version: 2.2.2
183
242
  signing_key:
184
243
  specification_version: 4
185
244
  summary: Async provider for EXEL using Sidekiq
186
245
  test_files:
187
246
  - spec/exel/sidekiq/execution_worker_spec.rb
188
247
  - spec/exel/sidekiq/sidekiq_provider_spec.rb
248
+ - spec/exel/sidekiq_spec.rb
189
249
  - spec/spec_helper.rb