chewy-resque 0.0.3 → 0.1.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: 90682ec788f3fc9e44bf86a91118fc2609fcf9df
4
- data.tar.gz: 419cb3dc5219dbeaa1174c56c04a2e5b0e60be81
3
+ metadata.gz: 6fa93127ea647f8dd3b834d7fca48bba1f5375c1
4
+ data.tar.gz: a8f653186a8be53c07fa999a0a942289b9450403
5
5
  SHA512:
6
- metadata.gz: 6b9a6e6df0f25001d3da8e6128c1346e78519cb0f45ee51c9431197cd84eef1a7c3cb1c61401e2272f162e8d177d9f135db7a1fff6401ffdd2c3fcab5c65fd25
7
- data.tar.gz: f8605641be3963b11719b54d2560a58aca7826a550473b60e00088607e1e83a307d01bb53cf51b9657cd35d87ab2dd6968e83305ec643c87d079af10b6c9f9e3
6
+ metadata.gz: 55afd7162e220c80342a904ea2d9e369de535d15b8c128bb6c4b932cf619b30d952745fa2a41cdf7cd4030a5c8498595baacf29934018ff836eb968807593d00
7
+ data.tar.gz: 471c451a787feb2a09e62aa9582f761ba1d1fde2fe8c714433ae9ad259e3f04cd74a887cf8424e41d6f9beb76ddbee0d79bda03b01eb0a6d8e5e016fadc0ef08
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # [WIP] Chewy::Resque
2
2
 
3
- Background atomic & urgent strategies for [Chewy](https://github.com/toptal/chewy) gem.
3
+ Resque atomic & urgent strategies for [Chewy](https://github.com/toptal/chewy) gem.
4
4
 
5
5
  ## Installation
6
6
 
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Dimko"]
10
10
  spec.email = ["deemox@gmail.com"]
11
11
  spec.summary = %q{Resque integration for chewy}
12
- spec.description = %q{Background atomic & urgent strategies for Chewy gem}
12
+ spec.description = %q{Resque atomic & urgent strategies for Chewy gem}
13
13
  spec.homepage = ""
14
14
  spec.license = "MIT"
15
15
 
@@ -18,9 +18,9 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "chewy", "~> 0.7.0"
21
+ spec.add_dependency "chewy", "~> 0.6.2"
22
22
  spec.add_dependency "resque"
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.7"
25
- spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
26
  end
@@ -1,9 +1,9 @@
1
1
  require "chewy"
2
2
  require "resque"
3
3
 
4
- require_relative "strategy/background_base"
5
- require_relative "strategy/background_atomic"
6
- require_relative "strategy/background_urgent"
4
+ require_relative "strategy/resque_base"
5
+ require_relative "strategy/resque_atomic"
6
+ require_relative "strategy/resque_urgent"
7
7
  require_relative "resque/version"
8
8
  require_relative "resque/worker"
9
9
 
@@ -1,5 +1,5 @@
1
1
  module Chewy
2
2
  module Resque
3
- VERSION = "0.0.3"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  module Chewy
2
2
  class Strategy
3
- class BackgroundAtomic < BackgroundBase
3
+ class ResqueAtomic < ResqueBase
4
4
  def initialize
5
5
  @stash = {}
6
6
  end
@@ -0,0 +1,11 @@
1
+ module Chewy
2
+ class Strategy
3
+ class ResqueBase < Base
4
+ def enqueue(type, ids)
5
+ unless ids.empty?
6
+ ::Resque.enqueue Chewy::Resque::Worker, type.derived_name, ids
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,6 +1,6 @@
1
1
  module Chewy
2
2
  class Strategy
3
- class BackgroundUrgent < BackgroundBase
3
+ class ResqueUrgent < ResqueBase
4
4
  def update(type, objects, options = {})
5
5
  ids = type.adapter.identify(objects)
6
6
  enqueue(type, ids)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chewy-resque
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimko
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.0
19
+ version: 0.6.2
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: 0.7.0
26
+ version: 0.6.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: resque
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '10.0'
69
- description: Background atomic & urgent strategies for Chewy gem
69
+ description: Resque atomic & urgent strategies for Chewy gem
70
70
  email:
71
71
  - deemox@gmail.com
72
72
  executables: []
@@ -82,9 +82,9 @@ files:
82
82
  - lib/chewy/resque.rb
83
83
  - lib/chewy/resque/version.rb
84
84
  - lib/chewy/resque/worker.rb
85
- - lib/chewy/strategy/background_atomic.rb
86
- - lib/chewy/strategy/background_base.rb
87
- - lib/chewy/strategy/background_urgent.rb
85
+ - lib/chewy/strategy/resque_atomic.rb
86
+ - lib/chewy/strategy/resque_base.rb
87
+ - lib/chewy/strategy/resque_urgent.rb
88
88
  homepage: ''
89
89
  licenses:
90
90
  - MIT
@@ -1,9 +0,0 @@
1
- module Chewy
2
- class Strategy
3
- class BackgroundBase < Base
4
- def enqueue(type, ids)
5
- ::Resque.enqueue Chewy::Resque::Worker, type.derived_name, ids
6
- end
7
- end
8
- end
9
- end